xref: /linux/kernel/trace/Kconfig (revision e5a81b629ea8feb9e7530cfac35cfb41c45facf3)
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
108da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
118da3821bSSteven Rostedt	bool
128da3821bSSteven Rostedt
13352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
14352ad25aSSteven Rostedt	bool
15352ad25aSSteven Rostedt
16bc0c38d1SSteven Rostedtconfig TRACING
17bc0c38d1SSteven Rostedt	bool
18bc0c38d1SSteven Rostedt	select DEBUG_FS
1986387f7eSIngo Molnar	select STACKTRACE
205f87f112SIngo Molnar	select TRACEPOINTS
21bc0c38d1SSteven Rostedt
221b29b018SSteven Rostedtconfig FTRACE
231b29b018SSteven Rostedt	bool "Kernel Function Tracer"
24694379e9SIngo Molnar	depends on HAVE_FTRACE
251b29b018SSteven Rostedt	select FRAME_POINTER
261b29b018SSteven Rostedt	select TRACING
2735e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
281b29b018SSteven Rostedt	help
291b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
301b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
311b29b018SSteven Rostedt	  instruction to the beginning of every kernel function, which NOP
321b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
331b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
341b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
351b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
3635e8e302SSteven Rostedt
3781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
3881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
3981d68a96SSteven Rostedt	default n
4081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
4181d68a96SSteven Rostedt	depends on GENERIC_TIME
42c1d2327bSIngo Molnar	depends on HAVE_FTRACE
4381d68a96SSteven Rostedt	select TRACE_IRQFLAGS
4481d68a96SSteven Rostedt	select TRACING
4581d68a96SSteven Rostedt	select TRACER_MAX_TRACE
4681d68a96SSteven Rostedt	help
4781d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
4881d68a96SSteven Rostedt	  sections, with microsecond accuracy.
4981d68a96SSteven Rostedt
5081d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
5181d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
5281d68a96SSteven Rostedt	  via:
5381d68a96SSteven Rostedt
5481d68a96SSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
5581d68a96SSteven Rostedt
566cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
576cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
586cd8a4bbSSteven Rostedt	  used together or separately.)
596cd8a4bbSSteven Rostedt
606cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
616cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
626cd8a4bbSSteven Rostedt	default n
636cd8a4bbSSteven Rostedt	depends on GENERIC_TIME
646cd8a4bbSSteven Rostedt	depends on PREEMPT
65c1d2327bSIngo Molnar	depends on HAVE_FTRACE
666cd8a4bbSSteven Rostedt	select TRACING
676cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
686cd8a4bbSSteven Rostedt	help
696cd8a4bbSSteven Rostedt	  This option measures the time spent in preemption off critical
706cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
716cd8a4bbSSteven Rostedt
726cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
736cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
746cd8a4bbSSteven Rostedt	  via:
756cd8a4bbSSteven Rostedt
766cd8a4bbSSteven Rostedt	      echo 0 > /debugfs/tracing/tracing_max_latency
776cd8a4bbSSteven Rostedt
786cd8a4bbSSteven Rostedt	  (Note that kernel size and overhead increases with this option
796cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
806cd8a4bbSSteven Rostedt	  used together or separately.)
816cd8a4bbSSteven Rostedt
82f06c3810SIngo Molnarconfig SYSPROF_TRACER
83f06c3810SIngo Molnar	bool "Sysprof Tracer"
844d2df795SThomas Gleixner	depends on X86
85f06c3810SIngo Molnar	select TRACING
86f06c3810SIngo Molnar	help
87f06c3810SIngo Molnar	  This tracer provides the trace needed by the 'Sysprof' userspace
88f06c3810SIngo Molnar	  tool.
89f06c3810SIngo Molnar
90352ad25aSSteven Rostedtconfig SCHED_TRACER
91352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
92c1d2327bSIngo Molnar	depends on HAVE_FTRACE
93352ad25aSSteven Rostedt	select TRACING
94352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
95352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
96352ad25aSSteven Rostedt	help
97352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
98352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
99352ad25aSSteven Rostedt
10035e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER
10135e8e302SSteven Rostedt	bool "Trace process context switches"
102c1d2327bSIngo Molnar	depends on HAVE_FTRACE
10335e8e302SSteven Rostedt	select TRACING
10435e8e302SSteven Rostedt	select MARKERS
10535e8e302SSteven Rostedt	help
10635e8e302SSteven Rostedt	  This tracer gets called from the context switch and records
10735e8e302SSteven Rostedt	  all switching of tasks.
10835e8e302SSteven Rostedt
109*e5a81b62SSteven Rostedtconfig STACK_TRACER
110*e5a81b62SSteven Rostedt	bool "Trace max stack"
111*e5a81b62SSteven Rostedt	depends on HAVE_FTRACE
112*e5a81b62SSteven Rostedt	select FTRACE
113*e5a81b62SSteven Rostedt	select STACKTRACE
114*e5a81b62SSteven Rostedt	help
115*e5a81b62SSteven Rostedt	  This tracer records the max stack of the kernel, and displays
116*e5a81b62SSteven Rostedt	  it in debugfs/tracing/stack_trace
117*e5a81b62SSteven Rostedt
1183d083395SSteven Rostedtconfig DYNAMIC_FTRACE
1193d083395SSteven Rostedt	bool "enable/disable ftrace tracepoints dynamically"
1203d083395SSteven Rostedt	depends on FTRACE
121677aa9f7SSteven Rostedt	depends on HAVE_DYNAMIC_FTRACE
1223d083395SSteven Rostedt	default y
1233d083395SSteven Rostedt	help
1243d083395SSteven Rostedt         This option will modify all the calls to ftrace dynamically
1253d083395SSteven Rostedt	 (will patch them out of the binary image and replaces them
1263d083395SSteven Rostedt	 with a No-Op instruction) as they are called. A table is
1273d083395SSteven Rostedt	 created to dynamically enable them again.
1283d083395SSteven Rostedt
1293d083395SSteven Rostedt	 This way a CONFIG_FTRACE kernel is slightly larger, but otherwise
1303d083395SSteven Rostedt	 has native performance as long as no tracing is active.
1313d083395SSteven Rostedt
1323d083395SSteven Rostedt	 The changes to the code are done by a kernel thread that
1333d083395SSteven Rostedt	 wakes up once a second and checks to see if any ftrace calls
1343d083395SSteven Rostedt	 were made. If so, it runs stop_machine (stops all CPUS)
1353d083395SSteven Rostedt	 and modifies the code to jump over the call to ftrace.
13660a11774SSteven Rostedt
1378da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
1388da3821bSSteven Rostedt	def_bool y
1398da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
1408da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
1418da3821bSSteven Rostedt
14260a11774SSteven Rostedtconfig FTRACE_SELFTEST
14360a11774SSteven Rostedt	bool
14460a11774SSteven Rostedt
14560a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST
14660a11774SSteven Rostedt	bool "Perform a startup test on ftrace"
14760a11774SSteven Rostedt	depends on TRACING
14860a11774SSteven Rostedt	select FTRACE_SELFTEST
14960a11774SSteven Rostedt	help
15060a11774SSteven Rostedt	  This option performs a series of startup tests on ftrace. On bootup
15160a11774SSteven Rostedt	  a series of tests are made to verify that the tracer is
15260a11774SSteven Rostedt	  functioning properly. It will do tests on all the configured
15360a11774SSteven Rostedt	  tracers of ftrace.
154