Loading core/java/com/android/internal/os/Zygote.java +5 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public final class Zygote { */ public static final int PROFILE_SYSTEM_SERVER = 1 << 14; /** * Enable profiling from shell. */ public static final int PROFILE_FROM_SHELL = 1 << 15; /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE; /** Default external storage should be mounted. */ Loading core/jni/com_android_internal_os_Zygote.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,7 @@ enum MountExternalKind { // Must match values in com.android.internal.os.Zygote. enum RuntimeFlags : uint32_t { DEBUG_ENABLE_JDWP = 1, PROFILE_FROM_SHELL = 1 << 15, }; // Forward declaration so we don't have to move the signal handler. Loading Loading @@ -1224,6 +1225,13 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, if ((runtime_flags & RuntimeFlags::DEBUG_ENABLE_JDWP) != 0) { EnableDebugger(); } if ((runtime_flags & RuntimeFlags::PROFILE_FROM_SHELL) != 0) { // simpleperf needs the process to be dumpable to profile it. if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { ALOGE("prctl(PR_SET_DUMPABLE) failed: %s", strerror(errno)); RuntimeAbort(env, __LINE__, "prctl(PR_SET_DUMPABLE, 1) failed"); } } if (NeedsNoRandomizeWorkaround()) { // Work around ARM kernel ASLR lossage (http://b/5817320). Loading services/core/java/com/android/server/am/ProcessList.java +3 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ import android.content.res.Resources; import android.graphics.Point; import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.net.Uri; import android.os.AppZygote; import android.os.Binder; import android.os.Build; Loading Loading @@ -1481,6 +1480,9 @@ public final class ProcessList { mService.mSafeMode == true) { runtimeFlags |= Zygote.DEBUG_ENABLE_SAFEMODE; } if ((app.info.privateFlags & ApplicationInfo.PRIVATE_FLAG_PROFILEABLE_BY_SHELL) != 0) { runtimeFlags |= Zygote.PROFILE_FROM_SHELL; } if ("1".equals(SystemProperties.get("debug.checkjni"))) { runtimeFlags |= Zygote.DEBUG_ENABLE_CHECKJNI; } Loading Loading
core/java/com/android/internal/os/Zygote.java +5 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public final class Zygote { */ public static final int PROFILE_SYSTEM_SERVER = 1 << 14; /** * Enable profiling from shell. */ public static final int PROFILE_FROM_SHELL = 1 << 15; /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE; /** Default external storage should be mounted. */ Loading
core/jni/com_android_internal_os_Zygote.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,7 @@ enum MountExternalKind { // Must match values in com.android.internal.os.Zygote. enum RuntimeFlags : uint32_t { DEBUG_ENABLE_JDWP = 1, PROFILE_FROM_SHELL = 1 << 15, }; // Forward declaration so we don't have to move the signal handler. Loading Loading @@ -1224,6 +1225,13 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, if ((runtime_flags & RuntimeFlags::DEBUG_ENABLE_JDWP) != 0) { EnableDebugger(); } if ((runtime_flags & RuntimeFlags::PROFILE_FROM_SHELL) != 0) { // simpleperf needs the process to be dumpable to profile it. if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { ALOGE("prctl(PR_SET_DUMPABLE) failed: %s", strerror(errno)); RuntimeAbort(env, __LINE__, "prctl(PR_SET_DUMPABLE, 1) failed"); } } if (NeedsNoRandomizeWorkaround()) { // Work around ARM kernel ASLR lossage (http://b/5817320). Loading
services/core/java/com/android/server/am/ProcessList.java +3 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ import android.content.res.Resources; import android.graphics.Point; import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.net.Uri; import android.os.AppZygote; import android.os.Binder; import android.os.Build; Loading Loading @@ -1481,6 +1480,9 @@ public final class ProcessList { mService.mSafeMode == true) { runtimeFlags |= Zygote.DEBUG_ENABLE_SAFEMODE; } if ((app.info.privateFlags & ApplicationInfo.PRIVATE_FLAG_PROFILEABLE_BY_SHELL) != 0) { runtimeFlags |= Zygote.PROFILE_FROM_SHELL; } if ("1".equals(SystemProperties.get("debug.checkjni"))) { runtimeFlags |= Zygote.DEBUG_ENABLE_CHECKJNI; } Loading