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

Commit b8a39368 authored by Kevin Jeon's avatar Kevin Jeon
Browse files

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
parent 9a983f2f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2226,8 +2226,7 @@ Dumpstate::RunStatus Dumpstate::DumpTraces(const char** path) {

        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