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 112a3a4f66SFrédéric Weisbecker select NOP_TRACER 12bc0c38d1SSteven Rostedt 13677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 14677aa9f7SSteven Rostedt bool 15677aa9f7SSteven Rostedt 168da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD 178da3821bSSteven Rostedt bool 188da3821bSSteven Rostedt 19352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 20352ad25aSSteven Rostedt bool 21352ad25aSSteven Rostedt 227a8e76a3SSteven Rostedtconfig RING_BUFFER 237a8e76a3SSteven Rostedt bool 247a8e76a3SSteven Rostedt 25bc0c38d1SSteven Rostedtconfig TRACING 26bc0c38d1SSteven Rostedt bool 27bc0c38d1SSteven Rostedt select DEBUG_FS 287a8e76a3SSteven Rostedt select RING_BUFFER 2986387f7eSIngo Molnar select STACKTRACE 305f87f112SIngo Molnar select TRACEPOINTS 31bc0c38d1SSteven Rostedt 32*17d80fd0SPeter Zijlstramenu "Tracers" 33*17d80fd0SPeter Zijlstra 34606576ceSSteven Rostedtconfig FUNCTION_TRACER 351b29b018SSteven Rostedt bool "Kernel Function Tracer" 36606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 37d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 381b29b018SSteven Rostedt select FRAME_POINTER 391b29b018SSteven Rostedt select TRACING 4035e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 411b29b018SSteven Rostedt help 421b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 431b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 441b29b018SSteven Rostedt instruction to the beginning of every kernel function, which NOP 451b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 461b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 471b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 481b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 4935e8e302SSteven Rostedt 5081d68a96SSteven Rostedtconfig IRQSOFF_TRACER 5181d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 5281d68a96SSteven Rostedt default n 5381d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 5481d68a96SSteven Rostedt depends on GENERIC_TIME 55d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 5681d68a96SSteven Rostedt select TRACE_IRQFLAGS 5781d68a96SSteven Rostedt select TRACING 5881d68a96SSteven Rostedt select TRACER_MAX_TRACE 5981d68a96SSteven Rostedt help 6081d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 6181d68a96SSteven Rostedt sections, with microsecond accuracy. 6281d68a96SSteven Rostedt 6381d68a96SSteven Rostedt The default measurement method is a maximum search, which is 6481d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 6581d68a96SSteven Rostedt via: 6681d68a96SSteven Rostedt 6781d68a96SSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 6881d68a96SSteven Rostedt 696cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 706cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 716cd8a4bbSSteven Rostedt used together or separately.) 726cd8a4bbSSteven Rostedt 736cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 746cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 756cd8a4bbSSteven Rostedt default n 766cd8a4bbSSteven Rostedt depends on GENERIC_TIME 776cd8a4bbSSteven Rostedt depends on PREEMPT 78d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 796cd8a4bbSSteven Rostedt select TRACING 806cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 816cd8a4bbSSteven Rostedt help 826cd8a4bbSSteven Rostedt This option measures the time spent in preemption off critical 836cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 846cd8a4bbSSteven Rostedt 856cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 866cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 876cd8a4bbSSteven Rostedt via: 886cd8a4bbSSteven Rostedt 896cd8a4bbSSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 906cd8a4bbSSteven Rostedt 916cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 926cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 936cd8a4bbSSteven Rostedt used together or separately.) 946cd8a4bbSSteven Rostedt 95f06c3810SIngo Molnarconfig SYSPROF_TRACER 96f06c3810SIngo Molnar bool "Sysprof Tracer" 974d2df795SThomas Gleixner depends on X86 98f06c3810SIngo Molnar select TRACING 99f06c3810SIngo Molnar help 100f06c3810SIngo Molnar This tracer provides the trace needed by the 'Sysprof' userspace 101f06c3810SIngo Molnar tool. 102f06c3810SIngo Molnar 103352ad25aSSteven Rostedtconfig SCHED_TRACER 104352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 105d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 106352ad25aSSteven Rostedt select TRACING 107352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 108352ad25aSSteven Rostedt select TRACER_MAX_TRACE 109352ad25aSSteven Rostedt help 110352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 111352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 112352ad25aSSteven Rostedt 11335e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER 11435e8e302SSteven Rostedt bool "Trace process context switches" 115d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 11635e8e302SSteven Rostedt select TRACING 11735e8e302SSteven Rostedt select MARKERS 11835e8e302SSteven Rostedt help 11935e8e302SSteven Rostedt This tracer gets called from the context switch and records 12035e8e302SSteven Rostedt all switching of tasks. 12135e8e302SSteven Rostedt 1221f5c2abbSFrédéric Weisbeckerconfig BOOT_TRACER 1231f5c2abbSFrédéric Weisbecker bool "Trace boot initcalls" 1241f5c2abbSFrédéric Weisbecker depends on DEBUG_KERNEL 1251f5c2abbSFrédéric Weisbecker select TRACING 1261f5c2abbSFrédéric Weisbecker help 1271f5c2abbSFrédéric Weisbecker This tracer helps developers to optimize boot times: it records 12898d9c66aSIngo Molnar the timings of the initcalls and traces key events and the identity 12998d9c66aSIngo Molnar of tasks that can cause boot delays, such as context-switches. 13098d9c66aSIngo Molnar 13198d9c66aSIngo Molnar Its aim is to be parsed by the /scripts/bootgraph.pl tool to 13298d9c66aSIngo Molnar produce pretty graphics about boot inefficiencies, giving a visual 13398d9c66aSIngo Molnar representation of the delays during initcalls - but the raw 13498d9c66aSIngo Molnar /debug/tracing/trace text output is readable too. 13598d9c66aSIngo Molnar 13698d9c66aSIngo Molnar ( Note that tracing self tests can't be enabled if this tracer is 13798d9c66aSIngo Molnar selected, because the self-tests are an initcall as well and that 13898d9c66aSIngo Molnar would invalidate the boot trace. ) 1391f5c2abbSFrédéric Weisbecker 140e5a81b62SSteven Rostedtconfig STACK_TRACER 141e5a81b62SSteven Rostedt bool "Trace max stack" 142606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 1432ff01c6aSIngo Molnar depends on DEBUG_KERNEL 144606576ceSSteven Rostedt select FUNCTION_TRACER 145e5a81b62SSteven Rostedt select STACKTRACE 146e5a81b62SSteven Rostedt help 1474519d9e5SIngo Molnar This special tracer records the maximum stack footprint of the 1484519d9e5SIngo Molnar kernel and displays it in debugfs/tracing/stack_trace. 1494519d9e5SIngo Molnar 1504519d9e5SIngo Molnar This tracer works by hooking into every function call that the 1514519d9e5SIngo Molnar kernel executes, and keeping a maximum stack depth value and 1524519d9e5SIngo Molnar stack-trace saved. Because this logic has to execute in every 1534519d9e5SIngo Molnar kernel function, all the time, this option can slow down the 1544519d9e5SIngo Molnar kernel measurably and is generally intended for kernel 1554519d9e5SIngo Molnar developers only. 1564519d9e5SIngo Molnar 1574519d9e5SIngo Molnar Say N if unsure. 158e5a81b62SSteven Rostedt 1593d083395SSteven Rostedtconfig DYNAMIC_FTRACE 1603d083395SSteven Rostedt bool "enable/disable ftrace tracepoints dynamically" 161606576ceSSteven Rostedt depends on FUNCTION_TRACER 162677aa9f7SSteven Rostedt depends on HAVE_DYNAMIC_FTRACE 163d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 1643d083395SSteven Rostedt default y 1653d083395SSteven Rostedt help 1663d083395SSteven Rostedt This option will modify all the calls to ftrace dynamically 1673d083395SSteven Rostedt (will patch them out of the binary image and replaces them 1683d083395SSteven Rostedt with a No-Op instruction) as they are called. A table is 1693d083395SSteven Rostedt created to dynamically enable them again. 1703d083395SSteven Rostedt 171606576ceSSteven Rostedt This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise 1723d083395SSteven Rostedt has native performance as long as no tracing is active. 1733d083395SSteven Rostedt 1743d083395SSteven Rostedt The changes to the code are done by a kernel thread that 1753d083395SSteven Rostedt wakes up once a second and checks to see if any ftrace calls 1763d083395SSteven Rostedt were made. If so, it runs stop_machine (stops all CPUS) 1773d083395SSteven Rostedt and modifies the code to jump over the call to ftrace. 17860a11774SSteven Rostedt 1798da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD 1808da3821bSSteven Rostedt def_bool y 1818da3821bSSteven Rostedt depends on DYNAMIC_FTRACE 1828da3821bSSteven Rostedt depends on HAVE_FTRACE_MCOUNT_RECORD 1838da3821bSSteven Rostedt 18460a11774SSteven Rostedtconfig FTRACE_SELFTEST 18560a11774SSteven Rostedt bool 18660a11774SSteven Rostedt 18760a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST 18860a11774SSteven Rostedt bool "Perform a startup test on ftrace" 1893ce2b920SFrédéric Weisbecker depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER 19060a11774SSteven Rostedt select FTRACE_SELFTEST 19160a11774SSteven Rostedt help 19260a11774SSteven Rostedt This option performs a series of startup tests on ftrace. On bootup 19360a11774SSteven Rostedt a series of tests are made to verify that the tracer is 19460a11774SSteven Rostedt functioning properly. It will do tests on all the configured 19560a11774SSteven Rostedt tracers of ftrace. 196*17d80fd0SPeter Zijlstra 197*17d80fd0SPeter Zijlstraendmenu 198