diff options
author | San Mehat <san@google.com> | 2009-09-01 13:27:20 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-09-01 14:41:13 -0700 |
commit | 30b9f57c8b2c1e3d0b3d2668ad04980ea0050d04 (patch) | |
tree | be3d8edb5a9a144c415c9c28b2e4f7bbca31957a /cmds/dumpstate/dumpstate.c | |
parent | 05a6f3cde52e5fbbad5187615bfc87d58559161f (diff) | |
download | frameworks_base-30b9f57c8b2c1e3d0b3d2668ad04980ea0050d04.zip frameworks_base-30b9f57c8b2c1e3d0b3d2668ad04980ea0050d04.tar.gz frameworks_base-30b9f57c8b2c1e3d0b3d2668ad04980ea0050d04.tar.bz2 |
dumpstate: Add support for apanic crash data
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'cmds/dumpstate/dumpstate.c')
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 18713e9..3ddc922 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -20,6 +20,7 @@ #include <unistd.h> #include <sys/stat.h> #include <limits.h> +#include <errno.h> #include <fcntl.h> #include <sys/time.h> #include <sys/resource.h> @@ -34,6 +35,8 @@ static int end_pattern[] = { 75, 50, 75, 50, 75, 0 }; static struct tm now; +static void dump_kernel_log(const char *path, const char *title) ; + /* dumps the current system state to stdout */ static void dumpstate(int full) { if (full) { @@ -101,8 +104,12 @@ static void dumpstate(int full) { DUMP("/data/system/packages.xml"); PRINT("------ PACKAGE UID ERRORS ------"); DUMP("/data/system/uiderrors.txt"); - PRINT("------ LAST KERNEL LOG ------"); - DUMP("/data/last_kmsg"); + + dump_kernel_log("/data/dontpanic/last_kmsg", "RAMCONSOLE"); + dump_kernel_log("/data/dontpanic/apanic_console", + "PANIC CONSOLE"); + dump_kernel_log("/data/dontpanic/apanic_threads", + "PANIC THREADS"); } PRINT("========================================================"); PRINT("== build.prop"); @@ -295,3 +302,13 @@ int main(int argc, char *argv[]) { return 0; } +static void dump_kernel_log(const char *path, const char *title) + +{ + printf("------ KERNEL %s LOG ------\n", title); + if (access(path, R_OK) < 0) + printf("%s: %s\n", path, strerror(errno)); + else + DUMP(path); +} + |