xref: /linux-6.15/kernel/trace/Kconfig (revision 5f87f112)
116444a8aSArnaldo Carvalho de Melo#
216444a8aSArnaldo Carvalho de Melo# Architectures that offer an FTRACE implementation should select HAVE_FTRACE:
316444a8aSArnaldo Carvalho de Melo#
416444a8aSArnaldo Carvalho de Meloconfig HAVE_FTRACE
516444a8aSArnaldo Carvalho de Melo	bool
6bc0c38d1SSteven Rostedt
7677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
8677aa9f7SSteven Rostedt	bool
9677aa9f7SSteven Rostedt
10352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
11352ad25aSSteven Rostedt	bool
12352ad25aSSteven Rostedt
13bc0c38d1SSteven Rostedtconfig TRACING
14bc0c38d1SSteven Rostedt	bool
15bc0c38d1SSteven Rostedt	select DEBUG_FS
1686387f7eSIngo Molnar	select STACKTRACE
17*5f87f112SIngo Molnar	select TRACEPOINTS
18bc0c38d1SSteven Rostedt
191b29b018SSteven Rostedtconfig FTRACE
201b29b018SSteven Rostedt	bool "Kernel Function Tracer"
21694379e9SIngo Molnar	depends on HAVE_FTRACE
221b29b018SSteven Rostedt	select FRAME_POINTER
231b29b018SSteven Rostedt	select TRACING
2435e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
251b29b018SSteven Rostedt	help
261b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
271b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
281b29b018SSteven Rostedt	  instruction to the beginning of every kernel function, which NOP
291b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
301b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
311b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
321b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
3335e8e302SSteven Rostedt
3481d68a96SSteven Rostedtconfig IRQSOFF_TRACER
3581d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
3681d68a96SSteven Rostedt	default n
3781d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
3881d68a96SSteven Rostedt	depends on GENERIC_TIME
39c1d2327bSIngo Molnar	depends on HAVE_FTRACE
4081d68a96SSteven Rostedt	select TRACE_IRQFLAGS
4181d68a96SSteven Rostedt	select TRACING
4281d68a96SSteven Rostedt	select TRACER_MAX_TRACE
4381d68a96SSteven Rostedt	help
4481d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
4581d68a96SSteven Rostedt	  sections, with microsecond accuracy.
4681d68a96SSteven Rostedt
4781d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
4881d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
4981d68a96SSteven Rostedt	  via:
5081d68a96SSteven Rostedt
5181d68a96SSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
5281d68a96SSteven Rostedt
536cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
546cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
556cd8a4bbSSteven Rostedt	  used together or separately.)
566cd8a4bbSSteven Rostedt
576cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
586cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
596cd8a4bbSSteven Rostedt	default n
606cd8a4bbSSteven Rostedt	depends on GENERIC_TIME
616cd8a4bbSSteven Rostedt	depends on PREEMPT
62c1d2327bSIngo Molnar	depends on HAVE_FTRACE
636cd8a4bbSSteven Rostedt	select TRACING
646cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
656cd8a4bbSSteven Rostedt	help
666cd8a4bbSSteven Rostedt	  This option measures the time spent in preemption off critical
676cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
686cd8a4bbSSteven Rostedt
696cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
706cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
716cd8a4bbSSteven Rostedt	  via:
726cd8a4bbSSteven Rostedt
736cd8a4bbSSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
746cd8a4bbSSteven Rostedt
756cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
766cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
776cd8a4bbSSteven Rostedt	  used together or separately.)
786cd8a4bbSSteven Rostedt
79f06c3810SIngo Molnarconfig SYSPROF_TRACER
80f06c3810SIngo Molnar	bool "Sysprof Tracer"
814d2df795SThomas Gleixner	depends on X86
82f06c3810SIngo Molnar	select TRACING
83f06c3810SIngo Molnar	help
84f06c3810SIngo Molnar	  This tracer provides the trace needed by the 'Sysprof' userspace
85f06c3810SIngo Molnar	  tool.
86f06c3810SIngo Molnar
87352ad25aSSteven Rostedtconfig SCHED_TRACER
88352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
89c1d2327bSIngo Molnar	depends on HAVE_FTRACE
90352ad25aSSteven Rostedt	select TRACING
91352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
92352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
93352ad25aSSteven Rostedt	help
94352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
95352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
96352ad25aSSteven Rostedt
9735e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER
9835e8e302SSteven Rostedt	bool "Trace process context switches"
99c1d2327bSIngo Molnar	depends on HAVE_FTRACE
10035e8e302SSteven Rostedt	select TRACING
10135e8e302SSteven Rostedt	select MARKERS
10235e8e302SSteven Rostedt	help
10335e8e302SSteven Rostedt	  This tracer gets called from the context switch and records
10435e8e302SSteven Rostedt	  all switching of tasks.
10535e8e302SSteven Rostedt
1063d083395SSteven Rostedtconfig DYNAMIC_FTRACE
1073d083395SSteven Rostedt	bool "enable/disable ftrace tracepoints dynamically"
1083d083395SSteven Rostedt	depends on FTRACE
109677aa9f7SSteven Rostedt	depends on HAVE_DYNAMIC_FTRACE
1103d083395SSteven Rostedt	default y
1113d083395SSteven Rostedt	help
1123d083395SSteven Rostedt         This option will modify all the calls to ftrace dynamically
1133d083395SSteven Rostedt	 (will patch them out of the binary image and replaces them
1143d083395SSteven Rostedt	 with a No-Op instruction) as they are called. A table is
1153d083395SSteven Rostedt	 created to dynamically enable them again.
1163d083395SSteven Rostedt
1173d083395SSteven Rostedt	 This way a CONFIG_FTRACE kernel is slightly larger, but otherwise
1183d083395SSteven Rostedt	 has native performance as long as no tracing is active.
1193d083395SSteven Rostedt
1203d083395SSteven Rostedt	 The changes to the code are done by a kernel thread that
1213d083395SSteven Rostedt	 wakes up once a second and checks to see if any ftrace calls
1223d083395SSteven Rostedt	 were made. If so, it runs stop_machine (stops all CPUS)
1233d083395SSteven Rostedt	 and modifies the code to jump over the call to ftrace.
12460a11774SSteven Rostedt
12560a11774SSteven Rostedtconfig FTRACE_SELFTEST
12660a11774SSteven Rostedt	bool
12760a11774SSteven Rostedt
12860a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST
12960a11774SSteven Rostedt	bool "Perform a startup test on ftrace"
13060a11774SSteven Rostedt	depends on TRACING
13160a11774SSteven Rostedt	select FTRACE_SELFTEST
13260a11774SSteven Rostedt	help
13360a11774SSteven Rostedt	  This option performs a series of startup tests on ftrace. On bootup
13460a11774SSteven Rostedt	  a series of tests are made to verify that the tracer is
13560a11774SSteven Rostedt	  functioning properly. It will do tests on all the configured
13660a11774SSteven Rostedt	  tracers of ftrace.
137