diff options
author | Daniel Díaz <daniel.diaz@linaro.org> | 2017-02-18 08:11:19 -0600 |
---|---|---|
committer | Daniel Díaz Rodríguez <daniel.diaz@linaro.org> | 2017-03-06 10:09:42 +0000 |
commit | 7d7ec4d7829808bbb10858729912ad3ed2733289 (patch) | |
tree | 15bb1ac43532bfe56efd398c81746b0de5b60152 /automated/android/bionic-benchmarks/device-script.sh | |
parent | cbcaf9e66fa939881658cb2c8060c30fcaa3110e (diff) |
automated: add bionic-benchmarks test
Change-Id: Ic2714900764a4d0a13864f5feb4a85c8ef54afc0
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Diffstat (limited to 'automated/android/bionic-benchmarks/device-script.sh')
-rwxr-xr-x | automated/android/bionic-benchmarks/device-script.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/automated/android/bionic-benchmarks/device-script.sh b/automated/android/bionic-benchmarks/device-script.sh new file mode 100755 index 0000000..5c64456 --- /dev/null +++ b/automated/android/bionic-benchmarks/device-script.sh @@ -0,0 +1,45 @@ +#!/system/bin/sh + +OUTPUT_FILE="/data/local/tmp/result_unsorted.txt" + +test_bionic_benchmark() { + tbb_arch=$1 + cmd="" + if [ "X$tbb_arch" = "X32" ]; then + cmd="/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32" + elif [ "X$tbb_arch" = "X64" ]; then + cmd="/data/benchmarktest/bionic-benchmarks/bionic-benchmarks64" + else + echo "The specified arch ($tbb_arch) is not supported!" + return + fi + chmod +x ${cmd} ||: + if [ -x "${cmd}" ]; then + for res_line in $(${cmd} |grep "BM_"|tr -s ' '|tr ' ' ','); do + tbb_key=$(echo "$res_line"|cut -d, -f1|tr '/' '_') + #tbb_iterations=$(echo "$res_line"|cut -d, -f2) + tbb_ns_time=$(echo "$res_line"|cut -d, -f3) + tbb_throughput=$(echo "$res_line"|cut -d, -f4) + tbb_throughput_units=$(echo "$res_line"|cut -d, -f5) + echo "${tbb_arch}_${tbb_key}" "pass" >> "${OUTPUT_FILE}" + echo "${tbb_arch}_${tbb_key}_time" "pass" "${tbb_ns_time}" "ns/op" >> "${OUTPUT_FILE}" + if [ -n "${tbb_throughput_units}" ]; then + echo "${tbb_arch}_${tbb_key}_throughput" "pass" "${tbb_throughput}" "${tbb_throughput_units}" >> "${OUTPUT_FILE}" + fi + done + else + echo "Can't execute ${cmd}!" + return + fi +} + +: > "${OUTPUT_FILE}" +loops=1 +[ $# -gt 0 ] && loops=$1 +i=1 +until [ ${i} -gt "${loops}" ]; do + echo "Run ${i}..." + test_bionic_benchmark "64" + test_bionic_benchmark "32" + i=$((i + 1)) +done |