x86, cpufeature: If we disable CLFLUSH, we should disable CLFLUSHOPT
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / bin / parse-rcutorture.sh
blobdd0a275d9796d170e4bc8532d5a9d96a7b702b4e
1 #!/bin/sh
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.
10 # Usage:
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.$$
32 file="$1"
33 title="$2"
35 trap 'rm -f $T.seq' 0
37 . functions.sh
39 # check for presence of rcutorture.txt file
41 if test -f "$file" -a -r "$file"
42 then
44 else
45 echo $title unreadable rcutorture.txt file: $file
46 exit 1
49 # check for abject failure
51 if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
52 then
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
55 echo " " $url
56 exit
59 grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
60 awk '
61 BEGIN {
62 ver = 0;
63 badseq = 0;
67 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
68 badseqno1 = ver;
69 badseqno2 = $5;
70 badseqnr = NR;
71 badseq = 1;
73 ver = $5
76 END {
77 if (badseq) {
78 if (badseqno1 == badseqno2 && badseqno2 == ver)
79 print "RCU GP HANG at " ver " rcutorture stat " badseqnr;
80 else
81 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr;
83 }' > $T.seq
85 if grep -q SUCCESS $file
86 then
87 if test -s $T.seq
88 then
89 print_warning $title $title `cat $T.seq`
90 echo " " $file
91 exit 2
93 else
94 if grep -q RCU_HOTPLUG $file
95 then
96 print_warning HOTPLUG FAILURES $title `cat $T.seq`
97 echo " " $file
98 exit 3
100 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
101 if test -s $T.seq
102 then
103 print_warning $title `cat $T.seq`
105 exit 2