Commit dbf0b425 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

tools/memory-model: Make runlitmus.sh generate .litmus.out for --hw



In the absence of "Result:" comments, the runlitmus.sh script relies on
litmus.out files from prior LKMM runs.  This can be a bit user-hostile,
so this commit makes runlitmus.sh generate any needed .litmus.out files
that don't already exist.

Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 08203824
Loading
Loading
Loading
Loading
+30 −24
Original line number Diff line number Diff line
@@ -28,17 +28,24 @@ if test -f "$litmus" -a -r "$litmus"
then
	:
else
	echo ' --- ' error: \"$litmus\" is not a readable file
	echo ' !!! ' error: \"$litmus\" is not a readable file
	exit 255
fi

if test -z "$LKMM_HW_MAP_FILE"
if test -z "$LKMM_HW_MAP_FILE" -o ! -e $LKMM_DESTDIR/$litmus.out
then
	# LKMM run
	herdoptions=${LKMM_HERD_OPTIONS--conf linux-kernel.cfg}
	echo Herd options: $herdoptions > $LKMM_DESTDIR/$litmus.out
	/usr/bin/time $LKMM_TIMEOUT_CMD herd7 $herdoptions $litmus >> $LKMM_DESTDIR/$litmus.out 2>&1
else
	ret=$?
	if test -z "$LKMM_HW_MAP_FILE"
	then
		exit $ret
	fi
	echo " --- " Automatically generated LKMM output for '"'--hw $LKMM_HW_MAP_FILE'"' run
fi

# Hardware run

T=/tmp/checklitmushw.sh.$$
@@ -60,10 +67,9 @@ else
	exit 254
fi

	# Generate the assembly code and run herd on it.
# Generate the assembly code and run herd7 on it.
gen_theme7 -n 10 -map $mapfile -call Linux.call > $themefile
jingle7 -theme $themefile $litmus > $T/$hwlitmusfile 2> $T/$hwlitmusfile.jingle7.out
/usr/bin/time $LKMM_TIMEOUT_CMD herd7 -model $catfile $T/$hwlitmusfile > $LKMM_DESTDIR/$hwlitmus.out 2>&1
fi

exit $?