* [LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string
@ 2026-01-14 10:18 Vincent Chen via ltp
2026-01-14 16:55 ` Petr Vorel
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Chen via ltp @ 2026-01-14 10:18 UTC (permalink / raw)
To: ltp; +Cc: vincent.chen
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.
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
--
2.34.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string
2026-01-14 10:18 [LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string Vincent Chen via ltp
@ 2026-01-14 16:55 ` Petr Vorel
0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2026-01-14 16:55 UTC (permalink / raw)
To: Vincent Chen; +Cc: ltp
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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-14 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-14 10:18 [LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string Vincent Chen via ltp
2026-01-14 16:55 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox