Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ftrace: Allow tracing of some of the tracing code

There is times when tracing the tracing infrastructure can be useful for
debugging the tracing code. Currently all files in the tracing directory
are set to "notrace" the functions.

Add a new config option FUNCTION_SELF_TRACING that will allow some of the
files in the tracing infrastructure to be traced. It requires a config to
enable because it will add noise to the function tracer if events and
other tracing features are enabled. Tracing functions and events together
is quite common, so not tracing the event code should be the default.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20251120181514.736f2d5f@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+31
+14
kernel/trace/Kconfig
··· 330 330 depends on DYNAMIC_FTRACE 331 331 depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS 332 332 333 + config FUNCTION_SELF_TRACING 334 + bool "Function trace tracing code" 335 + depends on FUNCTION_TRACER 336 + help 337 + Normally all the tracing code is set to notrace, where the function 338 + tracer will ignore all the tracing functions. Sometimes it is useful 339 + for debugging to trace some of the tracing infratructure itself. 340 + Enable this to allow some of the tracing infrastructure to be traced 341 + by the function tracer. Note, this will likely add noise to function 342 + tracing if events and other tracing features are enabled along with 343 + function tracing. 344 + 345 + If unsure, say N. 346 + 333 347 config FPROBE 334 348 bool "Kernel Function Probe (fprobe)" 335 349 depends on HAVE_FUNCTION_GRAPH_FREGS && HAVE_FTRACE_GRAPH_FUNC
+17
kernel/trace/Makefile
··· 16 16 endif 17 17 endif 18 18 19 + # Allow some files to be function traced 20 + ifdef CONFIG_FUNCTION_SELF_TRACING 21 + CFLAGS_trace_output.o = $(CC_FLAGS_FTRACE) 22 + CFLAGS_trace_seq.o = $(CC_FLAGS_FTRACE) 23 + CFLAGS_trace_stat.o = $(CC_FLAGS_FTRACE) 24 + CFLAGS_tracing_map.o = $(CC_FLAGS_FTRACE) 25 + CFLAGS_synth_event_gen_test.o = $(CC_FLAGS_FTRACE) 26 + CFLAGS_trace_events.o = $(CC_FLAGS_FTRACE) 27 + CFLAGS_trace_syscalls.o = $(CC_FLAGS_FTRACE) 28 + CFLAGS_trace_events_filter.o = $(CC_FLAGS_FTRACE) 29 + CFLAGS_trace_events_trigger.o = $(CC_FLAGS_FTRACE) 30 + CFLAGS_trace_events_synth.o = $(CC_FLAGS_FTRACE) 31 + CFLAGS_trace_events_hist.o = $(CC_FLAGS_FTRACE) 32 + CFLAGS_trace_events_user.o = $(CC_FLAGS_FTRACE) 33 + CFLAGS_trace_dynevent.o = $(CC_FLAGS_FTRACE) 34 + endif 35 + 19 36 ifdef CONFIG_FTRACE_STARTUP_TEST 20 37 CFLAGS_trace_kprobe_selftest.o = $(CC_FLAGS_FTRACE) 21 38 obj-$(CONFIG_KPROBE_EVENTS) += trace_kprobe_selftest.o