Hi all, These are my PM-QA commits recently, send them out FYI.
Hongbo Zhang (8): thermal: kill heater program if test is terminated by signal thermal: don't check launch of the glmark2 if it isn't there thermal: remove unnecessary variable TRIP_CROSSED_COUNT thermal: Consolidate launching glmark2 as GPU heater thermal: add switch for thermal_06.sh thermal: enable launching glmark2 in Android pm-qa: enable thermal test scipts. Version 0.4.0
Makefile | 4 ++-- VERSION | 2 +- include/thermal_functions.sh | 41 +++++++++++++++++++++++++++++++++++++++++ thermal/thermal_03.sh | 29 ++++++++++++----------------- thermal/thermal_04.sh | 11 ++++++++++- thermal/thermal_06.sh | 39 ++++++++++++++++++++------------------- 6 files changed, 86 insertions(+), 40 deletions(-)
if the thermal test is terminated by signals such as an Ctrl+C operation, the heat_cpu and also glmark(if there is any) should be terminated too.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- thermal/thermal_03.sh | 22 ++++++++++++++-------- thermal/thermal_04.sh | 11 ++++++++++- thermal/thermal_06.sh | 22 ++++++++++++++-------- 3 files changed, 38 insertions(+), 17 deletions(-)
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index 86bdffd..5790320 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -30,14 +30,23 @@ source ../include/thermal_functions.sh
CPU_HEAT_BIN=../utils/heat_cpu GPU_HEAT_BIN=/usr/bin/glmark2 +cpu_pid=0 +gpu_pid=0 + +heater_kill() { + if [ $cpu_pid != 0 ]; then + kill -9 $cpu_pid + fi + if [ $gpu_pid != 0 ]; then + kill -9 $gpu_pid + fi +}
check_temperature_change() { local dirpath=$THERMAL_PATH/$1 local zone_name=$1 shift 1
- local cpu_pid=0 - local gpu_pid=0 local init_temp=$(cat $dirpath/temp) $CPU_HEAT_BIN & cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') @@ -55,13 +64,10 @@ check_temperature_change() {
sleep 5 local final_temp=$(cat $dirpath/temp) - if [ $cpu_pid != 0 ]; then - kill -9 $cpu_pid - fi - if [ $gpu_pid != 0 ]; then - kill -9 $gpu_pid - fi + heater_kill check "temperature variation with load" "test $final_temp -gt $init_temp" }
+trap "heater_kill; sigtrap" SIGHUP SIGINT SIGTERM + for_each_thermal_zone check_temperature_change diff --git a/thermal/thermal_04.sh b/thermal/thermal_04.sh index 52882e2..8f0dee7 100755 --- a/thermal/thermal_04.sh +++ b/thermal/thermal_04.sh @@ -28,6 +28,13 @@ source ../include/functions.sh source ../include/thermal_functions.sh HEAT_CPU_MODERATE=../utils/heat_cpu +pid=0 + +heater_kill() { + if [ $pid != 0 ]; then + kill -9 $pid + fi +}
verify_cooling_device_temp_change() { local dirpath=$THERMAL_PATH/$1 @@ -65,9 +72,11 @@ verify_cooling_device_temp_change() { "test $cool_temp -ge 0" count=$((count+1)) done - kill -9 $pid + heater_kill echo $prev_mode_val > $tzonepath/mode echo $prev_state_val > $dirpath/cur_state }
+trap "heater_kill; sigtrap" SIGHUP SIGINT SIGTERM + for_each_cooling_device verify_cooling_device_temp_change diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 1497bcc..8013b82 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -32,6 +32,17 @@ CPU_HEAT_BIN=../utils/heat_cpu GPU_HEAT_BIN=/usr/bin/glmark2 TEST_LOOP=100 TRIP_CROSSED_COUNT= +cpu_pid=0 +gpu_pid=0 + +heater_kill() { + if [ $cpu_pid != 0 ]; then + kill -9 $cpu_pid + fi + if [ $gpu_pid != 0 ]; then + kill -9 $gpu_pid + fi +}
check_trip_point_change() { local dirpath=$THERMAL_PATH/$1 @@ -43,8 +54,6 @@ check_trip_point_change() { local trip_temp=0 local trip_cross= local trip_id= - local cpu_pid=0 - local gpu_pid=0 local trip_type=0 local trip_type_path=0 $CPU_HEAT_BIN & @@ -94,12 +103,9 @@ check_trip_point_change() { index=$((index + 1)) done
- if [ $cpu_pid != 0 ]; then - kill -9 $cpu_pid - fi - if [ $gpu_pid != 0 ]; then - kill -9 $gpu_pid - fi + heater_kill }
+trap "heater_kill; sigtrap" SIGHUP SIGINT SIGTERM + for_each_thermal_zone check_trip_point_change
if the glmark2 as a heater isn't there, don't report a launch failure.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- thermal/thermal_03.sh | 2 +- thermal/thermal_06.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index 5790320..5703ad3 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -57,10 +57,10 @@ check_temperature_change() { $GPU_HEAT_BIN & gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') test -z $gpu_pid && gpu_pid=0 + check "start gpu heat binary" "test $gpu_pid -ne 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) diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 8013b82..fcb6c0a 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -65,10 +65,10 @@ check_trip_point_change() { $GPU_HEAT_BIN & gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') test -z $gpu_pid && gpu_pid=0 + check "start gpu heat binary" "test $gpu_pid -ne 0" else echo "glmark2 not found." 1>&2 fi - check "start gpu heat binary" "test $gpu_pid -ne 0"
local index=0 for trip in $(ls $dirpath | grep "trip_point_['$MAX_ZONE']_temp"); do
variable TRIP_CROSSED_COUNT is never used, should be removed.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- thermal/thermal_06.sh | 1 - 1 file changed, 1 deletion(-)
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index fcb6c0a..95eda91 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -31,7 +31,6 @@ source ../include/thermal_functions.sh CPU_HEAT_BIN=../utils/heat_cpu GPU_HEAT_BIN=/usr/bin/glmark2 TEST_LOOP=100 -TRIP_CROSSED_COUNT= cpu_pid=0 gpu_pid=0
Currently the glmark2 is used to heat GPU for thermal test, this patch consolidates launching glmark2 from serial console. The glmark2 heater is optional now, which means no apparent fail will be reported if there is no glmark2 or it cannot be launched.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- include/thermal_functions.sh | 31 +++++++++++++++++++++++++++++++ thermal/thermal_03.sh | 15 ++------------- thermal/thermal_06.sh | 17 +++-------------- 3 files changed, 36 insertions(+), 27 deletions(-)
diff --git a/include/thermal_functions.sh b/include/thermal_functions.sh index f385ec1..df7adfe 100644 --- a/include/thermal_functions.sh +++ b/include/thermal_functions.sh @@ -238,3 +238,34 @@ enable_all_thermal_zones() { done return 0 } + +GPU_HEAT_BIN=/usr/bin/glmark2 +gpu_pid=0 + +start_glmark2() { + if [ -x $GPU_HEAT_BIN ]; then + $GPU_HEAT_BIN & + gpu_pid=$(pidof $GPU_HEAT_BIN) + # Starting X application from serial console needs this + if [ -z "$gpu_pid" ]; then + cp /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.bk + echo "autologin-user=root" >> /etc/lightdm/lightdm.conf + export DISPLAY=localhost:0.0 + restart lightdm + sleep 5 + mv /etc/lightdm/lightdm.conf.bk /etc/lightdm/lightdm.conf + $GPU_HEAT_BIN & + gpu_pid=$(pidof $GPU_HEAT_BIN) + fi + test -z "$gpu_pid" && cpu_pid=0 + echo "start gpu heat binary $gpu_pid" + else + echo "glmark2 not found." 1>&2 + fi +} + +kill_glmark2() { + if [ "$gpu_pid" != 0 ]; then + kill -9 $gpu_pid + fi +} diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index 5703ad3..ff8ca33 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -29,17 +29,13 @@ source ../include/functions.sh source ../include/thermal_functions.sh
CPU_HEAT_BIN=../utils/heat_cpu -GPU_HEAT_BIN=/usr/bin/glmark2 cpu_pid=0 -gpu_pid=0
heater_kill() { if [ $cpu_pid != 0 ]; then kill -9 $cpu_pid fi - if [ $gpu_pid != 0 ]; then - kill -9 $gpu_pid - fi + kill_glmark2 }
check_temperature_change() { @@ -53,14 +49,7 @@ check_temperature_change() { test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0"
- 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 - check "start gpu heat binary" "test $gpu_pid -ne 0" - else - echo "glmark2 not found." 1>&2 - fi + start_glmark2
sleep 5 local final_temp=$(cat $dirpath/temp) diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 95eda91..13f695d 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -28,19 +28,15 @@ source ../include/functions.sh source ../include/thermal_functions.sh
-CPU_HEAT_BIN=../utils/heat_cpu -GPU_HEAT_BIN=/usr/bin/glmark2 TEST_LOOP=100 +CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0 -gpu_pid=0
heater_kill() { if [ $cpu_pid != 0 ]; then kill -9 $cpu_pid fi - if [ $gpu_pid != 0 ]; then - kill -9 $gpu_pid - fi + kill_glmark2 }
check_trip_point_change() { @@ -60,14 +56,7 @@ check_trip_point_change() { test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0"
- 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 - check "start gpu heat binary" "test $gpu_pid -ne 0" - else - echo "glmark2 not found." 1>&2 - fi + start_glmark2
local index=0 for trip in $(ls $dirpath | grep "trip_point_['$MAX_ZONE']_temp"); do
This script aims at testing all the trip points are crossed or not, since the trip points are usually very high and can be reached only in extreme conditions like high environment temerature etc, in normal conditions they cannot be all crossed even if the CPU load is high, so failures will be reported and this will introduce a mess. Add this switch to switch off this test by default, anyone who wants to do this test still can enable it manually.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- thermal/thermal_06.sh | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 13f695d..28fdaec 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -28,6 +28,13 @@ source ../include/functions.sh source ../include/thermal_functions.sh
+# test_switch: switch on/off this test +test_switch=0 +if [ "$test_switch" -eq 0 ]; then + log_skip "test of trip points being crossed" + exit 0 +fi + TEST_LOOP=100 CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0
On Mon, Jan 28, 2013 at 11:38 AM, Hongbo Zhang hongbo.zhang@linaro.org wrote:
This script aims at testing all the trip points are crossed or not, since the trip points are usually very high and can be reached only in extreme conditions like high environment temerature etc, in normal conditions they cannot be all crossed even if the CPU load is high, so failures will be reported and this will introduce a mess. Add this switch to switch off this test by default, anyone who wants to do this test still can enable it manually.
NACK to this implementation. It should be possible to enable/disable default tests in a single file in the top-level directory. It shouldn't be required to go to each test script to set a variable enable/disabling a test.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org
thermal/thermal_06.sh | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 13f695d..28fdaec 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -28,6 +28,13 @@ source ../include/functions.sh source ../include/thermal_functions.sh
+# test_switch: switch on/off this test +test_switch=0 +if [ "$test_switch" -eq 0 ]; then
- log_skip "test of trip points being crossed"
- exit 0
+fi
TEST_LOOP=100 CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0 -- 1.8.0
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
On 28 January 2013 18:16, Amit Kucheria amit.kucheria@linaro.org wrote:
On Mon, Jan 28, 2013 at 11:38 AM, Hongbo Zhang hongbo.zhang@linaro.org wrote:
This script aims at testing all the trip points are crossed or not, since the trip points are usually very high and can be reached only in extreme conditions like high environment temerature etc, in normal conditions they cannot be all crossed even if the CPU load is high, so failures will be reported and this will introduce a mess. Add this switch to switch off this test by default, anyone who wants to do this test still can enable it manually.
NACK to this implementation. It should be possible to enable/disable default tests in a single file in the top-level directory. It shouldn't be required to go to each test script to set a variable enable/disabling a test.
Good suggestion. There are also some other switches besides this one, I will collect them into one top level config file.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org
thermal/thermal_06.sh | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh index 13f695d..28fdaec 100755 --- a/thermal/thermal_06.sh +++ b/thermal/thermal_06.sh @@ -28,6 +28,13 @@ source ../include/functions.sh source ../include/thermal_functions.sh
+# test_switch: switch on/off this test +test_switch=0 +if [ "$test_switch" -eq 0 ]; then
- log_skip "test of trip points being crossed"
- exit 0
+fi
TEST_LOOP=100 CPU_HEAT_BIN=../utils/heat_cpu cpu_pid=0 -- 1.8.0
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Enable launching glmark2 in Android to heat GPU as one of thermal tests.
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- include/thermal_functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/include/thermal_functions.sh b/include/thermal_functions.sh index df7adfe..8a4d627 100644 --- a/include/thermal_functions.sh +++ b/include/thermal_functions.sh @@ -243,6 +243,11 @@ GPU_HEAT_BIN=/usr/bin/glmark2 gpu_pid=0
start_glmark2() { + if [ -n "$ANDROID" ]; then + am start org.linaro.glmark2/.Glmark2Activity + return + fi + if [ -x $GPU_HEAT_BIN ]; then $GPU_HEAT_BIN & gpu_pid=$(pidof $GPU_HEAT_BIN) @@ -265,6 +270,11 @@ start_glmark2() { }
kill_glmark2() { + if [ -n "$ANDROID" ]; then + am kill org.linaro.glmark2 + return + fi + if [ "$gpu_pid" != 0 ]; then kill -9 $gpu_pid fi
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile index 1e73608..fa979e0 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ check: @(cd cpuidle; $(MAKE) check) @(cd sched_mc; $(MAKE) check) # @(cd suspend; $(MAKE) check) -# @(cd thermal; $(MAKE) check) + @(cd thermal; $(MAKE) check) # @(cd powertop; $(MAKE) check)
uncheck: @@ -41,7 +41,7 @@ uncheck: @(cd cpuidle; $(MAKE) uncheck) @(cd sched_mc; $(MAKE) uncheck) # @(cd suspend; $(MAKE) uncheck) -# @(cd thermal; $(MAKE) uncheck) + @(cd thermal; $(MAKE) uncheck)
recheck: uncheck check
Signed-off-by: Hongbo Zhang hongbo.zhang@linaro.org --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION index d15723f..1d0ba9e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.2 +0.4.0