Merge "Do not disable tracing in zygote." am: 88be2985c4 am: aee51d9eab
Change-Id: I8b6280d305ea53c5361442e4b7bb45aa164fb5d2
This commit is contained in:
@@ -175,11 +175,7 @@ public final class Trace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether tracing is enabled in this process. Tracing is disabled shortly after Zygote
|
* Set whether tracing is enabled in this process.
|
||||||
* initializes and re-enabled after processes fork from Zygote. This is done because Zygote
|
|
||||||
* has no way to be notified about changes to the tracing tags, and if Zygote ever reads and
|
|
||||||
* caches the tracing tags, forked processes will inherit those stale tags.
|
|
||||||
*
|
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static void setTracingEnabled(boolean enabled, int debugFlags) {
|
public static void setTracingEnabled(boolean enabled, int debugFlags) {
|
||||||
|
|||||||
@@ -261,10 +261,8 @@ public final class Zygote {
|
|||||||
int pid = nativeForkAndSpecialize(
|
int pid = nativeForkAndSpecialize(
|
||||||
uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose,
|
uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose,
|
||||||
fdsToIgnore, startChildZygote, instructionSet, appDataDir);
|
fdsToIgnore, startChildZygote, instructionSet, appDataDir);
|
||||||
// Enable tracing as soon as possible for the child process.
|
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
Zygote.disableExecuteOnly(targetSdkVersion);
|
Zygote.disableExecuteOnly(targetSdkVersion);
|
||||||
Trace.setTracingEnabled(true, runtimeFlags);
|
|
||||||
|
|
||||||
// Note that this event ends at the end of handleChildProc,
|
// Note that this event ends at the end of handleChildProc,
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "PostFork");
|
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "PostFork");
|
||||||
@@ -309,9 +307,6 @@ public final class Zygote {
|
|||||||
nativeSpecializeAppProcess(uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo,
|
nativeSpecializeAppProcess(uid, gid, gids, runtimeFlags, rlimits, mountExternal, seInfo,
|
||||||
niceName, startChildZygote, instructionSet, appDataDir);
|
niceName, startChildZygote, instructionSet, appDataDir);
|
||||||
|
|
||||||
// Enable tracing as soon as possible for the child process.
|
|
||||||
Trace.setTracingEnabled(true, runtimeFlags);
|
|
||||||
|
|
||||||
// Note that this event ends at the end of handleChildProc.
|
// Note that this event ends at the end of handleChildProc.
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "PostFork");
|
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "PostFork");
|
||||||
|
|
||||||
@@ -367,11 +362,6 @@ public final class Zygote {
|
|||||||
uid, gid, gids, runtimeFlags, rlimits,
|
uid, gid, gids, runtimeFlags, rlimits,
|
||||||
permittedCapabilities, effectiveCapabilities);
|
permittedCapabilities, effectiveCapabilities);
|
||||||
|
|
||||||
// Enable tracing as soon as we enter the system_server.
|
|
||||||
if (pid == 0) {
|
|
||||||
Trace.setTracingEnabled(true, runtimeFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the Java Language thread priority to the default value for new apps.
|
// Set the Java Language thread priority to the default value for new apps.
|
||||||
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
|
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
|
||||||
|
|
||||||
|
|||||||
@@ -908,10 +908,6 @@ public class ZygoteInit {
|
|||||||
bootTimingsTraceLog.traceEnd(); // PostZygoteInitGC
|
bootTimingsTraceLog.traceEnd(); // PostZygoteInitGC
|
||||||
|
|
||||||
bootTimingsTraceLog.traceEnd(); // ZygoteInit
|
bootTimingsTraceLog.traceEnd(); // ZygoteInit
|
||||||
// Disable tracing so that forked processes do not inherit stale tracing tags from
|
|
||||||
// Zygote.
|
|
||||||
Trace.setTracingEnabled(false, 0);
|
|
||||||
|
|
||||||
|
|
||||||
Zygote.initNativeState(isPrimaryZygote);
|
Zygote.initNativeState(isPrimaryZygote);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user