am 4ba4e03e: Merge "also add backtraces of CPUs before watchdog kills system server" into lmp-mr1-dev
* commit '4ba4e03e6b8dcb556774b323429f8904676cd615': also add backtraces of CPUs before watchdog kills system server
This commit is contained in:
@@ -415,15 +415,9 @@ public class Watchdog extends Thread {
|
||||
dumpKernelStackTraces();
|
||||
}
|
||||
|
||||
// Trigger the kernel to dump all blocked threads to the kernel log
|
||||
try {
|
||||
FileWriter sysrq_trigger = new FileWriter("/proc/sysrq-trigger");
|
||||
sysrq_trigger.write("w");
|
||||
sysrq_trigger.close();
|
||||
} catch (IOException e) {
|
||||
Slog.e(TAG, "Failed to write to /proc/sysrq-trigger");
|
||||
Slog.e(TAG, e.getMessage());
|
||||
}
|
||||
// Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log
|
||||
doSysRq('w');
|
||||
doSysRq('l');
|
||||
|
||||
// Try to add the error to the dropbox, but assuming that the ActivityManager
|
||||
// itself may be deadlocked. (which has happened, causing this statement to
|
||||
@@ -488,6 +482,16 @@ public class Watchdog extends Thread {
|
||||
}
|
||||
}
|
||||
|
||||
private void doSysRq(char c) {
|
||||
try {
|
||||
FileWriter sysrq_trigger = new FileWriter("/proc/sysrq-trigger");
|
||||
sysrq_trigger.write(c);
|
||||
sysrq_trigger.close();
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "Failed to write to /proc/sysrq-trigger", e);
|
||||
}
|
||||
}
|
||||
|
||||
private File dumpKernelStackTraces() {
|
||||
String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null);
|
||||
if (tracesPath == null || tracesPath.length() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user