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

Configure Feed

Select the types of activity you want to include in your feed.

tools/memory-model: Make judgelitmus.sh identify bad macros

Currently, judgelitmus.sh treats use of unknown primitives (such as
srcu_read_lock() prior to SRCU support) as "!!! Verification error".
This can be misleading because it fails to call out typos and running
a version LKMM on a litmus test requiring a feature not provided by
that version. This commit therefore changes judgelitmus.sh to check
for unknown primitives and to report them, for example, with:

'!!! Current LKMM version does not know "rcu_write_lock"'.

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

+39 -4
+27 -4
tools/memory-model/scripts/cmplitmushist.sh
··· 12 12 mkdir $T 13 13 14 14 # comparetest oldpath newpath 15 + badmacnam=0 15 16 timedout=0 16 17 perfect=0 17 18 obsline=0 ··· 20 19 obsresult=0 21 20 badcompare=0 22 21 comparetest () { 23 - if grep -q '^Command exited with non-zero status 124' $1 || 24 - grep -q '^Command exited with non-zero status 124' $2 22 + if grep -q ': Unknown macro ' $1 || grep -q ': Unknown macro ' $2 23 + then 24 + if grep -q ': Unknown macro ' $1 25 + then 26 + badname=`grep ': Unknown macro ' $1 | 27 + sed -e 's/^.*: Unknown macro //' | 28 + sed -e 's/ (User error).*$//'` 29 + echo 'Current LKMM version does not know "'$badname'"' $1 30 + fi 31 + if grep -q ': Unknown macro ' $2 32 + then 33 + badname=`grep ': Unknown macro ' $2 | 34 + sed -e 's/^.*: Unknown macro //' | 35 + sed -e 's/ (User error).*$//'` 36 + echo 'Current LKMM version does not know "'$badname'"' $2 37 + fi 38 + badmacnam=`expr "$badmacnam" + 1` 39 + return 0 40 + elif grep -q '^Command exited with non-zero status 124' $1 || 41 + grep -q '^Command exited with non-zero status 124' $2 25 42 then 26 43 if grep -q '^Command exited with non-zero status 124' $1 && 27 44 grep -q '^Command exited with non-zero status 124' $2 ··· 75 56 return 0 76 57 fi 77 58 else 78 - echo Missing Observation line "(e.g., herd7 timeout)": $2 59 + echo Missing Observation line "(e.g., syntax error)": $2 79 60 noobsline=`expr "$noobsline" + 1` 80 61 return 0 81 62 fi ··· 109 90 fi 110 91 if test "$noobsline" -ne 0 111 92 then 112 - echo Missing Observation line "(e.g., herd7 timeout)": $noobsline 1>&2 93 + echo Missing Observation line "(e.g., syntax error)": $noobsline 1>&2 113 94 fi 114 95 if test "$obsresult" -ne 0 115 96 then ··· 118 99 if test "$timedout" -ne 0 119 100 then 120 101 echo "!!!" Timed out: $timedout 1>&2 102 + fi 103 + if test "$badmacnam" -ne 0 104 + then 105 + echo "!!!" Unknown primitive: $badmacnam 1>&2 121 106 fi 122 107 if test "$badcompare" -ne 0 123 108 then
+12
tools/memory-model/scripts/judgelitmus.sh
··· 42 42 if grep -q '^Observation' $LKMM_DESTDIR/$litmus.out 43 43 then 44 44 : 45 + elif grep ': Unknown macro ' $LKMM_DESTDIR/$litmus.out 46 + then 47 + badname=`grep ': Unknown macro ' $LKMM_DESTDIR/$litmus.out | 48 + sed -e 's/^.*: Unknown macro //' | 49 + sed -e 's/ (User error).*$//'` 50 + badmsg=' !!! Current LKMM version does not know "'$badname'"'" $litmus" 51 + echo $badmsg 52 + if ! grep -q '!!!' $LKMM_DESTDIR/$litmus.out 53 + then 54 + echo ' !!! '$badmsg >> $LKMM_DESTDIR/$litmus.out 2>&1 55 + fi 56 + exit 254 45 57 elif grep '^Command exited with non-zero status 124' $LKMM_DESTDIR/$litmus.out 46 58 then 47 59 echo ' !!! Timeout' $litmus