brintos

brintos / linux-shallow public Read only

0
0
Text · 1.9 KiB · 406ecfc Raw
61 lines · bash
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.0+3#4# Reruns the C-language litmus tests previously run that match the5# specified criteria, and compares the result to that of the previous6# runs from initlitmushist.sh and/or newlitmushist.sh.7#8# sh checklitmushist.sh9#10# Run from the Linux kernel tools/memory-model directory.11# See scripts/parseargs.sh for list of arguments.12#13# Copyright IBM Corporation, 201814#15# Author: Paul E. McKenney <paulmck@linux.ibm.com>16 17. scripts/parseargs.sh18 19T=/tmp/checklitmushist.sh.$$20trap 'rm -rf $T' 021mkdir $T22 23if test -d litmus24then25	:26else27	echo Run scripts/initlitmushist.sh first, need litmus repo.28	exit 129fi30 31# Create the results directory and populate it with subdirectories.32# The initial output is created here to avoid clobbering the output33# generated earlier.34mkdir $T/results35find litmus -type d -print | ( cd $T/results; sed -e 's/^/mkdir -p /' | sh )36 37# Create the list of litmus tests already run, then remove those that38# are excluded by this run's --procs argument.39( cd $LKMM_DESTDIR; find litmus -name '*.litmus.out' -print ) |40	sed -e 's/\.out$//' |41	xargs -r grep -L "^P${LKMM_PROCS}"> $T/list-C-already42xargs < $T/list-C-already -r grep -L "^P${LKMM_PROCS}" > $T/list-C-short43 44# Redirect output, run tests, then restore destination directory.45destdir="$LKMM_DESTDIR"46LKMM_DESTDIR=$T/results; export LKMM_DESTDIR47scripts/runlitmushist.sh < $T/list-C-short > $T/runlitmushist.sh.out 2>&148LKMM_DESTDIR="$destdir"; export LKMM_DESTDIR49 50# Move the newly generated .litmus.out files to .litmus.out.new files51# in the destination directory.52cdir=`pwd`53ddir=`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 )57 58sed < $T/list-C-short -e 's,^,'"$LKMM_DESTDIR/"',' |59	sh scripts/cmplitmushist.sh60exit $?61