2 # Architectures that offer an FUNCTION_TRACER implementation should
3 # select HAVE_FUNCTION_TRACER:
6 config USER_STACKTRACE_SUPPORT
12 config HAVE_FTRACE_NMI_ENTER
15 See Documentation/trace/ftrace-design.txt
17 config HAVE_FUNCTION_TRACER
20 See Documentation/trace/ftrace-design.txt
22 config HAVE_FUNCTION_GRAPH_TRACER
25 See Documentation/trace/ftrace-design.txt
27 config HAVE_FUNCTION_GRAPH_FP_TEST
30 See Documentation/trace/ftrace-design.txt
32 config HAVE_FUNCTION_TRACE_MCOUNT_TEST
35 See Documentation/trace/ftrace-design.txt
37 config HAVE_DYNAMIC_FTRACE
40 See Documentation/trace/ftrace-design.txt
42 config HAVE_DYNAMIC_FTRACE_WITH_REGS
45 config HAVE_FTRACE_MCOUNT_RECORD
48 See Documentation/trace/ftrace-design.txt
50 config HAVE_SYSCALL_TRACEPOINTS
53 See Documentation/trace/ftrace-design.txt
58 Arch supports the gcc options -pg with -mfentry
60 config HAVE_C_RECORDMCOUNT
63 C version of recordmcount available?
65 config TRACER_MAX_TRACE
76 config FTRACE_NMI_ENTER
78 depends on HAVE_FTRACE_NMI_ENTER
82 select CONTEXT_SWITCH_TRACER
85 config GPU_TRACEPOINTS
88 config CONTEXT_SWITCH_TRACER
91 config RING_BUFFER_ALLOW_SWAP
94 Allow the use of ring_buffer_swap_cpu.
95 Adds a very slight overhead to tracing when enabled.
97 # All tracer options should select GENERIC_TRACER. For those options that are
98 # enabled by all tracers (context switch and event tracer) they select TRACING.
99 # This allows those options to appear when no other tracer is selected. But the
100 # options do not appear when something else selects it. We need the two options
101 # GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
102 # hiding of the automatic options.
108 select STACKTRACE if STACKTRACE_SUPPORT
115 config GENERIC_TRACER
120 # Minimum requirements an architecture has to meet for us to
121 # be able to offer generic tracing facilities:
123 config TRACING_SUPPORT
125 # PPC32 has no irqflags tracing support, but it can use most of the
126 # tracers anyway, they were tested to build and work. Note that new
127 # exceptions to this list aren't welcomed, better implement the
128 # irqflags tracing for your architecture.
129 depends on TRACE_IRQFLAGS_SUPPORT || PPC32
130 depends on STACKTRACE_SUPPORT
137 default y if DEBUG_KERNEL
139 Enable the kernel tracing infrastructure.
143 config FUNCTION_TRACER
144 bool "Kernel Function Tracer"
145 depends on HAVE_FUNCTION_TRACER
147 select GENERIC_TRACER
148 select CONTEXT_SWITCH_TRACER
150 Enable the kernel to trace every kernel function. This is done
151 by using a compiler feature to insert a small, 5-byte No-Operation
152 instruction at the beginning of every kernel function, which NOP
153 sequence is then dynamically patched into a tracer call when
154 tracing is enabled by the administrator. If it's runtime disabled
155 (the bootup default), then the overhead of the instructions is very
156 small and not measurable even in micro-benchmarks.
158 config FUNCTION_GRAPH_TRACER
159 bool "Kernel Function Graph Tracer"
160 depends on HAVE_FUNCTION_GRAPH_TRACER
161 depends on FUNCTION_TRACER
162 depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
165 Enable the kernel to trace a function at both its return
167 Its first purpose is to trace the duration of functions and
168 draw a call graph for each thread with some information like
169 the return value. This is done by setting the current return
170 address on the current task structure into a stack of calls.
173 config IRQSOFF_TRACER
174 bool "Interrupts-off Latency Tracer"
176 depends on TRACE_IRQFLAGS_SUPPORT
177 depends on !ARCH_USES_GETTIMEOFFSET
178 select TRACE_IRQFLAGS
179 select GENERIC_TRACER
180 select TRACER_MAX_TRACE
181 select RING_BUFFER_ALLOW_SWAP
182 select TRACER_SNAPSHOT
183 select TRACER_SNAPSHOT_PER_CPU_SWAP
185 This option measures the time spent in irqs-off critical
186 sections, with microsecond accuracy.
188 The default measurement method is a maximum search, which is
189 disabled by default and can be runtime (re-)started
192 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
194 (Note that kernel size and overhead increase with this option
195 enabled. This option and the preempt-off timing option can be
196 used together or separately.)
198 config PREEMPT_TRACER
199 bool "Preemption-off Latency Tracer"
201 depends on !ARCH_USES_GETTIMEOFFSET
203 select GENERIC_TRACER
204 select TRACER_MAX_TRACE
205 select RING_BUFFER_ALLOW_SWAP
206 select TRACER_SNAPSHOT
207 select TRACER_SNAPSHOT_PER_CPU_SWAP
209 This option measures the time spent in preemption-off critical
210 sections, with microsecond accuracy.
212 The default measurement method is a maximum search, which is
213 disabled by default and can be runtime (re-)started
216 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
218 (Note that kernel size and overhead increase with this option
219 enabled. This option and the irqs-off timing option can be
220 used together or separately.)
223 bool "Scheduling Latency Tracer"
224 select GENERIC_TRACER
225 select CONTEXT_SWITCH_TRACER
226 select TRACER_MAX_TRACE
227 select TRACER_SNAPSHOT
229 This tracer tracks the latency of the highest priority task
230 to be scheduled in, starting from the point it has woken up.
232 config ENABLE_DEFAULT_TRACERS
233 bool "Trace process context switches and events"
234 depends on !GENERIC_TRACER
237 This tracer hooks to various trace points in the kernel,
238 allowing the user to pick and choose which trace point they
239 want to trace. It also includes the sched_switch tracer plugin.
241 config FTRACE_SYSCALLS
242 bool "Trace syscalls"
243 depends on HAVE_SYSCALL_TRACEPOINTS
244 select GENERIC_TRACER
247 Basic tracer to catch the syscall entry and exit events.
249 config TRACER_SNAPSHOT
250 bool "Create a snapshot trace buffer"
251 select TRACER_MAX_TRACE
253 Allow tracing users to take snapshot of the current buffer using the
254 ftrace interface, e.g.:
256 echo 1 > /sys/kernel/debug/tracing/snapshot
259 config TRACER_SNAPSHOT_PER_CPU_SWAP
260 bool "Allow snapshot to swap per CPU"
261 depends on TRACER_SNAPSHOT
262 select RING_BUFFER_ALLOW_SWAP
264 Allow doing a snapshot of a single CPU buffer instead of a
265 full swap (all buffers). If this is set, then the following is
268 echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
270 After which, only the tracing buffer for CPU 2 was swapped with
271 the main tracing buffer, and the other CPU buffers remain the same.
273 When this is enabled, this adds a little more overhead to the
274 trace recording, as it needs to add some checks to synchronize
275 recording with swaps. But this does not affect the performance
276 of the overall system. This is enabled by default when the preempt
277 or irq latency tracers are enabled, as those need to swap as well
278 and already adds the overhead (plus a lot more).
280 config TRACE_BRANCH_PROFILING
282 select GENERIC_TRACER
285 prompt "Branch Profiling"
286 default BRANCH_PROFILE_NONE
288 The branch profiling is a software profiler. It will add hooks
289 into the C conditionals to test which path a branch takes.
291 The likely/unlikely profiler only looks at the conditions that
292 are annotated with a likely or unlikely macro.
294 The "all branch" profiler will profile every if-statement in the
295 kernel. This profiler will also enable the likely/unlikely
298 Either of the above profilers adds a bit of overhead to the system.
299 If unsure, choose "No branch profiling".
301 config BRANCH_PROFILE_NONE
302 bool "No branch profiling"
304 No branch profiling. Branch profiling adds a bit of overhead.
305 Only enable it if you want to analyse the branching behavior.
306 Otherwise keep it disabled.
308 config PROFILE_ANNOTATED_BRANCHES
309 bool "Trace likely/unlikely profiler"
310 select TRACE_BRANCH_PROFILING
312 This tracer profiles all likely and unlikely macros
313 in the kernel. It will display the results in:
315 /sys/kernel/debug/tracing/trace_stat/branch_annotated
317 Note: this will add a significant overhead; only turn this
318 on if you need to profile the system's use of these macros.
320 config PROFILE_ALL_BRANCHES
321 bool "Profile all if conditionals"
322 select TRACE_BRANCH_PROFILING
324 This tracer profiles all branch conditions. Every if ()
325 taken in the kernel is recorded whether it hit or miss.
326 The results will be displayed in:
328 /sys/kernel/debug/tracing/trace_stat/branch_all
330 This option also enables the likely/unlikely profiler.
332 This configuration, when enabled, will impose a great overhead
333 on the system. This should only be enabled when the system
334 is to be analyzed in much detail.
337 config TRACING_BRANCHES
340 Selected by tracers that will trace the likely and unlikely
341 conditions. This prevents the tracers themselves from being
342 profiled. Profiling the tracing infrastructure can only happen
343 when the likelys and unlikelys are not being traced.
346 bool "Trace likely/unlikely instances"
347 depends on TRACE_BRANCH_PROFILING
348 select TRACING_BRANCHES
350 This traces the events of likely and unlikely condition
351 calls in the kernel. The difference between this and the
352 "Trace likely/unlikely profiler" is that this is not a
353 histogram of the callers, but actually places the calling
354 events into a running trace buffer to see when and where the
355 events happened, as well as their results.
360 bool "Trace max stack"
361 depends on HAVE_FUNCTION_TRACER
362 select FUNCTION_TRACER
366 This special tracer records the maximum stack footprint of the
367 kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
369 This tracer works by hooking into every function call that the
370 kernel executes, and keeping a maximum stack depth value and
371 stack-trace saved. If this is configured with DYNAMIC_FTRACE
372 then it will not have any overhead while the stack tracer
375 To enable the stack tracer on bootup, pass in 'stacktrace'
376 on the kernel command line.
378 The stack tracer can also be enabled or disabled via the
379 sysctl kernel.stack_tracer_enabled
383 config BLK_DEV_IO_TRACE
384 bool "Support for tracing block IO actions"
390 select GENERIC_TRACER
393 Say Y here if you want to be able to trace the block layer actions
394 on a given queue. Tracing allows you to see any traffic happening
395 on a block device queue. For more information (and the userspace
396 support tools needed), fetch the blktrace tools from:
398 git://git.kernel.dk/blktrace.git
400 Tracing also is possible using the ftrace interface, e.g.:
402 echo 1 > /sys/block/sda/sda1/trace/enable
403 echo blk > /sys/kernel/debug/tracing/current_tracer
404 cat /sys/kernel/debug/tracing/trace_pipe
410 depends on HAVE_REGS_AND_STACK_ACCESS_API
411 bool "Enable kprobes-based dynamic events"
416 This allows the user to add tracing events (similar to tracepoints)
417 on the fly via the ftrace interface. See
418 Documentation/trace/kprobetrace.txt for more details.
420 Those events can be inserted wherever kprobes can probe, and record
421 various register and memory values.
423 This option is also required by perf-probe subcommand of perf tools.
424 If you want to use perf tools, this option is strongly recommended.
427 bool "Enable uprobes-based dynamic events"
428 depends on ARCH_SUPPORTS_UPROBES
435 This allows the user to add tracing events on top of userspace
436 dynamic events (similar to tracepoints) on the fly via the trace
437 events interface. Those events can be inserted wherever uprobes
438 can probe, and record various registers.
439 This option is required if you plan to use perf-probe subcommand
440 of perf tools on user space applications.
445 config DYNAMIC_FTRACE
446 bool "enable/disable function tracing dynamically"
447 depends on FUNCTION_TRACER
448 depends on HAVE_DYNAMIC_FTRACE
451 This option will modify all the calls to function tracing
452 dynamically (will patch them out of the binary image and
453 replace them with a No-Op instruction) on boot up. During
454 compile time, a table is made of all the locations that ftrace
455 can function trace, and this table is linked into the kernel
456 image. When this is enabled, functions can be individually
457 enabled, and the functions not enabled will not affect
458 performance of the system.
460 See the files in /sys/kernel/debug/tracing:
461 available_filter_functions
465 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
466 otherwise has native performance as long as no tracing is active.
468 config DYNAMIC_FTRACE_WITH_REGS
470 depends on DYNAMIC_FTRACE
471 depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
473 config FUNCTION_PROFILER
474 bool "Kernel function profiler"
475 depends on FUNCTION_TRACER
478 This option enables the kernel function profiler. A file is created
479 in debugfs called function_profile_enabled which defaults to zero.
480 When a 1 is echoed into this file profiling begins, and when a
481 zero is entered, profiling stops. A "functions" file is created in
482 the trace_stats directory; this file shows the list of functions that
483 have been hit and their counters.
487 config FTRACE_MCOUNT_RECORD
489 depends on DYNAMIC_FTRACE
490 depends on HAVE_FTRACE_MCOUNT_RECORD
492 config FTRACE_SELFTEST
495 config FTRACE_STARTUP_TEST
496 bool "Perform a startup test on ftrace"
497 depends on GENERIC_TRACER
498 select FTRACE_SELFTEST
500 This option performs a series of startup tests on ftrace. On bootup
501 a series of tests are made to verify that the tracer is
502 functioning properly. It will do tests on all the configured
505 config EVENT_TRACE_TEST_SYSCALLS
506 bool "Run selftest on syscall events"
507 depends on FTRACE_STARTUP_TEST
509 This option will also enable testing every syscall event.
510 It only enables the event and disables it and runs various loads
511 with the event enabled. This adds a bit more time for kernel boot
512 up since it runs this on every system call defined.
514 TBD - enable a way to actually call the syscalls as we test their
518 bool "Memory mapped IO tracing"
519 depends on HAVE_MMIOTRACE_SUPPORT && PCI
520 select GENERIC_TRACER
522 Mmiotrace traces Memory Mapped I/O access and is meant for
523 debugging and reverse engineering. It is called from the ioremap
524 implementation and works via page faults. Tracing is disabled by
525 default and can be enabled at run-time.
527 See Documentation/trace/mmiotrace.txt.
528 If you are not helping to develop drivers, say N.
530 config MMIOTRACE_TEST
531 tristate "Test module for mmiotrace"
532 depends on MMIOTRACE && m
534 This is a dumb module for testing mmiotrace. It is very dangerous
535 as it will write garbage to IO memory starting at a given address.
536 However, it should be safe to use on e.g. unused portion of VRAM.
538 Say N, unless you absolutely know what you are doing.
540 config RING_BUFFER_BENCHMARK
541 tristate "Ring buffer benchmark stress tester"
542 depends on RING_BUFFER
544 This option creates a test to stress the ring buffer and benchmark it.
545 It creates its own ring buffer such that it will not interfere with
546 any other users of the ring buffer (such as ftrace). It then creates
547 a producer and consumer that will run for 10 seconds and sleep for
548 10 seconds. Each interval it will print out the number of events
549 it recorded and give a rough estimate of how long each iteration took.
551 It does not disable interrupts or raise its priority, so it may be
552 affected by processes that are running.
556 config RING_BUFFER_STARTUP_TEST
557 bool "Ring buffer startup self test"
558 depends on RING_BUFFER
560 Run a simple self test on the ring buffer on boot up. Late in the
561 kernel boot sequence, the test will start that kicks off
562 a thread per cpu. Each thread will write various size events
563 into the ring buffer. Another thread is created to send IPIs
564 to each of the threads, where the IPI handler will also write
565 to the ring buffer, to test/stress the nesting ability.
566 If any anomalies are discovered, a warning will be displayed
567 and all ring buffers will be disabled.
569 The test runs for 10 seconds. This will slow your boot time
570 by at least 10 more seconds.
572 At the end of the test, statics and more checks are done.
573 It will output the stats of each per cpu buffer. What
574 was written, the sizes, what was read, what was lost, and
575 other similar details.
581 endif # TRACING_SUPPORT