Loading debuggerd/debuggerd.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -459,9 +459,10 @@ static bool perform_dump(const debugger_request_t& request, int fd, int tombston return false; } int total_sleep_time_usec = 0; while (true) { int signal = wait_for_signal(request.tid, &total_sleep_time_usec); // wait_for_signal waits for forever, but the watchdog process will kill us // if it takes too long. int signal = wait_for_signal(request.tid); switch (signal) { case -1: ALOGE("debuggerd: timed out waiting for signal"); Loading debuggerd/utility.cpp +2 −13 Original line number Diff line number Diff line Loading @@ -31,9 +31,6 @@ #include <backtrace/Backtrace.h> #include <log/log.h> constexpr int SLEEP_TIME_USEC = 50000; // 0.05 seconds constexpr int MAX_TOTAL_SLEEP_USEC = 10000000; // 10 seconds // Whitelist output desired in the logcat output. bool is_allowed_in_logcat(enum logtype ltype) { if ((ltype == HEADER) Loading Loading @@ -74,10 +71,10 @@ void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { } } int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { int wait_for_signal(pid_t tid) { while (true) { int status; pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL | WNOHANG)); pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL)); if (n == -1) { ALOGE("waitpid failed: tid %d, %s", tid, strerror(errno)); return -1; Loading @@ -91,14 +88,6 @@ int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { return -1; } } if (*total_sleep_time_usec > MAX_TOTAL_SLEEP_USEC) { ALOGE("timed out waiting for stop signal: tid=%d", tid); return -1; } usleep(SLEEP_TIME_USEC); *total_sleep_time_usec += SLEEP_TIME_USEC; } } Loading debuggerd/utility.h +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ enum logtype { void _LOG(log_t* log, logtype ltype, const char *fmt, ...) __attribute__ ((format(printf, 3, 4))); int wait_for_signal(pid_t tid, int* total_sleep_time_usec); int wait_for_signal(pid_t tid); void dump_memory(log_t* log, Backtrace* backtrace, uintptr_t addr, const char* fmt, ...); Loading Loading
debuggerd/debuggerd.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -459,9 +459,10 @@ static bool perform_dump(const debugger_request_t& request, int fd, int tombston return false; } int total_sleep_time_usec = 0; while (true) { int signal = wait_for_signal(request.tid, &total_sleep_time_usec); // wait_for_signal waits for forever, but the watchdog process will kill us // if it takes too long. int signal = wait_for_signal(request.tid); switch (signal) { case -1: ALOGE("debuggerd: timed out waiting for signal"); Loading
debuggerd/utility.cpp +2 −13 Original line number Diff line number Diff line Loading @@ -31,9 +31,6 @@ #include <backtrace/Backtrace.h> #include <log/log.h> constexpr int SLEEP_TIME_USEC = 50000; // 0.05 seconds constexpr int MAX_TOTAL_SLEEP_USEC = 10000000; // 10 seconds // Whitelist output desired in the logcat output. bool is_allowed_in_logcat(enum logtype ltype) { if ((ltype == HEADER) Loading Loading @@ -74,10 +71,10 @@ void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { } } int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { int wait_for_signal(pid_t tid) { while (true) { int status; pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL | WNOHANG)); pid_t n = TEMP_FAILURE_RETRY(waitpid(tid, &status, __WALL)); if (n == -1) { ALOGE("waitpid failed: tid %d, %s", tid, strerror(errno)); return -1; Loading @@ -91,14 +88,6 @@ int wait_for_signal(pid_t tid, int* total_sleep_time_usec) { return -1; } } if (*total_sleep_time_usec > MAX_TOTAL_SLEEP_USEC) { ALOGE("timed out waiting for stop signal: tid=%d", tid); return -1; } usleep(SLEEP_TIME_USEC); *total_sleep_time_usec += SLEEP_TIME_USEC; } } Loading
debuggerd/utility.h +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ enum logtype { void _LOG(log_t* log, logtype ltype, const char *fmt, ...) __attribute__ ((format(printf, 3, 4))); int wait_for_signal(pid_t tid, int* total_sleep_time_usec); int wait_for_signal(pid_t tid); void dump_memory(log_t* log, Backtrace* backtrace, uintptr_t addr, const char* fmt, ...); Loading