2 # SPDX-License-Identifier: GPL-2.0+
4 # Reruns the C-language litmus tests previously run that match the
5 # specified criteria, and compares the result to that of the previous
6 # runs from initlitmushist.sh and/or newlitmushist.sh.
8 # sh checklitmushist.sh
10 # Run from the Linux kernel tools/memory-model directory.
11 # See scripts/parseargs.sh for list of arguments.
13 # Copyright IBM Corporation, 2018
15 # Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
17 .
scripts
/parseargs.sh
19 T
=/tmp
/checklitmushist.sh.$$
27 echo Run
scripts
/initlitmushist.sh first
, need litmus repo.
31 # Create the results directory and populate it with subdirectories.
32 # The initial output is created here to avoid clobbering the output
35 find litmus
-type d
-print |
( cd $T/results
; sed -e 's/^/mkdir -p /' | sh
)
37 # Create the list of litmus tests already run, then remove those that
38 # are excluded by this run's --procs argument.
39 ( cd $LKMM_DESTDIR; find litmus
-name '*.litmus.out' -print ) |
41 xargs -r grep -L "^P${LKMM_PROCS}"> $T/list-C-already
42 xargs < $T/list-C-already
-r grep -L "^P${LKMM_PROCS}" > $T/list-C-short
44 # Redirect output, run tests, then restore destination directory.
45 destdir
="$LKMM_DESTDIR"
46 LKMM_DESTDIR
=$T/results
; export LKMM_DESTDIR
47 scripts
/runlitmushist.sh
< $T/list-C-short
> $T/runlitmushist.sh.out
2>&1
48 LKMM_DESTDIR
="$destdir"; export LKMM_DESTDIR
50 # Move the newly generated .litmus.out files to .litmus.out.new files
51 # in the destination directory.
53 ddir
=`awk -v c="$cdir" -v d="$LKMM_DESTDIR" \
54 'END { if (d ~ /^\//) print d; else print c "/" d; }' < /dev/null`
55 ( cd $T/results
; find litmus
-type f
-name '*.litmus.out' -print |
56 sed -e 's,^.*$,cp & '"$ddir"'/&.new,' | sh
)
58 sed < $T/list-C-short
-e 's,^,'"$LKMM_DESTDIR/"',' |
59 sh
scripts
/cmplitmushist.sh