diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2016-03-14 17:50:01 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@linaro.org> | 2016-03-18 12:51:15 +0530 |
commit | 457378c37fef6fe33d4a4f8ddb8239bf5ce2c0be (patch) | |
tree | 9b59b1081d4fa2fd431dec1b9175cc5cf792e4fb /android/scripts/configure-nexus5x-for-benchmarks.sh | |
parent | f4de84ffc9747730e3348ba80e1ecfc9a9ff6890 (diff) |
microbenchmarks add mode support for nexus5x
Change-Id: Iaf0803a14b15e3576d8a1c7c5cc3dbd2d37ab2a7
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
Diffstat (limited to 'android/scripts/configure-nexus5x-for-benchmarks.sh')
-rwxr-xr-x | android/scripts/configure-nexus5x-for-benchmarks.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/android/scripts/configure-nexus5x-for-benchmarks.sh b/android/scripts/configure-nexus5x-for-benchmarks.sh index 2a86bda..d0cae4b 100755 --- a/android/scripts/configure-nexus5x-for-benchmarks.sh +++ b/android/scripts/configure-nexus5x-for-benchmarks.sh @@ -1,5 +1,59 @@ #!/bin/bash +CPU_PATH="/sys/devices/system/cpu/cpu" + +set_online() { + local dirpath=$CPU_PATH$1/online + adb -s $IPADDR shell "echo 1 > $dirpath" +} + +set_offline() { + local dirpath=$CPU_PATH$1/online + adb -s $IPADDR shell "echo 0 > $dirpath" +} + + +all_small() { + set_online 0; set_online 1; set_online 2; set_online 3; + set_offline 4; set_offline 5; +} + +all_big() { + set_online 4; set_online 5; + set_offline 0; set_offline 1; set_offline 2; set_offline 3; +} + +all_online() { + set_online 0; set_online 1; set_online 2; + set_online 3; set_online 4; set_online 5; +} + +show_cpu() { + adb -s $IPADDR shell "cat /sys/devices/system/cpu/cpu*/online" +} + + +parse() { + case $1 in + small) + all_small + ;; + big) + all_big + ;; + default) + ;; + esac +} + set -x echo "configuring Nexus5X on: $IPADDR" adb -s $IPADDR wait-for-device +adb -s $IPADDR root +adb -s $IPADDR wait-for-device adb -s $IPADDR shell stop +for n in {0..5}; do + adb -s $IPADDR shell "echo userspace > /sys/devices/system/cpu/cpu$n/cpufreq/scaling_governor" + adb -s $IPADDR shell "echo 1000000 > /sys/devices/system/cpu/cpu$n/cpufreq/scaling_min_freq" + adb -s $IPADDR shell "echo 1000000 > /sys/devices/system/cpu/cpu$n/cpufreq/scaling_max_freq" +done +parse "$@" |