Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d40cc0c authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcutorture: Flag errors and warnings with color coding



The output of the rcutorture scripts often requires interpretation, so
this commit simplifies this interpretation by tagging messages as
BUGs (colored red) or WARNINGs (colored yellow).

Reported-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
parent f43f8f73
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -134,6 +134,22 @@ identify_qemu_vcpus () {
	lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://'
	lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://'
}
}


# print_bug
#
# Prints "BUG: " in red followed by remaining arguments
print_bug () {
	printf '\033[031mBUG: \033[m'
	echo $*
}

# print_warning
#
# Prints "WARNING: " in yellow followed by remaining arguments
print_warning () {
	printf '\033[033mWARNING: \033[m'
	echo $*
}

# specify_qemu_cpus qemu-cmd qemu-args #cpus
# specify_qemu_cpus qemu-cmd qemu-args #cpus
#
#
# Appends a string containing "-smp XXX" to qemu-args, unless the incoming
# Appends a string containing "-smp XXX" to qemu-args, unless the incoming
+2 −3
Original line number Original line Diff line number Diff line
@@ -188,6 +188,5 @@ then
fi
fi


cp $builddir/console.log $resdir
cp $builddir/console.log $resdir
parse-rcutorture.sh $resdir/console.log $title >> $resdir/Warnings 2>&1
parse-rcutorture.sh $resdir/console.log $title
parse-console.sh $resdir/console.log $title >> $resdir/Warnings 2>&1
parse-console.sh $resdir/console.log $title
cat $resdir/Warnings
+14 −4
Original line number Original line Diff line number Diff line
@@ -30,18 +30,28 @@
T=$1
T=$1
title=$2
title=$2


. functions.sh

if grep -q CC < $T
if grep -q CC < $T
then
then
	:
	:
else
else
	echo $title no build
	print_bug $title no build
	exit 1
	exit 1
fi
fi


if egrep -q "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
if grep -q "error:" < $T
then
	print_bug $title build errors:
	grep "error:" < $T
	exit 2
fi
exit 0

if egrep -q "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
then
then
	echo $title build errors:
	print_warning $title build errors:
	egrep "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
	egrep "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
	exit 2
	exit 2
fi
fi
exit 0
exit 0
+3 −1
Original line number Original line Diff line number Diff line
@@ -31,9 +31,11 @@ trap 'rm -f $T' 0
file="$1"
file="$1"
title="$2"
title="$2"


. functions.sh

egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T
egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T
if test -s $T
if test -s $T
then
then
	echo Assertion failure in $file $title
	print_warning Assertion failure in $file $title
	cat $T
	cat $T
fi
fi
+6 −4
Original line number Original line Diff line number Diff line
@@ -34,6 +34,8 @@ title="$2"


trap 'rm -f $T.seq' 0
trap 'rm -f $T.seq' 0


. functions.sh

# check for presence of rcutorture.txt file
# check for presence of rcutorture.txt file


if test -f "$file" -a -r "$file"
if test -f "$file" -a -r "$file"
@@ -49,7 +51,7 @@ fi
if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
then
then
	nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
	nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
	echo $title FAILURE, $nerrs instances
	print_bug $title FAILURE, $nerrs instances
	echo "   " $url
	echo "   " $url
	exit
	exit
fi
fi
@@ -84,21 +86,21 @@ if grep -q SUCCESS $file
then
then
	if test -s $T.seq
	if test -s $T.seq
	then
	then
		echo WARNING $title `cat $T.seq`
		print_warning $title $title `cat $T.seq`
		echo "   " $file
		echo "   " $file
		exit 2
		exit 2
	fi
	fi
else
else
	if grep -q RCU_HOTPLUG $file
	if grep -q RCU_HOTPLUG $file
	then
	then
		echo WARNING: HOTPLUG FAILURES $title `cat $T.seq`
		print_warning HOTPLUG FAILURES $title `cat $T.seq`
		echo "   " $file
		echo "   " $file
		exit 3
		exit 3
	fi
	fi
	echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
	echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
	if test -s $T.seq
	if test -s $T.seq
	then
	then
		echo WARNING $title `cat $T.seq`
		print_warning $title `cat $T.seq`
	fi
	fi
	exit 2
	exit 2
fi
fi