diff options
author | Paul E. McKenney | 2021-07-08 11:02:14 -0700 |
---|---|---|
committer | Paul E. McKenney | 2021-07-27 11:41:32 -0700 |
commit | 4567c76a8e45af6b5015b17ea1d1a62af1257cc4 (patch) | |
tree | 2febf31b95a7adc4b2f0251d34e5d10c6ad913ba /tools | |
parent | de2909461c1a663ab6554493344271e1fad4ecb2 (diff) |
torture: Use numeric taskset argument in jitter.sh
The jitter.sh script has some entertaining awk code to generate a
hex mask from a randomly selected CPU number, which is handed to the
"taskset" command. Except that this command has a "-c" parameter to
take a comma/dash-separated list of CPU numbers. This commit therefore
saves a few lines of awk by switching to a single-number CPU list.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/jitter.sh | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests/rcutorture/bin/jitter.sh index 15d937ba96ca..fd1ffaa5a135 100755 --- a/tools/testing/selftests/rcutorture/bin/jitter.sh +++ b/tools/testing/selftests/rcutorture/bin/jitter.sh @@ -68,16 +68,12 @@ do cpumask=`awk -v cpus="$cpus" -v me=$me -v n=$n 'BEGIN { srand(n + me + systime()); ncpus = split(cpus, ca); - curcpu = ca[int(rand() * ncpus + 1)]; - z = ""; - for (i = 1; 4 * i <= curcpu; i++) - z = z "0"; - print "0x" 2 ^ (curcpu % 4) z; + print ca[int(rand() * ncpus + 1)]; }' < /dev/null` n=$(($n+1)) - if ! taskset -p $cpumask $$ > /dev/null 2>&1 + if ! taskset -c -p $cpumask $$ > /dev/null 2>&1 then - echo taskset failure: '"taskset -p ' $cpumask $$ '"' + echo taskset failure: '"taskset -c -p ' $cpumask $$ '"' exit 1 fi |