Loading services/core/java/com/android/server/am/ActivityManagerDebugConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class ActivityManagerDebugConfig { static final boolean DEBUG_ALL = false; // Available log categories in the activity manager package. static final boolean DEBUG_ANR = true; // STOPSHIP disable it (b/113252928) static final boolean DEBUG_ANR = false; static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; static final boolean DEBUG_BACKUP = DEBUG_ALL || false; static final boolean DEBUG_BROADCAST = DEBUG_ALL || false; Loading services/core/java/com/android/server/am/ActivityManagerService.java +9 −11 Original line number Diff line number Diff line Loading @@ -3782,9 +3782,7 @@ public class ActivityManagerService extends IActivityManager.Stub ArrayList<Integer> nativePids) { ArrayList<Integer> extraPids = null; if (DEBUG_ANR) { Slog.d(TAG, "dumpStackTraces pids=" + lastPids + " nativepids=" + nativePids); } Slog.i(TAG, "dumpStackTraces pids=" + lastPids + " nativepids=" + nativePids); // Measure CPU usage as soon as we're called in order to get a realistic sampling // of the top users at the time of the request. Loading @@ -3806,8 +3804,8 @@ public class ActivityManagerService extends IActivityManager.Stub if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + stats.pid); extraPids.add(stats.pid); } else if (DEBUG_ANR) { Slog.d(TAG, "Skipping next CPU consuming process, not a java proc: " } else { Slog.i(TAG, "Skipping next CPU consuming process, not a java proc: " + stats.pid); } } Loading @@ -3825,9 +3823,6 @@ public class ActivityManagerService extends IActivityManager.Stub if (tracesFile == null) { return null; } if (DEBUG_ANR) { Slog.d(TAG, "Dumping to " + tracesFile.getAbsolutePath()); } dumpStackTraces(tracesFile.getAbsolutePath(), firstPids, nativePids, extraPids); return tracesFile; Loading Loading @@ -3920,6 +3915,8 @@ public class ActivityManagerService extends IActivityManager.Stub public static void dumpStackTraces(String tracesFile, ArrayList<Integer> firstPids, ArrayList<Integer> nativePids, ArrayList<Integer> extraPids) { Slog.i(TAG, "Dumping to " + tracesFile); // We don't need any sort of inotify based monitoring when we're dumping traces via // tombstoned. Data is piped to an "intercept" FD installed in tombstoned so we're in full // control of all writes to the file in question. Loading @@ -3931,7 +3928,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (firstPids != null) { int num = firstPids.size(); for (int i = 0; i < num; i++) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for pid " + firstPids.get(i)); Slog.i(TAG, "Collecting stacks for pid " + firstPids.get(i)); final long timeTaken = dumpJavaTracesTombstoned(firstPids.get(i), tracesFile, remainingTime); Loading @@ -3951,7 +3948,7 @@ public class ActivityManagerService extends IActivityManager.Stub // Next collect the stacks of the native pids if (nativePids != null) { for (int pid : nativePids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for native pid " + pid); Slog.i(TAG, "Collecting stacks for native pid " + pid); final long nativeDumpTimeoutMs = Math.min(NATIVE_DUMP_TIMEOUT_MS, remainingTime); final long start = SystemClock.elapsedRealtime(); Loading @@ -3975,7 +3972,7 @@ public class ActivityManagerService extends IActivityManager.Stub // Lastly, dump stacks for all extra PIDs from the CPU tracker. if (extraPids != null) { for (int pid : extraPids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + pid); Slog.i(TAG, "Collecting stacks for extra pid " + pid); final long timeTaken = dumpJavaTracesTombstoned(pid, tracesFile, remainingTime); Loading @@ -3991,6 +3988,7 @@ public class ActivityManagerService extends IActivityManager.Stub } } } Slog.i(TAG, "Done dumping"); } @Override Loading Loading
services/core/java/com/android/server/am/ActivityManagerDebugConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class ActivityManagerDebugConfig { static final boolean DEBUG_ALL = false; // Available log categories in the activity manager package. static final boolean DEBUG_ANR = true; // STOPSHIP disable it (b/113252928) static final boolean DEBUG_ANR = false; static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; static final boolean DEBUG_BACKUP = DEBUG_ALL || false; static final boolean DEBUG_BROADCAST = DEBUG_ALL || false; Loading
services/core/java/com/android/server/am/ActivityManagerService.java +9 −11 Original line number Diff line number Diff line Loading @@ -3782,9 +3782,7 @@ public class ActivityManagerService extends IActivityManager.Stub ArrayList<Integer> nativePids) { ArrayList<Integer> extraPids = null; if (DEBUG_ANR) { Slog.d(TAG, "dumpStackTraces pids=" + lastPids + " nativepids=" + nativePids); } Slog.i(TAG, "dumpStackTraces pids=" + lastPids + " nativepids=" + nativePids); // Measure CPU usage as soon as we're called in order to get a realistic sampling // of the top users at the time of the request. Loading @@ -3806,8 +3804,8 @@ public class ActivityManagerService extends IActivityManager.Stub if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + stats.pid); extraPids.add(stats.pid); } else if (DEBUG_ANR) { Slog.d(TAG, "Skipping next CPU consuming process, not a java proc: " } else { Slog.i(TAG, "Skipping next CPU consuming process, not a java proc: " + stats.pid); } } Loading @@ -3825,9 +3823,6 @@ public class ActivityManagerService extends IActivityManager.Stub if (tracesFile == null) { return null; } if (DEBUG_ANR) { Slog.d(TAG, "Dumping to " + tracesFile.getAbsolutePath()); } dumpStackTraces(tracesFile.getAbsolutePath(), firstPids, nativePids, extraPids); return tracesFile; Loading Loading @@ -3920,6 +3915,8 @@ public class ActivityManagerService extends IActivityManager.Stub public static void dumpStackTraces(String tracesFile, ArrayList<Integer> firstPids, ArrayList<Integer> nativePids, ArrayList<Integer> extraPids) { Slog.i(TAG, "Dumping to " + tracesFile); // We don't need any sort of inotify based monitoring when we're dumping traces via // tombstoned. Data is piped to an "intercept" FD installed in tombstoned so we're in full // control of all writes to the file in question. Loading @@ -3931,7 +3928,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (firstPids != null) { int num = firstPids.size(); for (int i = 0; i < num; i++) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for pid " + firstPids.get(i)); Slog.i(TAG, "Collecting stacks for pid " + firstPids.get(i)); final long timeTaken = dumpJavaTracesTombstoned(firstPids.get(i), tracesFile, remainingTime); Loading @@ -3951,7 +3948,7 @@ public class ActivityManagerService extends IActivityManager.Stub // Next collect the stacks of the native pids if (nativePids != null) { for (int pid : nativePids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for native pid " + pid); Slog.i(TAG, "Collecting stacks for native pid " + pid); final long nativeDumpTimeoutMs = Math.min(NATIVE_DUMP_TIMEOUT_MS, remainingTime); final long start = SystemClock.elapsedRealtime(); Loading @@ -3975,7 +3972,7 @@ public class ActivityManagerService extends IActivityManager.Stub // Lastly, dump stacks for all extra PIDs from the CPU tracker. if (extraPids != null) { for (int pid : extraPids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + pid); Slog.i(TAG, "Collecting stacks for extra pid " + pid); final long timeTaken = dumpJavaTracesTombstoned(pid, tracesFile, remainingTime); Loading @@ -3991,6 +3988,7 @@ public class ActivityManagerService extends IActivityManager.Stub } } } Slog.i(TAG, "Done dumping"); } @Override Loading