path: root/tools/testing/selftests/rcutorture/bin/jitter.sh
diff options
authorPaul E. McKenney <paulmck@kernel.org>2021-02-11 10:39:28 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-03-08 14:23:01 -0800
commit37812c9429722824859788cf754dd3e33f546908 (patch)
tree86def6733267dee647f2022d7204f4d115ed2459 /tools/testing/selftests/rcutorture/bin/jitter.sh
parenttorture: Use file-based protocol to mark batch's runs complete (diff)
torture: Use "jittering" file to control jitter.sh execution
Currently, jitter.sh execution is controlled by a time limit and by the "kill" command. The former allowed jitter.sh to run uselessly past the end of a set of runs that panicked during boot, and the latter is vulnerable to PID reuse. This commit therefore introduces a "jittering" file in the date-stamp directory within "res" that must be present for the jitter.sh scripts to continue executing. The time limit is still in place in order to avoid disturbing runs featuring large trace dumps, but the removal of the "jittering" file handles the panic-during-boot scenario without relying on PIDs. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/jitter.sh')
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh
index 188b864bc4bf..ed0ea86ddf5d 100755
--- a/tools/testing/selftests/rcutorture/bin/jitter.sh
+++ b/tools/testing/selftests/rcutorture/bin/jitter.sh
@@ -5,10 +5,11 @@
# of this script is to inflict random OS jitter on a concurrently running
# test.
-# Usage: jitter.sh me duration [ sleepmax [ spinmax ] ]
+# Usage: jitter.sh me duration jittering-path [ sleepmax [ spinmax ] ]
# me: Random-number-generator seed salt.
# duration: Time to run in seconds.
+# jittering-path: Path to file whose removal will stop this script.
# sleepmax: Maximum microseconds to sleep, defaults to one second.
# spinmax: Maximum microseconds to spin, defaults to one millisecond.
@@ -18,8 +19,9 @@
me=$(($1 * 1000))
@@ -47,7 +49,7 @@ do
# Check for stop request.
- if test -f "$TORTURE_STOPFILE"
+ if ! test -f "$jittering"
exit 1;