public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org, Joel Fernandes <joelagnelf@nvidia.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>
Subject: [PATCH v2 12/12] torture: Add testing of RCU's Rust bindings to torture.sh
Date: Mon, 31 Mar 2025 14:03:14 -0700	[thread overview]
Message-ID: <20250331210314.590622-12-paulmck@kernel.org> (raw)
In-Reply-To: <eea8d42f-6d2d-485b-9bb9-4eb77a0e1f95@paulmck-laptop>

This commit adds a --do-rcu-rust parameter to torture.sh, which invokes
a rust_doctests_kernel kunit run.  Note that kunit wants a clean source
tree, so this runs "make mrproper", which might come as a surprise to
some users.  Should there be a --mrproper parameter to torture.sh to make
the user explicitly ask for it?

Co-developed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 .../selftests/rcutorture/bin/torture.sh       | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/tools/testing/selftests/rcutorture/bin/torture.sh b/tools/testing/selftests/rcutorture/bin/torture.sh
index 751ce770e5462..2c3e86fe8c0a2 100755
--- a/tools/testing/selftests/rcutorture/bin/torture.sh
+++ b/tools/testing/selftests/rcutorture/bin/torture.sh
@@ -59,6 +59,7 @@ do_clocksourcewd=yes
 do_rt=yes
 do_rcutasksflavors=yes
 do_srcu_lockdep=yes
+do_rcu_rust=no
 
 # doyesno - Helper function for yes/no arguments
 function doyesno () {
@@ -89,6 +90,7 @@ usage () {
 	echo "       --do-rcutorture / --do-no-rcutorture / --no-rcutorture"
 	echo "       --do-refscale / --do-no-refscale / --no-refscale"
 	echo "       --do-rt / --do-no-rt / --no-rt"
+	echo "       --do-rcu-rust / --do-no-rcu-rust / --no-rcu-rust"
 	echo "       --do-scftorture / --do-no-scftorture / --no-scftorture"
 	echo "       --do-srcu-lockdep / --do-no-srcu-lockdep / --no-srcu-lockdep"
 	echo "       --duration [ <minutes> | <hours>h | <days>d ]"
@@ -191,6 +193,9 @@ do
 	--do-rt|--do-no-rt|--no-rt)
 		do_rt=`doyesno "$1" --do-rt`
 		;;
+	--do-rcu-rust|--do-no-rcu-rust|--no-rcu-rust)
+		do_rcu_rust=`doyesno "$1" --do-rcu-rust`
+		;;
 	--do-scftorture|--do-no-scftorture|--no-scftorture)
 		do_scftorture=`doyesno "$1" --do-scftorture`
 		;;
@@ -485,6 +490,46 @@ then
 	torture_set "rcurttorture-exp" tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration "$duration_rcutorture" --configs "TREE03" --kconfig "CONFIG_PREEMPT_LAZY=n CONFIG_PREEMPT_RT=y CONFIG_EXPERT=y" --trust-make
 fi
 
+if test "$do_rcu_rust" = "yes"
+then
+	echo " --- do-rcu-rust:" Start `date` | tee -a $T/log
+	rrdir="tools/testing/selftests/rcutorture/res/$ds/results-rcu-rust"
+	mkdir -p "$rrdir"
+	echo " --- make LLVM=1 rustavailable " | tee -a $rrdir/log > $rrdir/rustavailable.out
+	make LLVM=1 rustavailable > $T/rustavailable.out 2>&1
+	retcode=$?
+	echo $retcode > $rrdir/rustavailable.exitcode
+	cat $T/rustavailable.out | tee -a $rrdir/log >> $rrdir/rustavailable.out 2>&1
+	buildphase=rustavailable
+	if test "$retcode" -eq 0
+	then
+		echo " --- Running 'make mrproper' in order to run kunit." | tee -a $rrdir/log > $rrdir/mrproper.out
+		make mrproper > $rrdir/mrproper.out 2>&1
+		retcode = $?
+		echo $retcode > $rrdir/mrproper.exitcode
+		buildphase=mrproper
+	fi
+	if test "$retcode" -eq 0
+	then
+		echo " --- Running rust_doctests_kernel." | tee -a $rrdir/log > $rrdir/rust_doctests_kernel.out
+		./tools/testing/kunit/kunit.py run --make_options LLVM=1 --make_options CLIPPY=1 --arch arm64 --kconfig_add CONFIG_SMP=y --kconfig_add CONFIG_WERROR=y --kconfig_add CONFIG_RUST=y rust_doctests_kernel >> $rrdir/rust_doctests_kernel.out 2>&1
+		# @@@ Remove "--arch arm64" in order to test on native architecture?
+		# @@@ Analyze $rrdir/rust_doctests_kernel.out contents?
+		retcode=$?
+		echo $retcode > $rrdir/rust_doctests_kernel.exitcode
+		buildphase=rust_doctests_kernel
+	fi
+	if test "$retcode" -eq 0
+	then
+		echo "rcu-rust($retcode)" $rrdir >> $T/successes
+		echo Success >> $rrdir/log
+	else
+		echo "rcu-rust($retcode)" $rrdir >> $T/failures
+		echo " --- rcu-rust Test summary:" >> $rrdir/log
+		echo " --- Summary: Exit code $retcode from $buildphase, see $rrdir/$buildphase.out" >> $rrdir/log
+	fi
+fi
+
 if test "$do_srcu_lockdep" = "yes"
 then
 	echo " --- do-srcu-lockdep:" Start `date` | tee -a $T/log
-- 
2.40.1


  parent reply	other threads:[~2025-03-31 21:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 21:02 [PATCH v2 0/12] Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 01/12] rcutorture: Make srcu_lockdep.sh check kernel Kconfig Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 02/12] rcutorture: Make srcu_lockdep.sh check reader-conflict handling Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 03/12] rcutorture: Split out beginning and end from rcu_torture_one_read() Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 04/12] rcutorture: Make torture.sh --do-rt use CONFIG_PREEMPT_RT Paul E. McKenney
2025-04-02  7:42   ` Sebastian Andrzej Siewior
2025-04-02 18:51     ` Paul E. McKenney
2025-04-07 19:12   ` [PATCH v3 4/12] " Paul E. McKenney
2025-04-08 14:29     ` [v3,4/12] " Joel Fernandes
2025-04-08 16:20       ` Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 05/12] rcutorture: Add tests for SRCU up/down reader primitives Paul E. McKenney
2025-04-08 20:18   ` [v2,05/12] " Joel Fernandes
2025-04-08 20:58     ` Paul E. McKenney
2025-04-08 22:05       ` Joel Fernandes
2025-04-08 22:21         ` Paul E. McKenney
2025-04-15 17:16   ` [PATCH v2 05/12] " Joel Fernandes
2025-04-15 17:59     ` Paul E. McKenney
2025-04-15 21:15       ` Paul E. McKenney
2025-04-16  1:14         ` Joel Fernandes
2025-04-16  3:55           ` Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 06/12] rcutorture: Pull rcu_torture_updown() loop body into new function Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 07/12] rcutorture: Comment invocations of tick_dep_set_task() Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 08/12] rcutorture: Complain if an ->up_read() is delayed more than 10 seconds Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 09/12] rcutorture: Check for ->up_read() without matching ->down_read() Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 10/12] checkpatch: Deprecate srcu_read_lock_lite() and srcu_read_unlock_lite() Paul E. McKenney
2025-04-01  6:53   ` Joe Perches
2025-04-01 14:05     ` Paul E. McKenney
2025-04-02  3:48       ` Joe Perches
2025-04-02  4:23         ` Paul E. McKenney
2025-04-02  4:49           ` Joe Perches
2025-04-02 14:12             ` Paul E. McKenney
2025-03-31 21:03 ` [PATCH v2 11/12] torture: Add --do-{,no-}normal to torture.sh Paul E. McKenney
2025-03-31 21:03 ` Paul E. McKenney [this message]
2025-04-02 14:45 ` [PATCH v2 0/12] Joel Fernandes

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=20250331210314.590622-12-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=joelagnelf@nvidia.com \
    --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