diff options
author | zhanghongbo <hongbo.zhang@stericsson.com> | 2012-05-11 15:07:56 +0800 |
---|---|---|
committer | hongbo.zhang <hongbo.zhang@linaro.com> | 2012-11-28 17:07:21 +0800 |
commit | 4dbc977bc54c90b5cbbb1b6db0ae0d7265b5fa81 (patch) | |
tree | 1e1acde28726a97c6ae789de63c7b1282b854dae /thermal/thermal_03.sh | |
parent | 4416a528c3ac104f7bfb4e8df81ca8c3d097d2aa (diff) |
check if glmark2 is there before excuting it.
Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
Diffstat (limited to 'thermal/thermal_03.sh')
-rwxr-xr-x | thermal/thermal_03.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index 4bb3982..86bdffd 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -29,7 +29,7 @@ source ../include/functions.sh source ../include/thermal_functions.sh CPU_HEAT_BIN=../utils/heat_cpu -GPU_HEAT_BIN=glmark2 +GPU_HEAT_BIN=/usr/bin/glmark2 check_temperature_change() { local dirpath=$THERMAL_PATH/$1 @@ -41,11 +41,18 @@ check_temperature_change() { local init_temp=$(cat $dirpath/temp) $CPU_HEAT_BIN & cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') + test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0" - $GPU_HEAT_BIN & - gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') + if [ -x $GPU_HEAT_BIN ]; then + $GPU_HEAT_BIN & + gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') + test -z $gpu_pid && gpu_pid=0 + else + echo "glmark2 not found." 1>&2 + fi check "start gpu heat binary" "test $gpu_pid -ne 0" + sleep 5 local final_temp=$(cat $dirpath/temp) if [ $cpu_pid != 0 ]; then |