am 53f1a815: Merge "Remove unnecessary finally blocks for tracing."
* commit '53f1a815b4401f10cd833217143da44ab0408dcc': Remove unnecessary finally blocks for tracing.
This commit is contained in:
@@ -179,19 +179,15 @@ public class ZygoteInit {
|
|||||||
|
|
||||||
static void preload() {
|
static void preload() {
|
||||||
Log.d(TAG, "begin preload");
|
Log.d(TAG, "begin preload");
|
||||||
try {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClasses");
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClasses");
|
||||||
preloadClasses();
|
preloadClasses();
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
}
|
|
||||||
try {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadResources");
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadResources");
|
||||||
preloadResources();
|
preloadResources();
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
}
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL");
|
||||||
preloadOpenGL();
|
preloadOpenGL();
|
||||||
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
preloadSharedLibraries();
|
preloadSharedLibraries();
|
||||||
preloadTextResources();
|
preloadTextResources();
|
||||||
// Ask the WebViewFactory to do any initialization that must run in the zygote process,
|
// Ask the WebViewFactory to do any initialization that must run in the zygote process,
|
||||||
@@ -275,8 +271,8 @@ public class ZygoteInit {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClass " + line);
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadClass " + line);
|
||||||
|
try {
|
||||||
if (false) {
|
if (false) {
|
||||||
Log.v(TAG, "Preloading " + line + "...");
|
Log.v(TAG, "Preloading " + line + "...");
|
||||||
}
|
}
|
||||||
@@ -300,9 +296,8 @@ public class ZygoteInit {
|
|||||||
throw (RuntimeException) t;
|
throw (RuntimeException) t;
|
||||||
}
|
}
|
||||||
throw new 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 "
|
Log.i(TAG, "...preloaded " + count + " classes in "
|
||||||
@@ -578,16 +573,15 @@ public class ZygoteInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String argv[]) {
|
public static void main(String argv[]) {
|
||||||
try {
|
|
||||||
boolean startSystemServer = false;
|
|
||||||
String socketName = "zygote";
|
|
||||||
String abiList = null;
|
|
||||||
try {
|
try {
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygoteInit");
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygoteInit");
|
||||||
RuntimeInit.enableDdms();
|
RuntimeInit.enableDdms();
|
||||||
// Start profiling the zygote initialization.
|
// Start profiling the zygote initialization.
|
||||||
SamplingProfilerIntegration.start();
|
SamplingProfilerIntegration.start();
|
||||||
|
|
||||||
|
boolean startSystemServer = false;
|
||||||
|
String socketName = "zygote";
|
||||||
|
String abiList = null;
|
||||||
for (int i = 1; i < argv.length; i++) {
|
for (int i = 1; i < argv.length; i++) {
|
||||||
if ("start-system-server".equals(argv[i])) {
|
if ("start-system-server".equals(argv[i])) {
|
||||||
startSystemServer = true;
|
startSystemServer = true;
|
||||||
@@ -605,30 +599,23 @@ public class ZygoteInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerZygoteSocket(socketName);
|
registerZygoteSocket(socketName);
|
||||||
try {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygotePreload");
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "ZygotePreload");
|
||||||
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
|
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
|
||||||
SystemClock.uptimeMillis());
|
SystemClock.uptimeMillis());
|
||||||
preload();
|
preload();
|
||||||
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
|
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
|
||||||
SystemClock.uptimeMillis());
|
SystemClock.uptimeMillis());
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
}
|
|
||||||
|
|
||||||
// Finish profiling the zygote initialization.
|
// Finish profiling the zygote initialization.
|
||||||
SamplingProfilerIntegration.writeZygoteSnapshot();
|
SamplingProfilerIntegration.writeZygoteSnapshot();
|
||||||
|
|
||||||
// Do an initial gc to clean up after startup
|
// Do an initial gc to clean up after startup
|
||||||
try {
|
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PostZygoteInitGC");
|
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PostZygoteInitGC");
|
||||||
gcAndFinalize();
|
gcAndFinalize();
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
|
||||||
}
|
|
||||||
|
|
||||||
// Disable tracing so that forked processes do not inherit stale tracing tags from
|
// Disable tracing so that forked processes do not inherit stale tracing tags from
|
||||||
// Zygote.
|
// Zygote.
|
||||||
|
|||||||
Reference in New Issue
Block a user