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*15e6cb36SFrederic Weisbeckerconfig HAVE_FUNCTION_RET_TRACER 13*15e6cb36SFrederic Weisbecker bool 14*15e6cb36SFrederic Weisbecker 1560a7ecf4SSteven Rostedtconfig HAVE_FUNCTION_TRACE_MCOUNT_TEST 1660a7ecf4SSteven Rostedt bool 1760a7ecf4SSteven Rostedt help 1860a7ecf4SSteven Rostedt This gets selected when the arch tests the function_trace_stop 1960a7ecf4SSteven Rostedt variable at the mcount call site. Otherwise, this variable 2060a7ecf4SSteven Rostedt is tested by the called function. 2160a7ecf4SSteven Rostedt 22677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 23677aa9f7SSteven Rostedt bool 24677aa9f7SSteven Rostedt 258da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD 268da3821bSSteven Rostedt bool 278da3821bSSteven Rostedt 28352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 29352ad25aSSteven Rostedt bool 30352ad25aSSteven Rostedt 317a8e76a3SSteven Rostedtconfig RING_BUFFER 327a8e76a3SSteven Rostedt bool 337a8e76a3SSteven Rostedt 34bc0c38d1SSteven Rostedtconfig TRACING 35bc0c38d1SSteven Rostedt bool 36bc0c38d1SSteven Rostedt select DEBUG_FS 377a8e76a3SSteven Rostedt select RING_BUFFER 38c2c80529SAl Viro select STACKTRACE if STACKTRACE_SUPPORT 395f87f112SIngo Molnar select TRACEPOINTS 40f3384b28SSteven Rostedt select NOP_TRACER 41bc0c38d1SSteven Rostedt 4217d80fd0SPeter Zijlstramenu "Tracers" 4317d80fd0SPeter Zijlstra 44606576ceSSteven Rostedtconfig FUNCTION_TRACER 451b29b018SSteven Rostedt bool "Kernel Function Tracer" 46606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 47d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 481b29b018SSteven Rostedt select FRAME_POINTER 491b29b018SSteven Rostedt select TRACING 5035e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 511b29b018SSteven Rostedt help 521b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 531b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 541b29b018SSteven Rostedt instruction to the beginning of every kernel function, which NOP 551b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 561b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 571b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 581b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 5935e8e302SSteven Rostedt 60*15e6cb36SFrederic Weisbeckerconfig FUNCTION_RET_TRACER 61*15e6cb36SFrederic Weisbecker bool "Kernel Function return Tracer" 62*15e6cb36SFrederic Weisbecker depends on !DYNAMIC_FTRACE 63*15e6cb36SFrederic Weisbecker depends on HAVE_FUNCTION_RET_TRACER 64*15e6cb36SFrederic Weisbecker depends on FUNCTION_TRACER 65*15e6cb36SFrederic Weisbecker help 66*15e6cb36SFrederic Weisbecker Enable the kernel to trace a function at its return. 67*15e6cb36SFrederic Weisbecker It's first purpose is to trace the duration of functions. 68*15e6cb36SFrederic Weisbecker This is done by setting the current return address on the thread 69*15e6cb36SFrederic Weisbecker info structure of the current task. 70*15e6cb36SFrederic Weisbecker 7181d68a96SSteven Rostedtconfig IRQSOFF_TRACER 7281d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 7381d68a96SSteven Rostedt default n 7481d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 7581d68a96SSteven Rostedt depends on GENERIC_TIME 76d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 7781d68a96SSteven Rostedt select TRACE_IRQFLAGS 7881d68a96SSteven Rostedt select TRACING 7981d68a96SSteven Rostedt select TRACER_MAX_TRACE 8081d68a96SSteven Rostedt help 8181d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 8281d68a96SSteven Rostedt sections, with microsecond accuracy. 8381d68a96SSteven Rostedt 8481d68a96SSteven Rostedt The default measurement method is a maximum search, which is 8581d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 8681d68a96SSteven Rostedt via: 8781d68a96SSteven Rostedt 8881d68a96SSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 8981d68a96SSteven Rostedt 906cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 916cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 926cd8a4bbSSteven Rostedt used together or separately.) 936cd8a4bbSSteven Rostedt 946cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 956cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 966cd8a4bbSSteven Rostedt default n 976cd8a4bbSSteven Rostedt depends on GENERIC_TIME 986cd8a4bbSSteven Rostedt depends on PREEMPT 99d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 1006cd8a4bbSSteven Rostedt select TRACING 1016cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 1026cd8a4bbSSteven Rostedt help 1036cd8a4bbSSteven Rostedt This option measures the time spent in preemption off critical 1046cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 1056cd8a4bbSSteven Rostedt 1066cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 1076cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 1086cd8a4bbSSteven Rostedt via: 1096cd8a4bbSSteven Rostedt 1106cd8a4bbSSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 1116cd8a4bbSSteven Rostedt 1126cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 1136cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 1146cd8a4bbSSteven Rostedt used together or separately.) 1156cd8a4bbSSteven Rostedt 116f06c3810SIngo Molnarconfig SYSPROF_TRACER 117f06c3810SIngo Molnar bool "Sysprof Tracer" 1184d2df795SThomas Gleixner depends on X86 119f06c3810SIngo Molnar select TRACING 120f06c3810SIngo Molnar help 121f06c3810SIngo Molnar This tracer provides the trace needed by the 'Sysprof' userspace 122f06c3810SIngo Molnar tool. 123f06c3810SIngo Molnar 124352ad25aSSteven Rostedtconfig SCHED_TRACER 125352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 126d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 127352ad25aSSteven Rostedt select TRACING 128352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 129352ad25aSSteven Rostedt select TRACER_MAX_TRACE 130352ad25aSSteven Rostedt help 131352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 132352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 133352ad25aSSteven Rostedt 13435e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER 13535e8e302SSteven Rostedt bool "Trace process context switches" 136d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 13735e8e302SSteven Rostedt select TRACING 13835e8e302SSteven Rostedt select MARKERS 13935e8e302SSteven Rostedt help 14035e8e302SSteven Rostedt This tracer gets called from the context switch and records 14135e8e302SSteven Rostedt all switching of tasks. 14235e8e302SSteven Rostedt 1431f5c2abbSFrédéric Weisbeckerconfig BOOT_TRACER 1441f5c2abbSFrédéric Weisbecker bool "Trace boot initcalls" 1451f5c2abbSFrédéric Weisbecker depends on DEBUG_KERNEL 1461f5c2abbSFrédéric Weisbecker select TRACING 147ea31e72dSFrederic Weisbecker select CONTEXT_SWITCH_TRACER 1481f5c2abbSFrédéric Weisbecker help 1491f5c2abbSFrédéric Weisbecker This tracer helps developers to optimize boot times: it records 15098d9c66aSIngo Molnar the timings of the initcalls and traces key events and the identity 15198d9c66aSIngo Molnar of tasks that can cause boot delays, such as context-switches. 15298d9c66aSIngo Molnar 15398d9c66aSIngo Molnar Its aim is to be parsed by the /scripts/bootgraph.pl tool to 15498d9c66aSIngo Molnar produce pretty graphics about boot inefficiencies, giving a visual 15598d9c66aSIngo Molnar representation of the delays during initcalls - but the raw 15698d9c66aSIngo Molnar /debug/tracing/trace text output is readable too. 15798d9c66aSIngo Molnar 15898d9c66aSIngo Molnar ( Note that tracing self tests can't be enabled if this tracer is 15998d9c66aSIngo Molnar selected, because the self-tests are an initcall as well and that 16098d9c66aSIngo Molnar would invalidate the boot trace. ) 1611f5c2abbSFrédéric Weisbecker 162e5a81b62SSteven Rostedtconfig STACK_TRACER 163e5a81b62SSteven Rostedt bool "Trace max stack" 164606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 1652ff01c6aSIngo Molnar depends on DEBUG_KERNEL 166606576ceSSteven Rostedt select FUNCTION_TRACER 167e5a81b62SSteven Rostedt select STACKTRACE 168e5a81b62SSteven Rostedt help 1694519d9e5SIngo Molnar This special tracer records the maximum stack footprint of the 1704519d9e5SIngo Molnar kernel and displays it in debugfs/tracing/stack_trace. 1714519d9e5SIngo Molnar 1724519d9e5SIngo Molnar This tracer works by hooking into every function call that the 1734519d9e5SIngo Molnar kernel executes, and keeping a maximum stack depth value and 1744519d9e5SIngo Molnar stack-trace saved. Because this logic has to execute in every 1754519d9e5SIngo Molnar kernel function, all the time, this option can slow down the 1764519d9e5SIngo Molnar kernel measurably and is generally intended for kernel 1774519d9e5SIngo Molnar developers only. 1784519d9e5SIngo Molnar 1794519d9e5SIngo Molnar Say N if unsure. 180e5a81b62SSteven Rostedt 1813d083395SSteven Rostedtconfig DYNAMIC_FTRACE 1823d083395SSteven Rostedt bool "enable/disable ftrace tracepoints dynamically" 183606576ceSSteven Rostedt depends on FUNCTION_TRACER 184677aa9f7SSteven Rostedt depends on HAVE_DYNAMIC_FTRACE 185d3ee6d99SIngo Molnar depends on DEBUG_KERNEL 1863d083395SSteven Rostedt default y 1873d083395SSteven Rostedt help 1883d083395SSteven Rostedt This option will modify all the calls to ftrace dynamically 1893d083395SSteven Rostedt (will patch them out of the binary image and replaces them 1903d083395SSteven Rostedt with a No-Op instruction) as they are called. A table is 1913d083395SSteven Rostedt created to dynamically enable them again. 1923d083395SSteven Rostedt 193606576ceSSteven Rostedt This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise 1943d083395SSteven Rostedt has native performance as long as no tracing is active. 1953d083395SSteven Rostedt 1963d083395SSteven Rostedt The changes to the code are done by a kernel thread that 1973d083395SSteven Rostedt wakes up once a second and checks to see if any ftrace calls 1983d083395SSteven Rostedt were made. If so, it runs stop_machine (stops all CPUS) 1993d083395SSteven Rostedt and modifies the code to jump over the call to ftrace. 20060a11774SSteven Rostedt 2018da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD 2028da3821bSSteven Rostedt def_bool y 2038da3821bSSteven Rostedt depends on DYNAMIC_FTRACE 2048da3821bSSteven Rostedt depends on HAVE_FTRACE_MCOUNT_RECORD 2058da3821bSSteven Rostedt 20660a11774SSteven Rostedtconfig FTRACE_SELFTEST 20760a11774SSteven Rostedt bool 20860a11774SSteven Rostedt 20960a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST 21060a11774SSteven Rostedt bool "Perform a startup test on ftrace" 2113ce2b920SFrédéric Weisbecker depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER 21260a11774SSteven Rostedt select FTRACE_SELFTEST 21360a11774SSteven Rostedt help 21460a11774SSteven Rostedt This option performs a series of startup tests on ftrace. On bootup 21560a11774SSteven Rostedt a series of tests are made to verify that the tracer is 21660a11774SSteven Rostedt functioning properly. It will do tests on all the configured 21760a11774SSteven Rostedt tracers of ftrace. 21817d80fd0SPeter Zijlstra 21917d80fd0SPeter Zijlstraendmenu 220