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, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # Copyright (C) IBM Corporation, 2011
29 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
31 T=/tmp/parse-rcutorture.sh.$$
37 # check for presence of rcutorture.txt file
39 if test -f "$file" -a -r "$file"
43 echo $title unreadable rcutorture.txt file: $file
47 # check for abject failure
49 if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
51 nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
52 echo $title FAILURE, $nerrs instances
57 grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
65 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
76 if (badseqno1 == badseqno2 && badseqno2 == ver)
77 print "RCU GP HANG at " ver " rcutorture stat " badseqnr;
79 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr;
83 if grep -q SUCCESS $file
87 echo WARNING $title `cat $T.seq`
92 if grep -q RCU_HOTPLUG $file
94 echo WARNING: HOTPLUG FAILURES $title `cat $T.seq`
98 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
101 echo WARNING $title `cat $T.seq`