Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1aee6e5 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Remove STOPSHOP, disable DEBUG_ANR

Instead promote some of the logs from "d" to "i".

Bug: 136096951
Test: Boot and run "Development" app and triggers an ANR
Change-Id: I9c769bc912e26fe860ab450c991b4e617dcaa7c4
parent 079d81a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+9 −11
Original line number Diff line number Diff line
@@ -3694,9 +3694,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.
@@ -3718,8 +3716,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);
                }
            }
@@ -3737,9 +3735,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;
@@ -3832,6 +3827,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.
@@ -3843,7 +3840,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);
@@ -3863,7 +3860,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();
@@ -3887,7 +3884,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);
@@ -3903,6 +3900,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                }
            }
        }
        Slog.i(TAG, "Done dumping");
    }
    @Override