Skip to content

Commit ca25016

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE. Integrate: Include showmap output in bug report." into ics-mr0
2 parents 3ee4718 + 9b424b4 commit ca25016

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

cmds/dumpstate/dumpstate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ static void dumpstate() {
209209

210210
run_command("LIST OF OPEN FILES", 10, "su", "root", "lsof", NULL);
211211

212+
for_each_pid(do_showmap, "SMAPS OF ALL PROCESSES");
213+
212214
#ifdef BOARD_HAS_DUMPSTATE
213215
printf("========================================================\n");
214216
printf("== Board\n");

cmds/dumpstate/dumpstate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ void for_each_pid(void (*func)(int, const char *), const char *header);
4545
/* Displays a blocked processes in-kernel wait channel */
4646
void show_wchan(int pid, const char *name);
4747

48+
/* Runs "showmap" for a process */
49+
void do_showmap(int pid, const char *name);
50+
4851
/* Play a sound via Stagefright */
4952
void play_sound(const char* path);
5053

cmds/dumpstate/utils.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ void show_wchan(int pid, const char *name) {
9696
return;
9797
}
9898

99+
void do_showmap(int pid, const char *name) {
100+
char title[255];
101+
char arg[255];
102+
103+
sprintf(title, "SHOW MAP %d (%s)", pid, name);
104+
sprintf(arg, "%d", pid);
105+
run_command(title, 10, "su", "root", "showmap", arg, NULL);
106+
}
107+
99108
/* prints the contents of a file */
100109
int dump_file(const char *title, const char* path) {
101110
char buffer[32768];

0 commit comments

Comments
 (0)