diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-01-10 15:57:13 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2014-01-10 16:44:09 +0530 |
commit | 1249e65db4c8dd11d336da2b0b277e6cf685be2a (patch) | |
tree | 48766026bce187a0934a22caee247065961db590 | |
parent | 640b19ff82d8a2a1b05c723c8c96f7e2d3f20356 (diff) |
is-cpu-isolated.sh: Sense infinite isolation time
With the latest updates we might end up with infinite isolation time and hence
we need to sense it and quit/PASS tests rather than waiting infinitely.
Change-Id: Id97be7ff566d7b31101b6a0ad19b450e218cc0a9
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rwxr-xr-x | common/scripts/is-cpu-isolated.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh index 987d63b..91a2b3c 100755 --- a/common/scripts/is-cpu-isolated.sh +++ b/common/scripts/is-cpu-isolated.sh @@ -3,6 +3,7 @@ # Variable decided outcome of test, this is the minimum isolation we need. MIN_ISOLATION=10 RESULT="PASS" +STRESS_DURATION=500 if [ $2 ]; then MIN_ISOLATION=$2 @@ -49,6 +50,13 @@ get_isolation_duration() { while [ $new_count -eq $old_count ] do new_count=$(get_tick_count) + ps h -C stress -o pid > /dev/null + if [ $? != 0 ]; then + echo "Tick didn't got updated for stress duration:" $STRESS_DURATION + echo "Probably in infinite mode, quiting test" + echo "test_case_id:Min-isolation "$MIN_ISOLATION" secs result:"$RESULT" measurement:"$STRESS_DURATION" units:secs" + exit + fi done isdebug echo "count locked: " $new_count @@ -186,7 +194,7 @@ isolate_cpu1() { # But disallow load balancing within the NOHZ domain echo 0 > /dev/cpuset/rt/sched_load_balance - stress -q --cpu 1 --timeout 500 & + stress -q --cpu 1 --timeout $STRESS_DURATION & # Restart CPU1 to migrate all tasks to CPU0 echo 0 > /sys/devices/system/cpu/cpu1/online |