aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-10-28 09:34:22 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-03 13:11:18 -0500
commit6d40cc0cb4311d0c5aa4a106cc86a3d45a9ad86c (patch)
treedcbbd440ccea9f6b8272ada52bedcf0414fe4fa7 /tools/testing
parentf43f8f73510c1013fe9449d7732e8f73a75b6fde (diff)
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: Ingo Molnar <mingo@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Greg KH <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/rcutorture/bin/functions.sh16
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh5
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-build.sh18
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-console.sh4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-rcutorture.sh10
5 files changed, 41 insertions, 12 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index d0d19ebd2a94..963b6f04d4ef 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -134,6 +134,22 @@ identify_qemu_vcpus () {
134 lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://' 134 lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://'
135} 135}
136 136
137# print_bug
138#
139# Prints "BUG: " in red followed by remaining arguments
140print_bug () {
141 printf '\033[031mBUG: \033[m'
142 echo $*
143}
144
145# print_warning
146#
147# Prints "WARNING: " in yellow followed by remaining arguments
148print_warning () {
149 printf '\033[033mWARNING: \033[m'
150 echo $*
151}
152
137# specify_qemu_cpus qemu-cmd qemu-args #cpus 153# specify_qemu_cpus qemu-cmd qemu-args #cpus
138# 154#
139# Appends a string containing "-smp XXX" to qemu-args, unless the incoming 155# Appends a string containing "-smp XXX" to qemu-args, unless the incoming
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
index 3df1581e78ae..46f97d33e1ba 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
@@ -188,6 +188,5 @@ then
188fi 188fi
189 189
190cp $builddir/console.log $resdir 190cp $builddir/console.log $resdir
191parse-rcutorture.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 191parse-rcutorture.sh $resdir/console.log $title
192parse-console.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 192parse-console.sh $resdir/console.log $title
193cat $resdir/Warnings
diff --git a/tools/testing/selftests/rcutorture/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/parse-build.sh
index 2e0e9f7ebbb0..9da2c7ba3fce 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-build.sh
@@ -30,18 +30,28 @@
30T=$1 30T=$1
31title=$2 31title=$2
32 32
33. functions.sh
34
33if grep -q CC < $T 35if grep -q CC < $T
34then 36then
35 : 37 :
36else 38else
37 echo $title no build 39 print_bug $title no build
38 exit 1 40 exit 1
39fi 41fi
40 42
41if egrep -q "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T 43if grep -q "error:" < $T
44then
45 print_bug $title build errors:
46 grep "error:" < $T
47 exit 2
48fi
49exit 0
50
51if egrep -q "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
42then 52then
43 echo $title build errors: 53 print_warning $title build errors:
44 egrep "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T 54 egrep "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
45 exit 2 55 exit 2
46fi 56fi
47exit 0 57exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh
index bc1496fa1263..8f4be78f06b6 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-console.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh
@@ -31,9 +31,11 @@ trap 'rm -f $T' 0
31file="$1" 31file="$1"
32title="$2" 32title="$2"
33 33
34. functions.sh
35
34egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T 36egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T
35if test -s $T 37if test -s $T
36then 38then
37 echo Assertion failure in $file $title 39 print_warning Assertion failure in $file $title
38 cat $T 40 cat $T
39fi 41fi
diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
index 37368a046a9f..ac2f75a83225 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
@@ -34,6 +34,8 @@ title="$2"
34 34
35trap 'rm -f $T.seq' 0 35trap 'rm -f $T.seq' 0
36 36
37. functions.sh
38
37# check for presence of rcutorture.txt file 39# check for presence of rcutorture.txt file
38 40
39if test -f "$file" -a -r "$file" 41if test -f "$file" -a -r "$file"
@@ -49,7 +51,7 @@ fi
49if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file 51if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
50then 52then
51 nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` 53 nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
52 echo $title FAILURE, $nerrs instances 54 print_bug $title FAILURE, $nerrs instances
53 echo " " $url 55 echo " " $url
54 exit 56 exit
55fi 57fi
@@ -84,21 +86,21 @@ if grep -q SUCCESS $file
84then 86then
85 if test -s $T.seq 87 if test -s $T.seq
86 then 88 then
87 echo WARNING $title `cat $T.seq` 89 print_warning $title $title `cat $T.seq`
88 echo " " $file 90 echo " " $file
89 exit 2 91 exit 2
90 fi 92 fi
91else 93else
92 if grep -q RCU_HOTPLUG $file 94 if grep -q RCU_HOTPLUG $file
93 then 95 then
94 echo WARNING: HOTPLUG FAILURES $title `cat $T.seq` 96 print_warning HOTPLUG FAILURES $title `cat $T.seq`
95 echo " " $file 97 echo " " $file
96 exit 3 98 exit 3
97 fi 99 fi
98 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages 100 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
99 if test -s $T.seq 101 if test -s $T.seq
100 then 102 then
101 echo WARNING $title `cat $T.seq` 103 print_warning $title `cat $T.seq`
102 fi 104 fi
103 exit 2 105 exit 2
104fi 106fi