Rewrite the logic to check for userspace and powersave governors, so that the test_status_show() function gets called before these cpufreq scripts exit to display the final results.
Without this change, these cpufreq scripts will run on Android but will not print "cpufreq_xx: pass/fail/skip" at the end.
Signed-off-by: Lisa Nguyen lisa.nguyen@linaro.org --- cpufreq/cpufreq_06.sh | 11 +++++------ cpufreq/cpufreq_08.sh | 5 ++--- cpufreq/cpufreq_09.sh | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/cpufreq/cpufreq_06.sh b/cpufreq/cpufreq_06.sh index 9159c9e..75369bf 100755 --- a/cpufreq/cpufreq_06.sh +++ b/cpufreq/cpufreq_06.sh @@ -98,16 +98,15 @@ check_deviation() { supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep "userspace") if [ -z "$supported" ]; then log_skip "userspace not supported" - return 0 -fi +else + save_governors + save_frequencies
-save_governors -save_frequencies + for_each_cpu check_deviation +fi
trap "restore_frequencies; restore_governors; sigtrap" HUP INT TERM
-for_each_cpu check_deviation - restore_frequencies restore_governors test_status_show diff --git a/cpufreq/cpufreq_08.sh b/cpufreq/cpufreq_08.sh index e43c002..bfa984c 100755 --- a/cpufreq/cpufreq_08.sh +++ b/cpufreq/cpufreq_08.sh @@ -65,12 +65,11 @@ save_governors supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep "userspace") if [ -z "$supported" ]; then log_skip "userspace not supported" - return 0 +else + for_each_cpu check_userspace fi
trap "restore_governors; sigtrap" HUP INT TERM
-for_each_cpu check_userspace - restore_governors test_status_show diff --git a/cpufreq/cpufreq_09.sh b/cpufreq/cpufreq_09.sh index 7a3cd26..3356e83 100755 --- a/cpufreq/cpufreq_09.sh +++ b/cpufreq/cpufreq_09.sh @@ -63,11 +63,11 @@ save_governors supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep "powersave") if [ -z "$supported" ]; then log_skip "powersave not supported" - return 1 +else + for_each_cpu check_powersave fi
trap "restore_governors; sigtrap" HUP INT TERM
-for_each_cpu check_powersave restore_governors test_status_show