Loading llkd/libllkd.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -510,8 +510,10 @@ bool llkWriteStringToFileConfirm(const std::string& string, const std::string& f return android::base::Trim(content) == string; } void llkPanicKernel(bool dump, pid_t tid, const char* state) __noreturn; void llkPanicKernel(bool dump, pid_t tid, const char* state) { void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string& message = "") __noreturn; void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string& message) { if (!message.empty()) LOG(ERROR) << message; auto sysrqTriggerFd = llkFileToWriteFd("/proc/sysrq-trigger"); if (sysrqTriggerFd < 0) { // DYB Loading @@ -537,7 +539,11 @@ void llkPanicKernel(bool dump, pid_t tid, const char* state) { } ::usleep(200000); // let everything settle } llkWriteStringToFile("SysRq : Trigger a crash : 'livelock,"s + state + "'\n", "/dev/kmsg"); // SysRq message matches kernel format, and propagates through bootstat // ultimately to the boot reason into panic,livelock,<state>. llkWriteStringToFile(message + (message.empty() ? "" : "\n") + "SysRq : Trigger a crash : 'livelock,"s + state + "'\n", "/dev/kmsg"); android::base::WriteStringToFd("c", sysrqTriggerFd); // NOTREACHED // DYB Loading Loading @@ -1098,10 +1104,12 @@ milliseconds llkCheck(bool checkRunning) { } } // We are here because we have confirmed kernel live-lock LOG(ERROR) << state << ' ' << llkFormat(procp->count) << ' ' << ppid << "->" << pid << "->" << tid << ' ' << procp->getComm() << " [panic]"; const auto message = state + " "s + llkFormat(procp->count) + " " + std::to_string(ppid) + "->" + std::to_string(pid) + "->" + std::to_string(tid) + " " + procp->getComm() + " [panic]"; llkPanicKernel(true, tid, (state == 'Z') ? "zombie" : (state == 'D') ? "driver" : "sleeping"); (state == 'Z') ? "zombie" : (state == 'D') ? "driver" : "sleeping", message); } LOG(VERBOSE) << "+closedir()"; } Loading Loading
llkd/libllkd.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -510,8 +510,10 @@ bool llkWriteStringToFileConfirm(const std::string& string, const std::string& f return android::base::Trim(content) == string; } void llkPanicKernel(bool dump, pid_t tid, const char* state) __noreturn; void llkPanicKernel(bool dump, pid_t tid, const char* state) { void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string& message = "") __noreturn; void llkPanicKernel(bool dump, pid_t tid, const char* state, const std::string& message) { if (!message.empty()) LOG(ERROR) << message; auto sysrqTriggerFd = llkFileToWriteFd("/proc/sysrq-trigger"); if (sysrqTriggerFd < 0) { // DYB Loading @@ -537,7 +539,11 @@ void llkPanicKernel(bool dump, pid_t tid, const char* state) { } ::usleep(200000); // let everything settle } llkWriteStringToFile("SysRq : Trigger a crash : 'livelock,"s + state + "'\n", "/dev/kmsg"); // SysRq message matches kernel format, and propagates through bootstat // ultimately to the boot reason into panic,livelock,<state>. llkWriteStringToFile(message + (message.empty() ? "" : "\n") + "SysRq : Trigger a crash : 'livelock,"s + state + "'\n", "/dev/kmsg"); android::base::WriteStringToFd("c", sysrqTriggerFd); // NOTREACHED // DYB Loading Loading @@ -1098,10 +1104,12 @@ milliseconds llkCheck(bool checkRunning) { } } // We are here because we have confirmed kernel live-lock LOG(ERROR) << state << ' ' << llkFormat(procp->count) << ' ' << ppid << "->" << pid << "->" << tid << ' ' << procp->getComm() << " [panic]"; const auto message = state + " "s + llkFormat(procp->count) + " " + std::to_string(ppid) + "->" + std::to_string(pid) + "->" + std::to_string(tid) + " " + procp->getComm() + " [panic]"; llkPanicKernel(true, tid, (state == 'Z') ? "zombie" : (state == 'D') ? "driver" : "sleeping"); (state == 'Z') ? "zombie" : (state == 'D') ? "driver" : "sleeping", message); } LOG(VERBOSE) << "+closedir()"; } Loading