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.
7 # The file must contain torture output, but can be interspersed
8 # with other dmesg text, as in console-log output.
10 # Usage: parse-torture.sh file title
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.
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.
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.
26 # Copyright (C) IBM Corporation, 2011
28 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
30 T
=/tmp
/parse-torture.sh.$$
38 # check for presence of torture output file.
40 if test -f "$file" -a -r "$file"
44 echo $title unreadable torture output
file: $file
48 # check for abject failure
50 if grep -q FAILURE
$file ||
grep -q -e '-torture.*!!!' $file
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
58 grep --binary-files=text
'torture:.*ver:' $file |
grep --binary-files=text
-v '(null)' |
sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
66 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
77 if (badseqno1 == badseqno2 && badseqno2 == ver)
78 print "GP HANG at " ver " torture stat " badseqnr;
80 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " version " badseqnr;
84 if grep -q SUCCESS
$file
88 print_warning
$title $title `cat $T.seq`
93 if grep -q "_HOTPLUG:" $file
95 print_warning HOTPLUG FAILURES
$title `cat $T.seq`
99 echo $title no success message
, `grep --binary-files=text 'ver:' $file | wc -l` successful version messages
102 print_warning
$title `cat $T.seq`