From: sashiko-bot@kernel.org
To: "Steven Rostedt" <rostedt@goodmis.org>,
"Linux Trace Kernel" <linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: Add notrace to event functions that hook to ftrace
Date: Thu, 19 Nov 2026 17:56:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-223736@kernel.org> (raw)
In-Reply-To: <20261119124319.3a8bfe50@gandalf.local.home>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] tracing: missing notrace on update_event_probe() causes ftrace
recursion
--
commit fa7d6fcf36a58e2cb33d20aff7d184dfe9c6060d
Author: Steven Rostedt <rostedt@goodmis.org>
tracing: Add notrace to event functions that hook to ftrace
This commit adds the notrace annotation to event_enable_probe(),
event_enable_count_probe(), and function_test_events_call() so they are
not traced when CONFIG_FUNCTION_SELF_TRACING is enabled.
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 6afed2091e19c..fa8927068609a 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -4317,7 +4317,7 @@ static void update_event_probe(struct event_probe_data *data)
> set_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &data->file->flags);
> }
>
> -static void
> +static void notrace
> event_enable_probe(unsigned long ip, unsigned long parent_ip,
> struct trace_array *tr, struct ftrace_probe_ops *ops,
> void *data)
> @@ -4334,7 +4334,7 @@ event_enable_probe(unsigned long ip, unsigned long parent_ip,
> update_event_probe(edata);
> }
>
> -static void
> +static void notrace
> event_enable_count_probe(unsigned long ip, unsigned long parent_ip,
> struct trace_array *tr, struct ftrace_probe_ops *ops,
> void *data)
[Severity: High]
Should update_event_probe() also be marked notrace (or inline)?
Both event_enable_probe() and event_enable_count_probe() run via
function_trace_probe_call() without FTRACE_OPS_FL_RECURSION and call
update_event_probe(). Because update_event_probe() is neither notrace nor
inline, GCC cannot inline it into its notrace callers and emits it with
an ftrace entry hook under CONFIG_FUNCTION_SELF_TRACING. If an
enable_event or disable_event function probe matches update_event_probe()
(for example via a wildcard filter in set_ftrace_filter), calling
update_event_probe() re-enters function_trace_probe_call() and recurses
until the stack overflows.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119124319.3a8bfe50@gandalf.local.home?part=1
prev parent reply other threads:[~2026-11-19 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 17:43 [PATCH] tracing: Add notrace to event functions that hook to ftrace Steven Rostedt
2026-11-19 17:56 ` sashiko-bot [this message]
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=sashiko-outbox-223736@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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