[for-linus][PATCH 31/32] tracing: Add notrace to event functions that hook to ftrace
From: Steven Rostedt
Date: Fri Nov 20 2026 - 12:42:47 EST
From: Steven Rostedt <rostedt@xxxxxxxxxxx>
A few functions in trace_events.c are used to hook to the ftrace function
hooks. Before CONFIG_FUNCTION_SELF_TRACING was added, these functions were not
marked for tracing because the entire directory was set to "notrace". But
now that certain files can be traced by ftrace when the
CONFIG_FUNCTION_SELF_TRACING config is set, individual functions that use ftrace
must be annotated with "notrace" otherwise they can trigger a triple fault
when called.
Annotate the trace_events.c functions that are attached to ftrace with
"notrace.
Cc: stable@xxxxxxxxxxxxxxx
Link: https://patch.msgid.link/20261119124319.3a8bfe50@xxxxxxxxxxxxxxxxxx
Fixes: f93a7d0caccd6 ("ftrace: Allow tracing of some of the tracing code")
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
kernel/trace/trace_events.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index c9d31c9f3fca..7f89160aeff3 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)
@@ -5205,7 +5205,7 @@ static DEFINE_PER_CPU(atomic_t, ftrace_test_event_disable);
static struct trace_event_file event_trace_file __initdata;
-static void __init
+static void notrace __init
function_test_events_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *regs)
{
--
2.53.0