Merge "Make system server profiling an explicit runtime intent"

am: 232011c7d9

Change-Id: I07e6b4f0e75ff96bda3d5ce5acf6b9ea1f999325
This commit is contained in:
Calin Juravle
2018-05-09 16:25:53 -07:00
committed by android-build-merger
2 changed files with 10 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ public final class Zygote {
*/
public static final int API_ENFORCEMENT_POLICY_SHIFT =
Integer.numberOfTrailingZeros(API_ENFORCEMENT_POLICY_MASK);
/**
* Enable system server ART profiling.
*/
public static final int PROFILE_SYSTEM_SERVER = 1 << 14;
/** No external storage should be mounted. */
public static final int MOUNT_EXTERNAL_NONE = 0;

View File

@@ -671,6 +671,12 @@ public class ZygoteInit {
ZygoteConnection.applyDebuggerSystemProperty(parsedArgs);
ZygoteConnection.applyInvokeWithSystemProperty(parsedArgs);
boolean profileSystemServer = SystemProperties.getBoolean(
"dalvik.vm.profilesystemserver", false);
if (profileSystemServer) {
parsedArgs.runtimeFlags |= Zygote.PROFILE_SYSTEM_SERVER;
}
/* Request to fork the system server process */
pid = Zygote.forkSystemServer(
parsedArgs.uid, parsedArgs.gid,