linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: paulmck@kernel.org
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
	mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH tip/core/rcu 02/23] torture: Add script to smoke-test commits in a branch
Date: Mon, 22 Jun 2020 17:37:31 -0700	[thread overview]
Message-ID: <20200623003752.26872-2-paulmck@kernel.org> (raw)
In-Reply-To: <20200623003731.GA26717@paulmck-ThinkPad-P72>

From: "Paul E. McKenney" <paulmck@kernel.org>

This commit adds a kvm-check-branches.sh script that takes a list
of commits and commit ranges and runs a short rcutorture test on all
scenarios on each specified commit.  A summary is printed at the end, and
the script returns success if all rcutorture runs completed without error.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 .../selftests/rcutorture/bin/kvm-check-branches.sh | 108 +++++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100755 tools/testing/selftests/rcutorture/bin/kvm-check-branches.sh

diff --git a/tools/testing/selftests/rcutorture/bin/kvm-check-branches.sh b/tools/testing/selftests/rcutorture/bin/kvm-check-branches.sh
new file mode 100755
index 0000000..6e65c13
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-check-branches.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Run a group of kvm.sh tests on the specified commits.  This currently
+# unconditionally does three-minute runs on each scenario in CFLIST,
+# taking advantage of all available CPUs and trusting the "make" utility.
+# In the short term, adjustments can be made by editing this script and
+# CFLIST.  If some adjustments appear to have ongoing value, this script
+# might grow some command-line arguments.
+#
+# Usage: kvm-check-branches.sh commit1 commit2..commit3 commit4 ...
+#
+# This script considers its arguments one at a time.  If more elaborate
+# specification of commits is needed, please use "git rev-list" to
+# produce something that this simple script can understand.  The reason
+# for retaining the simplicity is that it allows the user to more easily
+# see which commit came from which branch.
+#
+# This script creates a yyyy.mm.dd-hh.mm.ss-group entry in the "res"
+# directory.  The calls to kvm.sh create the usual entries, but this script
+# moves them under the yyyy.mm.dd-hh.mm.ss-group entry, each in its own
+# directory numbered in run order, that is, "0001", "0002", and so on.
+# For successful runs, the large build artifacts are removed.  Doing this
+# reduces the disk space required by about two orders of magnitude for
+# successful runs.
+#
+# Copyright (C) Facebook, 2020
+#
+# Authors: Paul E. McKenney <paulmck@kernel.org>
+
+if ! git status > /dev/null 2>&1
+then
+	echo '!!!' This script needs to run in a git archive. 1>&2
+	echo '!!!' Giving up. 1>&2
+	exit 1
+fi
+
+# Remember where we started so that we can get back and the end.
+curcommit="`git status | head -1 | awk '{ print $NF }'`"
+
+nfail=0
+ntry=0
+resdir="tools/testing/selftests/rcutorture/res"
+ds="`date +%Y.%m.%d-%H.%M.%S`-group"
+if ! test -e $resdir
+then
+	mkdir $resdir || :
+fi
+mkdir $resdir/$ds
+echo Results directory: $resdir/$ds
+
+KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
+PATH=${KVM}/bin:$PATH; export PATH
+. functions.sh
+cpus="`identify_qemu_vcpus`"
+echo Using up to $cpus CPUs.
+
+# Each pass through this loop does one command-line argument.
+for gitbr in $@
+do
+	echo ' --- git branch ' $gitbr
+
+	# Each pass through this loop tests one commit.
+	for i in `git rev-list "$gitbr"`
+	do
+		ntry=`expr $ntry + 1`
+		idir=`awk -v ntry="$ntry" 'END { printf "%04d", ntry; }' < /dev/null`
+		echo ' --- commit ' $i from branch $gitbr
+		date
+		mkdir $resdir/$ds/$idir
+		echo $gitbr > $resdir/$ds/$idir/gitbr
+		echo $i >> $resdir/$ds/$idir/gitbr
+
+		# Test the specified commit.
+		git checkout $i > $resdir/$ds/$idir/git-checkout.out 2>&1
+		echo git checkout return code: $? "(Commit $ntry: $i)"
+		kvm.sh --cpus $cpus --duration 3 --trust-make > $resdir/$ds/$idir/kvm.sh.out 2>&1
+		ret=$?
+		echo kvm.sh return code $ret for commit $i from branch $gitbr
+
+		# Move the build products to their resting place.
+		runresdir="`grep -m 1 '^Results directory:' < $resdir/$ds/$idir/kvm.sh.out | sed -e 's/^Results directory://'`"
+		mv $runresdir $resdir/$ds/$idir
+		rrd="`echo $runresdir | sed -e 's,^.*/,,'`"
+		echo Run results: $resdir/$ds/$idir/$rrd
+		if test "$ret" -ne 0
+		then
+			# Failure, so leave all evidence intact.
+			nfail=`expr $nfail + 1`
+		else
+			# Success, so remove large files to save about 1GB.
+			( cd $resdir/$ds/$idir/$rrd; rm -f */vmlinux */bzImage */System.map */Module.symvers )
+		fi
+	done
+done
+date
+
+# Go back to the original commit.
+git checkout "$curcommit"
+
+if test $nfail -ne 0
+then
+	echo '!!! ' $nfail failures in $ntry 'runs!!!'
+	exit 1
+else
+	echo No failures in $ntry runs.
+	exit 0
+fi
-- 
2.9.5


  parent reply	other threads:[~2020-06-23  0:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  0:37 [PATCH tip/core/rcu 0/23] Torture-test updates for v5.9 Paul E. McKenney
2020-06-23  0:37 ` [PATCH tip/core/rcu 01/23] torture: Remove qemu dependency on EFI firmware paulmck
2020-06-23  0:37 ` paulmck [this message]
2020-06-23  0:37 ` [PATCH tip/core/rcu 03/23] locktorture: Use true and false to assign to bool variables paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 04/23] rcutorture: Add races with task-exit processing paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 05/23] torture: Set configfile variable to current scenario paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 06/23] rcutorture: Handle non-statistic bang-string error messages paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 07/23] rcutorture: NULL rcu_torture_current earlier in cleanup code paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 08/23] torture: Remove whitespace from identify_qemu_vcpus output paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 09/23] torture: Add --allcpus argument to the kvm.sh script paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 10/23] rcu/rcutorture: Replace 0 with false paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 11/23] torture: Create qemu-cmd in --buildonly runs paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 12/23] torture: Add a stop-run capability paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 13/23] torture: Abstract out console-log error detection paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 14/23] rcutorture: Check for unwatched readers paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 15/23] torture: Pass --kmake-arg to all make invocations paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 16/23] torture: Correctly summarize build-only runs paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 17/23] torture: Improve diagnostic for KCSAN-incapable compilers paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 18/23] torture: Add more tracing crib notes to kvm.sh paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 19/23] torture: Add kvm-tranform.sh script for qemu-cmd files paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 20/23] torture: Dump ftrace at shutdown only if requested paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 21/23] torture: Avoid duplicate specification of qemu command paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 22/23] torture: Remove obsolete "cd $KVM" paulmck
2020-06-23  0:37 ` [PATCH tip/core/rcu 23/23] rcutorture: Remove KCSAN stubs paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 01/10] fork: Annotate a data race in vm_area_dup() paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 02/10] x86/mm/pat: Mark an intentional data race paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 03/10] rculist: Add ASSERT_EXCLUSIVE_ACCESS() to __list_splice_init_rcu() paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 04/10] kcsan: Add test suite paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 05/10] locking/osq_lock: Annotate a data race in osq_lock paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 06/10] kcsan: Prefer '__no_kcsan inline' in test paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 07/10] kcsan: Silence -Wmissing-prototypes warning with W=1 paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 08/10] kcsan: Rename test.c to selftest.c paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 09/10] kcsan: Remove existing special atomic rules paulmck
2020-06-23  0:43 ` [PATCH tip/core/rcu 10/10] kcsan: Add jiffies test to test suite paulmck

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=20200623003752.26872-2-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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).