aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm-transform.sh
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2021-02-22 14:58:41 -0800
committerPaul E. McKenney <paulmck@kernel.org>2021-03-22 08:29:20 -0700
commit018629e909ffcabfc657388094371f20ba90649f (patch)
tree35e5c6e060a25465b42c69df891dac6450490f9e /tools/testing/selftests/rcutorture/bin/kvm-transform.sh
parenttorture: Add --duration argument to kvm-again.sh (diff)
downloadlinux-dev-018629e909ffcabfc657388094371f20ba90649f.tar.xz
linux-dev-018629e909ffcabfc657388094371f20ba90649f.zip
torture: Make kvm-transform.sh update jitter commands
When rerunning an old run using kvm-again.sh, the jitter commands will re-use the original "res" directory. This works, but is clearly an accident waiting to happen. And this accident will happen with remote runs, where the original directory lives on some other system. This commit therefore updates the qemu-cmd commands to use the new res directory created for this specific run. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/kvm-transform.sh')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-transform.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-transform.sh b/tools/testing/selftests/rcutorture/bin/kvm-transform.sh
index 162dddbcde00..e9dcbce17bbd 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-transform.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-transform.sh
@@ -3,7 +3,7 @@
#
# Transform a qemu-cmd file to allow reuse.
#
-# Usage: kvm-transform.sh bzImage console.log [ seconds ] < qemu-cmd-in > qemu-cmd-out
+# Usage: kvm-transform.sh bzImage console.log jitter_dir [ seconds ] < qemu-cmd-in > qemu-cmd-out
#
# bzImage: Kernel and initrd from the same prior kvm.sh run.
# console.log: File into which to place console output.
@@ -29,14 +29,31 @@ then
echo "Need console log file name."
exit 1
fi
-seconds=$3
+jitter_dir="$3"
+if test -z "$jitter_dir" || ! test -d "$jitter_dir"
+then
+ echo "Need valid jitter directory: '$jitter_dir'"
+ exit 1
+fi
+seconds="$4"
if test -n "$seconds" && echo $seconds | grep -q '[^0-9]'
then
echo "Invalid duration, should be numeric in seconds: '$seconds'"
exit 1
fi
-awk -v image="$image" -v consolelog="$consolelog" -v seconds="$seconds" '
+awk -v image="$image" -v consolelog="$consolelog" -v jitter_dir="$jitter_dir" \
+ -v seconds="$seconds" '
+/^# TORTURE_JITTER_START=/ {
+ print "# TORTURE_JITTER_START=\". jitterstart.sh " $4 " " jitter_dir " " $6 " " $7;
+ next;
+}
+
+/^# TORTURE_JITTER_STOP=/ {
+ print "# TORTURE_JITTER_STOP=\". jitterstop.sh " " " jitter_dir " " $5;
+ next;
+}
+
/^#/ {
print $0;
next;