Merge "Kill logcat with SEGV so we get a tombstone on timeout." am: 2a088541ac

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1696086

Change-Id: I6f2c4d4fb099abfd1b042559964cb07a84c0ca21
This commit is contained in:
Treehugger Robot
2021-05-18 03:47:05 +00:00
committed by Automerger Merge Worker

View File

@@ -10272,11 +10272,13 @@ public class ActivityManagerService extends IActivityManager.Stub
if (lines > 0) { if (lines > 0) {
sb.append("\n"); sb.append("\n");
// Merge several logcat streams, and take the last N lines
InputStreamReader input = null; InputStreamReader input = null;
try { try {
java.lang.Process logcat = new ProcessBuilder( java.lang.Process logcat = new ProcessBuilder(
"/system/bin/timeout", "-k", "15s", "10s", // Time out after 10s, but kill logcat with SEGV
// so we can investigate why it didn't finish.
"/system/bin/timeout", "-s", "SEGV", "10s",
// Merge several logcat streams, and take the last N lines.
"/system/bin/logcat", "-v", "threadtime", "-b", "events", "-b", "system", "/system/bin/logcat", "-v", "threadtime", "-b", "events", "-b", "system",
"-b", "main", "-b", "crash", "-t", String.valueOf(lines)) "-b", "main", "-b", "crash", "-t", String.valueOf(lines))
.redirectErrorStream(true).start(); .redirectErrorStream(true).start();