.. | .. |
---|
1 | 1 | #!/bin/bash |
---|
| 2 | +# SPDX-License-Identifier: GPL-2.0+ |
---|
2 | 3 | # |
---|
3 | 4 | # Check the console output from an rcutorture run for oopses. |
---|
4 | 5 | # The "file" is a pathname on the local system, and "title" is |
---|
.. | .. |
---|
6 | 7 | # |
---|
7 | 8 | # Usage: parse-console.sh file title |
---|
8 | 9 | # |
---|
9 | | -# This program is free software; you can redistribute it and/or modify |
---|
10 | | -# it under the terms of the GNU General Public License as published by |
---|
11 | | -# the Free Software Foundation; either version 2 of the License, or |
---|
12 | | -# (at your option) any later version. |
---|
13 | | -# |
---|
14 | | -# This program is distributed in the hope that it will be useful, |
---|
15 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | | -# GNU General Public License for more details. |
---|
18 | | -# |
---|
19 | | -# You should have received a copy of the GNU General Public License |
---|
20 | | -# along with this program; if not, you can access it online at |
---|
21 | | -# http://www.gnu.org/licenses/gpl-2.0.html. |
---|
22 | | -# |
---|
23 | 10 | # Copyright (C) IBM Corporation, 2011 |
---|
24 | 11 | # |
---|
25 | | -# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
---|
| 12 | +# Authors: Paul E. McKenney <paulmck@linux.ibm.com> |
---|
26 | 13 | |
---|
27 | 14 | T=${TMPDIR-/tmp}/parse-console.sh.$$ |
---|
28 | 15 | file="$1" |
---|
.. | .. |
---|
46 | 33 | fi |
---|
47 | 34 | cat /dev/null > $file.diags |
---|
48 | 35 | |
---|
49 | | -# Check for proper termination, except that rcuperf runs don't indicate this. |
---|
50 | | -if test "$TORTURE_SUITE" != rcuperf |
---|
| 36 | +# Check for proper termination, except for rcuscale and refscale. |
---|
| 37 | +if test "$TORTURE_SUITE" != rcuscale && test "$TORTURE_SUITE" != refscale |
---|
51 | 38 | then |
---|
52 | 39 | # check for abject failure |
---|
53 | 40 | |
---|
.. | .. |
---|
57 | 44 | tail -1 | |
---|
58 | 45 | awk ' |
---|
59 | 46 | { |
---|
60 | | - for (i=NF-8;i<=NF;i++) |
---|
| 47 | + normalexit = 1; |
---|
| 48 | + for (i=NF-8;i<=NF;i++) { |
---|
| 49 | + if (i <= 0 || i !~ /^[0-9]*$/) { |
---|
| 50 | + bangstring = $0; |
---|
| 51 | + gsub(/^\[[^]]*] /, "", bangstring); |
---|
| 52 | + print bangstring; |
---|
| 53 | + normalexit = 0; |
---|
| 54 | + exit 0; |
---|
| 55 | + } |
---|
61 | 56 | sum+=$i; |
---|
| 57 | + } |
---|
62 | 58 | } |
---|
63 | | - END { print sum }'` |
---|
64 | | - print_bug $title FAILURE, $nerrs instances |
---|
| 59 | + END { |
---|
| 60 | + if (normalexit) |
---|
| 61 | + print sum " instances" |
---|
| 62 | + }'` |
---|
| 63 | + print_bug $title FAILURE, $nerrs |
---|
65 | 64 | exit |
---|
66 | 65 | fi |
---|
67 | 66 | |
---|
68 | 67 | grep --binary-files=text 'torture:.*ver:' $file | |
---|
69 | 68 | egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' | |
---|
70 | 69 | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' | |
---|
| 70 | + sed -e 's/^.*ver: //' | |
---|
71 | 71 | awk ' |
---|
72 | 72 | BEGIN { |
---|
73 | 73 | ver = 0; |
---|
.. | .. |
---|
75 | 75 | } |
---|
76 | 76 | |
---|
77 | 77 | { |
---|
78 | | - if (!badseq && ($5 + 0 != $5 || $5 <= ver)) { |
---|
| 78 | + if (!badseq && ($1 + 0 != $1 || $1 <= ver)) { |
---|
79 | 79 | badseqno1 = ver; |
---|
80 | | - badseqno2 = $5; |
---|
| 80 | + badseqno2 = $1; |
---|
81 | 81 | badseqnr = NR; |
---|
82 | 82 | badseq = 1; |
---|
83 | 83 | } |
---|
84 | | - ver = $5 |
---|
| 84 | + ver = $1 |
---|
85 | 85 | } |
---|
86 | 86 | |
---|
87 | 87 | END { |
---|
.. | .. |
---|
117 | 117 | fi |
---|
118 | 118 | fi | tee -a $file.diags |
---|
119 | 119 | |
---|
120 | | -egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:|detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state|rcu_.*kthread starved for' < $file | |
---|
121 | | -grep -v 'ODEBUG: ' | |
---|
122 | | -grep -v 'Warning: unable to open an initial console' > $T.diags |
---|
| 120 | +console-badness.sh < $file > $T.diags |
---|
123 | 121 | if test -s $T.diags |
---|
124 | 122 | then |
---|
125 | 123 | print_warning "Assertion failure in $file $title" |
---|