[PATCH 2/2] selftests: tracing: Use mutex_unlock for testing glob filter

Masami Hiramatsu (Google) posted 2 patches 3 months ago
[PATCH 2/2] selftests: tracing: Use mutex_unlock for testing glob filter
Posted by Masami Hiramatsu (Google) 3 months ago
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Since commit c5b6ababd21a ("locking/mutex: implement
mutex_trylock_nested") makes mutex_trylock() as an inlined
function if CONFIG_DEBUG_LOCK_ALLOC=y, we can not use
mutex_trylock() for testing the glob filter of ftrace.

Use mutex_unlock instead.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 .../ftrace/test.d/ftrace/func-filter-glob.tc       |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
index 4b994b6df5ac..ed81eaf2afd6 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
@@ -29,7 +29,7 @@ ftrace_filter_check 'schedule*' '^schedule.*$'
 ftrace_filter_check '*pin*lock' '.*pin.*lock$'
 
 # filter by start*mid*
-ftrace_filter_check 'mutex*try*' '^mutex.*try.*'
+ftrace_filter_check 'mutex*unl*' '^mutex.*unl.*'
 
 # Advanced full-glob matching feature is recently supported.
 # Skip the tests if we are sure the kernel does not support it.
Re: [PATCH 2/2] selftests: tracing: Use mutex_unlock for testing glob filter
Posted by Steven Rostedt 3 months ago
On Thu,  3 Jul 2025 13:26:43 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Since commit c5b6ababd21a ("locking/mutex: implement
> mutex_trylock_nested") makes mutex_trylock() as an inlined
> function if CONFIG_DEBUG_LOCK_ALLOC=y, we can not use
> mutex_trylock() for testing the glob filter of ftrace.
> 
> Use mutex_unlock instead.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve
Re: [PATCH 2/2] selftests: tracing: Use mutex_unlock for testing glob filter
Posted by Masami Hiramatsu (Google) 3 months ago
Shuah,

Can you take this patch (fix) to your tree since this is
a fix for the selftest?

Thank you,

On Thu, 3 Jul 2025 10:30:39 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu,  3 Jul 2025 13:26:43 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> 
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Since commit c5b6ababd21a ("locking/mutex: implement
> > mutex_trylock_nested") makes mutex_trylock() as an inlined
> > function if CONFIG_DEBUG_LOCK_ALLOC=y, we can not use
> > mutex_trylock() for testing the glob filter of ftrace.
> > 
> > Use mutex_unlock instead.
> > 
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> 
> -- Steve


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Re: [PATCH 2/2] selftests: tracing: Use mutex_unlock for testing glob filter
Posted by Shuah Khan 3 months ago
On 7/4/25 00:04, Masami Hiramatsu (Google) wrote:
> Shuah,
> 
> Can you take this patch (fix) to your tree since this is
> a fix for the selftest?
> 
> Thank you,
> 
> On Thu, 3 Jul 2025 10:30:39 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
>> On Thu,  3 Jul 2025 13:26:43 +0900
>> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
>>
>>> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>>
>>> Since commit c5b6ababd21a ("locking/mutex: implement
>>> mutex_trylock_nested") makes mutex_trylock() as an inlined
>>> function if CONFIG_DEBUG_LOCK_ALLOC=y, we can not use
>>> mutex_trylock() for testing the glob filter of ftrace.
>>>
>>> Use mutex_unlock instead.
>>>
>>> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>
>> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>>
>> -- Steve
> 
> 

Applied to linux-kselftest next

thanks,
-- Shuah