rtc: rtc-ab-b5ze-s3: add sub-minute alarm support
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / bin / parse-torture.sh
blobe3c5f0705696d648cfd7d8d3d05bad143593cfab
1 #!/bin/bash
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.$$
31 file="$1"
32 title="$2"
34 trap 'rm -f $T.seq' 0
36 . functions.sh
38 # check for presence of torture output file.
40 if test -f "$file" -a -r "$file"
41 then
43 else
44 echo $title unreadable torture output file: $file
45 exit 1
48 # check for abject failure
50 if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
51 then
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
58 grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
59 awk '
60 BEGIN {
61 ver = 0;
62 badseq = 0;
66 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
67 badseqno1 = ver;
68 badseqno2 = $5;
69 badseqnr = NR;
70 badseq = 1;
72 ver = $5
75 END {
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;
82 }' > $T.seq
84 if grep -q SUCCESS $file
85 then
86 if test -s $T.seq
87 then
88 print_warning $title $title `cat $T.seq`
89 echo " " $file
90 exit 2
92 else
93 if grep -q "_HOTPLUG:" $file
94 then
95 print_warning HOTPLUG FAILURES $title `cat $T.seq`
96 echo " " $file
97 exit 3
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`
104 exit 2