From: sashiko-bot@kernel.org
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v13 10/12] selftests: ftrace: Add wprobe trigger testcase
Date: Sat, 22 Aug 2026 09:39:24 +0000 [thread overview]
Message-ID: <20260822093925.BA8481F000E9@smtp.kernel.org> (raw)
In-Reply-To: <178739070441.1520941.13438898193952389821.stgit@devnote2>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The `trigger-wprobe.tc` test has a race condition causing intermittent failures because the `clear_wprobe` trigger executes asynchronously and the test does not wait for it to fire before verifying the trace buffer.
- [Medium] The `trigger-wprobe.tc` test uses `timer=t` as a fetcharg without enforcing a BTF requirement, which will cause false-positive test failures on kernels without BTF support.
--
--- Patch [10]: [PATCH v13 10/12] selftests: ftrace: Add wprobe trigger testcase ---
commit f8200da0c99be51814ee14df413b8fd81995a06f
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
selftests: ftrace: Add wprobe trigger testcase
This commit adds a testcase to verify wprobe triggers. It uses set_wprobe
and clear_wprobe triggers on fprobe and static trace events to monitor
memory accesses within the trace-events-sample kernel module, and tests
wprobe trigger syntax error logging.
Link: https://lore.kernel.org/all/59637b96946653393a7ad3c7de094094796b39c2.1785067572.git.wangjinchao600@gmail.com/
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe.tc
> new file mode 100644
> index 0000000000000..0565e2c421778
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe.tc
[ ... ]
> +:;: "Add a wprobe event used by trigger" ;:
> +echo 'w:watch rw@0:8 address=$addr value=$value' > dynamic_events
> +
> +:;: "Add events for triggering wprobe" ;:
> +echo 'f:fprobes/testevent sample_timer_cb timer=t' >> dynamic_events
[Severity: Medium]
Is it intentional to use a local variable t as a fetcharg here?
This relies on BTF debug info. On kernels without
CONFIG_PROBE_EVENTS_BTF_ARGS=y or architectures lacking BTF support,
the kernel's tracing subsystem cannot resolve the argument and the
fprobe registration will fail.
Should this test either add a requirement for BTF arguments in the requires
directive, or use a register argument like $arg1 instead?
> +
> +:;: "Enable all events before setting triggers" ;:
> +echo 1 > tracing_on
> +echo 1 >> events/fprobes/testevent/enable
> +echo 1 >> events/sample-trace/foo_bar_with_fn/enable
[ ... ]
> +:;: "Set clear_wprobe trigger on foo_bar_with_fn" ;:
> +echo 'clear_wprobe:watch' >> events/sample-trace/foo_bar_with_fn/trigger
> +cat events/sample-trace/foo_bar_with_fn/trigger | grep ^clear_wprobe
> +
> +# Disable set_wprobe to prevent sample_timer_cb from re-arming the watchpoint
> +echo '!set_wprobe:watch:timer' >> events/fprobes/testevent/trigger
> +
> +# Clear trace and wait to ensure no new watchpoint events are generated
> +clear_trace
> +sleep 1
[Severity: Medium]
Can this sequence cause a race condition resulting in intermittent test
failures?
If the test clears the trace buffer here without first waiting for
foo_bar_with_fn to execute and actually clear the watchpoint, there is a race
window.
Since both foo_bar_with_fn and sample_timer_cb run periodically every
second, could sample_timer_cb execute after clear_trace but before
foo_bar_with_fn has fired?
If so, it would access the still-armed watchpoint and log a watch event in the
newly cleared trace buffer, causing the final verification step
(! grep -q watch trace) to fail.
> +
> +:;: "Ensure clear_wprobe trigger deactivated the watchpoint" ;:
> +! grep -q watch trace
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/178739053919.1520941.17662338993878200834.stgit@devnote2?part=10
next prev parent reply other threads:[~2026-08-22 9:39 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 9:22 [PATCH v13 00/12] tracing: wprobe: x86: Add wprobe for watchpoint Masami Hiramatsu (Google)
2026-08-22 9:22 ` [PATCH v13 01/12] kprobes: Protect kprobe_blacklist with RCU Masami Hiramatsu (Google)
2026-08-22 9:31 ` sashiko-bot
2026-08-22 9:22 ` [PATCH v13 02/12] x86/hw_breakpoints: Make DR7 updates NMI safe Masami Hiramatsu (Google)
2026-08-22 9:41 ` sashiko-bot
2026-08-30 5:35 ` Masami Hiramatsu
2026-08-22 9:22 ` [PATCH v13 03/12] x86/hw_breakpoints: Add arch_modify_local_hw_breakpoint_addr() API Masami Hiramatsu (Google)
2026-08-22 9:33 ` sashiko-bot
2026-08-22 9:23 ` [PATCH v13 04/12] HWBP: Add modify_local_hw_breakpoint_addr() API Masami Hiramatsu (Google)
2026-08-22 9:33 ` sashiko-bot
2026-08-22 9:24 ` [PATCH v13 05/12] tracing/wprobe: Add wprobe (watchpoint probe) trace event support Masami Hiramatsu (Google)
2026-08-22 9:49 ` sashiko-bot
2026-08-30 5:35 ` Masami Hiramatsu
2026-08-22 9:24 ` [PATCH v13 06/12] x86: hw_breakpoint: Add a kconfig to clarify when a breakpoint fires Masami Hiramatsu (Google)
2026-08-22 9:31 ` sashiko-bot
2026-08-22 9:24 ` [PATCH v13 07/12] selftests: tracing: Add a basic testcase for wprobe Masami Hiramatsu (Google)
2026-08-22 9:36 ` sashiko-bot
2026-08-30 5:35 ` Masami Hiramatsu
2026-08-22 9:24 ` [PATCH v13 08/12] selftests: tracing: Add syntax " Masami Hiramatsu (Google)
2026-08-22 9:35 ` sashiko-bot
2026-08-30 5:35 ` Masami Hiramatsu
2026-08-22 9:24 ` [PATCH v13 09/12] tracing/wprobe: Add set_wprobe and clear_wprobe event triggers Masami Hiramatsu (Google)
2026-08-22 9:42 ` sashiko-bot
2026-08-30 5:35 ` Masami Hiramatsu
2026-08-22 9:25 ` [PATCH v13 10/12] selftests: ftrace: Add wprobe trigger testcase Masami Hiramatsu (Google)
2026-08-22 9:39 ` sashiko-bot [this message]
2026-08-30 5:36 ` Masami Hiramatsu
2026-08-22 9:25 ` [PATCH v13 11/12] tracing/wprobe: Support BTF typecast in fetchargs Masami Hiramatsu (Google)
2026-08-22 9:40 ` sashiko-bot
2026-08-22 9:25 ` [PATCH v13 12/12] tracing/wprobe: Support BTF struct offset resolution in set_wprobe trigger Masami Hiramatsu (Google)
2026-08-22 9:51 ` sashiko-bot
2026-08-30 5:36 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260822093925.BA8481F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox