Skip to content

Commit

Permalink
Stop all other CPUs on Nexus 5
Browse files Browse the repository at this point in the history
  • Loading branch information
filiph committed Apr 9, 2019
1 parent 97358a7 commit 9ff5e24
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,24 @@ brought any performance improvement or not. Running several times also eliminate
the effect of extremely bad luck, like for example when Android decides to update some app while
test is running.

TODO(filiph): Explain how to lock CPU speeds, and why it's needed
https://github.com/google/skia/blob/master/infra/bots/recipe_modules/flavor/android.py
### Lock CPU and GPU speed for your performance test device

Run the following command when your performance test device is attached via USB.

```bash
./tool/lock_android_scaling.sh
```

WARNING:

* This only works for rooted devices.
* This only works for Nexus 5. The specifics of scaling lock are different from device to device.
You can modify the script to your needs, following
[this template](https://github.com/google/skia/blob/master/infra/bots/recipe_modules/flavor/android.py)
and
[/sys/devices/system/cpu documentation](https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu).

### Where to store the profiling data

You probably don't want to check the `*.tsv` output files into the repo. For that,
run `git update-index --assume-unchanged test_driver/*.tsv` in the root dir. This is a one time
Expand Down
13 changes: 12 additions & 1 deletion tool/lock_android_scaling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,19 @@ sleep 5
ACTUAL_CPU_FREQ=`adb shell "cat ${ROOT}/scaling_cur_freq"`
echo " - actual: ${ACTUAL_CPU_FREQ}"

# No need to disable CPUs on a Nexus 5.
# According to Skia, no need to disable CPUs on a Nexus 5.
# https://github.com/google/skia/blob/e25b4472cdd9f09cd393c9c34651218507c9847b/infra/bots/recipe_modules/flavor/android.py#L145
# But actually, Nexus 5 does scale other CPUs.

CPU_ONLINE=0
for n in 1 2 3
do
echo "Turning CPU ${n} to: ${CPU_ONLINE}"
adb shell "echo ${CPU_ONLINE} > /sys/devices/system/cpu/cpu${n}/online"
ACTUAL=`adb shell "cat /sys/devices/system/cpu/cpu${n}/online"`
echo " - actual: ${ACTUAL}"
done


# --- GPU ---

Expand Down

0 comments on commit 9ff5e24

Please sign in to comment.