aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 18:54:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 18:54:04 -0400
commit4057adafb395204af4ff93f3669ecb49eb45b3cf (patch)
treed6b0abf50ec5cd658fe958f90941c0192486549c /tools
parent137f5ae4dae85011b13e3a7049414c4060ad94c0 (diff)
parent52f2b34f46223ca2789320fa10c13f6664c1b628 (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU updates from Ingo Molnar: - updates to the handling of expedited grace periods - updates to reduce lock contention in the rcu_node combining tree [ These are in preparation for the consolidation of RCU-bh, RCU-preempt, and RCU-sched into a single flavor, which was requested by Linus in response to a security flaw whose root cause included confusion between the multiple flavors of RCU ] - torture-test updates that save their users some time and effort - miscellaneous fixes * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (44 commits) rcu/x86: Provide early rcu_cpu_starting() callback torture: Make kvm-find-errors.sh find build warnings rcutorture: Abbreviate kvm.sh summary lines rcutorture: Print end-of-test state in kvm.sh summary rcutorture: Print end-of-test state torture: Fold parse-torture.sh into parse-console.sh torture: Add a script to edit output from failed runs rcu: Update list of rcu_future_grace_period() trace events rcu: Drop early GP request check from rcu_gp_kthread() rcu: Simplify and inline cpu_needs_another_gp() rcu: The rcu_gp_cleanup() function does not need cpu_needs_another_gp() rcu: Make rcu_start_this_gp() check for out-of-range requests rcu: Add funnel locking to rcu_start_this_gp() rcu: Make rcu_start_future_gp() caller select grace period rcu: Inline rcu_start_gp_advanced() into rcu_start_future_gp() rcu: Clear request other than RCU_GP_FLAG_INIT at GP end rcu: Cleanup, don't put ->completed into an int rcu: Switch __rcu_process_callbacks() to rcu_accelerate_cbs() rcu: Avoid __call_rcu_core() root rcu_node ->lock acquisition rcu: Make rcu_migrate_callbacks wake GP kthread when needed ...
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-find-errors.sh56
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh12
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh1
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-console.sh115
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-torture.sh105
6 files changed, 166 insertions, 127 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh b/tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh
new file mode 100755
index 000000000000..98f650c9bf54
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh
@@ -0,0 +1,56 @@
1#!/bin/sh
2#
3# Invoke a text editor on all console.log files for all runs with diagnostics,
4# that is, on all such files having a console.log.diags counterpart.
5# Note that both console.log.diags and console.log are passed to the
6# editor (currently defaulting to "vi"), allowing the user to get an
7# idea of what to search for in the console.log file.
8#
9# Usage: kvm-find-errors.sh directory
10#
11# The "directory" above should end with the date/time directory, for example,
12# "tools/testing/selftests/rcutorture/res/2018.02.25-14:27:27".
13
14rundir="${1}"
15if test -z "$rundir" -o ! -d "$rundir"
16then
17 echo Usage: $0 directory
18fi
19editor=${EDITOR-vi}
20
21# Find builds with errors
22files=
23for i in ${rundir}/*/Make.out
24do
25 if egrep -q "error:|warning:" < $i
26 then
27 egrep "error:|warning:" < $i > $i.diags
28 files="$files $i.diags $i"
29 fi
30done
31if test -n "$files"
32then
33 $editor $files
34else
35 echo No build errors.
36fi
37if grep -q -e "--buildonly" < ${rundir}/log
38then
39 echo Build-only run, no console logs to check.
40fi
41
42# Find console logs with errors
43files=
44for i in ${rundir}/*/console.log
45do
46 if test -r $i.diags
47 then
48 files="$files $i.diags $i"
49 fi
50done
51if test -n "$files"
52then
53 $editor $files
54else
55 echo No errors in console logs.
56fi
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index c2e1bb6d0cba..477ecb1293ab 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -34,11 +34,15 @@ fi
34 34
35configfile=`echo $i | sed -e 's/^.*\///'` 35configfile=`echo $i | sed -e 's/^.*\///'`
36ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'` 36ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
37stopstate="`grep 'End-test grace-period state: g' $i/console.log 2> /dev/null |
38 tail -1 | sed -e 's/^\[[ 0-9.]*] //' |
39 awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
40 tr -d '\012\015'`"
37if test -z "$ngps" 41if test -z "$ngps"
38then 42then
39 echo "$configfile -------" 43 echo "$configfile ------- " $stopstate
40else 44else
41 title="$configfile ------- $ngps grace periods" 45 title="$configfile ------- $ngps GPs"
42 dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null` 46 dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
43 if test -z "$dur" 47 if test -z "$dur"
44 then 48 then
@@ -46,9 +50,9 @@ else
46 else 50 else
47 ngpsps=`awk -v ngps=$ngps -v dur=$dur ' 51 ngpsps=`awk -v ngps=$ngps -v dur=$dur '
48 BEGIN { print ngps / dur }' < /dev/null` 52 BEGIN { print ngps / dur }' < /dev/null`
49 title="$title ($ngpsps per second)" 53 title="$title ($ngpsps/s)"
50 fi 54 fi
51 echo $title 55 echo $title $stopstate
52 nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` 56 nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
53 if test -z "$nclosecalls" 57 if test -z "$nclosecalls"
54 then 58 then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index f7e988f369dd..c27e97824163 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -48,10 +48,6 @@ 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 if test "$TORTURE_SUITE" != rcuperf
52 then
53 parse-torture.sh $i/console.log $configfile
54 fi
55 parse-console.sh $i/console.log $configfile 51 parse-console.sh $i/console.log $configfile
56 if test -r $i/Warnings 52 if test -r $i/Warnings
57 then 53 then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index 5f8fbb0d7c17..c5b0f94341d9 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -267,5 +267,4 @@ then
267 echo Unknown PID, cannot kill qemu command 267 echo Unknown PID, cannot kill qemu command
268fi 268fi
269 269
270parse-torture.sh $resdir/console.log $title
271parse-console.sh $resdir/console.log $title 270parse-console.sh $resdir/console.log $title
diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh
index 08aa7d50ae0e..17293436f551 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-console.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh
@@ -24,57 +24,146 @@
24# 24#
25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
26 26
27T=${TMPDIR-/tmp}/parse-console.sh.$$
27file="$1" 28file="$1"
28title="$2" 29title="$2"
29 30
31trap 'rm -f $T.seq $T.diags' 0
32
30. functions.sh 33. functions.sh
31 34
35# Check for presence and readability of console output file
36if test -f "$file" -a -r "$file"
37then
38 :
39else
40 echo $title unreadable console output file: $file
41 exit 1
42fi
32if grep -Pq '\x00' < $file 43if grep -Pq '\x00' < $file
33then 44then
34 print_warning Console output contains nul bytes, old qemu still running? 45 print_warning Console output contains nul bytes, old qemu still running?
35fi 46fi
36egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:|detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state|rcu_.*kthread starved for' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $1.diags 47cat /dev/null > $file.diags
37if test -s $1.diags 48
49# Check for proper termination, except that rcuperf runs don't indicate this.
50if test "$TORTURE_SUITE" != rcuperf
38then 51then
39 print_warning Assertion failure in $file $title 52 # check for abject failure
40 # cat $1.diags 53
54 if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
55 then
56 nerrs=`grep --binary-files=text '!!!' $file |
57 tail -1 |
58 awk '
59 {
60 for (i=NF-8;i<=NF;i++)
61 sum+=$i;
62 }
63 END { print sum }'`
64 print_bug $title FAILURE, $nerrs instances
65 exit
66 fi
67
68 grep --binary-files=text 'torture:.*ver:' $file |
69 egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' |
70 sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
71 awk '
72 BEGIN {
73 ver = 0;
74 badseq = 0;
75 }
76
77 {
78 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
79 badseqno1 = ver;
80 badseqno2 = $5;
81 badseqnr = NR;
82 badseq = 1;
83 }
84 ver = $5
85 }
86
87 END {
88 if (badseq) {
89 if (badseqno1 == badseqno2 && badseqno2 == ver)
90 print "GP HANG at " ver " torture stat " badseqnr;
91 else
92 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " version " badseqnr;
93 }
94 }' > $T.seq
95
96 if grep -q SUCCESS $file
97 then
98 if test -s $T.seq
99 then
100 print_warning $title `cat $T.seq`
101 echo " " $file
102 exit 2
103 fi
104 else
105 if grep -q "_HOTPLUG:" $file
106 then
107 print_warning HOTPLUG FAILURES $title `cat $T.seq`
108 echo " " $file
109 exit 3
110 fi
111 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful version messages
112 if test -s $T.seq
113 then
114 print_warning $title `cat $T.seq`
115 fi
116 exit 2
117 fi
118fi | tee -a $file.diags
119
120egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:|detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state|rcu_.*kthread starved for' < $file |
121grep -v 'ODEBUG: ' |
122grep -v 'Warning: unable to open an initial console' > $T.diags
123if test -s $T.diags
124then
125 print_warning "Assertion failure in $file $title"
126 # cat $T.diags
41 summary="" 127 summary=""
42 n_badness=`grep -c Badness $1` 128 n_badness=`grep -c Badness $file`
43 if test "$n_badness" -ne 0 129 if test "$n_badness" -ne 0
44 then 130 then
45 summary="$summary Badness: $n_badness" 131 summary="$summary Badness: $n_badness"
46 fi 132 fi
47 n_warn=`grep -v 'Warning: unable to open an initial console' $1 | egrep -c 'WARNING:|Warn'` 133 n_warn=`grep -v 'Warning: unable to open an initial console' $file | egrep -c 'WARNING:|Warn'`
48 if test "$n_warn" -ne 0 134 if test "$n_warn" -ne 0
49 then 135 then
50 summary="$summary Warnings: $n_warn" 136 summary="$summary Warnings: $n_warn"
51 fi 137 fi
52 n_bugs=`egrep -c 'BUG|Oops:' $1` 138 n_bugs=`egrep -c 'BUG|Oops:' $file`
53 if test "$n_bugs" -ne 0 139 if test "$n_bugs" -ne 0
54 then 140 then
55 summary="$summary Bugs: $n_bugs" 141 summary="$summary Bugs: $n_bugs"
56 fi 142 fi
57 n_calltrace=`grep -c 'Call Trace:' $1` 143 n_calltrace=`grep -c 'Call Trace:' $file`
58 if test "$n_calltrace" -ne 0 144 if test "$n_calltrace" -ne 0
59 then 145 then
60 summary="$summary Call Traces: $n_calltrace" 146 summary="$summary Call Traces: $n_calltrace"
61 fi 147 fi
62 n_lockdep=`grep -c =========== $1` 148 n_lockdep=`grep -c =========== $file`
63 if test "$n_badness" -ne 0 149 if test "$n_badness" -ne 0
64 then 150 then
65 summary="$summary lockdep: $n_badness" 151 summary="$summary lockdep: $n_badness"
66 fi 152 fi
67 n_stalls=`egrep -c 'detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state' $1` 153 n_stalls=`egrep -c 'detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state' $file`
68 if test "$n_stalls" -ne 0 154 if test "$n_stalls" -ne 0
69 then 155 then
70 summary="$summary Stalls: $n_stalls" 156 summary="$summary Stalls: $n_stalls"
71 fi 157 fi
72 n_starves=`grep -c 'rcu_.*kthread starved for' $1` 158 n_starves=`grep -c 'rcu_.*kthread starved for' $file`
73 if test "$n_starves" -ne 0 159 if test "$n_starves" -ne 0
74 then 160 then
75 summary="$summary Starves: $n_starves" 161 summary="$summary Starves: $n_starves"
76 fi 162 fi
77 print_warning Summary: $summary 163 print_warning Summary: $summary
78else 164 cat $T.diags >> $file.diags
79 rm $1.diags 165fi
166if ! test -s $file.diags
167then
168 rm -f $file.diags
80fi 169fi
diff --git a/tools/testing/selftests/rcutorture/bin/parse-torture.sh b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
deleted file mode 100755
index 5987e50cfeb4..000000000000
--- a/tools/testing/selftests/rcutorture/bin/parse-torture.sh
+++ /dev/null
@@ -1,105 +0,0 @@
1#!/bin/bash
2#
3# Check the console output from a torture run for goodness.
4# The "file" is a pathname on the local system, and "title" is
5# a text string for error-message purposes.
6#
7# The file must contain torture output, but can be interspersed
8# with other dmesg text, as in console-log output.
9#
10# Usage: parse-torture.sh file title
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, you can access it online at
24# http://www.gnu.org/licenses/gpl-2.0.html.
25#
26# Copyright (C) IBM Corporation, 2011
27#
28# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
29
30T=${TMPDIR-/tmp}/parse-torture.sh.$$
31file="$1"
32title="$2"
33
34trap 'rm -f $T.seq' 0
35
36. functions.sh
37
38# check for presence of torture output file.
39
40if test -f "$file" -a -r "$file"
41then
42 :
43else
44 echo $title unreadable torture output file: $file
45 exit 1
46fi
47
48# check for abject failure
49
50if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
51then
52 nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
53 print_bug $title FAILURE, $nerrs instances
54 echo " " $url
55 exit
56fi
57
58grep --binary-files=text 'torture:.*ver:' $file | egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
59awk '
60BEGIN {
61 ver = 0;
62 badseq = 0;
63 }
64
65 {
66 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
67 badseqno1 = ver;
68 badseqno2 = $5;
69 badseqnr = NR;
70 badseq = 1;
71 }
72 ver = $5
73 }
74
75END {
76 if (badseq) {
77 if (badseqno1 == badseqno2 && badseqno2 == ver)
78 print "GP HANG at " ver " torture stat " badseqnr;
79 else
80 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " version " badseqnr;
81 }
82 }' > $T.seq
83
84if grep -q SUCCESS $file
85then
86 if test -s $T.seq
87 then
88 print_warning $title $title `cat $T.seq`
89 echo " " $file
90 exit 2
91 fi
92else
93 if grep -q "_HOTPLUG:" $file
94 then
95 print_warning HOTPLUG FAILURES $title `cat $T.seq`
96 echo " " $file
97 exit 3
98 fi
99 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful version messages
100 if test -s $T.seq
101 then
102 print_warning $title `cat $T.seq`
103 fi
104 exit 2
105fi