From: Frederic Weisbecker <frederic@kernel.org>
To: "Paul E . McKenney" <paulmck@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <frederic@kernel.org>
Subject: [PATCH 2/3] torture: Add --configonly parameter for kvm.sh
Date: Thu, 6 May 2021 15:15:09 +0200 [thread overview]
Message-ID: <20210506131510.51488-3-frederic@kernel.org> (raw)
In-Reply-To: <20210506131510.51488-1-frederic@kernel.org>
Those who just want the resulting config file to generate for bare metal
don't need to wait for the build. Provide an option to only produce
the .config file.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
.../selftests/rcutorture/bin/kvm-build.sh | 5 ++++
.../selftests/rcutorture/bin/kvm-recheck.sh | 6 ++++-
.../rcutorture/bin/kvm-test-1-run.sh | 12 ++++++++-
tools/testing/selftests/rcutorture/bin/kvm.sh | 26 +++++++++++++------
4 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 9eb4324d42e1..463db5590220 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -43,6 +43,11 @@ then
exit 2
fi
+if test -n "$TORTURE_CONFIGONLY"
+then
+ exit 0
+fi
+
# Tell "make" to use double the number of real CPUs on the build system.
ncpus="`getconf _NPROCESSORS_ONLN`"
make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index e01b31b87044..68b521b5961e 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -57,7 +57,11 @@ do
cat $i/Warnings
fi
else
- if test -f "$i/buildonly"
+ if test -f "$i/configonly"
+ then
+ echo Config-only run, no build/boot/test
+ configcheck.sh $i/.config $i/ConfigFragment
+ elif test -f "$i/buildonly"
then
echo Build-only run, no boot/test
configcheck.sh $i/.config $i/ConfigFragment
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index e6aece69d81b..6df9efc77469 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -113,11 +113,21 @@ then
exit 1
elif kvm-build.sh $T/KcList $resdir "$kboot_args" "$modprobe_args"
then
+ cp .config $resdir
+ if test -n "$TORTURE_CONFIGONLY"
+ then
+ if test -f $resdir/build.wait
+ then
+ rm $resdir/build.wait
+ fi
+ echo Config-only run specified, build/boot/test omitted.
+ touch $resdir/configonly
+ exit 0
+ fi
# Had to build a kernel for this test.
QEMU="`identify_qemu vmlinux`"
BOOT_IMAGE="`identify_boot_image $QEMU`"
cp vmlinux $resdir
- cp .config $resdir
cp Module.symvers $resdir > /dev/null || :
cp System.map $resdir > /dev/null || :
if test -n "$BOOT_IMAGE"
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index a05a20135de1..283f5d896234 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -34,6 +34,7 @@ TORTURE_DEFCONFIG=defconfig
TORTURE_BOOT_IMAGE=""
TORTURE_BUILDONLY=
TORTURE_CMDLINE2CONFIG=
+TORTURE_CONFIGONLY=
TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
TORTURE_KCONFIG_ARG=""
TORTURE_KCONFIG_GDB_ARG=""
@@ -66,6 +67,7 @@ usage () {
echo " --bootimage relative-path-to-kernel-boot-image"
echo " --buildonly"
echo " --cmdline-to-config"
+ echo " --configonly"
echo " --configs \"config-file list w/ repeat factor (3*TINY01)\""
echo " --cpus N"
echo " --datestamp string"
@@ -113,6 +115,9 @@ do
--cmdline-to-config)
TORTURE_CMDLINE2CONFIG=1
;;
+ --configonly|--config-only)
+ TORTURE_CONFIGONLY=1
+ ;;
--configs|--config)
checkarg --configs "(list of config files)" "$#" "$2" '^[^/.a-z]\+$' '^--'
configs="$configs $2"
@@ -394,6 +399,7 @@ TORTURE_ALLOTED_CPUS="$TORTURE_ALLOTED_CPUS"; export TORTURE_ALLOTED_CPUS
TORTURE_BOOT_IMAGE="$TORTURE_BOOT_IMAGE"; export TORTURE_BOOT_IMAGE
TORTURE_BUILDONLY="$TORTURE_BUILDONLY"; export TORTURE_BUILDONLY
TORTURE_CMDLINE2CONFIG="$TORTURE_CMDLINE2CONFIG"; export TORTURE_CMDLINE2CONFIG
+TORTURE_CONFIGONLY="$TORTURE_CONFIGONLY"; export TORTURE_CONFIGONLY
TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
TORTURE_INITRD="$TORTURE_INITRD"; export TORTURE_INITRD
TORTURE_KCONFIG_ARG="$TORTURE_KCONFIG_ARG"; export TORTURE_KCONFIG_ARG
@@ -438,6 +444,7 @@ fi
___EOF___
awk < $T/cfgcpu.pack \
-v TORTURE_BUILDONLY="$TORTURE_BUILDONLY" \
+ -v TORTURE_CONFIGONLY="$TORTURE_CONFIGONLY" \
-v CONFIGDIR="$CONFIGFRAG/" \
-v KVM="$KVM" \
-v ncpus=$cpus \
@@ -490,12 +497,14 @@ function dump(first, pastlast, batchnum)
print "mkdir " rd cfr[jn] " || :";
print "touch " builddir ".wait";
print "kvm-test-1-run.sh " CONFIGDIR cf[j], rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
- print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
- print "while test -f " builddir ".wait"
- print "do"
- print "\tsleep 1"
- print "done"
- print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
+ if (!TORTURE_CONFIGONLY) {
+ print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
+ print "while test -f " builddir ".wait"
+ print "do"
+ print "\tsleep 1"
+ print "done"
+ print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
+ }
jn++;
}
print "runfiles="
@@ -503,7 +512,7 @@ function dump(first, pastlast, batchnum)
builddir=rd cfr[j] "/build";
if (TORTURE_BUILDONLY)
print "rm -f " builddir ".ready"
- else
+ else if (!TORTURE_CONFIGONLY)
print "mv " builddir ".ready " builddir ".run"
print "runfiles=\"$runfiles " builddir ".run\""
fi
@@ -517,7 +526,8 @@ function dump(first, pastlast, batchnum)
njitter = 0;
print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
}
- if (TORTURE_BUILDONLY) {
+
+ if (TORTURE_BUILDONLY || TORTURE_CONFIGONLY) {
print "needqemurun="
}
print "if test -n \"$needqemurun\""
--
2.25.1
next prev parent reply other threads:[~2021-05-06 13:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 13:15 [PATCH 0/3] torture: Update bare metal config generation Frederic Weisbecker
2021-05-06 13:15 ` [PATCH 1/3] torture: Add --cmdline-to-config parameter to kvm.sh Frederic Weisbecker
2021-05-07 19:20 ` Paul E. McKenney
2021-05-17 10:42 ` Frederic Weisbecker
2021-05-17 20:40 ` Paul E. McKenney
2021-05-06 13:15 ` Frederic Weisbecker [this message]
2021-05-07 20:29 ` [PATCH 2/3] torture: Add --configonly parameter for kvm.sh Paul E. McKenney
2021-05-17 10:55 ` Frederic Weisbecker
2021-05-06 13:15 ` [PATCH 3/3] torture: Update bare metal advices to latest kvm.sh options Frederic Weisbecker
2021-05-07 20:37 ` 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=20210506131510.51488-3-frederic@kernel.org \
--to=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.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