From 7eabe55db6b113f83c2cefcd06812648927de877 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 21 Jul 2011 14:56:34 -0700 Subject: Add looper profiling to adb shell am To profile the looper, run the following command: adb shell am profile looper start adb shell am profile looper stop Change-Id: I781f156e473d7bdbb6d13aaffeeaae88bc01a69f --- cmds/am/src/com/android/commands/am/Am.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cmds') 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 \n" + " am instrument [-r] [-e ] [-p] [-w]\n" + " [--no-window-animation] \n" + - " am profile start \n" + - " am profile stop \n" + + " am profile [looper] start \n" + + " am profile [looper] stop \n" + " am dumpheap [flags] \n" + " am monitor [--gdb ]\n" + " am screen-compat [on|off] \n" + -- cgit v1.1