Update docs for profiling Content Shell on Android.
This needed to be updated to reflect the move from GYP to GN, and to show the more modern alternative to manually invoking perf, which is having Catapult do it for you. BUG=608414 Review-Url: https://codereview.chromium.org/1950383002 Cr-Commit-Position: refs/heads/master@{#392675}
This commit is contained in:
@ -73,14 +73,31 @@ requires going to “about phone” or “about tablet” and clicking the build
|
||||
7 times:
|
||||
http://androidmuscle.com/how-to-enable-usb-debugging-developer-options-on-nexus-4-and-android-4-2-devices/
|
||||
|
||||
## Enable profiling
|
||||
|
||||
Rebuild `content_shell_apk` with profiling enabled.
|
||||
|
||||
With GYP (deprecated):
|
||||
|
||||
export GYP_DEFINES="$GYP_DEFINES profiling=1"
|
||||
build/gyp_chromium
|
||||
ninja -C out/Release content_shell_apk
|
||||
|
||||
With GN:
|
||||
|
||||
gn args out/Profiling
|
||||
# add "enable_profiling = true"
|
||||
ninja -C out/Profiling content_shell_apk
|
||||
export CHROMIUM_OUTPUT_DIR="$PWD/out/Profiling"
|
||||
|
||||
## Run a Telemetry perf profiler
|
||||
|
||||
You can run any Telemetry benchmark with `--profiler=perf`, and it will:
|
||||
|
||||
1. Download `perf` and `perfhost`
|
||||
1. Install on your device
|
||||
1. Run the test
|
||||
1. Setup symlinks to work with the `--symfs` parameter
|
||||
2. Install on your device
|
||||
3. Run the test
|
||||
4. Setup symlinks to work with the `--symfs` parameter
|
||||
|
||||
You can also run "manual" tests with Telemetry, more information here:
|
||||
http://www.chromium.org/developers/telemetry/profiling#TOC-Manual-Profiling---Android
|
||||
@ -88,6 +105,17 @@ http://www.chromium.org/developers/telemetry/profiling#TOC-Manual-Profiling---An
|
||||
The following steps describe building `perf`, which is no longer necessary if
|
||||
you use Telemetry.
|
||||
|
||||
## Use `adb_profile_chrome`
|
||||
|
||||
Even if you're not running a Telemetry test, you can use Catapult to
|
||||
automatically push binaries and pull the profile data for you.
|
||||
|
||||
build/android/adb_profile_chrome --browser=content_shell --perf
|
||||
|
||||
While you still have to build, install and launch the APK yourself, Catapult
|
||||
will take care of creating the symfs etc. (i.e. you can skip the "not needed for
|
||||
Telemetry" steps below).
|
||||
|
||||
## Install `/system/bin/perf` on your device (not needed for Telemetry)
|
||||
|
||||
# From inside the android source tree (not inside Chromium)
|
||||
@ -96,14 +124,6 @@ you use Telemetry.
|
||||
adb sync
|
||||
adb shell perf top # check that perf can get samples (don’t expect symbols)
|
||||
|
||||
## Enable profiling
|
||||
|
||||
Rebuild `content_shell_apk` with profiling enabled
|
||||
|
||||
export GYP_DEFINES="$GYP_DEFINES profiling=1"
|
||||
build/gyp_chromium
|
||||
ninja -C out/Release content_shell_apk
|
||||
|
||||
## Install ContentShell
|
||||
|
||||
Install with the following:
|
||||
@ -167,7 +187,6 @@ Run the following:
|
||||
adb shell perf record -g -p 12345 sleep 5
|
||||
adb pull /data/perf.data
|
||||
|
||||
|
||||
## Create the report
|
||||
|
||||
1. Run the following:
|
||||
|
Reference in New Issue
Block a user