1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0+ 3 # 4 # Start up the specified number of jitter.sh scripts in the background. 5 # 6 # Usage: . jitterstart.sh n jittering-dir duration [ sleepmax [ spinmax ] ] 7 # 8 # n: Number of jitter.sh scripts to start up. 9 # jittering-dir: Directory in which to put "jittering" file. 10 # duration: Time to run in seconds. 11 # sleepmax: Maximum microseconds to sleep, defaults to one second. 12 # spinmax: Maximum microseconds to spin, defaults to one millisecond. 13 # 14 # Copyright (C) 2021 Facebook, Inc. 15 # 16 # Authors: Paul E. McKenney <paulmck@kernel.org> 17 18 jitter_n=$1 19 if test -z "$jitter_n" 20 then 21 echo jitterstart.sh: Missing count of jitter.sh scripts to start. 22 exit 33 23 fi 24 jittering_dir=$2 25 if test -z "$jittering_dir" 26 then 27 echo jitterstart.sh: Missing directory in which to place jittering file. 28 exit 34 29 fi 30 shift 31 shift 32 33 touch ${jittering_dir}/jittering 34 for ((jitter_i = 1; jitter_i <= $jitter_n; jitter_i++)) 35 do 36 jitter.sh $jitter_i "${jittering_dir}/jittering" "$@" & 37 done
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.