-
Notifications
You must be signed in to change notification settings - Fork 2
/
perf_record.sh
31 lines (22 loc) · 963 Bytes
/
perf_record.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -x
# Record a simple perf profile of vehicle startup.
# -Call to app_profiler.py can be customized with simpleperf options
# -Alternatives code paths launch the vehicle just before the capture begins
# Fetch unstripped libraries from this directory.
TOPOBJDIR_ARGS=
if [ -d "$TOPOBJDIR" ] ; then
TOPOBJDIR_ARGS=--native_lib_dir $TOPOBJDIR
fi
PACKAGE=org.mozilla.firefox
ACTIVITY=org.mozilla.gecko.BrowserApp
# kill the vehicle processes
adb shell am force-stop $PACKAGE
# optional: fresh profile
adb shell pm clear $PACKAGE
# alternative: launch vehicle just before starting simple perf
#adb shell "am start -n $PACKAGE/$ACTIVITY"
# alternative: launch vehicle to a given site
adb shell "am start -n $PACKAGE/$ACTIVITY -a android.intent.action.VIEW -d 'https://www.google.com'"
# start the simpleperf profile
python app_profiler.py -p $PACKAGE --ndk_path ~/.mozbuild/android-ndk-r20 $TOPOBJDIR_ARGS -r "-f 1000 -g --duration 5"