Loading core/java/com/android/internal/os/ZygoteInit.java +15 −6 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Trace; import android.os.UserHandle; import android.os.UserHandle; import android.os.ZygoteProcess; import android.os.ZygoteProcess; import android.os.storage.StorageManager; import android.os.storage.StorageManager; import android.provider.DeviceConfig; import android.security.keystore.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import android.system.ErrnoException; import android.system.ErrnoException; import android.system.Os; import android.system.Os; Loading Loading @@ -474,6 +475,16 @@ public class ZygoteInit { ZygoteHooks.gcAndFinalize(); ZygoteHooks.gcAndFinalize(); } } private static boolean profileSystemServer() { boolean defaultValue = SystemProperties.getBoolean("dalvik.vm.profilesystemserver", /*default=*/ false); // Can't use DeviceConfig since it's not initialized at this point. return SystemProperties.getBoolean( "persist.device_config." + DeviceConfig.NAMESPACE_RUNTIME_NATIVE_BOOT + ".profilesystemserver", defaultValue); } /** /** * Finish remaining work for the newly forked system server process. * Finish remaining work for the newly forked system server process. */ */ Loading @@ -496,10 +507,9 @@ public class ZygoteInit { } } // Capturing profiles is only supported for debug or eng builds since selinux normally // Capturing profiles is only supported for debug or eng builds since selinux normally // prevents it. // prevents it. boolean profileSystemServer = SystemProperties.getBoolean( if (profileSystemServer() && (Build.IS_USERDEBUG || Build.IS_ENG)) { "dalvik.vm.profilesystemserver", false); if (profileSystemServer && (Build.IS_USERDEBUG || Build.IS_ENG)) { try { try { Log.d(TAG, "Preparing system server profile"); prepareSystemServerProfile(systemServerClasspath); prepareSystemServerProfile(systemServerClasspath); } catch (Exception e) { } catch (Exception e) { Log.wtf(TAG, "Failed to set up system server profile", e); Log.wtf(TAG, "Failed to set up system server profile", e); Loading Loading @@ -770,9 +780,8 @@ public class ZygoteInit { Zygote.applyDebuggerSystemProperty(parsedArgs); Zygote.applyDebuggerSystemProperty(parsedArgs); Zygote.applyInvokeWithSystemProperty(parsedArgs); Zygote.applyInvokeWithSystemProperty(parsedArgs); boolean profileSystemServer = SystemProperties.getBoolean( if (profileSystemServer()) { "dalvik.vm.profilesystemserver", false); if (profileSystemServer) { parsedArgs.mRuntimeFlags |= Zygote.PROFILE_SYSTEM_SERVER; parsedArgs.mRuntimeFlags |= Zygote.PROFILE_SYSTEM_SERVER; } } Loading Loading
core/java/com/android/internal/os/ZygoteInit.java +15 −6 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Trace; import android.os.UserHandle; import android.os.UserHandle; import android.os.ZygoteProcess; import android.os.ZygoteProcess; import android.os.storage.StorageManager; import android.os.storage.StorageManager; import android.provider.DeviceConfig; import android.security.keystore.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import android.system.ErrnoException; import android.system.ErrnoException; import android.system.Os; import android.system.Os; Loading Loading @@ -474,6 +475,16 @@ public class ZygoteInit { ZygoteHooks.gcAndFinalize(); ZygoteHooks.gcAndFinalize(); } } private static boolean profileSystemServer() { boolean defaultValue = SystemProperties.getBoolean("dalvik.vm.profilesystemserver", /*default=*/ false); // Can't use DeviceConfig since it's not initialized at this point. return SystemProperties.getBoolean( "persist.device_config." + DeviceConfig.NAMESPACE_RUNTIME_NATIVE_BOOT + ".profilesystemserver", defaultValue); } /** /** * Finish remaining work for the newly forked system server process. * Finish remaining work for the newly forked system server process. */ */ Loading @@ -496,10 +507,9 @@ public class ZygoteInit { } } // Capturing profiles is only supported for debug or eng builds since selinux normally // Capturing profiles is only supported for debug or eng builds since selinux normally // prevents it. // prevents it. boolean profileSystemServer = SystemProperties.getBoolean( if (profileSystemServer() && (Build.IS_USERDEBUG || Build.IS_ENG)) { "dalvik.vm.profilesystemserver", false); if (profileSystemServer && (Build.IS_USERDEBUG || Build.IS_ENG)) { try { try { Log.d(TAG, "Preparing system server profile"); prepareSystemServerProfile(systemServerClasspath); prepareSystemServerProfile(systemServerClasspath); } catch (Exception e) { } catch (Exception e) { Log.wtf(TAG, "Failed to set up system server profile", e); Log.wtf(TAG, "Failed to set up system server profile", e); Loading Loading @@ -770,9 +780,8 @@ public class ZygoteInit { Zygote.applyDebuggerSystemProperty(parsedArgs); Zygote.applyDebuggerSystemProperty(parsedArgs); Zygote.applyInvokeWithSystemProperty(parsedArgs); Zygote.applyInvokeWithSystemProperty(parsedArgs); boolean profileSystemServer = SystemProperties.getBoolean( if (profileSystemServer()) { "dalvik.vm.profilesystemserver", false); if (profileSystemServer) { parsedArgs.mRuntimeFlags |= Zygote.PROFILE_SYSTEM_SERVER; parsedArgs.mRuntimeFlags |= Zygote.PROFILE_SYSTEM_SERVER; } } Loading