diff options
author | 2011-11-03 19:19:28 -0700 | |
---|---|---|
committer | 2011-11-03 19:19:28 -0700 | |
commit | 5123468934e4c8debf2f0dd07d8b9e56eb005697 (patch) | |
tree | 9b1cc43b373366085308e4f4058f79b48cf608b8 | |
parent | e0ad47465ededb16c6cd60524acd6941a8ce0bd8 (diff) |
Include showmap output in bug report.
Change-Id: I02d246defc73ea45c469ab7cb899f45d5663a301
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 2 | ||||
-rw-r--r-- | cmds/dumpstate/dumpstate.h | 3 | ||||
-rw-r--r-- | cmds/dumpstate/utils.c | 9 |
3 files changed, 14 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 30aed3317307..ca66a4e7e672 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -209,6 +209,8 @@ static void dumpstate() { run_command("LIST OF OPEN FILES", 10, "su", "root", "lsof", NULL); + for_each_pid(do_showmap, "SMAPS OF ALL PROCESSES"); + #ifdef BOARD_HAS_DUMPSTATE printf("========================================================\n"); printf("== Board\n"); diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h index 597ab1fa6a15..6d66b1ba6676 100644 --- a/cmds/dumpstate/dumpstate.h +++ b/cmds/dumpstate/dumpstate.h @@ -45,6 +45,9 @@ void for_each_pid(void (*func)(int, const char *), const char *header); /* Displays a blocked processes in-kernel wait channel */ void show_wchan(int pid, const char *name); +/* Runs "showmap" for a process */ +void do_showmap(int pid, const char *name); + /* Play a sound via Stagefright */ void play_sound(const char* path); diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c index b2f9e800dca7..14984ecf40a9 100644 --- a/cmds/dumpstate/utils.c +++ b/cmds/dumpstate/utils.c @@ -96,6 +96,15 @@ out_close: return; } +void do_showmap(int pid, const char *name) { + char title[255]; + char arg[255]; + + sprintf(title, "SHOW MAP %d (%s)", pid, name); + sprintf(arg, "%d", pid); + run_command(title, 10, "su", "root", "showmap", arg, NULL); +} + /* prints the contents of a file */ int dump_file(const char *title, const char* path) { char buffer[32768]; |