public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: tracing: Add tprobe enable/disable testcase
@ 2025-11-07 14:35 Masami Hiramatsu (Google)
  2025-11-19 21:44 ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu (Google) @ 2025-11-07 14:35 UTC (permalink / raw)
  To: Steven Rostedt, Shuah Khan
  Cc: Masami Hiramatsu, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel, linux-kselftest

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-07 14:35 [PATCH] selftests: tracing: Add tprobe enable/disable testcase Masami Hiramatsu (Google)
@ 2025-11-19 21:44 ` Shuah Khan
  2025-11-19 22:06   ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2025-11-19 21:44 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), Steven Rostedt, Shuah Khan
  Cc: Mathieu Desnoyers, linux-kernel, linux-trace-kernel,
	linux-kselftest, Shuah Khan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-19 21:44 ` Shuah Khan
@ 2025-11-19 22:06   ` Steven Rostedt
  2025-11-19 22:56     ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2025-11-19 22:06 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Masami Hiramatsu (Google), Shuah Khan, Mathieu Desnoyers,
	linux-kernel, linux-trace-kernel, linux-kselftest

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-19 22:06   ` Steven Rostedt
@ 2025-11-19 22:56     ` Shuah Khan
  2025-11-20  1:25       ` Masami Hiramatsu
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2025-11-19 22:56 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu (Google), Shuah Khan, Mathieu Desnoyers,
	linux-kernel, linux-trace-kernel, linux-kselftest, Shuah Khan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-19 22:56     ` Shuah Khan
@ 2025-11-20  1:25       ` Masami Hiramatsu
  2025-11-20 16:40         ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2025-11-20  1:25 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Steven Rostedt, Masami Hiramatsu (Google), Shuah Khan,
	Mathieu Desnoyers, linux-kernel, linux-trace-kernel,
	linux-kselftest

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>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-20  1:25       ` Masami Hiramatsu
@ 2025-11-20 16:40         ` Shuah Khan
  2025-11-24 20:39           ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Shuah Khan @ 2025-11-20 16:40 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Steven Rostedt, Shuah Khan, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel, linux-kselftest, Shuah Khan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-20 16:40         ` Shuah Khan
@ 2025-11-24 20:39           ` Steven Rostedt
  2025-11-25  0:34             ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2025-11-24 20:39 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Masami Hiramatsu (Google), Shuah Khan, Mathieu Desnoyers,
	linux-kernel, linux-trace-kernel, linux-kselftest

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] selftests: tracing: Add tprobe enable/disable testcase
  2025-11-24 20:39           ` Steven Rostedt
@ 2025-11-25  0:34             ` Shuah Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Shuah Khan @ 2025-11-25  0:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu (Google), Shuah Khan, Mathieu Desnoyers,
	linux-kernel, linux-trace-kernel, linux-kselftest, Shuah Khan

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-25  0:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 14:35 [PATCH] selftests: tracing: Add tprobe enable/disable testcase Masami Hiramatsu (Google)
2025-11-19 21:44 ` Shuah Khan
2025-11-19 22:06   ` Steven Rostedt
2025-11-19 22:56     ` Shuah Khan
2025-11-20  1:25       ` Masami Hiramatsu
2025-11-20 16:40         ` Shuah Khan
2025-11-24 20:39           ` Steven Rostedt
2025-11-25  0:34             ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox