From 457378c37fef6fe33d4a4f8ddb8239bf5ce2c0be Mon Sep 17 00:00:00 2001 From: Vishal Bhoj Date: Mon, 14 Mar 2016 17:50:01 +0530 Subject: microbenchmarks add mode support for nexus5x Change-Id: Iaf0803a14b15e3576d8a1c7c5cc3dbd2d37ab2a7 Signed-off-by: Vishal Bhoj --- android/art-microbenchmarks.yaml | 3 +- .../scripts/configure-nexus5x-for-benchmarks.sh | 54 ++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'android') diff --git a/android/art-microbenchmarks.yaml b/android/art-microbenchmarks.yaml index 143bf37..de5c579 100644 --- a/android/art-microbenchmarks.yaml +++ b/android/art-microbenchmarks.yaml @@ -25,6 +25,7 @@ params: TARGET_DEVICE: "nexus9" ITERATIONS: 10 MODE: 64 + CORE: "default" run: steps: @@ -34,7 +35,7 @@ run: - then - if [ -f ./android/scripts/configure-$TARGET_DEVICE-for-benchmarks.sh ] - then - - . ./android/scripts/configure-$TARGET_DEVICE-for-benchmarks.sh || true + - . ./android/scripts/configure-$TARGET_DEVICE-for-benchmarks.sh $CORE || true - fi - ./art-testing/run.py -t $IPADDR --iterations $ITERATIONS --mode $MODE --output-pkl $PWD/art-microbenchmarks.pkl --output-json $PWD/art-microbenchmarks.json | tee logs.txt - . ./android/scripts/parse-ubenchmarks-results.sh logs.txt 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 "$@" -- cgit v1.2.3