From 8432d4a6abefdfdad1666a4c4866378d0a3d84bf Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 8 Aug 2022 20:47:09 +0000 Subject: [PATCH] Use `timeout -i` to distinguish cases where logcat is making progress. Bug: http://b/196856709 Test: treehugger Change-Id: I90ccb32df5ef841a02e9b759891552291142979f --- .../java/com/android/server/am/ActivityManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 09b601c349054..8ca688910e249 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8407,9 +8407,9 @@ public class ActivityManagerService extends IActivityManager.Stub InputStreamReader input = null; try { java.lang.Process logcat = new ProcessBuilder( - // Time out after 10s, but kill logcat with SEGV + // Time out after 10s of inactivity, but kill logcat with SEGV // so we can investigate why it didn't finish. - "/system/bin/timeout", "-s", "SEGV", "10s", + "/system/bin/timeout", "-i", "-s", "SEGV", "10s", // Merge several logcat streams, and take the last N lines. "/system/bin/logcat", "-v", "threadtime", "-b", "events", "-b", "system", "-b", "main", "-b", "crash", "-t", String.valueOf(lines))