[LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string
Petr Vorel
pvorel@suse.cz
Wed Jan 14 17:55:00 CET 2026
Hi Vincent,
> lock_torture.sh parses the lock_torture result from dmesg by
> matching the "End of test: <RESULT>:" line.
> When the kernel is built with lock debugging enabled (e.g.
> CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_RT_MUTEXES, CONFIG_DEBUG_SPINLOCK),
> lock_torture may print "End of test: SUCCESS [debug]: ...".
> The current regexp expects "SUCCESS:" and fails to match, causing the
> test to be reported as failure.
> Allow an optional " [debug]" token between the result string and the
> colon so the test can correctly detect SUCCESS on debug kernels.
Indeed:
torture_type, tag, cxt.debug_lock ? " [debug]": "", [1]
based on config you mentioned [2].
Thanks, merged!
Kind regards,
Petr
[1] https://elixir.bootlin.com/linux/v6.19-rc5/source/kernel/locking/locktorture.c#L1103
[2] https://elixir.bootlin.com/linux/v6.19-rc5/source/kernel/locking/locktorture.c#L1279
> Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
> ---
> testcases/kernel/device-drivers/locking/lock_torture.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/testcases/kernel/device-drivers/locking/lock_torture.sh b/testcases/kernel/device-drivers/locking/lock_torture.sh
> index dfa57373f..d9bd95da2 100755
> --- a/testcases/kernel/device-drivers/locking/lock_torture.sh
> +++ b/testcases/kernel/device-drivers/locking/lock_torture.sh
> @@ -83,7 +83,7 @@ for type in $lock_type; do
> tst_brkm TBROK "failed to unload module"
> # check module status in dmesg
> - result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+):.*/\1/p'`
> + result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+)([[:space:]]+\[debug\])?:.*/\1/p'`
> if [ "$result_str" = "SUCCESS" ]; then
> tst_resm TPASS "$type: completed"
> else
More information about the ltp
mailing list