llkd: Add waiting task to dump

Consider reporting d (lock dump) and w (waiting tasks) after
t (stack dump) as the ramoops buffer could be overflowed.

Test: compile
Bug: 118712403
Change-Id: I64fac7e13c14a1cbc45c9e35fe7746f9b778dcf4
This commit is contained in:
Mark Salyzyn 2018-10-31 16:03:45 -07:00
parent bd7c856507
commit 53e782d531
1 changed files with 6 additions and 0 deletions

View File

@ -524,10 +524,16 @@ void llkPanicKernel(bool dump, pid_t tid, const char* state) {
if (dump) {
// Show all locks that are held
android::base::WriteStringToFd("d", sysrqTriggerFd);
// Show all waiting tasks
android::base::WriteStringToFd("w", sysrqTriggerFd);
// This can trigger hardware watchdog, that is somewhat _ok_.
// But useless if pstore configured for <256KB, low ram devices ...
if (llkEnableSysrqT) {
android::base::WriteStringToFd("t", sysrqTriggerFd);
// Show all locks that are held (in case 't' overflows ramoops)
android::base::WriteStringToFd("d", sysrqTriggerFd);
// Show all waiting tasks (in case 't' overflows ramoops)
android::base::WriteStringToFd("w", sysrqTriggerFd);
}
::usleep(200000); // let everything settle
}