Skip to content

Commit 80c9476

Browse files
committed
torture: Add scftorture to the rcutorture scripting
This commit updates the rcutorture scripting to include the new scftorture torture-test module. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 687d477 commit 80c9476

8 files changed

Lines changed: 92 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0+
3+
#
4+
# Analyze a given results directory for rcutorture progress.
5+
#
6+
# Usage: kvm-recheck-rcu.sh resdir
7+
#
8+
# Copyright (C) Facebook, 2020
9+
#
10+
# Authors: Paul E. McKenney <paulmck@kernel.org>
11+
12+
i="$1"
13+
if test -d "$i" -a -r "$i"
14+
then
15+
:
16+
else
17+
echo Unreadable results directory: $i
18+
exit 1
19+
fi
20+
. functions.sh
21+
22+
configfile=`echo $i | sed -e 's/^.*\///'`
23+
nscfs="`grep 'scf_invoked_count ver:' $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* scf_invoked_count ver: //' -e 's/ .*$//' | tr -d '\015'`"
24+
if test -z "$nscfs"
25+
then
26+
echo "$configfile ------- "
27+
else
28+
dur="`sed -e 's/^.* scftorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`"
29+
if test -z "$dur"
30+
then
31+
rate=""
32+
else
33+
nscfss=`awk -v nscfs=$nscfs -v dur=$dur '
34+
BEGIN { print nscfs / dur }' < /dev/null`
35+
rate=" ($nscfss/s)"
36+
fi
37+
echo "${configfile} ------- ${nscfs} SCF handler invocations$rate"
38+
fi

tools/testing/selftests/rcutorture/bin/kvm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ do
184184
shift
185185
;;
186186
--torture)
187-
checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\|refscale\)$' '^--'
187+
checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\|refscale\|scf\)$' '^--'
188188
TORTURE_SUITE=$2
189189
shift
190190
if test "$TORTURE_SUITE" = rcuperf || test "$TORTURE_SUITE" = refscale
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NOPREEMPT
2+
PREEMPT
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_SCF_TORTURE_TEST=y
2+
CONFIG_PRINTK_TIME=y
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_SMP=y
2+
CONFIG_PREEMPT_NONE=y
3+
CONFIG_PREEMPT_VOLUNTARY=n
4+
CONFIG_PREEMPT=n
5+
CONFIG_HZ_PERIODIC=n
6+
CONFIG_NO_HZ_IDLE=n
7+
CONFIG_NO_HZ_FULL=y
8+
CONFIG_DEBUG_LOCK_ALLOC=n
9+
CONFIG_PROVE_LOCKING=n
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nohz_full=1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_SMP=y
2+
CONFIG_PREEMPT_NONE=n
3+
CONFIG_PREEMPT_VOLUNTARY=n
4+
CONFIG_PREEMPT=y
5+
CONFIG_HZ_PERIODIC=n
6+
CONFIG_NO_HZ_IDLE=y
7+
CONFIG_NO_HZ_FULL=n
8+
CONFIG_DEBUG_LOCK_ALLOC=y
9+
CONFIG_PROVE_LOCKING=y
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0+
3+
#
4+
# Torture-suite-dependent shell functions for the rest of the scripts.
5+
#
6+
# Copyright (C) Facebook, 2020
7+
#
8+
# Authors: Paul E. McKenney <paulmck@kernel.org>
9+
10+
# scftorture_param_onoff bootparam-string config-file
11+
#
12+
# Adds onoff scftorture module parameters to kernels having it.
13+
scftorture_param_onoff () {
14+
if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
15+
then
16+
echo CPU-hotplug kernel, adding scftorture onoff. 1>&2
17+
echo scftorture.onoff_interval=1000 scftorture.onoff_holdoff=30
18+
fi
19+
}
20+
21+
# per_version_boot_params bootparam-string config-file seconds
22+
#
23+
# Adds per-version torture-module parameters to kernels supporting them.
24+
per_version_boot_params () {
25+
echo $1 `scftorture_param_onoff "$1" "$2"` \
26+
scftorture.stat_interval=15 \
27+
scftorture.shutdown_secs=$3 \
28+
scftorture.verbose=1 \
29+
scf
30+
}

0 commit comments

Comments
 (0)