Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53f1a815 authored by Yasuhiro Matsuda's avatar Yasuhiro Matsuda Committed by Gerrit Code Review
Browse files

Merge "Remove unnecessary finally blocks for tracing."

parents b1db04f3 25878b28
Loading
Loading
Loading
Loading
+44 −57
Original line number Diff line number Diff line
@@ -182,19 +182,15 @@ public class ZygoteInit {

    static void preload() {
        Log.d(TAG, "begin preload");
        try {
        Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClasses");
        preloadClasses();
        } finally {
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
        }
        try {
        Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadResources");
        preloadResources();
        } finally {
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
        }
        Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL");
        preloadOpenGL();
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
        preloadSharedLibraries();
        // Ask the WebViewFactory to do any initialization that must run in the zygote process,
        // for memory sharing purposes.
@@ -273,8 +269,8 @@ public class ZygoteInit {
                    continue;
                }

                try {
                Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClass " + line);
                try {
                    if (false) {
                        Log.v(TAG, "Preloading " + line + "...");
                    }
@@ -298,9 +294,8 @@ public class ZygoteInit {
                        throw (RuntimeException) t;
                    }
                    throw new RuntimeException(t);
                } finally {
                    Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
                }
                Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
            }

            Log.i(TAG, "...preloaded " + count + " classes in "
@@ -575,16 +570,15 @@ public class ZygoteInit {
    }

    public static void main(String argv[]) {
        try {
            boolean startSystemServer = false;
            String socketName = "zygote";
            String abiList = null;
        try {
            Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygoteInit");
            RuntimeInit.enableDdms();
            // Start profiling the zygote initialization.
            SamplingProfilerIntegration.start();

            boolean startSystemServer = false;
            String socketName = "zygote";
            String abiList = null;
            for (int i = 1; i < argv.length; i++) {
                if ("start-system-server".equals(argv[i])) {
                    startSystemServer = true;
@@ -602,30 +596,23 @@ public class ZygoteInit {
            }

            registerZygoteSocket(socketName);
                try {
            Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygotePreload");
            EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
                SystemClock.uptimeMillis());
            preload();
            EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
                SystemClock.uptimeMillis());
                } finally {
            Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
                }

            // Finish profiling the zygote initialization.
            SamplingProfilerIntegration.writeZygoteSnapshot();

            // Do an initial gc to clean up after startup
                try {
            Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PostZygoteInitGC");
            gcAndFinalize();
                } finally {
            Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
                }
            } finally {

            Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
            }

            // Disable tracing so that forked processes do not inherit stale tracing tags from
            // Zygote.