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

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/rcutorture/bin/kvm-recheck.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/bash
  2 # SPDX-License-Identifier: GPL-2.0+
  3 #
  4 # Given the results directories for previous KVM-based torture runs,
  5 # check the build and console output for errors.  Given a directory
  6 # containing results directories, this recursively checks them all.
  7 #
  8 # Usage: kvm-recheck.sh resdir ...
  9 #
 10 # Returns status reflecting the success or not of the last run specified.
 11 #
 12 # Copyright (C) IBM Corporation, 2011
 13 #
 14 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
 15 
 16 T="`mktemp ${TMPDIR-/tmp}/kvm-recheck.sh.XXXXXX`"
 17 trap 'rm -f $T' 0 2
 18 
 19 configerrors=0
 20 
 21 PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
 22 . functions.sh
 23 for rd in "$@"
 24 do
 25         firsttime=1
 26         dirs=`find $rd -name Make.defconfig.out -print | sort | sed -e 's,/[^/]*$,,' | sort -u`
 27         for i in $dirs
 28         do
 29                 if test -n "$firsttime"
 30                 then
 31                         firsttime=""
 32                         resdir=`echo $i | sed -e 's,/$,,' -e 's,/[^/]*$,,'`
 33                         head -1 $resdir/log
 34                 fi
 35                 TORTURE_SUITE="`cat $i/../torture_suite`" ; export TORTURE_SUITE
 36                 configfile=`echo $i | sed -e 's,^.*/,,'`
 37                 rm -f $i/console.log.*.diags $i/ConfigFragment.diags
 38                 case "${TORTURE_SUITE}" in
 39                 X*)
 40                         ;;
 41                 *)
 42                         kvm-recheck-${TORTURE_SUITE}.sh $i
 43                 esac
 44                 if test -f "$i/qemu-retval" && test "`cat $i/qemu-retval`" -ne 0 && test "`cat $i/qemu-retval`" -ne 137
 45                 then
 46                         echo QEMU error, output:
 47                         cat $i/qemu-output
 48                 elif test -f "$i/console.log"
 49                 then
 50                         if test -f "$i/qemu-retval" && test "`cat $i/qemu-retval`" -eq 137
 51                         then
 52                                 echo QEMU killed
 53                         fi
 54                         configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
 55                         if grep -q '^CONFIG_KCSAN=y$' $i/ConfigFragment.input
 56                         then
 57                                 # KCSAN forces a number of Kconfig options, so remove
 58                                 # complaints about those Kconfig options in KCSAN runs.
 59                                 mv $i/ConfigFragment.diags $i/ConfigFragment.diags.kcsan
 60                                 grep -v -E 'CONFIG_PROVE_RCU|CONFIG_PREEMPT_COUNT' $i/ConfigFragment.diags.kcsan > $i/ConfigFragment.diags
 61                         fi
 62                         if test -s $i/ConfigFragment.diags
 63                         then
 64                                 cat $i/ConfigFragment.diags
 65                                 configerrors=$((configerrors+1))
 66                         else
 67                                 rm $i/ConfigFragment.diags
 68                         fi
 69                         if test -r $i/Make.oldconfig.err
 70                         then
 71                                 cat $i/Make.oldconfig.err
 72                         fi
 73                         parse-build.sh $i/Make.out $configfile
 74                         parse-console.sh $i/console.log $configfile
 75                         if test -r $i/Warnings
 76                         then
 77                                 cat $i/Warnings
 78                         fi
 79                 else
 80                         if test -f "$i/buildonly"
 81                         then
 82                                 echo Build-only run, no boot/test
 83                                 configcheck.sh $i/.config $i/ConfigFragment > $i/ConfigFragment.diags 2>&1
 84                                 if test -s $i/ConfigFragment.diags
 85                                 then
 86                                         cat $i/ConfigFragment.diags
 87                                         configerrors=$((configerrors+1))
 88                                 else
 89                                         rm $i/ConfigFragment.diags
 90                                 fi
 91                                 parse-build.sh $i/Make.out $configfile
 92                         elif test -f "$i/qemu-cmd"
 93                         then
 94                                 print_bug qemu failed
 95                                 echo "   $i"
 96                         else
 97                                 print_bug Build failed
 98                                 echo "   $i"
 99                         fi
100                 fi
101         done
102         if test -f "$rd/kcsan.sum"
103         then
104                 if ! test -f $i/ConfigFragment.diags
105                 then
106                         :
107                 elif grep -q CONFIG_KCSAN=y $i/ConfigFragment.diags
108                 then
109                         echo "Compiler or architecture does not support KCSAN!"
110                         echo Did you forget to switch your compiler with '--kmake-arg CC=<cc-that-supports-kcsan>'?
111                 elif test -s "$rd/kcsan.sum"
112                 then
113                         echo KCSAN summary in $rd/kcsan.sum
114                 else
115                         echo Clean KCSAN run in $rd
116                 fi
117         fi
118 done
119 
120 if test "$configerrors" -gt 0
121 then
122         echo $configerrors runs with .config errors.
123         ret=1
124 fi
125 EDITOR=echo kvm-find-errors.sh "${@: -1}" > $T 2>&1
126 builderrors="`tr ' ' '\012' < $T | grep -c '/Make.out.diags'`"
127 if test "$builderrors" -gt 0
128 then
129         echo $builderrors runs with build errors.
130         ret=2
131 fi
132 runerrors="`tr ' ' '\012' < $T | grep -c '/console.log.diags'`"
133 if test "$runerrors" -gt 0
134 then
135         echo $runerrors runs with runtime errors.
136         ret=3
137 fi
138 exit $ret

~ [ 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