diff options
author | Todd Poynor <toddpoynor@google.com> | 2013-12-11 06:30:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-12-11 06:30:39 +0000 |
commit | 34ced636fbeff4f7f60ef87fb832d0b56a95d30e (patch) | |
tree | 638e3bdad80636f204de377d3428ae99636f9b05 /cmds | |
parent | 0075d781b49a098d88a97aad4a4446a95790a6c9 (diff) | |
parent | 2a83daa8a3e1eab292dc1464bbe78f025f4bc0e9 (diff) | |
download | frameworks_native-34ced636fbeff4f7f60ef87fb832d0b56a95d30e.zip frameworks_native-34ced636fbeff4f7f60ef87fb832d0b56a95d30e.tar.gz frameworks_native-34ced636fbeff4f7f60ef87fb832d0b56a95d30e.tar.bz2 |
am 2a83daa8: dumpstate: dump console-ramoops instead of last_kmsg if present
* commit '2a83daa8a3e1eab292dc1464bbe78f025f4bc0e9':
dumpstate: dump console-ramoops instead of last_kmsg if present
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 3c79ae9..220af47 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -43,6 +43,8 @@ static const char *dump_traces_path = NULL; static char screenshot_path[PATH_MAX] = ""; +#define PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops" + /* dumps the current system state to stdout */ static void dumpstate() { time_t now = time(NULL); @@ -161,8 +163,14 @@ static void dumpstate() { dump_file("NETWORK ROUTES", "/proc/net/route"); dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route"); - /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */ - dump_file("LAST KMSG", "/proc/last_kmsg"); + if (!stat(PSTORE_LAST_KMSG, &st)) { + /* Also TODO: Make console-ramoops CAP_SYSLOG protected. */ + dump_file("LAST KMSG", PSTORE_LAST_KMSG); + } else { + /* TODO: Make last_kmsg CAP_SYSLOG protected. b/5555691 */ + dump_file("LAST KMSG", "/proc/last_kmsg"); + } + dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console"); dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads"); @@ -321,7 +329,7 @@ static void usage() { " -e: play sound file instead of vibrate, at end of job\n" " -q: disable vibrate\n" " -B: send broadcast when finished (requires -o and -p)\n" - ); + ); } static void sigpipe_handler(int n) { |