Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/memory-model: Make judgelitmus.sh ransack .litmus.out files

The judgelitmus.sh script currently relies solely on the "Result:"
comment in the .litmus file. This is problematic when using the --hw
argument, because it is necessary to check the hardware model against
LKMM even in the absence of "Result:" comments.

This commit therefore modifies judgelitmus.sh to check the observation
in a .litmus.out file, in case one was generated by a previous LKMM run.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

+8 -1
+8 -1
tools/memory-model/scripts/judgelitmus.sh
··· 8 8 # is provided, this is assumed to be a hardware test, and the output is 9 9 # assumed to be in file.HW.litmus.out, where "HW" is the --hw argument. 10 10 # In addition, non-Sometimes verification results will be noted, but 11 - # forgiven. 11 + # forgiven. Furthermore, if there is no "Result:" comment but there is 12 + # an LKMM .litmus.out file, the observation in that file will be used 13 + # to judge the assembly-language verification. 12 14 # 13 15 # Usage: 14 16 # judgelitmus.sh file.litmus ··· 34 32 if test -z "$LKMM_HW_MAP_FILE" 35 33 then 36 34 litmusout=$litmus.out 35 + lkmmout= 37 36 else 38 37 litmusout="`echo $litmus | 39 38 sed -e 's/\.litmus$/.'${LKMM_HW_MAP_FILE}'.litmus/'`.out" 39 + lkmmout=$litmus.out 40 40 fi 41 41 if test -f "$LKMM_DESTDIR/$litmusout" -a -r "$LKMM_DESTDIR/$litmusout" 42 42 then ··· 50 46 if grep -q '^ \* Result: ' $litmus 51 47 then 52 48 outcome=`grep -m 1 '^ \* Result: ' $litmus | awk '{ print $3 }'` 49 + elif test -n "$LKMM_HW_MAP_FILE" && grep -q '^Observation' $LKMM_DESTDIR/$lkmmout > /dev/null 2>&1 50 + then 51 + outcome=`grep -m 1 '^Observation ' $LKMM_DESTDIR/$lkmmout | awk '{ print $3 }'` 53 52 else 54 53 outcome=specified 55 54 fi