2 # Architectures that offer an FUNCTION_TRACER implementation should
3 # select HAVE_FUNCTION_TRACER:
9 config HAVE_FUNCTION_TRACER
13 config HAVE_DYNAMIC_FTRACE
16 config HAVE_FTRACE_MCOUNT_RECORD
19 config TRACER_MAX_TRACE
32 config FUNCTION_TRACER
33 bool "Kernel Function Tracer"
34 depends on HAVE_FUNCTION_TRACER
35 depends on DEBUG_KERNEL
38 select CONTEXT_SWITCH_TRACER
40 Enable the kernel to trace every kernel function. This is done
41 by using a compiler feature to insert a small, 5-byte No-Operation
42 instruction to the beginning of every kernel function, which NOP
43 sequence is then dynamically patched into a tracer call when
44 tracing is enabled by the administrator. If it's runtime disabled
45 (the bootup default), then the overhead of the instructions is very
46 small and not measurable even in micro-benchmarks.
49 bool "Interrupts-off Latency Tracer"
51 depends on TRACE_IRQFLAGS_SUPPORT
52 depends on GENERIC_TIME
53 depends on DEBUG_KERNEL
56 select TRACER_MAX_TRACE
58 This option measures the time spent in irqs-off critical
59 sections, with microsecond accuracy.
61 The default measurement method is a maximum search, which is
62 disabled by default and can be runtime (re-)started
65 echo 0 > /debugfs/tracing/tracing_max_latency
67 (Note that kernel size and overhead increases with this option
68 enabled. This option and the preempt-off timing option can be
69 used together or separately.)
72 bool "Preemption-off Latency Tracer"
74 depends on GENERIC_TIME
76 depends on DEBUG_KERNEL
78 select TRACER_MAX_TRACE
80 This option measures the time spent in preemption off critical
81 sections, with microsecond accuracy.
83 The default measurement method is a maximum search, which is
84 disabled by default and can be runtime (re-)started
87 echo 0 > /debugfs/tracing/tracing_max_latency
89 (Note that kernel size and overhead increases with this option
90 enabled. This option and the irqs-off timing option can be
91 used together or separately.)
98 This tracer provides the trace needed by the 'Sysprof' userspace
102 bool "Scheduling Latency Tracer"
103 depends on DEBUG_KERNEL
105 select CONTEXT_SWITCH_TRACER
106 select TRACER_MAX_TRACE
108 This tracer tracks the latency of the highest priority task
109 to be scheduled in, starting from the point it has woken up.
111 config CONTEXT_SWITCH_TRACER
112 bool "Trace process context switches"
113 depends on DEBUG_KERNEL
117 This tracer gets called from the context switch and records
118 all switching of tasks.
121 bool "Trace boot initcalls"
122 depends on DEBUG_KERNEL
125 This tracer helps developers to optimize boot times: it records
126 the timings of the initcalls and traces key events and the identity
127 of tasks that can cause boot delays, such as context-switches.
129 Its aim is to be parsed by the /scripts/bootgraph.pl tool to
130 produce pretty graphics about boot inefficiencies, giving a visual
131 representation of the delays during initcalls - but the raw
132 /debug/tracing/trace text output is readable too.
134 ( Note that tracing self tests can't be enabled if this tracer is
135 selected, because the self-tests are an initcall as well and that
136 would invalidate the boot trace. )
139 bool "Trace max stack"
140 depends on HAVE_FUNCTION_TRACER
141 depends on DEBUG_KERNEL
142 select FUNCTION_TRACER
145 This special tracer records the maximum stack footprint of the
146 kernel and displays it in debugfs/tracing/stack_trace.
148 This tracer works by hooking into every function call that the
149 kernel executes, and keeping a maximum stack depth value and
150 stack-trace saved. Because this logic has to execute in every
151 kernel function, all the time, this option can slow down the
152 kernel measurably and is generally intended for kernel
157 config DYNAMIC_FTRACE
158 bool "enable/disable ftrace tracepoints dynamically"
159 depends on FUNCTION_TRACER
160 depends on HAVE_DYNAMIC_FTRACE
161 depends on DEBUG_KERNEL
164 This option will modify all the calls to ftrace dynamically
165 (will patch them out of the binary image and replaces them
166 with a No-Op instruction) as they are called. A table is
167 created to dynamically enable them again.
169 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise
170 has native performance as long as no tracing is active.
172 The changes to the code are done by a kernel thread that
173 wakes up once a second and checks to see if any ftrace calls
174 were made. If so, it runs stop_machine (stops all CPUS)
175 and modifies the code to jump over the call to ftrace.
177 config FTRACE_MCOUNT_RECORD
179 depends on DYNAMIC_FTRACE
180 depends on HAVE_FTRACE_MCOUNT_RECORD
182 config FTRACE_SELFTEST
185 config FTRACE_STARTUP_TEST
186 bool "Perform a startup test on ftrace"
187 depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER
188 select FTRACE_SELFTEST
190 This option performs a series of startup tests on ftrace. On bootup
191 a series of tests are made to verify that the tracer is
192 functioning properly. It will do tests on all the configured