xref: /linux/kernel/trace/Kconfig (revision 60a7ecf42661f2b22168751298592da6ee210c9e)
116444a8aSArnaldo Carvalho de Melo#
2606576ceSSteven Rostedt# Architectures that offer an FUNCTION_TRACER implementation should
3606576ceSSteven Rostedt#  select HAVE_FUNCTION_TRACER:
416444a8aSArnaldo Carvalho de Melo#
52a3a4f66SFrédéric Weisbecker
62a3a4f66SFrédéric Weisbeckerconfig NOP_TRACER
72a3a4f66SFrédéric Weisbecker	bool
82a3a4f66SFrédéric Weisbecker
9606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
1016444a8aSArnaldo Carvalho de Melo	bool
11bc0c38d1SSteven Rostedt
12*60a7ecf4SSteven Rostedtconfig HAVE_FUNCTION_TRACE_MCOUNT_TEST
13*60a7ecf4SSteven Rostedt	bool
14*60a7ecf4SSteven Rostedt	help
15*60a7ecf4SSteven Rostedt	 This gets selected when the arch tests the function_trace_stop
16*60a7ecf4SSteven Rostedt	 variable at the mcount call site. Otherwise, this variable
17*60a7ecf4SSteven Rostedt	 is tested by the called function.
18*60a7ecf4SSteven Rostedt
19677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
20677aa9f7SSteven Rostedt	bool
21677aa9f7SSteven Rostedt
228da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
238da3821bSSteven Rostedt	bool
248da3821bSSteven Rostedt
25352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
26352ad25aSSteven Rostedt	bool
27352ad25aSSteven Rostedt
287a8e76a3SSteven Rostedtconfig RING_BUFFER
297a8e76a3SSteven Rostedt	bool
307a8e76a3SSteven Rostedt
31bc0c38d1SSteven Rostedtconfig TRACING
32bc0c38d1SSteven Rostedt	bool
33bc0c38d1SSteven Rostedt	select DEBUG_FS
347a8e76a3SSteven Rostedt	select RING_BUFFER
35c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
365f87f112SIngo Molnar	select TRACEPOINTS
37f3384b28SSteven Rostedt	select NOP_TRACER
38bc0c38d1SSteven Rostedt
3917d80fd0SPeter Zijlstramenu "Tracers"
4017d80fd0SPeter Zijlstra
41606576ceSSteven Rostedtconfig FUNCTION_TRACER
421b29b018SSteven Rostedt	bool "Kernel Function Tracer"
43606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
44d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
451b29b018SSteven Rostedt	select FRAME_POINTER
461b29b018SSteven Rostedt	select TRACING
4735e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
481b29b018SSteven Rostedt	help
491b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
501b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
511b29b018SSteven Rostedt	  instruction to the beginning of every kernel function, which NOP
521b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
531b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
541b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
551b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
5635e8e302SSteven Rostedt
5781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
5881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
5981d68a96SSteven Rostedt	default n
6081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
6181d68a96SSteven Rostedt	depends on GENERIC_TIME
62d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
6381d68a96SSteven Rostedt	select TRACE_IRQFLAGS
6481d68a96SSteven Rostedt	select TRACING
6581d68a96SSteven Rostedt	select TRACER_MAX_TRACE
6681d68a96SSteven Rostedt	help
6781d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
6881d68a96SSteven Rostedt	  sections, with microsecond accuracy.
6981d68a96SSteven Rostedt
7081d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
7181d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
7281d68a96SSteven Rostedt	  via:
7381d68a96SSteven Rostedt
7481d68a96SSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
7581d68a96SSteven Rostedt
766cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
776cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
786cd8a4bbSSteven Rostedt	  used together or separately.)
796cd8a4bbSSteven Rostedt
806cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
816cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
826cd8a4bbSSteven Rostedt	default n
836cd8a4bbSSteven Rostedt	depends on GENERIC_TIME
846cd8a4bbSSteven Rostedt	depends on PREEMPT
85d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
866cd8a4bbSSteven Rostedt	select TRACING
876cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
886cd8a4bbSSteven Rostedt	help
896cd8a4bbSSteven Rostedt	  This option measures the time spent in preemption off critical
906cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
916cd8a4bbSSteven Rostedt
926cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
936cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
946cd8a4bbSSteven Rostedt	  via:
956cd8a4bbSSteven Rostedt
966cd8a4bbSSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
976cd8a4bbSSteven Rostedt
986cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
996cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
1006cd8a4bbSSteven Rostedt	  used together or separately.)
1016cd8a4bbSSteven Rostedt
102f06c3810SIngo Molnarconfig SYSPROF_TRACER
103f06c3810SIngo Molnar	bool "Sysprof Tracer"
1044d2df795SThomas Gleixner	depends on X86
105f06c3810SIngo Molnar	select TRACING
106f06c3810SIngo Molnar	help
107f06c3810SIngo Molnar	  This tracer provides the trace needed by the 'Sysprof' userspace
108f06c3810SIngo Molnar	  tool.
109f06c3810SIngo Molnar
110352ad25aSSteven Rostedtconfig SCHED_TRACER
111352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
112d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
113352ad25aSSteven Rostedt	select TRACING
114352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
115352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
116352ad25aSSteven Rostedt	help
117352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
118352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
119352ad25aSSteven Rostedt
12035e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER
12135e8e302SSteven Rostedt	bool "Trace process context switches"
122d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
12335e8e302SSteven Rostedt	select TRACING
12435e8e302SSteven Rostedt	select MARKERS
12535e8e302SSteven Rostedt	help
12635e8e302SSteven Rostedt	  This tracer gets called from the context switch and records
12735e8e302SSteven Rostedt	  all switching of tasks.
12835e8e302SSteven Rostedt
1291f5c2abbSFrédéric Weisbeckerconfig BOOT_TRACER
1301f5c2abbSFrédéric Weisbecker	bool "Trace boot initcalls"
1311f5c2abbSFrédéric Weisbecker	depends on DEBUG_KERNEL
1321f5c2abbSFrédéric Weisbecker	select TRACING
133ea31e72dSFrederic Weisbecker	select CONTEXT_SWITCH_TRACER
1341f5c2abbSFrédéric Weisbecker	help
1351f5c2abbSFrédéric Weisbecker	  This tracer helps developers to optimize boot times: it records
13698d9c66aSIngo Molnar	  the timings of the initcalls and traces key events and the identity
13798d9c66aSIngo Molnar	  of tasks that can cause boot delays, such as context-switches.
13898d9c66aSIngo Molnar
13998d9c66aSIngo Molnar	  Its aim is to be parsed by the /scripts/bootgraph.pl tool to
14098d9c66aSIngo Molnar	  produce pretty graphics about boot inefficiencies, giving a visual
14198d9c66aSIngo Molnar	  representation of the delays during initcalls - but the raw
14298d9c66aSIngo Molnar	  /debug/tracing/trace text output is readable too.
14398d9c66aSIngo Molnar
14498d9c66aSIngo Molnar	  ( Note that tracing self tests can't be enabled if this tracer is
14598d9c66aSIngo Molnar	    selected, because the self-tests are an initcall as well and that
14698d9c66aSIngo Molnar	    would invalidate the boot trace. )
1471f5c2abbSFrédéric Weisbecker
148e5a81b62SSteven Rostedtconfig STACK_TRACER
149e5a81b62SSteven Rostedt	bool "Trace max stack"
150606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1512ff01c6aSIngo Molnar	depends on DEBUG_KERNEL
152606576ceSSteven Rostedt	select FUNCTION_TRACER
153e5a81b62SSteven Rostedt	select STACKTRACE
154e5a81b62SSteven Rostedt	help
1554519d9e5SIngo Molnar	  This special tracer records the maximum stack footprint of the
1564519d9e5SIngo Molnar	  kernel and displays it in debugfs/tracing/stack_trace.
1574519d9e5SIngo Molnar
1584519d9e5SIngo Molnar	  This tracer works by hooking into every function call that the
1594519d9e5SIngo Molnar	  kernel executes, and keeping a maximum stack depth value and
1604519d9e5SIngo Molnar	  stack-trace saved. Because this logic has to execute in every
1614519d9e5SIngo Molnar	  kernel function, all the time, this option can slow down the
1624519d9e5SIngo Molnar	  kernel measurably and is generally intended for kernel
1634519d9e5SIngo Molnar	  developers only.
1644519d9e5SIngo Molnar
1654519d9e5SIngo Molnar	  Say N if unsure.
166e5a81b62SSteven Rostedt
1673d083395SSteven Rostedtconfig DYNAMIC_FTRACE
1683d083395SSteven Rostedt	bool "enable/disable ftrace tracepoints dynamically"
169606576ceSSteven Rostedt	depends on FUNCTION_TRACER
170677aa9f7SSteven Rostedt	depends on HAVE_DYNAMIC_FTRACE
171d3ee6d99SIngo Molnar	depends on DEBUG_KERNEL
1723d083395SSteven Rostedt	default y
1733d083395SSteven Rostedt	help
1743d083395SSteven Rostedt         This option will modify all the calls to ftrace dynamically
1753d083395SSteven Rostedt	 (will patch them out of the binary image and replaces them
1763d083395SSteven Rostedt	 with a No-Op instruction) as they are called. A table is
1773d083395SSteven Rostedt	 created to dynamically enable them again.
1783d083395SSteven Rostedt
179606576ceSSteven Rostedt	 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise
1803d083395SSteven Rostedt	 has native performance as long as no tracing is active.
1813d083395SSteven Rostedt
1823d083395SSteven Rostedt	 The changes to the code are done by a kernel thread that
1833d083395SSteven Rostedt	 wakes up once a second and checks to see if any ftrace calls
1843d083395SSteven Rostedt	 were made. If so, it runs stop_machine (stops all CPUS)
1853d083395SSteven Rostedt	 and modifies the code to jump over the call to ftrace.
18660a11774SSteven Rostedt
1878da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
1888da3821bSSteven Rostedt	def_bool y
1898da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
1908da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
1918da3821bSSteven Rostedt
19260a11774SSteven Rostedtconfig FTRACE_SELFTEST
19360a11774SSteven Rostedt	bool
19460a11774SSteven Rostedt
19560a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST
19660a11774SSteven Rostedt	bool "Perform a startup test on ftrace"
1973ce2b920SFrédéric Weisbecker	depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER
19860a11774SSteven Rostedt	select FTRACE_SELFTEST
19960a11774SSteven Rostedt	help
20060a11774SSteven Rostedt	  This option performs a series of startup tests on ftrace. On bootup
20160a11774SSteven Rostedt	  a series of tests are made to verify that the tracer is
20260a11774SSteven Rostedt	  functioning properly. It will do tests on all the configured
20360a11774SSteven Rostedt	  tracers of ftrace.
20417d80fd0SPeter Zijlstra
20517d80fd0SPeter Zijlstraendmenu
206