2014-07-12 05:31:27 +08:00
#!/bin/bash
2013-09-29 05:12:21 +08:00
#
# Check the console output from an rcutorture run for oopses.
# The "file" is a pathname on the local system, and "title" is
# a text string for error-message purposes.
#
2014-07-12 07:47:35 +08:00
# Usage: parse-console.sh file title
2013-09-29 05:12:21 +08:00
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2013-12-04 01:54:18 +08:00
# along with this program; if not, you can access it online at
# http://www.gnu.org/licenses/gpl-2.0.html.
2013-09-29 05:12:21 +08:00
#
# Copyright (C) IBM Corporation, 2011
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
T = /tmp/abat-chk-badness.sh.$$
trap 'rm -f $T' 0
file = " $1 "
title = " $2 "
2013-10-28 21:34:22 +08:00
. functions.sh
2014-08-27 02:35:43 +08:00
if grep -Pq '\x00' < $file
then
print_warning Console output contains nul bytes, old qemu still running?
fi
2014-12-09 01:13:52 +08:00
egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:|Stall ended before state dump start' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T
2013-09-29 05:12:21 +08:00
if test -s $T
then
2013-10-28 21:34:22 +08:00
print_warning Assertion failure in $file $title
2013-09-29 05:12:21 +08:00
cat $T
fi