Mohan Srinivasan | d5f50d8 | 2017-01-26 11:07:14 -0800 | [diff] [blame] | 1 | Instructions to Run (and modify) app-launcher script |
| 2 | ---------------------------------------------------- |
| 3 | |
| 4 | Introduction: app-launcher is a script that launches apps many times, |
| 5 | measures various system metrics, computes basic stats for the metrics |
| 6 | and reports that stats. |
| 7 | |
Maggie White | 0584bbd | 2017-07-05 17:01:40 -0700 | [diff] [blame] | 8 | Setup: |
| 9 | 1) Make sure the device is seen via 'adb devices' and authorize adb via the |
| 10 | popup dialog. |
| 11 | 2) Clear the setup wizard. |
| 12 | 3) Login to an android user test account. |
| 13 | 4) Clear the first time user dialogs on supported apps for your device (see |
| 14 | below). |
| 15 | 5) Enable wifi and connect to a network (ex. GoogleGuest). |
| 16 | |
Mohan Srinivasan | d5f50d8 | 2017-01-26 11:07:14 -0800 | [diff] [blame] | 17 | Launching app-launcher : |
Maggie White | 5d58ea1 | 2017-06-21 17:42:25 -0700 | [diff] [blame] | 18 | app-launcher -a|-b|-u [-c|-v|-s <serial number>] num-iterations |
Mohan Srinivasan | d5f50d8 | 2017-01-26 11:07:14 -0800 | [diff] [blame] | 19 | -a:Run on all cores |
| 20 | -b:Run only big cores |
| 21 | -c:pagecached. Don't drop pagecache before each launch (not default) |
| 22 | -h:Dump help menu' |
| 23 | -u:user experience, no change to cpu/gpu frequencies or governors' |
Maggie White | 5d58ea1 | 2017-06-21 17:42:25 -0700 | [diff] [blame] | 24 | -v:Optional, Verbose mode, prints stats on a lot of metrics. |
| 25 | -s <serial number>:Optional, specify serial number if multiple devices are |
| 26 | attached to host |
Mohan Srinivasan | d5f50d8 | 2017-01-26 11:07:14 -0800 | [diff] [blame] | 27 | num-iterations : Must be >= 100 to get statistically valid data. |
| 28 | |
| 29 | Note, under -a|-b, we lock the CPU and GPU frequencies. |
| 30 | |
| 31 | Apps Supported : |
| 32 | On phone, these 4 apps are launched |
| 33 | Chrome |
| 34 | Camera |
| 35 | Maps |
| 36 | Youtube |
| 37 | |
| 38 | On Fugu (Google TV), these 3 apps are launched |
| 39 | YouTube |
| 40 | Games |
| 41 | Music |
| 42 | |
| 43 | To add new apps, launch app manually and grep for package name + |
| 44 | activity name in logcat and add these to the launch_phone_apps() |
| 45 | function. |
| 46 | |
| 47 | Adding support for new Devices to app-launcher : |
| 48 | There are a few bits of code needed to do this. |
| 49 | 1) Add a new cpufreq_<device> routine to fix the CPU/GPU frequencies |
| 50 | as desired. |
| 51 | 2) Add logic that checks the $model obtained and check against your device. |
| 52 | (a) Then add code to call your cpufreq_<device> routine there |
| 53 | (b) (Optional) Add code to get the /system block device pathname. This is |
| 54 | only needed if you wan to get storage block device (/system) data. |
| 55 | |
| 56 | Adding new Metrics to app-launcher : |
| 57 | You can modify the way simpleperf is used in the script to collect |
| 58 | different metrics, but that will require a change to getstats() to |
| 59 | parse the output as necessary. Adding new storage stats or other stats |
| 60 | collected from /proc (or /sys) is definitely possible, but code needs |
| 61 | to be written for that - modeled after the disk_stats_before/after |
| 62 | functions. |
| 63 | |
| 64 | Notes : |
| 65 | |
| 66 | Here are the commands to launch/stop the various Apps of interest. The |
| 67 | way to find the package and activity for the app of interest is to |
| 68 | launch the app and then grep for it in logcat to find the |
| 69 | package+activity and use that in am start. |
| 70 | |
| 71 | Chrome : |
| 72 | adb shell 'simpleperf stat -a am start -W -n com.android.chrome/com.google.android.apps.chrome.Main' |
| 73 | adb shell 'am force-stop com.android.chrome' |
| 74 | |
| 75 | Camera : |
| 76 | adb shell 'simpleperf stat -a am start -W -n com.google.android.GoogleCamera/com.android.camera.CameraActivity' |
| 77 | adb shell 'am force-stop com.google.android.GoogleCamera' |
| 78 | |
| 79 | Maps : |
| 80 | adb shell 'simpleperf stat -a am start -W -n com.google.android.apps.maps/com.google.android.maps.MapsActivity' |
| 81 | adb shell 'am force-stop com.google.android.apps.maps' |
| 82 | |
| 83 | Youtube : |
| 84 | adb shell 'am start -W -n com.google.android.youtube/com.google.android.apps.youtube.app.WatchWhileActivity' |
| 85 | adb shell 'am force-stop com.google.android.youtube' |
| 86 | |
| 87 | |