diff options
author | Lisa Nguyen <lisa.nguyen@linaro.org> | 2015-11-17 17:03:02 -0800 |
---|---|---|
committer | Lisa Nguyen <lisa.nguyen@linaro.org> | 2015-11-19 17:34:09 -0800 |
commit | bab54c06eb5009db6b7196f33d36094bfadfd465 (patch) | |
tree | 49cb3adf833d35fa511774b5aee58df96fcc1551 | |
parent | d39d0bb15c55461b9c6c1999ba36ee959b0fd7c3 (diff) |
functions: Look for thermal zones when needed
Look for thermal zones only when it's needed (e.g. in
specific functions used by the thermal subtests), not
every time the functions.sh file gets sourced.
Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
-rw-r--r-- | include/functions.sh | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/include/functions.sh b/include/functions.sh index 86d9dc1..74e85c7 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -43,8 +43,6 @@ MAX_CDEV=0-50 scaling_freq_array="scaling_freq" mode_array="mode_list" thermal_gov_array="thermal_governor_backup" -thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") - test_status_show() { if [ $fail_count -ne 0 ]; then @@ -454,13 +452,13 @@ check_valid_temp() { } for_each_thermal_zone() { - + thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") thermal_func=$1 shift 1 for thermal_zone in $thermal_zones; do - INC=0 - $thermal_func $thermal_zone $@ + INC=0 + $thermal_func $thermal_zone $@ done return 0 @@ -621,7 +619,7 @@ get_trip_id() { } disable_all_thermal_zones() { - + thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") index=0 for thermal_zone in $thermal_zones; do @@ -636,7 +634,7 @@ disable_all_thermal_zones() { } enable_all_thermal_zones() { - + thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") index=0 for thermal_zone in $thermal_zones; do @@ -690,7 +688,7 @@ kill_glmark2() { } set_thermal_governors() { - + thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") gov=$1 index=0 @@ -706,7 +704,7 @@ set_thermal_governors() { } restore_thermal_governors() { - + thermal_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") index=0 for thermal_zone in $thermal_zones; do |