diff options
author | Jonglin Lee <jonglin@google.com> | 2019-01-15 16:38:44 -0800 |
---|---|---|
committer | Jonglin Lee <jonglin@google.com> | 2019-01-17 19:14:46 +0000 |
commit | 28a2c9213b526c90968267df98684baf7f44a93b (patch) | |
tree | 5052a590de9a09d81e65caa001d0b16bcb8bb493 /init | |
parent | c8b83f3874cdef096b37e01ded8a15a47dbfa1c2 (diff) | |
download | system_core-28a2c9213b526c90968267df98684baf7f44a93b.tar.gz system_core-28a2c9213b526c90968267df98684baf7f44a93b.tar.bz2 system_core-28a2c9213b526c90968267df98684baf7f44a93b.zip |
init: dump less debug logs when unmount timeout
Dump only uninterruptible tasks instead of all tasks when
unmount timeout. Also dump current CPU stack traces.
Bug: 122858312
Test: Reboot with and without timeout
Change-Id: I1412ace022b6d78e25fbe1337d1082d4be9c19c0
Diffstat (limited to 'init')
-rw-r--r-- | init/reboot.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/init/reboot.cpp b/init/reboot.cpp index 45dc6d316..9118f5759 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -189,7 +189,7 @@ static bool FindPartitionsToUmount(std::vector<MountEntry>* blockDevPartitions, return true; } -static void DumpUmountDebuggingInfo(bool dump_all) { +static void DumpUmountDebuggingInfo() { int status; if (!security_getenforce()) { LOG(INFO) << "Run lsof"; @@ -198,10 +198,9 @@ static void DumpUmountDebuggingInfo(bool dump_all) { true, nullptr, nullptr, 0); } FindPartitionsToUmount(nullptr, nullptr, true); - if (dump_all) { - // dump current tasks, this log can be lengthy, so only dump with dump_all - android::base::WriteStringToFile("t", "/proc/sysrq-trigger"); - } + // dump current CPU stack traces and uninterruptible tasks + android::base::WriteStringToFile("l", "/proc/sysrq-trigger"); + android::base::WriteStringToFile("w", "/proc/sysrq-trigger"); } static UmountStat UmountPartitions(std::chrono::milliseconds timeout) { @@ -264,11 +263,11 @@ static UmountStat TryUmountAndFsck(bool runFsck, std::chrono::milliseconds timeo UmountStat stat = UmountPartitions(timeout - t.duration()); if (stat != UMOUNT_STAT_SUCCESS) { LOG(INFO) << "umount timeout, last resort, kill all and try"; - if (DUMP_ON_UMOUNT_FAILURE) DumpUmountDebuggingInfo(true); + if (DUMP_ON_UMOUNT_FAILURE) DumpUmountDebuggingInfo(); KillAllProcesses(); // even if it succeeds, still it is timeout and do not run fsck with all processes killed UmountStat st = UmountPartitions(0ms); - if ((st != UMOUNT_STAT_SUCCESS) && DUMP_ON_UMOUNT_FAILURE) DumpUmountDebuggingInfo(false); + if ((st != UMOUNT_STAT_SUCCESS) && DUMP_ON_UMOUNT_FAILURE) DumpUmountDebuggingInfo(); } if (stat == UMOUNT_STAT_SUCCESS && runFsck) { |