]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
torture: Add --do-{,no-}normal to torture.sh
authorPaul E. McKenney <paulmck@kernel.org>
Sun, 9 Mar 2025 16:00:35 +0000 (09:00 -0700)
committerJoel Fernandes <joelagnelf@nvidia.com>
Fri, 16 May 2025 15:12:54 +0000 (11:12 -0400)
Right now, torture.sh runs normal runs unconditionally, which can be slow
and thus annoying when you only want to test --kcsan or --kasan runs.
This commit therefore adds a --do-normal argument so that "--kcsan
--do-no-kasan --do-no-normal" runs only KCSAN runs.  Note that specifying
"--do-no-kasan --do-no-kcsan --do-no-normal" gets normal runs, so you
should not try to use this as a synonym for --do-none.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
tools/testing/selftests/rcutorture/bin/torture.sh

index b64b356f55ffa3a1ee9cc2264b3f9242be8dbf74..475f758f62167e53b179f4defc959bcef2e20ce0 100755 (executable)
@@ -51,6 +51,8 @@ do_scftorture=yes
 do_rcuscale=yes
 do_refscale=yes
 do_kvfree=yes
+do_normal=yes
+explicit_normal=no
 do_kasan=yes
 do_kcsan=no
 do_clocksourcewd=yes
@@ -128,6 +130,8 @@ do
                do_refscale=yes
                do_rt=yes
                do_kvfree=yes
+               do_normal=yes
+               explicit_normal=no
                do_kasan=yes
                do_kcsan=yes
                do_clocksourcewd=yes
@@ -161,11 +165,17 @@ do
                do_refscale=no
                do_rt=no
                do_kvfree=no
+               do_normal=no
+               explicit_normal=no
                do_kasan=no
                do_kcsan=no
                do_clocksourcewd=no
                do_srcu_lockdep=no
                ;;
+       --do-normal|--do-no-normal|--no-normal)
+               do_normal=`doyesno "$1" --do-normal`
+               explicit_normal=yes
+               ;;
        --do-rcuscale|--do-no-rcuscale|--no-rcuscale)
                do_rcuscale=`doyesno "$1" --do-rcuscale`
                ;;
@@ -242,6 +252,17 @@ trap 'rm -rf $T' 0 2
 echo " --- " $scriptname $args | tee -a $T/log
 echo " --- Results directory: " $ds | tee -a $T/log
 
+if test "$do_normal" = "no" && test "$do_kasan" = "no" && test "$do_kcsan" = "no"
+then
+       # Match old scripts so that "--do-none --do-rcutorture" does
+       # normal rcutorture testing, but no KASAN or KCSAN testing.
+       if test $explicit_normal = yes
+       then
+               echo " --- Everything disabled, so explicit --do-normal overridden" | tee -a $T/log
+       fi
+       do_normal=yes
+fi
+
 # Calculate rcutorture defaults and apportion time
 if test -z "$configs_rcutorture"
 then
@@ -332,9 +353,12 @@ function torture_set {
        local kcsan_kmake_tag=
        local flavor=$1
        shift
-       curflavor=$flavor
-       torture_one "$@"
-       mv $T/last-resdir $T/last-resdir-nodebug || :
+       if test "$do_normal" = "yes"
+       then
+               curflavor=$flavor
+               torture_one "$@"
+               mv $T/last-resdir $T/last-resdir-nodebug || :
+       fi
        if test "$do_kasan" = "yes"
        then
                curflavor=${flavor}-kasan