From 10c705738a37c6a8c10d08b9fb87cb29a609ea80 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Tue, 19 May 2015 12:34:35 +0800 Subject: android: update tjbench test update tjbench test to support for both 64bit and 32bit and make it use the common framework to run and output the result Change-Id: Ice6701b6baa4716939f89379059a7b2bf8e55dea Signed-off-by: Yongqin Liu --- android/scripts/tjbench.sh | 58 +++++++++++++++++++++++++++++++++ android/scripts/tjbench/tjbench.sh | 26 --------------- android/scripts/tjbench/tjbenchparse.sh | 48 --------------------------- android/scripts/tjbench/tjbenchstart.sh | 26 --------------- android/tjbench.yaml | 13 ++++---- 5 files changed, 65 insertions(+), 106 deletions(-) create mode 100755 android/scripts/tjbench.sh delete mode 100755 android/scripts/tjbench/tjbench.sh delete mode 100755 android/scripts/tjbench/tjbenchparse.sh delete mode 100755 android/scripts/tjbench/tjbenchstart.sh diff --git a/android/scripts/tjbench.sh b/android/scripts/tjbench.sh new file mode 100755 index 0000000..3d8ae81 --- /dev/null +++ b/android/scripts/tjbench.sh @@ -0,0 +1,58 @@ +#!/system/bin/sh + +local_file_path="$0" +local_file_parent=$(cd $(dirname ${local_file_path}); pwd) +. ${local_file_parent}/common.sh + +img_dir="/data/local/tmp" +#imgs="vgl_5674_0098.ppm vgl_6434_0018.ppm vgl_6548_0026.ppm artificial.ppm nightshot_iso_100.ppm" +imgs="nightshot_iso_100.ppm" + +func_tjbench(){ + cmd=$1 + if [ -z "${cmd}" ];then + return + else + shift + fi + if [ -z "$(which $cmd)" ];then + return + fi + + for img in ${imgs}; do + for line in $($cmd ${img_dir}/${img} 95 -rgb -quiet $@|grep '^RGB'|tr -s ' '|tr ' ' ','); do + key=$(echo $line|cut -d, -f1-6) + compPerf=$(echo $line|cut -d, -f7) + compRatio=$(echo $line|cut -d, -f8) + decompPerf=$(echo $line|cut -d, -f9) + key="${key}_${cmd}_${img}_95_rgb" + if [ -n "$*" ]; then + key="${key}_$*" + fi + key=$(echo $key|tr ', ' '_'|tr -d ':()/') + + output_test_result "${key}_CompPerf" "pass" "${compPerf}" "Mpixels/sec" + output_test_result "${key}_CompRatio" "pass" "${compRatio}" "%" + output_test_result "${key}_DecompPerf" "pass" "${decompPerf}" "Mpixels/sec" + done + done +} + +test_func(){ + func_tjbench tjbench64 scale 1/2 + func_tjbench tjbench64 + func_tjbench tjbench32 scale 1/2 + func_tjbench tjbench32 +} + +main(){ + cd $img_dir + for img in ${imgs}; do + wget http://testdata.validation.linaro.org/tjbench/${img} -O ${img_dir}/${img} + done + + var_test_func="test_func" + run_test "$@" +} + +main "$@" diff --git a/android/scripts/tjbench/tjbench.sh b/android/scripts/tjbench/tjbench.sh deleted file mode 100755 index a7b2395..0000000 --- a/android/scripts/tjbench/tjbench.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/system/bin/sh -# -# tjbench.sh -# -# Copyright (C) 2010 - 2014, Linaro Limited. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Author: Harigopal Gollamudi -# Maintainer: Botao Sun - -tjbench $1 95 -rgb -quiet $2 $3 > tjbench.txt 2>&1 -sh $PWD/tjbenchparse.sh $2 $3 -rm -rf tjbench.txt diff --git a/android/scripts/tjbench/tjbenchparse.sh b/android/scripts/tjbench/tjbenchparse.sh deleted file mode 100755 index 531fc01..0000000 --- a/android/scripts/tjbench/tjbenchparse.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/system/bin/sh -# -# tjbenchparse.sh -# -# Copyright (C) 2010 - 2014, Linaro Limited. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Author: Harigopal Gollamudi -# Maintainer: Botao Sun - -while read line -do - echo $line|sed -n '/RGB/p' >> tmp.txt -done < tjbench.txt - -while read inputline -do - bmp_format="$(echo $inputline | cut -d' ' -f1)" - jpg_subsamp="$(echo $inputline | cut -d' ' -f3)" - jpg_qual="$(echo $inputline | cut -d' ' -f4)" - - test_def_comp_perf=$bmp_format'_'$jpg_subsamp'_'$jpg_qual'_comp_perf'$1$2 - test_def_comp_ratio=$bmp_format'_'$jpg_subsamp'_'$jpg_qual'_comp_ratio'$1$2 - test_def_decomp_perf=$bmp_format'_'$jpg_subsamp'_'$jpg_qual'_decomp_perf'$1$2 - - comp_perf="$(echo $inputline | cut -d' ' -f7)" - comp_ratio="$(echo $inputline | cut -d' ' -f8)" - decomp_perf="$(echo $inputline | cut -d' ' -f9)" - - echo $test_def_comp_perf 'pass' $comp_perf 'Mpixels/sec' - echo $test_def_comp_ratio 'pass' $comp_ratio '%' - echo $test_def_decomp_perf 'pass' $decomp_perf 'Mpixels/sec' - -done < tmp.txt -rm -rf tmp.txt diff --git a/android/scripts/tjbench/tjbenchstart.sh b/android/scripts/tjbench/tjbenchstart.sh deleted file mode 100755 index 5505a4a..0000000 --- a/android/scripts/tjbench/tjbenchstart.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/system/bin/sh -# -# tjbenchstart.sh -# -# Copyright (C) 2010 - 2014, Linaro Limited. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Author: Harigopal Gollamudi -# Maintainer: Botao Sun - -wget http://testdata.validation.linaro.org/tjbench/nightshot_iso_100.ppm -sh $PWD/tjbench.sh $PWD/nightshot_iso_100.ppm scale 1/2 -sh $PWD/tjbench.sh $PWD/nightshot_iso_100.ppm diff --git a/android/tjbench.yaml b/android/tjbench.yaml index 6190811..00caad6 100644 --- a/android/tjbench.yaml +++ b/android/tjbench.yaml @@ -6,7 +6,8 @@ metadata: performance and the compression ratio obtained when compressing the test image as a JPEG image and then decompressing the JPEG image back to its original, uncompressed form." maintainer: - - harigopal.gollamudi@linaro.org + - botao.sun@linaro.org + - yongqin.liu@linaro.org os: - android scope: @@ -19,10 +20,10 @@ metadata: - vexpress-tc2 - juno +params: + RECORD_RESULT_LOCAL: "FALSE" + LOOP_COUNT: "1" + run: steps: - - "disablesuspend.sh" - - "./android/scripts/tjbench/tjbenchstart.sh" - -parse: - pattern: "^(?P\\S+)\\s+(?P\\S+)\\s+(?P[\\d.]+)\\s+(?P\\S+)$" + - ./android/scripts/tjbench.sh --record-csv ${RECORD_RESULT_LOCAL} --loop-count ${LOOP_COUNT} -- cgit v1.2.3