~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/rcutorture/bin/kvm-check-branches.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0+
  3 #
  4 # Run a group of kvm.sh tests on the specified commits.  This currently
  5 # unconditionally does three-minute runs on each scenario in CFLIST,
  6 # taking advantage of all available CPUs and trusting the "make" utility.
  7 # In the short term, adjustments can be made by editing this script and
  8 # CFLIST.  If some adjustments appear to have ongoing value, this script
  9 # might grow some command-line arguments.
 10 #
 11 # Usage: kvm-check-branches.sh commit1 commit2..commit3 commit4 ...
 12 #
 13 # This script considers its arguments one at a time.  If more elaborate
 14 # specification of commits is needed, please use "git rev-list" to
 15 # produce something that this simple script can understand.  The reason
 16 # for retaining the simplicity is that it allows the user to more easily
 17 # see which commit came from which branch.
 18 #
 19 # This script creates a yyyy.mm.dd-hh.mm.ss-group entry in the "res"
 20 # directory.  The calls to kvm.sh create the usual entries, but this script
 21 # moves them under the yyyy.mm.dd-hh.mm.ss-group entry, each in its own
 22 # directory numbered in run order, that is, "0001", "0002", and so on.
 23 # For successful runs, the large build artifacts are removed.  Doing this
 24 # reduces the disk space required by about two orders of magnitude for
 25 # successful runs.
 26 #
 27 # Copyright (C) Facebook, 2020
 28 #
 29 # Authors: Paul E. McKenney <paulmck@kernel.org>
 30 
 31 if ! git status > /dev/null 2>&1
 32 then
 33         echo '!!!' This script needs to run in a git archive. 1>&2
 34         echo '!!!' Giving up. 1>&2
 35         exit 1
 36 fi
 37 
 38 # Remember where we started so that we can get back at the end.
 39 curcommit="`git status | head -1 | awk '{ print $NF }'`"
 40 
 41 nfail=0
 42 ntry=0
 43 resdir="tools/testing/selftests/rcutorture/res"
 44 ds="`date +%Y.%m.%d-%H.%M.%S`-group"
 45 if ! test -e $resdir
 46 then
 47         mkdir $resdir || :
 48 fi
 49 mkdir $resdir/$ds
 50 echo Results directory: $resdir/$ds
 51 
 52 RCUTORTURE="`pwd`/tools/testing/selftests/rcutorture"; export RCUTORTURE
 53 PATH=${RCUTORTURE}/bin:$PATH; export PATH
 54 . functions.sh
 55 echo Using all `identify_qemu_vcpus` CPUs.
 56 
 57 # Each pass through this loop does one command-line argument.
 58 for gitbr in $@
 59 do
 60         echo ' --- git branch ' $gitbr
 61 
 62         # Each pass through this loop tests one commit.
 63         for i in `git rev-list "$gitbr"`
 64         do
 65                 ntry=`expr $ntry + 1`
 66                 idir=`awk -v ntry="$ntry" 'END { printf "%04d", ntry; }' < /dev/null`
 67                 echo ' --- commit ' $i from branch $gitbr
 68                 date
 69                 mkdir $resdir/$ds/$idir
 70                 echo $gitbr > $resdir/$ds/$idir/gitbr
 71                 echo $i >> $resdir/$ds/$idir/gitbr
 72 
 73                 # Test the specified commit.
 74                 git checkout $i > $resdir/$ds/$idir/git-checkout.out 2>&1
 75                 echo git checkout return code: $? "(Commit $ntry: $i)"
 76                 kvm.sh --allcpus --duration 3 --trust-make --datestamp "$ds/$idir" > $resdir/$ds/$idir/kvm.sh.out 2>&1
 77                 ret=$?
 78                 echo kvm.sh return code $ret for commit $i from branch $gitbr
 79                 echo Run results: $resdir/$ds/$idir
 80                 if test "$ret" -ne 0
 81                 then
 82                         # Failure, so leave all evidence intact.
 83                         nfail=`expr $nfail + 1`
 84                 else
 85                         # Success, so remove large files to save about 1GB.
 86                         ( cd $resdir/$ds/$idir/$rrd; rm -f */vmlinux */bzImage */System.map */Module.symvers )
 87                 fi
 88         done
 89 done
 90 date
 91 
 92 # Go back to the original commit.
 93 git checkout "$curcommit"
 94 
 95 if test $nfail -ne 0
 96 then
 97         echo '!!! ' $nfail failures in $ntry 'runs!!!'
 98         exit 1
 99 else
100         echo No failures in $ntry runs.
101         exit 0
102 fi

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php