Skip to content

Commit f8b4bb2

Browse files
committed
torture: Add refperf to the rcutorture scripting
This commit updates the rcutorture scripting to include the new refperf torture-test module. Cc: Joel Fernandes (Google) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 708cda3 commit f8b4bb2

File tree

8 files changed

+130
-6
lines changed

8 files changed

+130
-6
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0+
3+
#
4+
# Analyze a given results directory for refperf performance measurements.
5+
#
6+
# Usage: kvm-recheck-refperf.sh resdir
7+
#
8+
# Copyright (C) IBM Corporation, 2016
9+
#
10+
# Authors: Paul E. McKenney <[email protected]>
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+
PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
21+
. functions.sh
22+
23+
configfile=`echo $i | sed -e 's/^.*\///'`
24+
25+
sed -e 's/^\[[^]]*]//' < $i/console.log | tr -d '\015' |
26+
awk -v configfile="$configfile" '
27+
/^[ ]*Threads Time\(ns\) *$/ {
28+
if (dataphase + 0 == 0) {
29+
dataphase = 1;
30+
# print configfile, $0;
31+
}
32+
next;
33+
}
34+
35+
/[^ ]*[0-9][0-9]* [0-9][0-9]*\.[0-9][0-9]*$/ {
36+
if (dataphase == 1) {
37+
# print $0;
38+
readertimes[++n] = $2;
39+
sum += $2;
40+
}
41+
next;
42+
}
43+
44+
{
45+
if (dataphase == 1)
46+
dataphase == 2;
47+
next;
48+
}
49+
50+
END {
51+
print configfile " results:";
52+
newNR = asort(readertimes);
53+
if (newNR <= 0) {
54+
print "No refperf records found???"
55+
exit;
56+
}
57+
medianidx = int(newNR / 2);
58+
if (newNR == medianidx * 2)
59+
medianvalue = (readertimes[medianidx - 1] + readertimes[medianidx]) / 2;
60+
else
61+
medianvalue = readertimes[medianidx];
62+
print "Average reader duration: " sum / newNR " nanoseconds";
63+
print "Minimum reader duration: " readertimes[1];
64+
print "Median reader duration: " medianvalue;
65+
print "Maximum reader duration: " readertimes[newNR];
66+
print "Computed from refperf printk output.";
67+
}'

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,14 @@ do
180180
shift
181181
;;
182182
--torture)
183-
checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\)$' '^--'
183+
checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\|refperf\)$' '^--'
184184
TORTURE_SUITE=$2
185185
shift
186-
if test "$TORTURE_SUITE" = rcuperf
186+
if test "$TORTURE_SUITE" = rcuperf || test "$TORTURE_SUITE" = refperf
187187
then
188-
# If you really want jitter for rcuperf, specify
189-
# it after specifying rcuperf. (But why?)
188+
# If you really want jitter for refperf or
189+
# rcuperf, specify it after specifying the rcuperf
190+
# or the refperf. (But why jitter in these cases?)
190191
jitter=0
191192
fi
192193
;;

tools/testing/selftests/rcutorture/bin/parse-console.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ then
3333
fi
3434
cat /dev/null > $file.diags
3535

36-
# Check for proper termination, except that rcuperf runs don't indicate this.
37-
if test "$TORTURE_SUITE" != rcuperf
36+
# Check for proper termination, except for rcuperf and refperf.
37+
if test "$TORTURE_SUITE" != rcuperf && test "$TORTURE_SUITE" != refperf
3838
then
3939
# check for abject failure
4040

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_RCU_REF_PERF_TEST=y
2+
CONFIG_PRINTK_TIME=y
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CONFIG_SMP=y
2+
CONFIG_PREEMPT_NONE=y
3+
CONFIG_PREEMPT_VOLUNTARY=n
4+
CONFIG_PREEMPT=n
5+
#CHECK#CONFIG_PREEMPT_RCU=n
6+
CONFIG_HZ_PERIODIC=n
7+
CONFIG_NO_HZ_IDLE=y
8+
CONFIG_NO_HZ_FULL=n
9+
CONFIG_RCU_FAST_NO_HZ=n
10+
CONFIG_HOTPLUG_CPU=n
11+
CONFIG_SUSPEND=n
12+
CONFIG_HIBERNATION=n
13+
CONFIG_RCU_NOCB_CPU=n
14+
CONFIG_DEBUG_LOCK_ALLOC=n
15+
CONFIG_PROVE_LOCKING=n
16+
CONFIG_RCU_BOOST=n
17+
CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
18+
CONFIG_RCU_EXPERT=y
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CONFIG_SMP=y
2+
CONFIG_PREEMPT_NONE=n
3+
CONFIG_PREEMPT_VOLUNTARY=n
4+
CONFIG_PREEMPT=y
5+
#CHECK#CONFIG_PREEMPT_RCU=y
6+
CONFIG_HZ_PERIODIC=n
7+
CONFIG_NO_HZ_IDLE=y
8+
CONFIG_NO_HZ_FULL=n
9+
CONFIG_RCU_FAST_NO_HZ=n
10+
CONFIG_HOTPLUG_CPU=n
11+
CONFIG_SUSPEND=n
12+
CONFIG_HIBERNATION=n
13+
CONFIG_RCU_NOCB_CPU=n
14+
CONFIG_DEBUG_LOCK_ALLOC=n
15+
CONFIG_PROVE_LOCKING=n
16+
CONFIG_RCU_BOOST=n
17+
CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
18+
CONFIG_RCU_EXPERT=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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) IBM Corporation, 2015
7+
#
8+
# Authors: Paul E. McKenney <[email protected]>
9+
10+
# per_version_boot_params bootparam-string config-file seconds
11+
#
12+
# Adds per-version torture-module parameters to kernels supporting them.
13+
per_version_boot_params () {
14+
echo $1 refperf.shutdown=1 \
15+
refperf.verbose=1
16+
}

0 commit comments

Comments
 (0)