aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-01-11 16:13:12 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 16:37:36 -0400
commitfd35be623a1534bde57029c429b206d6c22a1ef6 (patch)
tree2bc128fbd9e4d8b353be10d2166feb9a5f27fbe2
parent274529ba9bda86c91c2c06da3a641aaf617dd30f (diff)
rcutorture: Update scripting to accommodate rcuperf
This commit adds the scripting changes to add support for the shiny new rcuperf kernel module. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh82
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh5
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh2
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon2
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/TREE19
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh52
7 files changed, 161 insertions, 2 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
new file mode 100755
index 000000000000..e5b28174fda0
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh
@@ -0,0 +1,82 @@
1#!/bin/bash
2#
3# Analyze a given results directory for rcuperf performance measurements.
4#
5# Usage: kvm-recheck-rcuperf.sh resdir
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2016
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25i="$1"
26if test -d $i
27then
28 :
29else
30 echo Unreadable results directory: $i
31 exit 1
32fi
33. tools/testing/selftests/rcutorture/bin/functions.sh
34
35configfile=`echo $i | sed -e 's/^.*\///'`
36
37grep -e '-perf:.*writer-duration' $i/console.log | sed -e 's/^\[[^]]*]//' |
38awk '
39{
40 gptimes[++n] = $5 / 1000.;
41 sum += $5 / 1000.;
42}
43
44END {
45 if (NR <= 0) {
46 print "No rcuperf records found???"
47 exit;
48 }
49 asort(gptimes);
50 pct50 = int(NR * 50 / 100);
51 if (pct50 < 1)
52 pct50 = 1;
53 pct90 = int(NR * 90 / 100);
54 if (pct90 < 1)
55 pct90 = 1;
56 pct99 = int(NR * 99 / 100);
57 if (pct99 < 1)
58 pct99 = 1;
59 div = 10 ** int(log(gptimes[pct90]) / log(10) + .5) / 100;
60 print "Histogram bucket size: " div;
61 last = gptimes[1] - 10;
62 count = 0;
63 for (i = 1; i <= NR; i++) {
64 current = div * int(gptimes[i] / div);
65 if (last == current) {
66 count++;
67 } else {
68 if (count > 0)
69 print last, count;
70 count = 1;
71 last = current;
72 }
73 }
74 if (count > 0)
75 print last, count;
76 print "Average grace-period duration: " sum / NR " microseconds";
77 print "Minimum grace-period duration: " gptimes[1];
78 print "50th percentile grace-period duration: " gptimes[pct50];
79 print "90th percentile grace-period duration: " gptimes[pct90];
80 print "99th percentile grace-period duration: " gptimes[pct99];
81 print "Maximum grace-period duration: " gptimes[NR];
82}'
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index d86bdd6b6cc2..f659346d3358 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -48,7 +48,10 @@ do
48 cat $i/Make.oldconfig.err 48 cat $i/Make.oldconfig.err
49 fi 49 fi
50 parse-build.sh $i/Make.out $configfile 50 parse-build.sh $i/Make.out $configfile
51 parse-torture.sh $i/console.log $configfile 51 if test "$TORTURE_SUITE" != rcuperf
52 then
53 parse-torture.sh $i/console.log $configfile
54 fi
52 parse-console.sh $i/console.log $configfile 55 parse-console.sh $i/console.log $configfile
53 if test -r $i/Warnings 56 if test -r $i/Warnings
54 then 57 then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 4a431767f77a..c33cb582b3dc 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -156,7 +156,7 @@ do
156 shift 156 shift
157 ;; 157 ;;
158 --torture) 158 --torture)
159 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\)$' '^--' 159 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\)$' '^--'
160 TORTURE_SUITE=$2 160 TORTURE_SUITE=$2
161 shift 161 shift
162 ;; 162 ;;
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST b/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST
new file mode 100644
index 000000000000..c9f56cf20775
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/CFLIST
@@ -0,0 +1 @@
TREE
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
new file mode 100644
index 000000000000..a09816b8c0f3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
@@ -0,0 +1,2 @@
1CONFIG_RCU_PERF_TEST=y
2CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/TREE b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE
new file mode 100644
index 000000000000..614e107f6db5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/TREE
@@ -0,0 +1,19 @@
1CONFIG_SMP=y
2CONFIG_PREEMPT_NONE=n
3CONFIG_PREEMPT_VOLUNTARY=n
4CONFIG_PREEMPT=y
5#CHECK#CONFIG_PREEMPT_RCU=y
6CONFIG_HZ_PERIODIC=n
7CONFIG_NO_HZ_IDLE=y
8CONFIG_NO_HZ_FULL=n
9CONFIG_RCU_FAST_NO_HZ=n
10CONFIG_RCU_TRACE=n
11CONFIG_HOTPLUG_CPU=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_RCU_NOCB_CPU=n
15CONFIG_DEBUG_LOCK_ALLOC=n
16CONFIG_PROVE_LOCKING=n
17CONFIG_RCU_BOOST=n
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
19CONFIG_RCU_EXPERT=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
new file mode 100644
index 000000000000..34f2a1b35ee5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
@@ -0,0 +1,52 @@
1#!/bin/bash
2#
3# Torture-suite-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2015
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcuperf_param_nreaders bootparam-string
24#
25# Adds nreaders rcuperf module parameter if not already specified.
26rcuperf_param_nreaders () {
27 if ! echo "$1" | grep -q "rcuperf.nreaders"
28 then
29 echo rcuperf.nreaders=-1
30 fi
31}
32
33# rcuperf_param_nwriters bootparam-string
34#
35# Adds nwriters rcuperf module parameter if not already specified.
36rcuperf_param_nwriters () {
37 if ! echo "$1" | grep -q "rcuperf.nwriters"
38 then
39 echo rcuperf.nwriters=-1
40 fi
41}
42
43# per_version_boot_params bootparam-string config-file seconds
44#
45# Adds per-version torture-module parameters to kernels supporting them.
46per_version_boot_params () {
47 echo $1 `rcuperf_param_nreaders "$1"` \
48 `rcuperf_param_nwriters "$1"` \
49 rcuperf.perf_runnable=1 \
50 rcuperf.shutdown=1 \
51 rcuperf.verbose=1
52}