aboutsummaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2016-12-06 15:13:03 +0530
committerVishal Bhoj <vishal.bhoj@linaro.org>2017-01-17 17:03:56 +0530
commita73b46cf97ea9db4a5a41fe4d0000cda07904ca3 (patch)
treeca78a9b2967af60364137ae693bcf17ce4bf9617 /benchmarks
parentddf3bff408e34d113fc2045f27b66dab48e57282 (diff)
benchmarks: support to skip build/running benchmarks
Change-Id: I539d8519d86ca23b144a36775eee854053a95129 Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
Diffstat (limited to 'benchmarks')
-rwxr-xr-xbenchmarks/benchmarks_run_target.sh88
1 files changed, 55 insertions, 33 deletions
diff --git a/benchmarks/benchmarks_run_target.sh b/benchmarks/benchmarks_run_target.sh
index 9a9d992..00c58b4 100755
--- a/benchmarks/benchmarks_run_target.sh
+++ b/benchmarks/benchmarks_run_target.sh
@@ -23,6 +23,8 @@ set_default_options() {
options["sudo"]="false"
options["x86"]="false"
options["cpu"]="all"
+ options["skip-build"]="false"
+ options["skip-run"]="false"
options["iterations"]=$default_iterations
}
@@ -39,6 +41,11 @@ validate_options() {
if [[ ! ${iterations} =~ ^[0-9]+$ ]]; then
log E "Invalid number of iterations: ${iterations}"
fi
+ local -r skip_build="${options["skip-build"]}"
+ local -r skip_run="${options["skip-run"]}"
+ if [[ "${skip_build}" == "true" && "${skip_run}" == "true" ]]; then
+ log E "skip_run and skip_build can't true in the same execution. Please set the right option"
+ fi
}
dump_options() {
@@ -52,32 +59,37 @@ usage() {
log I "$0"
log I "This script should be used for running the benchmarks in an --android-root configuration."
log I "The script expects a device to be connected. Use --list-devices to show supported devices."
- log I " -h|--help - help"
- log I " -v|--verbose - verbose"
+ log I " -h|--help - help"
+ log I " -v|--verbose - verbose"
log I "-------------------------------------------"
- log I " --list-devices - List the devices supported by this script."
- log I " --mode <all|32|64> - Run benchmarks for the specified mode(s)."
- log I " (default: all)"
+ log I " --list-devices - List the devices supported by this script."
+ log I " --mode <all|32|64> - Run benchmarks for the specified mode(s)."
+ log I " (default: all)"
log I " --cpu <all|big|little|full> - CPU mode."
- log I " \"big\": Run with only big cores and pin their frequency"
- log I " \"little\": Run with only little cores and pin their frequency"
- log I " \"all\": With big.LITTLE devices:"
- log I " Run consecutively with only little cores enabled and pinned,"
- log I " and then with only big cores enabled and pinned."
- log I " For devices without big.LITTLE, all cores are enabled and pinned"
- log I " \"full\": Run with unaltered default CPU configuration"
- log I " (no pinning)."
- log I " (default: \"all\")"
- log I " --iterations <n> - The number of iterations to run the benchmarks for."
- log I " (default: $default_iterations)"
- log I " --linux - Compile ART for a non-android kernel"
- log I " --x86 - Compile ART for x86 architecture (otherwise, arm is implied)"
- log I " --sudo - Use \`sudo\` for \`adb shell\` commands in targets without"
- log I " support for \`adb root\`"
+ log I " \"big\": Run with only big cores and pin their frequency"
+ log I " \"little\": Run with only little cores and pin their frequency"
+ log I " \"all\": With big.LITTLE devices:"
+ log I " Run consecutively with only little cores enabled and pinned,"
+ log I " and then with only big cores enabled and pinned."
+ log I " For devices without big.LITTLE, all cores are enabled and pinned"
+ log I " \"full\": Run with unaltered default CPU configuration"
+ log I " (no pinning)."
+ log I " (default: all)"
+ log I " --iterations <n> - The number of iterations to run the benchmarks for."
+ log I " (default: $default_iterations)"
+ log I " --linux - Compile ART for a non-android kernel"
+ log I " --x86 - Compile ART for x86 architecture (otherwise, arm is implied)"
+ log I " --sudo - Use \`sudo\` for \`adb shell\` commands in targets without"
+ log I " support for \`adb root\`"
+ log I " --skip-build <false|true> - Skips the build step and runs benchmark with prebuilt artifacts from \$OUT directory"
+ log I " (default: false)"
+ log I " --skip-run <false|true> - Skips the running benchmark but just builds the artifacts"
+ log I " (default: false)"
+ log I " (default: all)"
log I "-------------------------------------------"
log I "Default Configuration:"
- log I " --default - Default benchmark configuration, equivalent to"
- log I " \`--mode all --cpu all --iterations $default_iterations\`."
+ log I " --default - Default benchmark configuration, equivalent to"
+ log I " \`--mode all --cpu all --iterations $default_iterations\`."
log I "-------------------------------------------"
}
@@ -112,7 +124,7 @@ arguments_parser() {
--linux|--x86|--sudo)
set_option "${option}"
;;
- --mode|--cpu|--iterations)
+ --mode|--cpu|--iterations|--skip-build|--skip-run)
shift
set_option "${option}" "$1"
;;
@@ -195,6 +207,8 @@ main() {
arguments_parser "$@"
dump_options
local -r mode="${options["mode"]}"
+ local -r skip_build="${options["skip-build"]}"
+ local -r skip_run="${options["skip-run"]}"
if android_build_already_setup; then
log E "This test does not support environment targets. Please re-run in a clean environment."
@@ -213,20 +227,28 @@ main() {
# Set environment variables.
set_environment
- # Build target.
- build_target "${bits}"
+ if [[ "${skip_build}" == "false" ]]; then
+ # Build target.
+ build_target "${bits}"
+ fi
+
+ if [[ "${skip_run}" == "false" ]]; then
+ # Setup & sync device.
+ device_setup "${bits}"
+ device_cleanup "${bits}"
+ sync_target_adb_push "${bits}"
- # Setup & sync device.
- device_setup "${bits}"
- device_cleanup "${bits}"
- sync_target_adb_push "${bits}"
+ # Set freq.
+ run_all_benchmarks "${bits}"
+ fi
- # Set freq.
- run_all_benchmarks "${bits}"
done
- # Return the device to its default configuration.
- device_restore
+ if [[ "${skip_run}" == "false" ]]; then
+ # Return the device to its default configuration.
+ device_restore
+ fi
+
stop_timer "${target_timer_name}"
log S "$0 Finished!"