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

Commit 53e782d5 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

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
parent bd7c8565
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
    }