[PATCH] selftests: tracing: Add tprobe enable/disable testcase

Masami Hiramatsu (Google) posted 1 patch 1 month, 1 week ago
.../test.d/dynevent/enable_disable_tprobe.tc       |   40 ++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc
[PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Masami Hiramatsu (Google) 1 month, 1 week ago
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
enable tprobe event") caused regression bug and tprobe did not work.
To prevent similar problems, add a testcase which enables/disables a
tprobe and check the results.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 .../test.d/dynevent/enable_disable_tprobe.tc       |   40 ++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc

diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc
new file mode 100644
index 000000000000..c1f1cafa30f3
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc
@@ -0,0 +1,40 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Generic dynamic event - enable/disable tracepoint probe events
+# requires: dynamic_events "t[:[<group>/][<event>]] <tracepoint> [<args>]":README
+
+echo 0 > events/enable
+echo > dynamic_events
+
+TRACEPOINT=sched_switch
+ENABLEFILE=events/tracepoints/myprobe/enable
+
+:;: "Add tracepoint event on $TRACEPOINT" ;:
+
+echo "t:myprobe ${TRACEPOINT}" >> dynamic_events
+
+:;: "Check enable/disable to ensure it works" ;:
+
+echo 1 > $ENABLEFILE
+
+grep -q $TRACEPOINT trace
+
+echo 0 > $ENABLEFILE
+
+echo > trace
+
+! grep -q $TRACEPOINT trace
+
+:;: "Repeat enable/disable to ensure it works" ;:
+
+echo 1 > $ENABLEFILE
+
+grep -q $TRACEPOINT trace
+
+echo 0 > $ENABLEFILE
+
+echo > trace
+
+! grep -q $TRACEPOINT trace
+
+exit 0
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Shuah Khan 4 weeks, 1 day ago
On 11/7/25 07:35, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
> enable tprobe event") caused regression bug and tprobe did not work.
> To prevent similar problems, add a testcase which enables/disables a
> tprobe and check the results.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Steve, do you want me to take this through my tree?

thanks,
-- Shuah
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Steven Rostedt 4 weeks, 1 day ago
On Wed, 19 Nov 2025 14:44:22 -0700
Shuah Khan <skhan@linuxfoundation.org> wrote:

> On 11/7/25 07:35, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
> > enable tprobe event") caused regression bug and tprobe did not work.
> > To prevent similar problems, add a testcase which enables/disables a
> > tprobe and check the results.
> > 
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>  
> 
> Steve, do you want me to take this through my tree?

Yes please. Masami's an official maintainer and mostly handles all things
"probe" related. This is his domain ;-)

Thanks,

-- Steve
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Shuah Khan 4 weeks, 1 day ago
On 11/19/25 15:06, Steven Rostedt wrote:
> On Wed, 19 Nov 2025 14:44:22 -0700
> Shuah Khan <skhan@linuxfoundation.org> wrote:
> 
>> On 11/7/25 07:35, Masami Hiramatsu (Google) wrote:
>>> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>>
>>> Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
>>> enable tprobe event") caused regression bug and tprobe did not work.
>>> To prevent similar problems, add a testcase which enables/disables a
>>> tprobe and check the results.
>>>
>>> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>
>> Steve, do you want me to take this through my tree?
> 
> Yes please. Masami's an official maintainer and mostly handles all things
> "probe" related. This is his domain ;-)
> 
> Thanks,
> 
> -- Steve
Applied to linux-kselftest next for Linux 6.19-rc1.

thanks,
-- Shuah
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Masami Hiramatsu (Google) 4 weeks, 1 day ago
On Wed, 19 Nov 2025 15:56:57 -0700
Shuah Khan <skhan@linuxfoundation.org> wrote:

> On 11/19/25 15:06, Steven Rostedt wrote:
> > On Wed, 19 Nov 2025 14:44:22 -0700
> > Shuah Khan <skhan@linuxfoundation.org> wrote:
> > 
> >> On 11/7/25 07:35, Masami Hiramatsu (Google) wrote:
> >>> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >>>
> >>> Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
> >>> enable tprobe event") caused regression bug and tprobe did not work.
> >>> To prevent similar problems, add a testcase which enables/disables a
> >>> tprobe and check the results.
> >>>
> >>> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >>
> >> Steve, do you want me to take this through my tree?
> > 
> > Yes please. Masami's an official maintainer and mostly handles all things
> > "probe" related. This is his domain ;-)
> > 
> > Thanks,
> > 
> > -- Steve
> Applied to linux-kselftest next for Linux 6.19-rc1.

Thanks Shuah! This and other regression fixes is better to go
through selftests tree because those are checking existing
features. Maybe better to add [PATCH -selftests] or something
like that?

Thank you,

> 
> thanks,
> -- Shuah


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Shuah Khan 4 weeks, 1 day ago
On 11/19/25 18:25, Masami Hiramatsu (Google) wrote:
> On Wed, 19 Nov 2025 15:56:57 -0700
> Shuah Khan <skhan@linuxfoundation.org> wrote:
> 
>> On 11/19/25 15:06, Steven Rostedt wrote:
>>> On Wed, 19 Nov 2025 14:44:22 -0700
>>> Shuah Khan <skhan@linuxfoundation.org> wrote:
>>>
>>>> On 11/7/25 07:35, Masami Hiramatsu (Google) wrote:
>>>>> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>>>>
>>>>> Commit 2867495dea86 ("tracing: tprobe-events: Register tracepoint when
>>>>> enable tprobe event") caused regression bug and tprobe did not work.
>>>>> To prevent similar problems, add a testcase which enables/disables a
>>>>> tprobe and check the results.
>>>>>
>>>>> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>>>>
>>>> Steve, do you want me to take this through my tree?
>>>
>>> Yes please. Masami's an official maintainer and mostly handles all things
>>> "probe" related. This is his domain ;-)
>>>
>>> Thanks,
>>>
>>> -- Steve
>> Applied to linux-kselftest next for Linux 6.19-rc1.
> 
> Thanks Shuah! This and other regression fixes is better to go
> through selftests tree because those are checking existing
> features. Maybe better to add [PATCH -selftests] or something
> like that?
> 

Let me know which ones you would like to pick up and apply to my tree.

thanks,
-- Shuah
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Steven Rostedt 3 weeks, 3 days ago
On Thu, 20 Nov 2025 09:40:28 -0700
Shuah Khan <skhan@linuxfoundation.org> wrote:

> > Thanks Shuah! This and other regression fixes is better to go
> > through selftests tree because those are checking existing
> > features. Maybe better to add [PATCH -selftests] or something
> > like that?
> >   
> 
> Let me know which ones you would like to pick up and apply to my tree.

This one and I believe this one:

  https://lore.kernel.org/linux-trace-kernel/176295318112.431538.11780280333728368327.stgit@devnote2

-- Steve
Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
Posted by Shuah Khan 3 weeks, 3 days ago
On 11/24/25 13:39, Steven Rostedt wrote:
> On Thu, 20 Nov 2025 09:40:28 -0700
> Shuah Khan <skhan@linuxfoundation.org> wrote:
> 
>>> Thanks Shuah! This and other regression fixes is better to go
>>> through selftests tree because those are checking existing
>>> features. Maybe better to add [PATCH -selftests] or something
>>> like that?
>>>    
>>
>> Let me know which ones you would like to pick up and apply to my tree.
> 
> This one and I believe this one:
> 
>    https://lore.kernel.org/linux-trace-kernel/176295318112.431538.11780280333728368327.stgit@devnote2
> 

Both these patches are in linux-kselftest next.

thanks,
-- Shuah