tools/memory-model: Make judgelitmus.sh detect hard deadlocks
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 19 Mar 2019 21:27:06 +0000 (14:27 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 24 Mar 2023 17:24:13 +0000 (10:24 -0700)
If a litmus test specifies "Result: Never" and if it contains an
unconditional ("hard") deadlock, then running checklitmus.sh on it will
not flag any errors, despite the fact that there are no executions.
This commit therefore updates judgelitmus.sh to complain about tests
with no executions that are marked, but not as "Result: DEADLOCK".

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/memory-model/scripts/judgelitmus.sh

index d40439c7b71e0f37145eb9075c25f3a38c647cc4..84c62eee321bf421815f49b99aec28fc51702e62 100755 (executable)
@@ -83,6 +83,14 @@ then
                fi
                ret=1
        fi
+elif grep '^Observation' $LKMM_DESTDIR/$litmus.out | grep -q 'Never 0 0$'
+then
+       echo " !!! Unexpected non-$outcome deadlock" $litmus
+       if ! grep -q '!!!' $LKMM_DESTDIR/$litmus.out
+       then
+               echo " !!! Unexpected non-$outcome deadlock" $litmus >> $LKMM_DESTDIR/$litmus.out 2>&1
+       fi
+       ret=1
 elif grep '^Observation' $LKMM_DESTDIR/$litmus.out | grep -q $outcome || test "$outcome" = Maybe
 then
        ret=0