Reduce debuggerd backtrace timeouts in dumpstate
This change reduces the per-process timeouts for dumping backtraces from
5 (Java processes) and 20 (native processes) seconds to 3 seconds. A
large amount of the time spent in dumpstate's DUMP TRACES task can be
attributed to waiting for timeouts to expire, even though
successfully-dumped backtraces typically complete under 1 second.
If the current 5 or 20 second timeout is reached, it's more likely that
the process is blocked on something else, rather than the trace dump
just needing more time to finish.
Test: - Collect a bug report with 'adb shell bugreportz' and verify that
there aren't any more timed-out trace dumps than usual.
- Set the timeout to something even larger (60s) and check that
there are still timed-out trace dumps, and that there are no
dumps that were successful because of the increased timeout.
Bug: 276451949
Change-Id: I5fe89fdd720af56030ecdf7dd82ccc61a83fe58a
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 7537237..5594c26 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -2226,8 +2226,7 @@
const uint64_t start = Nanotime();
const int ret = dump_backtrace_to_file_timeout(
- pid, is_java_process ? kDebuggerdJavaBacktrace : kDebuggerdNativeBacktrace,
- is_java_process ? 5 : 20, fd);
+ pid, is_java_process ? kDebuggerdJavaBacktrace : kDebuggerdNativeBacktrace, 3, fd);
if (ret == -1) {
// For consistency, the header and footer to this message match those