3 # Check the console output from an rcutorture run for goodness.
4 # The "file" is a pathname on the local system, and "title" is
5 # a text string for error-message purposes.
7 # The file must contain rcutorture output, but can be interspersed
8 # with other dmesg text.
11 # sh parse-rcutorture.sh file title
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, you can access it online at
25 # http://www.gnu.org/licenses/gpl-2.0.html.
27 # Copyright (C) IBM Corporation, 2011
29 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
31 T
=/tmp
/parse-rcutorture.sh.$$
39 # check for presence of rcutorture.txt file
41 if test -f "$file" -a -r "$file"
45 echo $title unreadable rcutorture.txt
file: $file
49 # check for abject failure
51 if grep -q FAILURE
$file ||
grep -q -e '-torture.*!!!' $file
53 nerrs
=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
54 print_bug
$title FAILURE
, $nerrs instances
59 grep --binary-files=text
'torture:.*ver:' $file |
grep --binary-files=text
-v '(null)' |
sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
67 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
78 if (badseqno1 == badseqno2 && badseqno2 == ver)
79 print "RCU GP HANG at " ver " rcutorture stat " badseqnr;
81 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr;
85 if grep -q SUCCESS
$file
89 print_warning
$title $title `cat $T.seq`
94 if grep -q RCU_HOTPLUG
$file
96 print_warning HOTPLUG FAILURES
$title `cat $T.seq`
100 echo $title no success message
, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
103 print_warning
$title `cat $T.seq`