aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duraj <julien.duraj@linaro.org>2017-01-17 11:40:05 +0000
committerLinaro Android Code Review <android-review@review.linaro.org>2017-01-17 11:40:05 +0000
commitf46994f40160070368f2f6a6c66b34f916a5f246 (patch)
tree5d28c6a36929a276eee099c688451377d747b3f6
parente121ac80fdface9cb83fd4d137cb8e07faae487f (diff)
parent60ed638df25096fa7ac1a86e3deabe54c47944ef (diff)
Merge "benchmarks: run benchmarks on adb device over network"
-rwxr-xr-xbenchmarks/benchmarks_run_target.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/benchmarks/benchmarks_run_target.sh b/benchmarks/benchmarks_run_target.sh
index 00c58b4..0cd7336 100755
--- a/benchmarks/benchmarks_run_target.sh
+++ b/benchmarks/benchmarks_run_target.sh
@@ -26,6 +26,7 @@ set_default_options() {
options["skip-build"]="false"
options["skip-run"]="false"
options["iterations"]=$default_iterations
+ options["ip-address"]="0.0.0.0"
}
validate_options() {
@@ -79,6 +80,8 @@ usage() {
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 " --ip-address - Connect to device with adb over network using ip-address."
+ log I " It tries to connect to device on default port 5555"
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"
@@ -124,7 +127,7 @@ arguments_parser() {
--linux|--x86|--sudo)
set_option "${option}"
;;
- --mode|--cpu|--iterations|--skip-build|--skip-run)
+ --mode|--cpu|--iterations|--skip-build|--skip-run|--ip-address)
shift
set_option "${option}" "$1"
;;
@@ -143,6 +146,17 @@ arguments_parser() {
validate_options
}
+# connects to device with adb over ip
+connect_device() {
+ export ANDROID_SERIAL=${1}:5555
+ safe adb connect "${ANDROID_SERIAL}"
+}
+
+# disconnect with the device with adb over ip
+disconnect_device() {
+ safe adb disconnect "${ANDROID_SERIAL}"
+}
+
# Note we need adb push for the benchmarks.
sync_target_adb_push() {
start_adb_section "sync_target_$1"
@@ -209,6 +223,7 @@ main() {
local -r mode="${options["mode"]}"
local -r skip_build="${options["skip-build"]}"
local -r skip_run="${options["skip-run"]}"
+ local -r ip_address="${options["ip-address"]}"
if android_build_already_setup; then
log E "This test does not support environment targets. Please re-run in a clean environment."
@@ -232,6 +247,10 @@ main() {
build_target "${bits}"
fi
+ if [[ "${ip_address}" != "0.0.0.0" ]]; then
+ connect_device "${ip_address}"
+ fi
+
if [[ "${skip_run}" == "false" ]]; then
# Setup & sync device.
device_setup "${bits}"
@@ -245,6 +264,9 @@ main() {
done
if [[ "${skip_run}" == "false" ]]; then
+ if [[ "${ip_address}" != "0.0.0.0" ]]; then
+ disconnect_device "${ip_address}"
+ fi
# Return the device to its default configuration.
device_restore
fi