rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 06/18] torture: Make kvm-recheck.sh report .config errors
Date: Mon, 17 Jul 2023 11:23:25 -0700	[thread overview]
Message-ID: <20230717182337.1098991-6-paulmck@kernel.org> (raw)
In-Reply-To: <d03c7482-acde-4f33-a7fb-fa7c58fdc9a2@paulmck-laptop>

Currently, kvm-recheck.sh will print out any .config errors with messages
of the form:

:CONFIG_TASKS_TRACE_RCU=y: improperly set

However, if these are the only errors, the resulting exit code will
declare the run successful.  This commit therefore causes kvm-recheck.sh
to record .config errors in the results directory in a file named
ConfigFragment.diags and also returns a non-zero error code in that case.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 .../selftests/rcutorture/bin/kvm-recheck.sh   | 37 +++++++++++++++----
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index 1df7e695edf7..97bdacc3fc55 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -16,6 +16,8 @@
 T=/tmp/kvm-recheck.sh.$$
 trap 'rm -f $T' 0 2
 
+configerrors=0
+
 PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
 . functions.sh
 for rd in "$@"
@@ -32,7 +34,7 @@ do
 		fi
 		TORTURE_SUITE="`cat $i/../torture_suite`" ; export TORTURE_SUITE
 		configfile=`echo $i | sed -e 's,^.*/,,'`
-		rm -f $i/console.log.*.diags
+		rm -f $i/console.log.*.diags $i/ConfigFragment.diags
 		case "${TORTURE_SUITE}" in
 		X*)
 			;;
@@ -49,8 +51,14 @@ do
 			then
 				echo QEMU killed
 			fi
-			configcheck.sh $i/.config $i/ConfigFragment > $T 2>&1
-			cat $T
+			configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
+			if test -s $i/ConfigFragment.diags
+			then
+				cat $i/ConfigFragment.diags
+				configerrors=$((configerrors+1))
+			else
+				rm $i/ConfigFragment.diags
+			fi
 			if test -r $i/Make.oldconfig.err
 			then
 				cat $i/Make.oldconfig.err
@@ -65,7 +73,14 @@ do
 			if test -f "$i/buildonly"
 			then
 				echo Build-only run, no boot/test
-				configcheck.sh $i/.config $i/ConfigFragment
+				configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
+				if test -s $i/ConfigFragment.diags
+				then
+					cat $i/ConfigFragment.diags
+					configerrors=$((configerrors+1))
+				else
+					rm $i/ConfigFragment.diags
+				fi
 				parse-build.sh $i/Make.out $configfile
 			elif test -f "$i/qemu-cmd"
 			then
@@ -79,10 +94,10 @@ do
 	done
 	if test -f "$rd/kcsan.sum"
 	then
-		if ! test -f $T
+		if ! test -f $i/ConfigFragment.diags
 		then
 			:
-		elif grep -q CONFIG_KCSAN=y $T
+		elif grep -q CONFIG_KCSAN=y $i/ConfigFragment.diags
 		then
 			echo "Compiler or architecture does not support KCSAN!"
 			echo Did you forget to switch your compiler with '--kmake-arg CC=<cc-that-supports-kcsan>'?
@@ -94,17 +109,23 @@ do
 		fi
 	fi
 done
+
+if test "$configerrors" -gt 0
+then
+	echo $configerrors runs with .config errors.
+	ret=1
+fi
 EDITOR=echo kvm-find-errors.sh "${@: -1}" > $T 2>&1
 builderrors="`tr ' ' '\012' < $T | grep -c '/Make.out.diags'`"
 if test "$builderrors" -gt 0
 then
 	echo $builderrors runs with build errors.
-	ret=1
+	ret=2
 fi
 runerrors="`tr ' ' '\012' < $T | grep -c '/console.log.diags'`"
 if test "$runerrors" -gt 0
 then
 	echo $runerrors runs with runtime errors.
-	ret=2
+	ret=3
 fi
 exit $ret
-- 
2.40.1


  parent reply	other threads:[~2023-07-17 18:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 18:23 [PATCH rcu 0/18] Torture-test scripting updates for v6.6 Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 01/18] rcutorture: Remove obsolete BOOTPARAM_HOTPLUG_CPU0 Kconfig option Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 02/18] rcu: Remove formal-verification tests Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 03/18] torture: Add "--no-" as synonym for "--do-no-" in torture.sh Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 04/18] rcutorture: Remove contradictory Kconfig constraint Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 05/18] torture: Allow #CHECK# in --kconfig argument to kvm.sh Paul E. McKenney
2023-07-17 18:23 ` Paul E. McKenney [this message]
2023-07-17 18:23 ` [PATCH rcu 07/18] torture: Add RCU Tasks individual-flavor build tests Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 08/18] torture: Make kvm-remote print diagnostics on initial ssh failure Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 09/18] rcutorture: Remove obsolete parameter check from mkinitrd.sh Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 10/18] torture: Place --bootargs parameters at end of -append list Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 11/18] torture: Make torture.sh summarize config and build errors Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 12/18] torture: Loosen .config checks for KCSAN kernels Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 13/18] torture: Add srcu_lockdep.sh to torture.sh Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 14/18] torture: Avoid torture-test reboot loops Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 15/18] torture: Add init-program support for loongarch Paul E. McKenney
2023-07-18  2:56   ` Feiyang Chen
2023-07-18 18:41     ` Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 16/18] torture: Switch qemu from -nographic to -display none Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 17/18] torture: Make init program dump command-line arguments Paul E. McKenney
2023-07-17 18:23 ` [PATCH rcu 18/18] torture: Cause mkinitrd.sh to indicate failure on compile errors Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230717182337.1098991-6-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).