[PATCH 23/40] dmesg: reduce noise from other tests

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Dave Chinner <dchinner@xxxxxxxxxx>

dmesg records everything from every test concurrently running, so
noise from other tests can cause multiple other tests to fail
because they detect something from another test. Update the filter
behaviour to minimise this crosstalk problem.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
`
---
 common/rc         | 13 +++++++------
 tests/generic/310 |  5 +----
 tests/xfs/079     |  2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/common/rc b/common/rc
index fdd18a386..3b4b9a59f 100644
--- a/common/rc
+++ b/common/rc
@@ -4591,6 +4591,7 @@ _check_dmesg_filter()
 
 	grep -E -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \
 		-e "BUG: MAX_STACK_TRACE_ENTRIES too low" \
+		-e "WARNING: Reset corrupted AGFL" \
 		$extra_filter
 }
 
@@ -4613,18 +4614,18 @@ _check_dmesg()
 	fi
 	rm -f ${RESULT_DIR}/check_dmesg
 
-	# default filter is a simple cat command, caller could provide a
-	# customized filter and pass the name through the first argument, to
-	# filter out intentional WARNINGs or Oopses
-	local filter=${1:-_check_dmesg_filter}
+	# we always filter dmesg for global things that should not cause
+	# test failures. Custom filters are then applied afterwards.
+	_dmesg_since_test_start | _check_dmesg_filter > $seqres.dmesg
+	if [ -n "$1" ]; then
+		cat $seqres.dmesg | $1 > $seqres.dmesg
+	fi
 
-	_dmesg_since_test_start | $filter >$seqres.dmesg
 	grep -E -q -e "kernel BUG at" \
 	     -e "WARNING:" \
 	     -e "\bBUG:" \
 	     -e "Oops:" \
 	     -e "possible recursive locking detected" \
-	     -e "Internal error" \
 	     -e "(INFO|ERR): suspicious RCU usage" \
 	     -e "INFO: possible circular locking dependency detected" \
 	     -e "general protection fault:" \
diff --git a/tests/generic/310 b/tests/generic/310
index 1ae9e0233..1ab81dd2e 100755
--- a/tests/generic/310
+++ b/tests/generic/310
@@ -46,7 +46,6 @@ _require_test
 dmesg -c > /dev/null
 
 nr_bug=`dmesg | grep -c "kernel BUG"`
-nr_error=`dmesg | grep -wc "error"`
 nr_null=`dmesg | grep -c "kernel NULL pointer dereference"`
 nr_warning=`dmesg | grep -c "^WARNING"`
 nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
@@ -55,20 +54,18 @@ nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
 check_kernel_bug()
 {
 	new_bug=`dmesg | grep -c "kernel BUG"`
-	new_error=`dmesg | grep -wc "error"`
 	new_null=`dmesg | grep -c "kernel NULL pointer dereference"`
 	new_warning=`dmesg | grep -c "^WARNING"`
 	new_lockdep=`dmesg | grep -c "possible recursive locking detected"`
 
 	# no kernel bug is detected
-	if [ $new_bug -eq $nr_bug -a $new_error -eq $nr_error -a \
+	if [ $new_bug -eq $nr_bug -a \
 	     $new_null -eq $nr_null -a $new_warning -eq $nr_warning -a \
 	     $new_lockdep -eq $nr_lockdep ]; then
 		return 0
 	fi
 
 	nr_bug=$new_bug
-	nr_error=$new_error
 	nr_null=$new_null
 	nr_warning=$new_warning
 	nr_lockdep=$new_lockdep
diff --git a/tests/xfs/079 b/tests/xfs/079
index 4a1999bb8..3287a20fb 100755
--- a/tests/xfs/079
+++ b/tests/xfs/079
@@ -45,7 +45,7 @@ _try_scratch_mount "-o logbsize=64k"
 
 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
 # messages to detect failure in this case.
-dmesg -c | grep XFS | grep CRC
+_dmesg_since_test_start | grep "XFS $(_short_dev $SCRATCH_DEV)" | grep CRC
 
 # success, all done
 status=0
-- 
2.45.2





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux