Skip to contentSkip to conversation

selftests: tracing: Add tprobe enable/disable testcase

PATCH In review Masami Hiramatsu (Google) 3 participants 8 messages Nov 7, 2025 – Nov 25, 2025

Subsystems (2)
lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 selftests: tracing: Add tprobe enable/disable testcase

From: Masami Hiramatsu (Google) <[email protected]>

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.

---
 .../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
tools/testing/selftests/ftrace/test.d/dynevent/enable_disable_tprobe.tc new file +40 -0
new file mode 100644
index 000000000000..c1f1cafa30f3
@@ -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
maintainer
#1 lore raw
Quoted 8 lines · Masami Hiramatsu (Google)

From: Masami Hiramatsu (Google) <[email protected]>

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.

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

thanks,
-- Shuah

maintainer
#2 lore raw
Quoted 11 lines · On Wed, 19 Nov 2025 14:44:22 -0700 Shuah Khan <[email protected]> wrote:
Quoted 8 lines · Masami Hiramatsu (Google)

From: Masami Hiramatsu (Google) <[email protected]>

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.

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

maintainer
#3 lore raw
Quoted 13 lines · Steven Rostedt
Quoted 10 lines · On Wed, 19 Nov 2025 14:44:22 -0700 Shuah Khan <[email protected]> wrote:
Quoted 8 lines · Masami Hiramatsu (Google)

From: Masami Hiramatsu (Google) <[email protected]>

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.

Quoted 8 lines
Quoted 1 line

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

author maintainer
#4 lore raw
Quoted 16 lines · On Wed, 19 Nov 2025 15:56:57 -0700 Shuah Khan <[email protected]> wrote:
Quoted 15 lines · Steven Rostedt
Quoted 11 lines · On Wed, 19 Nov 2025 14:44:22 -0700 Shuah Khan <[email protected]> wrote:
Quoted 8 lines · Masami Hiramatsu (Google)

From: Masami Hiramatsu (Google) <[email protected]>

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.

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

Quoted 7 lines
Quoted 6 lines

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,

Quoted 3 lines

thanks,
-- Shuah

Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
maintainer
#5 lore raw
Quoted 24 lines · Masami Hiramatsu (Google)
Quoted 21 lines · On Wed, 19 Nov 2025 15:56:57 -0700 Shuah Khan <[email protected]> wrote:
Quoted 20 lines · Steven Rostedt
Quoted 11 lines · On Wed, 19 Nov 2025 14:44:22 -0700 Shuah Khan <[email protected]> wrote:
Quoted 8 lines · Masami Hiramatsu (Google)

From: Masami Hiramatsu (Google) <[email protected]>

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.

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,

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

-- 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

maintainer
#6 lore raw
Quoted 7 lines · On Thu, 20 Nov 2025 09:40:28 -0700 Shuah Khan <[email protected]> wrote:
Quoted 5 lines

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

maintainer
#7 lore raw
Quoted 9 lines · Steven Rostedt
Quoted 6 lines · On Thu, 20 Nov 2025 09:40:28 -0700 Shuah Khan <[email protected]> wrote:
Quoted 5 lines

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?

Quoted 6 lines
Quoted 1 line

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