summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-07-21 14:56:34 -0700
committerRomain Guy <romainguy@google.com>2011-07-21 14:56:34 -0700
commit7eabe55db6b113f83c2cefcd06812648927de877 (patch)
treea105d90d8addbce9bb457b4bef974ce2f699fc81 /cmds/am
parentac4159549c10dbe428d42980278c0e43ecc8d93f (diff)
downloadframeworks_base-7eabe55db6b113f83c2cefcd06812648927de877.zip
frameworks_base-7eabe55db6b113f83c2cefcd06812648927de877.tar.gz
frameworks_base-7eabe55db6b113f83c2cefcd06812648927de877.tar.bz2
Add looper profiling to adb shell am
To profile the looper, run the following command: adb shell am profile looper start <process> <file> adb shell am profile looper stop <process> Change-Id: I781f156e473d7bdbb6d13aaffeeaae88bc01a69f
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 3fb1736..6dfa12b 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -468,10 +468,16 @@ public class Am {
String profileFile = null;
boolean start = false;
boolean wall = false;
+ int profileType = 0;
String process = null;
String cmd = nextArgRequired();
+ if ("looper".equals(cmd)) {
+ cmd = nextArgRequired();
+ profileType = 1;
+ }
+
if ("start".equals(cmd)) {
start = true;
wall = "--wall".equals(nextOption());
@@ -516,7 +522,7 @@ public class Am {
} else if (start) {
//removeWallOption();
}
- if (!mAm.profileControl(process, start, profileFile, fd)) {
+ if (!mAm.profileControl(process, start, profileFile, fd, profileType)) {
wall = false;
throw new AndroidException("PROFILE FAILED on process " + process);
}
@@ -1076,8 +1082,8 @@ public class Am {
" am broadcast <INTENT>\n" +
" am instrument [-r] [-e <NAME> <VALUE>] [-p] [-w]\n" +
" [--no-window-animation] <COMPONENT>\n" +
- " am profile start <PROCESS> <FILE>\n" +
- " am profile stop <PROCESS>\n" +
+ " am profile [looper] start <PROCESS> <FILE>\n" +
+ " am profile [looper] stop <PROCESS>\n" +
" am dumpheap [flags] <PROCESS> <FILE>\n" +
" am monitor [--gdb <port>]\n" +
" am screen-compat [on|off] <PACKAGE>\n" +