selftests: tracing: Add tprobe enable/disable testcase
Masami Hiramatsu (Google)
maintainerPATCH 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
@@ -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
Shuah Khan
maintainerQuoted 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.Signed-off-by Masami Hiramatsu (Google) <[email protected]>
Steve, do you want me to take this through my tree?
thanks,
-- Shuah
Steven Rostedt
maintainerQuoted 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.Signed-off-by Masami Hiramatsu (Google) <[email protected]>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
Shuah Khan
maintainerQuoted 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.Signed-off-by Masami Hiramatsu (Google) <[email protected]>
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
Masami Hiramatsu (Google)
maintainerQuoted 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.Signed-off-by Masami Hiramatsu (Google) <[email protected]>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]>
Shuah Khan
maintainerQuoted 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.Signed-off-by Masami Hiramatsu (Google) <[email protected]>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
Steven Rostedt
maintainerQuoted 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
Shuah Khan
maintainerQuoted 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