summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-11-05 16:40:10 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-05 16:40:10 +0000
commit3f3e8f0c371eff9d9454779e42fb02db67d91a9f (patch)
treea6cf5ef3f677304a20c60b680e827406d70c5d21
parentd291558b56aaa9e8233cb5d55abd1f9463a1ebc5 (diff)
parent55fe6763d29cb0e899b2541497f4d8bc1bbd14ba (diff)
downloadframeworks_base-3f3e8f0c371eff9d9454779e42fb02db67d91a9f.zip
frameworks_base-3f3e8f0c371eff9d9454779e42fb02db67d91a9f.tar.gz
frameworks_base-3f3e8f0c371eff9d9454779e42fb02db67d91a9f.tar.bz2
am 55fe6763: Merge "Include showmap output in bug report." into ics-mr1
* commit '55fe6763d29cb0e899b2541497f4d8bc1bbd14ba': Include showmap output in bug report.
-rw-r--r--cmds/dumpstate/dumpstate.c2
-rw-r--r--cmds/dumpstate/dumpstate.h3
-rw-r--r--cmds/dumpstate/utils.c9
3 files changed, 14 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 30aed33..ca66a4e 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 597ab1f..6d66b1b 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 b2f9e80..14984ec 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];