Loading services/java/com/android/server/Watchdog.java +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ public class Watchdog extends Thread { static final int WAITED_HALF = 2; static final int OVERDUE = 3; static final String[] NATIVE_STACKS_OF_INTEREST = new String[] { // Which native processes to dump into dropbox's stack traces public static final String[] NATIVE_STACKS_OF_INTEREST = new String[] { "/system/bin/mediaserver", "/system/bin/sdcard", "/system/bin/surfaceflinger" Loading services/java/com/android/server/am/ActivityManagerService.java +19 −13 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.internal.util.XmlUtils.readIntAttribute; import static com.android.internal.util.XmlUtils.readLongAttribute; import static com.android.internal.util.XmlUtils.writeIntAttribute; import static com.android.internal.util.XmlUtils.writeLongAttribute; import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST; import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT; import static org.xmlpull.v1.XmlPullParser.START_TAG; Loading Loading @@ -322,6 +323,9 @@ public final class ActivityManagerService extends ActivityManagerNative static final String[] EMPTY_STRING_ARRAY = new String[0]; // How many bytes to write into the dropbox log before truncating static final int DROPBOX_MAX_SIZE = 256 * 1024; /** Run all ActivityStacks through this */ ActivityStackSupervisor mStackSupervisor; Loading Loading @@ -3687,7 +3691,17 @@ public final class ActivityManagerService extends ActivityManagerNative } } // Next measure CPU usage. // Next collect the stacks of the native pids if (nativeProcs != null) { int[] pids = Process.getPidsForCommands(nativeProcs); if (pids != null) { for (int pid : pids) { Debug.dumpNativeBacktraceToFile(pid, tracesPath); } } } // Lastly, measure CPU usage. if (processCpuTracker != null) { processCpuTracker.init(); System.gc(); Loading Loading @@ -3719,19 +3733,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } finally { observer.stopWatching(); } if (nativeProcs != null) { int[] pids = Process.getPidsForCommands(nativeProcs); if (pids != null) { for (int pid : pids) { Debug.dumpNativeBacktraceToFile(pid, tracesPath); } } } } final void logAppTooSlow(ProcessRecord app, long startTime, String msg) { Loading Loading @@ -3895,7 +3899,8 @@ public final class ActivityManagerService extends ActivityManagerNative final ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); File tracesFile = dumpStackTraces(true, firstPids, processCpuTracker, lastPids, null); File tracesFile = dumpStackTraces(true, firstPids, processCpuTracker, lastPids, NATIVE_STACKS_OF_INTEREST); String cpuInfo = null; if (MONITOR_CPU_USAGE) { Loading Loading @@ -9826,7 +9831,8 @@ public final class ActivityManagerService extends ActivityManagerNative } if (logFile != null) { try { sb.append(FileUtils.readTextFile(logFile, 128 * 1024, "\n\n[[TRUNCATED]]")); sb.append(FileUtils.readTextFile(logFile, DROPBOX_MAX_SIZE, "\n\n[[TRUNCATED]]")); } catch (IOException e) { Slog.e(TAG, "Error reading " + logFile, e); } Loading Loading
services/java/com/android/server/Watchdog.java +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ public class Watchdog extends Thread { static final int WAITED_HALF = 2; static final int OVERDUE = 3; static final String[] NATIVE_STACKS_OF_INTEREST = new String[] { // Which native processes to dump into dropbox's stack traces public static final String[] NATIVE_STACKS_OF_INTEREST = new String[] { "/system/bin/mediaserver", "/system/bin/sdcard", "/system/bin/surfaceflinger" Loading
services/java/com/android/server/am/ActivityManagerService.java +19 −13 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.internal.util.XmlUtils.readIntAttribute; import static com.android.internal.util.XmlUtils.readLongAttribute; import static com.android.internal.util.XmlUtils.writeIntAttribute; import static com.android.internal.util.XmlUtils.writeLongAttribute; import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST; import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT; import static org.xmlpull.v1.XmlPullParser.START_TAG; Loading Loading @@ -322,6 +323,9 @@ public final class ActivityManagerService extends ActivityManagerNative static final String[] EMPTY_STRING_ARRAY = new String[0]; // How many bytes to write into the dropbox log before truncating static final int DROPBOX_MAX_SIZE = 256 * 1024; /** Run all ActivityStacks through this */ ActivityStackSupervisor mStackSupervisor; Loading Loading @@ -3687,7 +3691,17 @@ public final class ActivityManagerService extends ActivityManagerNative } } // Next measure CPU usage. // Next collect the stacks of the native pids if (nativeProcs != null) { int[] pids = Process.getPidsForCommands(nativeProcs); if (pids != null) { for (int pid : pids) { Debug.dumpNativeBacktraceToFile(pid, tracesPath); } } } // Lastly, measure CPU usage. if (processCpuTracker != null) { processCpuTracker.init(); System.gc(); Loading Loading @@ -3719,19 +3733,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } finally { observer.stopWatching(); } if (nativeProcs != null) { int[] pids = Process.getPidsForCommands(nativeProcs); if (pids != null) { for (int pid : pids) { Debug.dumpNativeBacktraceToFile(pid, tracesPath); } } } } final void logAppTooSlow(ProcessRecord app, long startTime, String msg) { Loading Loading @@ -3895,7 +3899,8 @@ public final class ActivityManagerService extends ActivityManagerNative final ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); File tracesFile = dumpStackTraces(true, firstPids, processCpuTracker, lastPids, null); File tracesFile = dumpStackTraces(true, firstPids, processCpuTracker, lastPids, NATIVE_STACKS_OF_INTEREST); String cpuInfo = null; if (MONITOR_CPU_USAGE) { Loading Loading @@ -9826,7 +9831,8 @@ public final class ActivityManagerService extends ActivityManagerNative } if (logFile != null) { try { sb.append(FileUtils.readTextFile(logFile, 128 * 1024, "\n\n[[TRUNCATED]]")); sb.append(FileUtils.readTextFile(logFile, DROPBOX_MAX_SIZE, "\n\n[[TRUNCATED]]")); } catch (IOException e) { Slog.e(TAG, "Error reading " + logFile, e); } Loading