Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH] tracing: Add notrace to event functions that hook to ftrace
@ 2026-11-19 17:43 Steven Rostedt
  2026-11-19 17:56 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2026-11-19 17:43 UTC (permalink / raw)
  To: LKML, Linux Trace Kernel
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Mark Rutland

From: Steven Rostedt <rostedt@goodmis.org>

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@vger.kernel.org
Fixes: f93a7d0caccd6 ("ftrace: Allow tracing of some of the tracing code")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox