platform_bionic/benchmarks/run-on-host.sh
Ryan Prichard 3cfb89d451 run-on-host fixes
* Fix the path to bionic-benchmarks-glibc

 * Add symlinks for the toybox symlink commands. Each symlink bypasses the
   intermediate symlink in ${OUT}/system/bin and points to the final
   toybox binary. Suppress a bunch of warnings by skipping symlinks for
   non-existent files.

   The new spawn benchmarks try to run /system/bin/true. (They also try to
   run /vendor/bin/true and print an error.)

 * Quote "$@"

 * Use soong_ui.bash --dumpvars-mode to set a bunch of variables, rather
   than get_build_var, which invokes Soong once per variable. This reduces
   the "build/run-on-host.sh" runtime from 4s to 1.3s.

 * build/run-on-host.sh isn't executable and is only useful when it's
   sourced into another shell, so remove its shebang to reduce confusion.

Bug: none
Test: \
  . build/envsetup.sh
  lunch aosp_x86_64-userdebug
  . bionic/build/run-on-host.sh
  prepare MODULES-IN-bionic MODULES-IN-external-toybox
  /system/bin/true

Change-Id: I59e9a6aca77d35b16bdf51759c5fc7e725bfc67c
2019-09-24 15:36:31 -07:00

33 lines
953 B
Bash
Executable file

#!/bin/bash -e
. $(dirname $0)/../build/run-on-host.sh
if [ "$1" = glibc ]; then
m -j bionic-benchmarks-glibc
(
cd ${ANDROID_BUILD_TOP}
export ANDROID_DATA=${TARGET_OUT_DATA}
export ANDROID_ROOT=${TARGET_OUT}
${HOST_OUT}/benchmarktest64/bionic-benchmarks-glibc/bionic-benchmarks-glibc "$@"
)
exit 0
elif [ "$1" != 32 -a "$1" != 64 ]; then
echo "Usage: $0 [ 32 | 64 | glibc ] [benchmark flags]"
exit 1
fi
if [ ${HOST_OS}-${HOST_ARCH} = linux-x86 -o ${HOST_OS}-${HOST_ARCH} = linux-x86_64 ]; then
prepare $1 bionic-benchmarks
if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then
(
cd ${ANDROID_BUILD_TOP}
export ANDROID_DATA=${TARGET_OUT_DATA}
export ANDROID_ROOT=${TARGET_OUT}
${BENCHMARKS}/bionic-benchmarks/bionic-benchmarks "$@"
)
else
echo "$0 not supported on TARGET_ARCH=$TARGET_ARCH"
fi
fi