diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-03-15 15:48:38 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-03-15 15:48:38 -0700 |
commit | 2a29b3ad1350785aedea3442b38042885533576c (patch) | |
tree | 110eb4b7982347f7fb8bdc309369a98d44ea4993 /cmds | |
parent | 7f94977867ae67aa4f75d9db5de94e1233a2d7fe (diff) | |
download | frameworks_base-2a29b3ad1350785aedea3442b38042885533576c.zip frameworks_base-2a29b3ad1350785aedea3442b38042885533576c.tar.gz frameworks_base-2a29b3ad1350785aedea3442b38042885533576c.tar.bz2 |
Debugging code for #6169553: Make Phone launch faster
The activity manager now has a tick when launching an app every
500ms, where it collects the current stack traces of the app if
it hasn't finished launching. These traces are included as part
of dumpstate.
This is only done on non-user builds.
Change-Id: I7f09ea00aab821ac81795f48c9d68fcca65f89fe
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index 395c28b..60af415 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -108,6 +108,24 @@ static void dumpstate() { dump_file("VM TRACES AT LAST ANR", anr_traces_path); } + /* slow traces for slow operations */ + if (anr_traces_path[0] != 0) { + int tail = strlen(anr_traces_path)-1; + while (tail > 0 && anr_traces_path[tail] != '/') { + tail--; + } + int i = 0; + while (1) { + sprintf(anr_traces_path+tail+1, "slow%02d.txt", i); + if (stat(anr_traces_path, &st)) { + // No traces file at this index, done with the files. + break; + } + dump_file("VM TRACES WHEN SLOW", anr_traces_path); + i++; + } + } + // dump_file("EVENT LOG TAGS", "/etc/event-log-tags"); run_command("EVENT LOG", 20, "logcat", "-b", "events", "-v", "threadtime", "-d", "*:v", NULL); run_command("RADIO LOG", 20, "logcat", "-b", "radio", "-v", "threadtime", "-d", "*:v", NULL); |