1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 216444a8aSArnaldo Carvalho de Melo# 3606576ceSSteven Rostedt# Architectures that offer an FUNCTION_TRACER implementation should 4606576ceSSteven Rostedt# select HAVE_FUNCTION_TRACER: 516444a8aSArnaldo Carvalho de Melo# 62a3a4f66SFrédéric Weisbecker 78d26487fSTörök Edwinconfig USER_STACKTRACE_SUPPORT 88d26487fSTörök Edwin bool 98d26487fSTörök Edwin 102a3a4f66SFrédéric Weisbeckerconfig NOP_TRACER 112a3a4f66SFrédéric Weisbecker bool 122a3a4f66SFrédéric Weisbecker 1354ecbe6fSMasami Hiramatsuconfig HAVE_RETHOOK 1454ecbe6fSMasami Hiramatsu bool 1554ecbe6fSMasami Hiramatsu 1654ecbe6fSMasami Hiramatsuconfig RETHOOK 1754ecbe6fSMasami Hiramatsu bool 1854ecbe6fSMasami Hiramatsu depends on HAVE_RETHOOK 1954ecbe6fSMasami Hiramatsu help 2054ecbe6fSMasami Hiramatsu Enable generic return hooking feature. This is an internal 2154ecbe6fSMasami Hiramatsu API, which will be used by other function-entry hooking 2254ecbe6fSMasami Hiramatsu features like fprobe and kprobes. 2354ecbe6fSMasami Hiramatsu 24606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER 2516444a8aSArnaldo Carvalho de Melo bool 26555f386cSMike Frysinger help 275fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 28bc0c38d1SSteven Rostedt 29fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER 3015e6cb36SFrederic Weisbecker bool 31555f386cSMike Frysinger help 325fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 3315e6cb36SFrederic Weisbecker 34a3ed4157SMasami Hiramatsu (Google)config HAVE_FUNCTION_GRAPH_FREGS 35a1be9cccSDonglin Peng bool 36a1be9cccSDonglin Peng 37a762e926SMasami Hiramatsu (Google)config HAVE_FTRACE_GRAPH_FUNC 38a762e926SMasami Hiramatsu (Google) bool 39a762e926SMasami Hiramatsu (Google) help 40a762e926SMasami Hiramatsu (Google) True if ftrace_graph_func() is defined. 41a762e926SMasami Hiramatsu (Google) 42677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 43677aa9f7SSteven Rostedt bool 44555f386cSMike Frysinger help 455fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 46677aa9f7SSteven Rostedt 4706aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS 4806aeaaeaSMasami Hiramatsu bool 4906aeaaeaSMasami Hiramatsu 50763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 51763e34e7SSteven Rostedt (VMware) bool 52763e34e7SSteven Rostedt (VMware) 53cbad0fb2SMark Rutlandconfig HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS 54cbad0fb2SMark Rutland bool 55cbad0fb2SMark Rutland 569f0cb917SSteven Rostedtconfig HAVE_EXTRA_IPI_TRACEPOINTS 579f0cb917SSteven Rostedt bool 589f0cb917SSteven Rostedt help 599f0cb917SSteven Rostedt For architectures that use ipi_raise, ipi_entry and ipi_exit 609f0cb917SSteven Rostedt tracepoints. 619f0cb917SSteven Rostedt 6202a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS 6302a474caSSteven Rostedt (VMware) bool 6402a474caSSteven Rostedt (VMware) help 6502a474caSSteven Rostedt (VMware) If this is set, then arguments and stack can be found from 6694d095ffSMark Rutland the ftrace_regs passed into the function callback regs parameter 6702a474caSSteven Rostedt (VMware) by default, even without setting the REGS flag in the ftrace_ops. 6894d095ffSMark Rutland This allows for use of ftrace_regs_get_argument() and 6994d095ffSMark Rutland ftrace_regs_get_stack_pointer(). 7002a474caSSteven Rostedt (VMware) 71762abbc0SMasami Hiramatsu (Google)config HAVE_FTRACE_REGS_HAVING_PT_REGS 72762abbc0SMasami Hiramatsu (Google) bool 73762abbc0SMasami Hiramatsu (Google) help 74762abbc0SMasami Hiramatsu (Google) If this is set, ftrace_regs has pt_regs, thus it can convert to 75762abbc0SMasami Hiramatsu (Google) pt_regs without allocating memory. 76762abbc0SMasami Hiramatsu (Google) 779440155cSPeter Zijlstra (Intel)config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE 789440155cSPeter Zijlstra (Intel) bool 799440155cSPeter Zijlstra (Intel) help 809440155cSPeter Zijlstra (Intel) If the architecture generates __patchable_function_entries sections 819440155cSPeter Zijlstra (Intel) but does not want them included in the ftrace locations. 829440155cSPeter Zijlstra (Intel) 8366700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS 84ee08c6ecSFrederic Weisbecker bool 85555f386cSMike Frysinger help 865fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 87ee08c6ecSFrederic Weisbecker 88a2546faeSSteven Rostedtconfig HAVE_FENTRY 89a2546faeSSteven Rostedt bool 90a2546faeSSteven Rostedt help 91a2546faeSSteven Rostedt Arch supports the gcc options -pg with -mfentry 92a2546faeSSteven Rostedt 932f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT 942f4df001SVasily Gorbik bool 952f4df001SVasily Gorbik help 962f4df001SVasily Gorbik Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount 972f4df001SVasily Gorbik 9822c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT 9922c8542dSSami Tolvanen bool 10022c8542dSSami Tolvanen help 10122c8542dSSami Tolvanen Arch supports objtool --mcount 10222c8542dSSami Tolvanen 103280981d6SSathvika Vasireddyconfig HAVE_OBJTOOL_NOP_MCOUNT 104280981d6SSathvika Vasireddy bool 105280981d6SSathvika Vasireddy help 106280981d6SSathvika Vasireddy Arch supports the objtool options --mcount with --mnop. 107280981d6SSathvika Vasireddy An architecture can select this if it wants to enable nop'ing 108280981d6SSathvika Vasireddy of ftrace locations. 109280981d6SSathvika Vasireddy 110cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT 11172441cb1SSteven Rostedt bool 11272441cb1SSteven Rostedt help 11372441cb1SSteven Rostedt C version of recordmcount available? 11472441cb1SSteven Rostedt 1154ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT 1164ed308c4SSteven Rostedt (Google) bool 1174ed308c4SSteven Rostedt (Google) help 1184ed308c4SSteven Rostedt (Google) An architecture selects this if it sorts the mcount_loc section 1194ed308c4SSteven Rostedt (Google) at build time. 1204ed308c4SSteven Rostedt (Google) 1216b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT 1226b9b6413SSteven Rostedt (Google) bool 1236b9b6413SSteven Rostedt (Google) default y 1244ed308c4SSteven Rostedt (Google) depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE 1256b9b6413SSteven Rostedt (Google) help 1266b9b6413SSteven Rostedt (Google) Sort the mcount_loc section at build time. 1276b9b6413SSteven Rostedt (Google) 128352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 129352ad25aSSteven Rostedt bool 130352ad25aSSteven Rostedt 131ea632e9fSJosh Triplettconfig TRACE_CLOCK 132ea632e9fSJosh Triplett bool 133ea632e9fSJosh Triplett 1347a8e76a3SSteven Rostedtconfig RING_BUFFER 1357a8e76a3SSteven Rostedt bool 136ea632e9fSJosh Triplett select TRACE_CLOCK 13722287688SSteven Rostedt (Red Hat) select IRQ_WORK 1387a8e76a3SSteven Rostedt 1395f77a88bSTom Zanussiconfig EVENT_TRACING 140b11c53e1SZhaolei select CONTEXT_SWITCH_TRACER 14160f1d5e3SMasami Hiramatsu select GLOB 142b11c53e1SZhaolei bool 143b11c53e1SZhaolei 144b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER 1455f77a88bSTom Zanussi bool 1465f77a88bSTom Zanussi 14785bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP 14885bac32cSSteven Rostedt bool 14985bac32cSSteven Rostedt help 15085bac32cSSteven Rostedt Allow the use of ring_buffer_swap_cpu. 15185bac32cSSteven Rostedt Adds a very slight overhead to tracing when enabled. 15285bac32cSSteven Rostedt 153c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS 154c3bc8fd6SJoel Fernandes (Google) bool 155c3bc8fd6SJoel Fernandes (Google) depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS 156c3bc8fd6SJoel Fernandes (Google) select TRACING 157c3bc8fd6SJoel Fernandes (Google) default y 158c3bc8fd6SJoel Fernandes (Google) help 159c3bc8fd6SJoel Fernandes (Google) Create preempt/irq toggle tracepoints if needed, so that other parts 160c3bc8fd6SJoel Fernandes (Google) of the kernel can use them to generate or add hooks to them. 161c3bc8fd6SJoel Fernandes (Google) 1625e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are 1635e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING. 1645e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the 1655e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options 1665e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the 16740892367SRandy Dunlap# hiding of the automatic options. 1685e0a0939SSteven Rostedt 169bc0c38d1SSteven Rostedtconfig TRACING 170bc0c38d1SSteven Rostedt bool 1717a8e76a3SSteven Rostedt select RING_BUFFER 172c2c80529SAl Viro select STACKTRACE if STACKTRACE_SUPPORT 1735f87f112SIngo Molnar select TRACEPOINTS 174f3384b28SSteven Rostedt select NOP_TRACER 175769b0441SFrederic Weisbecker select BINARY_PRINTF 1765f77a88bSTom Zanussi select EVENT_TRACING 177ea632e9fSJosh Triplett select TRACE_CLOCK 17802b3c5fcSPaul E. McKenney select NEED_TASKS_RCU 179bc0c38d1SSteven Rostedt 1805e0a0939SSteven Rostedtconfig GENERIC_TRACER 1815e0a0939SSteven Rostedt bool 1825e0a0939SSteven Rostedt select TRACING 1835e0a0939SSteven Rostedt 18440ada30fSIngo Molnar# 18540ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to 18640ada30fSIngo Molnar# be able to offer generic tracing facilities: 18740ada30fSIngo Molnar# 18840ada30fSIngo Molnarconfig TRACING_SUPPORT 18940ada30fSIngo Molnar bool 1900ea5ee03SMichael Ellerman depends on TRACE_IRQFLAGS_SUPPORT 19140ada30fSIngo Molnar depends on STACKTRACE_SUPPORT 192422d3c7aSKOSAKI Motohiro default y 19340ada30fSIngo Molnar 1944ed9f071SSteven Rostedtmenuconfig FTRACE 1954ed9f071SSteven Rostedt bool "Tracers" 196de32951bSMasahiro Yamada depends on TRACING_SUPPORT 19765b77242SSteven Rostedt default y if DEBUG_KERNEL 1984ed9f071SSteven Rostedt help 1994ed9f071SSteven Rostedt Enable the kernel tracing infrastructure. 2004ed9f071SSteven Rostedt 2014ed9f071SSteven Rostedtif FTRACE 20217d80fd0SPeter Zijlstra 2039ba817fbSSteven Rostedtconfig TRACEFS_AUTOMOUNT_DEPRECATED 2049ba817fbSSteven Rostedt bool "Automount tracefs on debugfs [DEPRECATED]" 2059ba817fbSSteven Rostedt depends on TRACING 2069ba817fbSSteven Rostedt default y 2079ba817fbSSteven Rostedt help 2089ba817fbSSteven Rostedt The tracing interface was moved from /sys/kernel/debug/tracing 2099ba817fbSSteven Rostedt to /sys/kernel/tracing in 2015, but the tracing file system 2109ba817fbSSteven Rostedt was still automounted in /sys/kernel/debug for backward 2119ba817fbSSteven Rostedt compatibility with tooling. 2129ba817fbSSteven Rostedt 2139ba817fbSSteven Rostedt The new interface has been around for more than 10 years and 2149ba817fbSSteven Rostedt the old debug mount will soon be removed. 2159ba817fbSSteven Rostedt 2161e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING 2171e837945SSteven Rostedt (VMware) bool "Boot-time Tracing support" 218d8a953ddSMasami Hiramatsu depends on TRACING 219d8a953ddSMasami Hiramatsu select BOOT_CONFIG 2201e837945SSteven Rostedt (VMware) help 2211e837945SSteven Rostedt (VMware) Enable developer to setup ftrace subsystem via supplemental 2221e837945SSteven Rostedt (VMware) kernel cmdline at boot time for debugging (tracing) driver 2231e837945SSteven Rostedt (VMware) initialization and boot process. 2241e837945SSteven Rostedt (VMware) 225606576ceSSteven Rostedtconfig FUNCTION_TRACER 2261b29b018SSteven Rostedt bool "Kernel Function Tracer" 227606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 2284d7a077cSSteven Rostedt select KALLSYMS 2295e0a0939SSteven Rostedt select GENERIC_TRACER 23035e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 23160f1d5e3SMasami Hiramatsu select GLOB 23202b3c5fcSPaul E. McKenney select NEED_TASKS_RCU 233e5a971d7SPaul E. McKenney select TASKS_RUDE_RCU 2341b29b018SSteven Rostedt help 2351b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 2361b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 23740892367SRandy Dunlap instruction at the beginning of every kernel function, which NOP 2381b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 2391b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 2401b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 2410a6d7d45SSteven Rostedt (Google) small and not measurable even in micro-benchmarks (at least on 2420a6d7d45SSteven Rostedt (Google) x86, but may have impact on other architectures). 24335e8e302SSteven Rostedt 244fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER 245fb52607aSFrederic Weisbecker bool "Kernel Function Graph Tracer" 246fb52607aSFrederic Weisbecker depends on HAVE_FUNCTION_GRAPH_TRACER 24715e6cb36SFrederic Weisbecker depends on FUNCTION_TRACER 248eb4a0378SSteven Rostedt depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE 249764f3b95SIngo Molnar default y 25015e6cb36SFrederic Weisbecker help 251fb52607aSFrederic Weisbecker Enable the kernel to trace a function at both its return 252fb52607aSFrederic Weisbecker and its entry. 253692105b8SMatt LaPlante Its first purpose is to trace the duration of functions and 254692105b8SMatt LaPlante draw a call graph for each thread with some information like 255692105b8SMatt LaPlante the return value. This is done by setting the current return 256692105b8SMatt LaPlante address on the current task structure into a stack of calls. 25715e6cb36SFrederic Weisbecker 258a1be9cccSDonglin Pengconfig FUNCTION_GRAPH_RETVAL 259a1be9cccSDonglin Peng bool "Kernel Function Graph Return Value" 260a3ed4157SMasami Hiramatsu (Google) depends on HAVE_FUNCTION_GRAPH_FREGS 261a1be9cccSDonglin Peng depends on FUNCTION_GRAPH_TRACER 262a1be9cccSDonglin Peng default n 263a1be9cccSDonglin Peng help 264a1be9cccSDonglin Peng Support recording and printing the function return value when 265a1be9cccSDonglin Peng using function graph tracer. It can be helpful to locate functions 266a1be9cccSDonglin Peng that return errors. This feature is off by default, and you can 267a1be9cccSDonglin Peng enable it via the trace option funcgraph-retval. 268a1be9cccSDonglin Peng See Documentation/trace/ftrace.rst 269a1be9cccSDonglin Peng 27021e92806SDonglin Pengconfig FUNCTION_GRAPH_RETADDR 27121e92806SDonglin Peng bool "Kernel Function Graph Return Address" 27221e92806SDonglin Peng depends on FUNCTION_GRAPH_TRACER 27321e92806SDonglin Peng default n 27421e92806SDonglin Peng help 27521e92806SDonglin Peng Support recording and printing the function return address when 27621e92806SDonglin Peng using function graph tracer. It can be helpful to locate code line that 27721e92806SDonglin Peng the function is called. This feature is off by default, and you can 27821e92806SDonglin Peng enable it via the trace option funcgraph-retaddr. 27921e92806SDonglin Peng 280533c20b0SSven Schnelleconfig FUNCTION_TRACE_ARGS 281533c20b0SSven Schnelle bool 282b81ff11cSSteven Rostedt depends on PROBE_EVENTS_BTF_ARGS 283533c20b0SSven Schnelle default y 284ff5c9c57SSven Schnelle help 285ff5c9c57SSven Schnelle If supported with function argument access API and BTF, then 286ff5c9c57SSven Schnelle the function tracer and function graph tracer will support printing 287ff5c9c57SSven Schnelle of function arguments. This feature is off by default, and can be 288ff5c9c57SSven Schnelle enabled via the trace option func-args (for the function tracer) and 289ff5c9c57SSven Schnelle funcgraph-args (for the function graph tracer) 290533c20b0SSven Schnelle 29161778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE 2929b4d5d33SSteven Rostedt bool 29361778cd7SSteven Rostedt (VMware) depends on FUNCTION_TRACER 29461778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE 29561778cd7SSteven Rostedt (VMware) default y 29661778cd7SSteven Rostedt (VMware) help 29761778cd7SSteven Rostedt (VMware) This option will modify all the calls to function tracing 29861778cd7SSteven Rostedt (VMware) dynamically (will patch them out of the binary image and 29961778cd7SSteven Rostedt (VMware) replace them with a No-Op instruction) on boot up. During 30061778cd7SSteven Rostedt (VMware) compile time, a table is made of all the locations that ftrace 30161778cd7SSteven Rostedt (VMware) can function trace, and this table is linked into the kernel 30261778cd7SSteven Rostedt (VMware) image. When this is enabled, functions can be individually 30361778cd7SSteven Rostedt (VMware) enabled, and the functions not enabled will not affect 30461778cd7SSteven Rostedt (VMware) performance of the system. 30561778cd7SSteven Rostedt (VMware) 3062455f0e1SRoss Zwisler See the files in /sys/kernel/tracing: 30761778cd7SSteven Rostedt (VMware) available_filter_functions 30861778cd7SSteven Rostedt (VMware) set_ftrace_filter 30961778cd7SSteven Rostedt (VMware) set_ftrace_notrace 31061778cd7SSteven Rostedt (VMware) 31161778cd7SSteven Rostedt (VMware) This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but 31261778cd7SSteven Rostedt (VMware) otherwise has native performance as long as no tracing is active. 31361778cd7SSteven Rostedt (VMware) 31461778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS 31561778cd7SSteven Rostedt (VMware) def_bool y 31661778cd7SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE 31761778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE_WITH_REGS 31861778cd7SSteven Rostedt (VMware) 31961778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS 32061778cd7SSteven Rostedt (VMware) def_bool y 32160c89718SFlorent Revest depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS 32261778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 32361778cd7SSteven Rostedt (VMware) 324cbad0fb2SMark Rutlandconfig DYNAMIC_FTRACE_WITH_CALL_OPS 325cbad0fb2SMark Rutland def_bool y 326cbad0fb2SMark Rutland depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS 327cbad0fb2SMark Rutland 32812f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS 32912f9951dSLukas Bulwahn def_bool y 33012f9951dSLukas Bulwahn depends on DYNAMIC_FTRACE 33112f9951dSLukas Bulwahn depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS 33212f9951dSLukas Bulwahn 333*f93a7d0cSSteven Rostedtconfig FUNCTION_SELF_TRACING 334*f93a7d0cSSteven Rostedt bool "Function trace tracing code" 335*f93a7d0cSSteven Rostedt depends on FUNCTION_TRACER 336*f93a7d0cSSteven Rostedt help 337*f93a7d0cSSteven Rostedt Normally all the tracing code is set to notrace, where the function 338*f93a7d0cSSteven Rostedt tracer will ignore all the tracing functions. Sometimes it is useful 339*f93a7d0cSSteven Rostedt for debugging to trace some of the tracing infratructure itself. 340*f93a7d0cSSteven Rostedt Enable this to allow some of the tracing infrastructure to be traced 341*f93a7d0cSSteven Rostedt by the function tracer. Note, this will likely add noise to function 342*f93a7d0cSSteven Rostedt tracing if events and other tracing features are enabled along with 343*f93a7d0cSSteven Rostedt function tracing. 344*f93a7d0cSSteven Rostedt 345*f93a7d0cSSteven Rostedt If unsure, say N. 346*f93a7d0cSSteven Rostedt 347cad9931fSMasami Hiramatsuconfig FPROBE 348cad9931fSMasami Hiramatsu bool "Kernel Function Probe (fprobe)" 3494346ba16SMasami Hiramatsu (Google) depends on HAVE_FUNCTION_GRAPH_FREGS && HAVE_FTRACE_GRAPH_FUNC 3504346ba16SMasami Hiramatsu (Google) depends on DYNAMIC_FTRACE_WITH_ARGS 3514346ba16SMasami Hiramatsu (Google) select FUNCTION_GRAPH_TRACER 352cad9931fSMasami Hiramatsu default n 353cad9931fSMasami Hiramatsu help 3545b0ab789SMasami Hiramatsu This option enables kernel function probe (fprobe) based on ftrace. 3555b0ab789SMasami Hiramatsu The fprobe is similar to kprobes, but probes only for kernel function 3565b0ab789SMasami Hiramatsu entries and exits. This also can probe multiple functions by one 3575b0ab789SMasami Hiramatsu fprobe. 358cad9931fSMasami Hiramatsu 359cad9931fSMasami Hiramatsu If unsure, say N. 360cad9931fSMasami Hiramatsu 36161778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER 36261778cd7SSteven Rostedt (VMware) bool "Kernel function profiler" 36361778cd7SSteven Rostedt (VMware) depends on FUNCTION_TRACER 36461778cd7SSteven Rostedt (VMware) default n 36561778cd7SSteven Rostedt (VMware) help 36661778cd7SSteven Rostedt (VMware) This option enables the kernel function profiler. A file is created 36761778cd7SSteven Rostedt (VMware) in debugfs called function_profile_enabled which defaults to zero. 36861778cd7SSteven Rostedt (VMware) When a 1 is echoed into this file profiling begins, and when a 36961778cd7SSteven Rostedt (VMware) zero is entered, profiling stops. A "functions" file is created in 37061778cd7SSteven Rostedt (VMware) the trace_stat directory; this file shows the list of functions that 37161778cd7SSteven Rostedt (VMware) have been hit and their counters. 37261778cd7SSteven Rostedt (VMware) 37361778cd7SSteven Rostedt (VMware) If in doubt, say N. 37461778cd7SSteven Rostedt (VMware) 37561778cd7SSteven Rostedt (VMware)config STACK_TRACER 37661778cd7SSteven Rostedt (VMware) bool "Trace max stack" 37761778cd7SSteven Rostedt (VMware) depends on HAVE_FUNCTION_TRACER 37861778cd7SSteven Rostedt (VMware) select FUNCTION_TRACER 37961778cd7SSteven Rostedt (VMware) select STACKTRACE 38061778cd7SSteven Rostedt (VMware) select KALLSYMS 38161778cd7SSteven Rostedt (VMware) help 38261778cd7SSteven Rostedt (VMware) This special tracer records the maximum stack footprint of the 3832455f0e1SRoss Zwisler kernel and displays it in /sys/kernel/tracing/stack_trace. 38461778cd7SSteven Rostedt (VMware) 38561778cd7SSteven Rostedt (VMware) This tracer works by hooking into every function call that the 38661778cd7SSteven Rostedt (VMware) kernel executes, and keeping a maximum stack depth value and 38761778cd7SSteven Rostedt (VMware) stack-trace saved. If this is configured with DYNAMIC_FTRACE 38861778cd7SSteven Rostedt (VMware) then it will not have any overhead while the stack tracer 38961778cd7SSteven Rostedt (VMware) is disabled. 39061778cd7SSteven Rostedt (VMware) 39161778cd7SSteven Rostedt (VMware) To enable the stack tracer on bootup, pass in 'stacktrace' 39261778cd7SSteven Rostedt (VMware) on the kernel command line. 39361778cd7SSteven Rostedt (VMware) 39461778cd7SSteven Rostedt (VMware) The stack tracer can also be enabled or disabled via the 39561778cd7SSteven Rostedt (VMware) sysctl kernel.stack_tracer_enabled 39661778cd7SSteven Rostedt (VMware) 39761778cd7SSteven Rostedt (VMware) Say N if unsure. 39861778cd7SSteven Rostedt (VMware) 399c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE 400c3bc8fd6SJoel Fernandes (Google) bool 401c3bc8fd6SJoel Fernandes (Google) help 402c3bc8fd6SJoel Fernandes (Google) Enables hooks which will be called when preemption is first disabled, 403c3bc8fd6SJoel Fernandes (Google) and last enabled. 404bac429f0SSteven Rostedt 40581d68a96SSteven Rostedtconfig IRQSOFF_TRACER 40681d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 40781d68a96SSteven Rostedt default n 40881d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 40981d68a96SSteven Rostedt select TRACE_IRQFLAGS 4105e0a0939SSteven Rostedt select GENERIC_TRACER 41181d68a96SSteven Rostedt select TRACER_MAX_TRACE 41285bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 41322cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 4140b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 41581d68a96SSteven Rostedt help 41681d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 41781d68a96SSteven Rostedt sections, with microsecond accuracy. 41881d68a96SSteven Rostedt 41981d68a96SSteven Rostedt The default measurement method is a maximum search, which is 42081d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 42181d68a96SSteven Rostedt via: 42281d68a96SSteven Rostedt 4232455f0e1SRoss Zwisler echo 0 > /sys/kernel/tracing/tracing_max_latency 42481d68a96SSteven Rostedt 42540892367SRandy Dunlap (Note that kernel size and overhead increase with this option 4266cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 4276cd8a4bbSSteven Rostedt used together or separately.) 4286cd8a4bbSSteven Rostedt 4296cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 4306cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 4316cd8a4bbSSteven Rostedt default n 43230c93704SThomas Gleixner depends on PREEMPTION 4335e0a0939SSteven Rostedt select GENERIC_TRACER 4346cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 43585bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 43622cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 4370b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 438c3bc8fd6SJoel Fernandes (Google) select TRACE_PREEMPT_TOGGLE 4396cd8a4bbSSteven Rostedt help 44040892367SRandy Dunlap This option measures the time spent in preemption-off critical 4416cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 4426cd8a4bbSSteven Rostedt 4436cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 4446cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 4456cd8a4bbSSteven Rostedt via: 4466cd8a4bbSSteven Rostedt 4472455f0e1SRoss Zwisler echo 0 > /sys/kernel/tracing/tracing_max_latency 4486cd8a4bbSSteven Rostedt 44940892367SRandy Dunlap (Note that kernel size and overhead increase with this option 4506cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 4516cd8a4bbSSteven Rostedt used together or separately.) 4526cd8a4bbSSteven Rostedt 453352ad25aSSteven Rostedtconfig SCHED_TRACER 454352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 4555e0a0939SSteven Rostedt select GENERIC_TRACER 456352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 457352ad25aSSteven Rostedt select TRACER_MAX_TRACE 45822cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 459352ad25aSSteven Rostedt help 460352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 461352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 462352ad25aSSteven Rostedt 463e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER 464e7c15cd8SSteven Rostedt (Red Hat) bool "Tracer to detect hardware latencies (like SMIs)" 465e7c15cd8SSteven Rostedt (Red Hat) select GENERIC_TRACER 466e25e43a4SMasami Hiramatsu (Google) select TRACER_MAX_TRACE 467e7c15cd8SSteven Rostedt (Red Hat) help 468e7c15cd8SSteven Rostedt (Red Hat) This tracer, when enabled will create one or more kernel threads, 469c5c1ea75SJesper Dangaard Brouer depending on what the cpumask file is set to, which each thread 470e7c15cd8SSteven Rostedt (Red Hat) spinning in a loop looking for interruptions caused by 471e7c15cd8SSteven Rostedt (Red Hat) something other than the kernel. For example, if a 472e7c15cd8SSteven Rostedt (Red Hat) System Management Interrupt (SMI) takes a noticeable amount of 473e7c15cd8SSteven Rostedt (Red Hat) time, this tracer will detect it. This is useful for testing 474e7c15cd8SSteven Rostedt (Red Hat) if a system is reliable for Real Time tasks. 475e7c15cd8SSteven Rostedt (Red Hat) 476e7c15cd8SSteven Rostedt (Red Hat) Some files are created in the tracing directory when this 477e7c15cd8SSteven Rostedt (Red Hat) is enabled: 478e7c15cd8SSteven Rostedt (Red Hat) 479e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/width - time in usecs for how long to spin for 480e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/window - time in usecs between the start of each 481e7c15cd8SSteven Rostedt (Red Hat) iteration 482e7c15cd8SSteven Rostedt (Red Hat) 483e7c15cd8SSteven Rostedt (Red Hat) A kernel thread is created that will spin with interrupts disabled 484c5c1ea75SJesper Dangaard Brouer for "width" microseconds in every "window" cycle. It will not spin 485e7c15cd8SSteven Rostedt (Red Hat) for "window - width" microseconds, where the system can 486e7c15cd8SSteven Rostedt (Red Hat) continue to operate. 487e7c15cd8SSteven Rostedt (Red Hat) 488e7c15cd8SSteven Rostedt (Red Hat) The output will appear in the trace and trace_pipe files. 489e7c15cd8SSteven Rostedt (Red Hat) 490e7c15cd8SSteven Rostedt (Red Hat) When the tracer is not running, it has no affect on the system, 491e7c15cd8SSteven Rostedt (Red Hat) but when it is running, it can cause the system to be 492e7c15cd8SSteven Rostedt (Red Hat) periodically non responsive. Do not run this tracer on a 493e7c15cd8SSteven Rostedt (Red Hat) production system. 494e7c15cd8SSteven Rostedt (Red Hat) 495e7c15cd8SSteven Rostedt (Red Hat) To enable this tracer, echo in "hwlat" into the current_tracer 496e7c15cd8SSteven Rostedt (Red Hat) file. Every time a latency is greater than tracing_thresh, it will 497e7c15cd8SSteven Rostedt (Red Hat) be recorded into the ring buffer. 498e7c15cd8SSteven Rostedt (Red Hat) 499bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER 500bce29ac9SDaniel Bristot de Oliveira bool "OS Noise tracer" 501bce29ac9SDaniel Bristot de Oliveira select GENERIC_TRACER 502e25e43a4SMasami Hiramatsu (Google) select TRACER_MAX_TRACE 503bce29ac9SDaniel Bristot de Oliveira help 504bce29ac9SDaniel Bristot de Oliveira In the context of high-performance computing (HPC), the Operating 505bce29ac9SDaniel Bristot de Oliveira System Noise (osnoise) refers to the interference experienced by an 506bce29ac9SDaniel Bristot de Oliveira application due to activities inside the operating system. In the 507bce29ac9SDaniel Bristot de Oliveira context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread 508bce29ac9SDaniel Bristot de Oliveira can cause noise to the system. Moreover, hardware-related jobs can 509bce29ac9SDaniel Bristot de Oliveira also cause noise, for example, via SMIs. 510bce29ac9SDaniel Bristot de Oliveira 511bce29ac9SDaniel Bristot de Oliveira The osnoise tracer leverages the hwlat_detector by running a similar 512bce29ac9SDaniel Bristot de Oliveira loop with preemption, SoftIRQs and IRQs enabled, thus allowing all 513bce29ac9SDaniel Bristot de Oliveira the sources of osnoise during its execution. The osnoise tracer takes 514bce29ac9SDaniel Bristot de Oliveira note of the entry and exit point of any source of interferences, 515bce29ac9SDaniel Bristot de Oliveira increasing a per-cpu interference counter. It saves an interference 516bce29ac9SDaniel Bristot de Oliveira counter for each source of interference. The interference counter for 517bce29ac9SDaniel Bristot de Oliveira NMI, IRQs, SoftIRQs, and threads is increased anytime the tool 518bce29ac9SDaniel Bristot de Oliveira observes these interferences' entry events. When a noise happens 519bce29ac9SDaniel Bristot de Oliveira without any interference from the operating system level, the 520bce29ac9SDaniel Bristot de Oliveira hardware noise counter increases, pointing to a hardware-related 521bce29ac9SDaniel Bristot de Oliveira noise. In this way, osnoise can account for any source of 522bce29ac9SDaniel Bristot de Oliveira interference. At the end of the period, the osnoise tracer prints 523bce29ac9SDaniel Bristot de Oliveira the sum of all noise, the max single noise, the percentage of CPU 524bce29ac9SDaniel Bristot de Oliveira available for the thread, and the counters for the noise sources. 525bce29ac9SDaniel Bristot de Oliveira 526bce29ac9SDaniel Bristot de Oliveira In addition to the tracer, a set of tracepoints were added to 527bce29ac9SDaniel Bristot de Oliveira facilitate the identification of the osnoise source. 528bce29ac9SDaniel Bristot de Oliveira 529bce29ac9SDaniel Bristot de Oliveira The output will appear in the trace and trace_pipe files. 530bce29ac9SDaniel Bristot de Oliveira 531bce29ac9SDaniel Bristot de Oliveira To enable this tracer, echo in "osnoise" into the current_tracer 532bce29ac9SDaniel Bristot de Oliveira file. 533bce29ac9SDaniel Bristot de Oliveira 534a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER 535a955d7eaSDaniel Bristot de Oliveira bool "Timerlat tracer" 536a955d7eaSDaniel Bristot de Oliveira select OSNOISE_TRACER 537a955d7eaSDaniel Bristot de Oliveira select GENERIC_TRACER 538a955d7eaSDaniel Bristot de Oliveira help 539a955d7eaSDaniel Bristot de Oliveira The timerlat tracer aims to help the preemptive kernel developers 540a955d7eaSDaniel Bristot de Oliveira to find sources of wakeup latencies of real-time threads. 541a955d7eaSDaniel Bristot de Oliveira 542a955d7eaSDaniel Bristot de Oliveira The tracer creates a per-cpu kernel thread with real-time priority. 543a955d7eaSDaniel Bristot de Oliveira The tracer thread sets a periodic timer to wakeup itself, and goes 544a955d7eaSDaniel Bristot de Oliveira to sleep waiting for the timer to fire. At the wakeup, the thread 545a955d7eaSDaniel Bristot de Oliveira then computes a wakeup latency value as the difference between 546a955d7eaSDaniel Bristot de Oliveira the current time and the absolute time that the timer was set 547a955d7eaSDaniel Bristot de Oliveira to expire. 548a955d7eaSDaniel Bristot de Oliveira 549a955d7eaSDaniel Bristot de Oliveira The tracer prints two lines at every activation. The first is the 550a955d7eaSDaniel Bristot de Oliveira timer latency observed at the hardirq context before the 551a955d7eaSDaniel Bristot de Oliveira activation of the thread. The second is the timer latency observed 552a955d7eaSDaniel Bristot de Oliveira by the thread, which is the same level that cyclictest reports. The 553a955d7eaSDaniel Bristot de Oliveira ACTIVATION ID field serves to relate the irq execution to its 554a955d7eaSDaniel Bristot de Oliveira respective thread execution. 555a955d7eaSDaniel Bristot de Oliveira 556a955d7eaSDaniel Bristot de Oliveira The tracer is build on top of osnoise tracer, and the osnoise: 557a955d7eaSDaniel Bristot de Oliveira events can be used to trace the source of interference from NMI, 558a955d7eaSDaniel Bristot de Oliveira IRQs and other threads. It also enables the capture of the 559a955d7eaSDaniel Bristot de Oliveira stacktrace at the IRQ context, which helps to identify the code 560a955d7eaSDaniel Bristot de Oliveira path that can cause thread delay. 561a955d7eaSDaniel Bristot de Oliveira 56221b3ce30SSteven Rostedt (VMware)config MMIOTRACE 56321b3ce30SSteven Rostedt (VMware) bool "Memory mapped IO tracing" 56421b3ce30SSteven Rostedt (VMware) depends on HAVE_MMIOTRACE_SUPPORT && PCI 56521b3ce30SSteven Rostedt (VMware) select GENERIC_TRACER 56621b3ce30SSteven Rostedt (VMware) help 56721b3ce30SSteven Rostedt (VMware) Mmiotrace traces Memory Mapped I/O access and is meant for 56821b3ce30SSteven Rostedt (VMware) debugging and reverse engineering. It is called from the ioremap 56921b3ce30SSteven Rostedt (VMware) implementation and works via page faults. Tracing is disabled by 57021b3ce30SSteven Rostedt (VMware) default and can be enabled at run-time. 57121b3ce30SSteven Rostedt (VMware) 57221b3ce30SSteven Rostedt (VMware) See Documentation/trace/mmiotrace.rst. 57321b3ce30SSteven Rostedt (VMware) If you are not helping to develop drivers, say N. 57421b3ce30SSteven Rostedt (VMware) 575897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS 576897f17a6SSteven Rostedt bool "Trace process context switches and events" 5775e0a0939SSteven Rostedt depends on !GENERIC_TRACER 578b77e38aaSSteven Rostedt select TRACING 579b77e38aaSSteven Rostedt help 58040892367SRandy Dunlap This tracer hooks to various trace points in the kernel, 581b77e38aaSSteven Rostedt allowing the user to pick and choose which trace point they 582897f17a6SSteven Rostedt want to trace. It also includes the sched_switch tracer plugin. 583a7abe97fSSteven Rostedt 584ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS 585ee08c6ecSFrederic Weisbecker bool "Trace syscalls" 58666700001SJosh Stone depends on HAVE_SYSCALL_TRACEPOINTS 5875e0a0939SSteven Rostedt select GENERIC_TRACER 5880ea1c415SFrederic Weisbecker select KALLSYMS 589ee08c6ecSFrederic Weisbecker help 590ee08c6ecSFrederic Weisbecker Basic tracer to catch the syscall entry and exit events. 591ee08c6ecSFrederic Weisbecker 592299ea67eSSteven Rostedtconfig TRACE_SYSCALL_BUF_SIZE_DEFAULT 593299ea67eSSteven Rostedt int "System call user read max size" 594299ea67eSSteven Rostedt range 0 165 595299ea67eSSteven Rostedt default 63 596299ea67eSSteven Rostedt depends on FTRACE_SYSCALLS 597299ea67eSSteven Rostedt help 598299ea67eSSteven Rostedt Some system call trace events will record the data from a user 599299ea67eSSteven Rostedt space address that one of the parameters point to. The amount of 600299ea67eSSteven Rostedt data per event is limited. That limit is set by this config and 601299ea67eSSteven Rostedt this config also affects how much user space data perf can read. 602299ea67eSSteven Rostedt 603299ea67eSSteven Rostedt For a tracing instance, this size may be changed by writing into 604299ea67eSSteven Rostedt its syscall_user_buf_size file. 605299ea67eSSteven Rostedt 606debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT 607debdd57fSHiraku Toyooka bool "Create a snapshot trace buffer" 608debdd57fSHiraku Toyooka select TRACER_MAX_TRACE 609debdd57fSHiraku Toyooka help 610debdd57fSHiraku Toyooka Allow tracing users to take snapshot of the current buffer using the 611debdd57fSHiraku Toyooka ftrace interface, e.g.: 612debdd57fSHiraku Toyooka 6132455f0e1SRoss Zwisler echo 1 > /sys/kernel/tracing/snapshot 614debdd57fSHiraku Toyooka cat snapshot 615debdd57fSHiraku Toyooka 6160b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP 6170b85ffc2SSteven Rostedt (Red Hat) bool "Allow snapshot to swap per CPU" 6180b85ffc2SSteven Rostedt (Red Hat) depends on TRACER_SNAPSHOT 6190b85ffc2SSteven Rostedt (Red Hat) select RING_BUFFER_ALLOW_SWAP 6200b85ffc2SSteven Rostedt (Red Hat) help 6210b85ffc2SSteven Rostedt (Red Hat) Allow doing a snapshot of a single CPU buffer instead of a 6220b85ffc2SSteven Rostedt (Red Hat) full swap (all buffers). If this is set, then the following is 6230b85ffc2SSteven Rostedt (Red Hat) allowed: 6240b85ffc2SSteven Rostedt (Red Hat) 6252455f0e1SRoss Zwisler echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot 6260b85ffc2SSteven Rostedt (Red Hat) 6270b85ffc2SSteven Rostedt (Red Hat) After which, only the tracing buffer for CPU 2 was swapped with 6280b85ffc2SSteven Rostedt (Red Hat) the main tracing buffer, and the other CPU buffers remain the same. 6290b85ffc2SSteven Rostedt (Red Hat) 6300b85ffc2SSteven Rostedt (Red Hat) When this is enabled, this adds a little more overhead to the 6310b85ffc2SSteven Rostedt (Red Hat) trace recording, as it needs to add some checks to synchronize 6320b85ffc2SSteven Rostedt (Red Hat) recording with swaps. But this does not affect the performance 6330b85ffc2SSteven Rostedt (Red Hat) of the overall system. This is enabled by default when the preempt 6340b85ffc2SSteven Rostedt (Red Hat) or irq latency tracers are enabled, as those need to swap as well 6350b85ffc2SSteven Rostedt (Red Hat) and already adds the overhead (plus a lot more). 6360b85ffc2SSteven Rostedt (Red Hat) 6372ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING 6389ae5b879SSteven Rostedt bool 6395e0a0939SSteven Rostedt select GENERIC_TRACER 6409ae5b879SSteven Rostedt 6419ae5b879SSteven Rostedtchoice 6429ae5b879SSteven Rostedt prompt "Branch Profiling" 6439ae5b879SSteven Rostedt default BRANCH_PROFILE_NONE 6449ae5b879SSteven Rostedt help 6459ae5b879SSteven Rostedt The branch profiling is a software profiler. It will add hooks 6469ae5b879SSteven Rostedt into the C conditionals to test which path a branch takes. 6479ae5b879SSteven Rostedt 6489ae5b879SSteven Rostedt The likely/unlikely profiler only looks at the conditions that 6499ae5b879SSteven Rostedt are annotated with a likely or unlikely macro. 6509ae5b879SSteven Rostedt 65140892367SRandy Dunlap The "all branch" profiler will profile every if-statement in the 6529ae5b879SSteven Rostedt kernel. This profiler will also enable the likely/unlikely 65340892367SRandy Dunlap profiler. 6549ae5b879SSteven Rostedt 65540892367SRandy Dunlap Either of the above profilers adds a bit of overhead to the system. 65640892367SRandy Dunlap If unsure, choose "No branch profiling". 6579ae5b879SSteven Rostedt 6589ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE 6599ae5b879SSteven Rostedt bool "No branch profiling" 6609ae5b879SSteven Rostedt help 6619ae5b879SSteven Rostedt No branch profiling. Branch profiling adds a bit of overhead. 6629ae5b879SSteven Rostedt Only enable it if you want to analyse the branching behavior. 6639ae5b879SSteven Rostedt Otherwise keep it disabled. 6649ae5b879SSteven Rostedt 6659ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES 6669ae5b879SSteven Rostedt bool "Trace likely/unlikely profiler" 6679ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 6681f0d69a9SSteven Rostedt help 66959bf8964SMasanari Iida This tracer profiles all likely and unlikely macros 6701f0d69a9SSteven Rostedt in the kernel. It will display the results in: 6711f0d69a9SSteven Rostedt 6722455f0e1SRoss Zwisler /sys/kernel/tracing/trace_stat/branch_annotated 6731f0d69a9SSteven Rostedt 67440892367SRandy Dunlap Note: this will add a significant overhead; only turn this 6751f0d69a9SSteven Rostedt on if you need to profile the system's use of these macros. 6761f0d69a9SSteven Rostedt 6772bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES 67868e76e03SRandy Dunlap bool "Profile all if conditionals" if !FORTIFY_SOURCE 6799ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 6802bcd521aSSteven Rostedt help 6812bcd521aSSteven Rostedt This tracer profiles all branch conditions. Every if () 6822bcd521aSSteven Rostedt taken in the kernel is recorded whether it hit or miss. 6832bcd521aSSteven Rostedt The results will be displayed in: 6842bcd521aSSteven Rostedt 6852455f0e1SRoss Zwisler /sys/kernel/tracing/trace_stat/branch_all 6862bcd521aSSteven Rostedt 6879ae5b879SSteven Rostedt This option also enables the likely/unlikely profiler. 6889ae5b879SSteven Rostedt 6892bcd521aSSteven Rostedt This configuration, when enabled, will impose a great overhead 6902bcd521aSSteven Rostedt on the system. This should only be enabled when the system 69140892367SRandy Dunlap is to be analyzed in much detail. 6929ae5b879SSteven Rostedtendchoice 6932bcd521aSSteven Rostedt 6942ed84eebSSteven Rostedtconfig TRACING_BRANCHES 69552f232cbSSteven Rostedt bool 69652f232cbSSteven Rostedt help 69752f232cbSSteven Rostedt Selected by tracers that will trace the likely and unlikely 69852f232cbSSteven Rostedt conditions. This prevents the tracers themselves from being 69952f232cbSSteven Rostedt profiled. Profiling the tracing infrastructure can only happen 70052f232cbSSteven Rostedt when the likelys and unlikelys are not being traced. 70152f232cbSSteven Rostedt 7022ed84eebSSteven Rostedtconfig BRANCH_TRACER 70352f232cbSSteven Rostedt bool "Trace likely/unlikely instances" 7042ed84eebSSteven Rostedt depends on TRACE_BRANCH_PROFILING 7052ed84eebSSteven Rostedt select TRACING_BRANCHES 70652f232cbSSteven Rostedt help 70752f232cbSSteven Rostedt This traces the events of likely and unlikely condition 70852f232cbSSteven Rostedt calls in the kernel. The difference between this and the 70952f232cbSSteven Rostedt "Trace likely/unlikely profiler" is that this is not a 71052f232cbSSteven Rostedt histogram of the callers, but actually places the calling 71152f232cbSSteven Rostedt events into a running trace buffer to see when and where the 71252f232cbSSteven Rostedt events happened, as well as their results. 71352f232cbSSteven Rostedt 71452f232cbSSteven Rostedt Say N if unsure. 71552f232cbSSteven Rostedt 7162db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE 71740892367SRandy Dunlap bool "Support for tracing block IO actions" 7182db270a8SFrederic Weisbecker depends on SYSFS 7191dfba05dSIngo Molnar depends on BLOCK 7202db270a8SFrederic Weisbecker select RELAY 7212db270a8SFrederic Weisbecker select DEBUG_FS 7222db270a8SFrederic Weisbecker select TRACEPOINTS 7235e0a0939SSteven Rostedt select GENERIC_TRACER 7242db270a8SFrederic Weisbecker select STACKTRACE 7252db270a8SFrederic Weisbecker help 7262db270a8SFrederic Weisbecker Say Y here if you want to be able to trace the block layer actions 7272db270a8SFrederic Weisbecker on a given queue. Tracing allows you to see any traffic happening 7282db270a8SFrederic Weisbecker on a block device queue. For more information (and the userspace 7292db270a8SFrederic Weisbecker support tools needed), fetch the blktrace tools from: 7302db270a8SFrederic Weisbecker 7312db270a8SFrederic Weisbecker git://git.kernel.dk/blktrace.git 7322db270a8SFrederic Weisbecker 7332db270a8SFrederic Weisbecker Tracing also is possible using the ftrace interface, e.g.: 7342db270a8SFrederic Weisbecker 7352db270a8SFrederic Weisbecker echo 1 > /sys/block/sda/sda1/trace/enable 7362455f0e1SRoss Zwisler echo blk > /sys/kernel/tracing/current_tracer 7372455f0e1SRoss Zwisler cat /sys/kernel/tracing/trace_pipe 7382db270a8SFrederic Weisbecker 7392db270a8SFrederic Weisbecker If unsure, say N. 74036994e58SFrederic Weisbecker 741334e5519SMasami Hiramatsu (Google)config FPROBE_EVENTS 742334e5519SMasami Hiramatsu (Google) depends on FPROBE 743334e5519SMasami Hiramatsu (Google) depends on HAVE_REGS_AND_STACK_ACCESS_API 744334e5519SMasami Hiramatsu (Google) bool "Enable fprobe-based dynamic events" 745334e5519SMasami Hiramatsu (Google) select TRACING 746334e5519SMasami Hiramatsu (Google) select PROBE_EVENTS 747334e5519SMasami Hiramatsu (Google) select DYNAMIC_EVENTS 748334e5519SMasami Hiramatsu (Google) default y 749334e5519SMasami Hiramatsu (Google) help 750334e5519SMasami Hiramatsu (Google) This allows user to add tracing events on the function entry and 751334e5519SMasami Hiramatsu (Google) exit via ftrace interface. The syntax is same as the kprobe events 752334e5519SMasami Hiramatsu (Google) and the kprobe events on function entry and exit will be 753334e5519SMasami Hiramatsu (Google) transparently converted to this fprobe events. 754334e5519SMasami Hiramatsu (Google) 755b576e097SMasami Hiramatsu (Google)config PROBE_EVENTS_BTF_ARGS 756b576e097SMasami Hiramatsu (Google) depends on HAVE_FUNCTION_ARG_ACCESS_API 757b576e097SMasami Hiramatsu (Google) depends on FPROBE_EVENTS || KPROBE_EVENTS 758b576e097SMasami Hiramatsu (Google) depends on DEBUG_INFO_BTF && BPF_SYSCALL 759b576e097SMasami Hiramatsu (Google) bool "Support BTF function arguments for probe events" 760b576e097SMasami Hiramatsu (Google) default y 761b576e097SMasami Hiramatsu (Google) help 762b576e097SMasami Hiramatsu (Google) The user can specify the arguments of the probe event using the names 763b576e097SMasami Hiramatsu (Google) of the arguments of the probed function, when the probe location is a 764b576e097SMasami Hiramatsu (Google) kernel function entry or a tracepoint. 765b576e097SMasami Hiramatsu (Google) This is available only if BTF (BPF Type Format) support is enabled. 766b576e097SMasami Hiramatsu (Google) 7676b0b7551SAnton Blanchardconfig KPROBE_EVENTS 768413d37d1SMasami Hiramatsu depends on KPROBES 769f850c30cSHeiko Carstens depends on HAVE_REGS_AND_STACK_ACCESS_API 77077b44d1bSMasami Hiramatsu bool "Enable kprobes-based dynamic events" 771413d37d1SMasami Hiramatsu select TRACING 7728ab83f56SSrikar Dronamraju select PROBE_EVENTS 7736212dd29SMasami Hiramatsu select DYNAMIC_EVENTS 77477b44d1bSMasami Hiramatsu default y 775413d37d1SMasami Hiramatsu help 77640892367SRandy Dunlap This allows the user to add tracing events (similar to tracepoints) 77740892367SRandy Dunlap on the fly via the ftrace interface. See 7785fb94e9cSMauro Carvalho Chehab Documentation/trace/kprobetrace.rst for more details. 77977b44d1bSMasami Hiramatsu 78077b44d1bSMasami Hiramatsu Those events can be inserted wherever kprobes can probe, and record 78177b44d1bSMasami Hiramatsu various register and memory values. 78277b44d1bSMasami Hiramatsu 78340892367SRandy Dunlap This option is also required by perf-probe subcommand of perf tools. 78440892367SRandy Dunlap If you want to use perf tools, this option is strongly recommended. 785413d37d1SMasami Hiramatsu 78645408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE 78745408c4fSMasami Hiramatsu bool "Do NOT protect notrace function from kprobe events" 78845408c4fSMasami Hiramatsu depends on KPROBE_EVENTS 7897bb83f6fSMasami Hiramatsu depends on DYNAMIC_FTRACE 79045408c4fSMasami Hiramatsu default n 79145408c4fSMasami Hiramatsu help 79245408c4fSMasami Hiramatsu This is only for the developers who want to debug ftrace itself 79345408c4fSMasami Hiramatsu using kprobe events. 79445408c4fSMasami Hiramatsu 79545408c4fSMasami Hiramatsu If kprobes can use ftrace instead of breakpoint, ftrace related 79628cc65a1SColin Ian King functions are protected from kprobe-events to prevent an infinite 79745408c4fSMasami Hiramatsu recursion or any unexpected execution path which leads to a kernel 79845408c4fSMasami Hiramatsu crash. 79945408c4fSMasami Hiramatsu 80045408c4fSMasami Hiramatsu This option disables such protection and allows you to put kprobe 80145408c4fSMasami Hiramatsu events on ftrace functions for debugging ftrace by itself. 80245408c4fSMasami Hiramatsu Note that this might let you shoot yourself in the foot. 80345408c4fSMasami Hiramatsu 80445408c4fSMasami Hiramatsu If unsure, say N. 80545408c4fSMasami Hiramatsu 8066b0b7551SAnton Blanchardconfig UPROBE_EVENTS 807f3f096cfSSrikar Dronamraju bool "Enable uprobes-based dynamic events" 808f3f096cfSSrikar Dronamraju depends on ARCH_SUPPORTS_UPROBES 809f3f096cfSSrikar Dronamraju depends on MMU 81009294e31SDavid A. Long depends on PERF_EVENTS 811f3f096cfSSrikar Dronamraju select UPROBES 812f3f096cfSSrikar Dronamraju select PROBE_EVENTS 8130597c49cSMasami Hiramatsu select DYNAMIC_EVENTS 814f3f096cfSSrikar Dronamraju select TRACING 81561f35d75SArnaldo Carvalho de Melo default y 816f3f096cfSSrikar Dronamraju help 817f3f096cfSSrikar Dronamraju This allows the user to add tracing events on top of userspace 818f3f096cfSSrikar Dronamraju dynamic events (similar to tracepoints) on the fly via the trace 819f3f096cfSSrikar Dronamraju events interface. Those events can be inserted wherever uprobes 820f3f096cfSSrikar Dronamraju can probe, and record various registers. 821f3f096cfSSrikar Dronamraju This option is required if you plan to use perf-probe subcommand 822f3f096cfSSrikar Dronamraju of perf tools on user space applications. 823f3f096cfSSrikar Dronamraju 8240dd1274aSSteven Rostedtconfig EPROBE_EVENTS 8250dd1274aSSteven Rostedt bool "Enable event-based dynamic events" 8260dd1274aSSteven Rostedt depends on TRACING 8270dd1274aSSteven Rostedt depends on HAVE_REGS_AND_STACK_ACCESS_API 8280dd1274aSSteven Rostedt select PROBE_EVENTS 8290dd1274aSSteven Rostedt select DYNAMIC_EVENTS 8300dd1274aSSteven Rostedt default y 8310dd1274aSSteven Rostedt help 8320dd1274aSSteven Rostedt Eprobes are dynamic events that can be placed on other existing 8330dd1274aSSteven Rostedt events. It can be used to limit what fields are recorded in 8340dd1274aSSteven Rostedt an event or even dereference a field of an event. It can 8350dd1274aSSteven Rostedt convert the type of an event field. For example, turn an 8360dd1274aSSteven Rostedt address into a string. 8370dd1274aSSteven Rostedt 838e1abf2ccSIngo Molnarconfig BPF_EVENTS 839e1abf2ccSIngo Molnar depends on BPF_SYSCALL 8406b0b7551SAnton Blanchard depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS 841e1abf2ccSIngo Molnar bool 842e1abf2ccSIngo Molnar default y 843e1abf2ccSIngo Molnar help 8445cbd22c1SPeter Wu This allows the user to attach BPF programs to kprobe, uprobe, and 8455cbd22c1SPeter Wu tracepoint events. 846e1abf2ccSIngo Molnar 8475448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS 8485448d44cSMasami Hiramatsu def_bool n 8495448d44cSMasami Hiramatsu 8508ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS 8518ab83f56SSrikar Dronamraju def_bool n 8528ab83f56SSrikar Dronamraju 8539802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE 8549802d865SJosef Bacik bool "Enable BPF programs to override a kprobed function" 8559802d865SJosef Bacik depends on BPF_EVENTS 856540adea3SMasami Hiramatsu depends on FUNCTION_ERROR_INJECTION 8579802d865SJosef Bacik default n 8589802d865SJosef Bacik help 8599802d865SJosef Bacik Allows BPF to override the execution of a probed function and 8609802d865SJosef Bacik set a different return value. This is used for error injection. 8619802d865SJosef Bacik 8623b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY 8633b15cdc1SSami Tolvanen bool 8644d6d0a62SSteven Rostedt depends on DYNAMIC_FTRACE 8653b15cdc1SSami Tolvanen 8663b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC 8673b15cdc1SSami Tolvanen def_bool y 8683b15cdc1SSami Tolvanen depends on $(cc-option,-mrecord-mcount) 8693b15cdc1SSami Tolvanen depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY 8704d6d0a62SSteven Rostedt depends on DYNAMIC_FTRACE 8713b15cdc1SSami Tolvanen 87222c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL 87322c8542dSSami Tolvanen def_bool y 87422c8542dSSami Tolvanen depends on HAVE_OBJTOOL_MCOUNT 87522c8542dSSami Tolvanen depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY 87622c8542dSSami Tolvanen depends on !FTRACE_MCOUNT_USE_CC 8774d6d0a62SSteven Rostedt depends on DYNAMIC_FTRACE 87803f16cd0SJosh Poimboeuf select OBJTOOL 87922c8542dSSami Tolvanen 8803b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT 8813b15cdc1SSami Tolvanen def_bool y 8823b15cdc1SSami Tolvanen depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY 8833b15cdc1SSami Tolvanen depends on !FTRACE_MCOUNT_USE_CC 88422c8542dSSami Tolvanen depends on !FTRACE_MCOUNT_USE_OBJTOOL 8854d6d0a62SSteven Rostedt depends on DYNAMIC_FTRACE 8863b15cdc1SSami Tolvanen 88708d43a5fSTom Zanussiconfig TRACING_MAP 88808d43a5fSTom Zanussi bool 88908d43a5fSTom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 89008d43a5fSTom Zanussi help 89108d43a5fSTom Zanussi tracing_map is a special-purpose lock-free map for tracing, 89208d43a5fSTom Zanussi separated out as a stand-alone facility in order to allow it 89308d43a5fSTom Zanussi to be shared between multiple tracers. It isn't meant to be 89408d43a5fSTom Zanussi generally used outside of that context, and is normally 89508d43a5fSTom Zanussi selected by tracers that use it. 89608d43a5fSTom Zanussi 897726721a5STom Zanussiconfig SYNTH_EVENTS 898726721a5STom Zanussi bool "Synthetic trace events" 899726721a5STom Zanussi select TRACING 900726721a5STom Zanussi select DYNAMIC_EVENTS 901726721a5STom Zanussi default n 902726721a5STom Zanussi help 903726721a5STom Zanussi Synthetic events are user-defined trace events that can be 904726721a5STom Zanussi used to combine data from other trace events or in fact any 905726721a5STom Zanussi data source. Synthetic events can be generated indirectly 906726721a5STom Zanussi via the trace() action of histogram triggers or directly 907726721a5STom Zanussi by way of an in-kernel API. 908726721a5STom Zanussi 909726721a5STom Zanussi See Documentation/trace/events.rst or 910726721a5STom Zanussi Documentation/trace/histogram.rst for details and examples. 911726721a5STom Zanussi 912726721a5STom Zanussi If in doubt, say N. 913726721a5STom Zanussi 9147f5a08c7SBeau Belgraveconfig USER_EVENTS 9157f5a08c7SBeau Belgrave bool "User trace events" 9167f5a08c7SBeau Belgrave select TRACING 9177f5a08c7SBeau Belgrave select DYNAMIC_EVENTS 9187f5a08c7SBeau Belgrave help 9197f5a08c7SBeau Belgrave User trace events are user-defined trace events that 9207f5a08c7SBeau Belgrave can be used like an existing kernel trace event. User trace 9217f5a08c7SBeau Belgrave events are generated by writing to a tracefs file. User 9227f5a08c7SBeau Belgrave processes can determine if their tracing events should be 92372357590SBeau Belgrave generated by registering a value and bit with the kernel 92472357590SBeau Belgrave that reflects when it is enabled or not. 9257f5a08c7SBeau Belgrave 92672357590SBeau Belgrave See Documentation/trace/user_events.rst. 9277f5a08c7SBeau Belgrave If in doubt, say N. 9287f5a08c7SBeau Belgrave 9297ef224d1STom Zanussiconfig HIST_TRIGGERS 9307ef224d1STom Zanussi bool "Histogram triggers" 9317ef224d1STom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 9327ef224d1STom Zanussi select TRACING_MAP 9337ad8fb61STom Zanussi select TRACING 9347bbab38dSMasami Hiramatsu select DYNAMIC_EVENTS 935726721a5STom Zanussi select SYNTH_EVENTS 9367ef224d1STom Zanussi default n 9377ef224d1STom Zanussi help 9387ef224d1STom Zanussi Hist triggers allow one or more arbitrary trace event fields 9397ef224d1STom Zanussi to be aggregated into hash tables and dumped to stdout by 9407ef224d1STom Zanussi reading a debugfs/tracefs file. They're useful for 9417ef224d1STom Zanussi gathering quick and dirty (though precise) summaries of 9427ef224d1STom Zanussi event activity as an initial guide for further investigation 9437ef224d1STom Zanussi using more advanced tools. 9447ef224d1STom Zanussi 94589e270c1STom Zanussi Inter-event tracing of quantities such as latencies is also 94689e270c1STom Zanussi supported using hist triggers under this option. 94789e270c1STom Zanussi 948ea272257SMauro Carvalho Chehab See Documentation/trace/histogram.rst. 9497ef224d1STom Zanussi If in doubt, say N. 9507ef224d1STom Zanussi 9516c3edaf9SCong Wangconfig TRACE_EVENT_INJECT 9526c3edaf9SCong Wang bool "Trace event injection" 9536c3edaf9SCong Wang depends on TRACING 9546c3edaf9SCong Wang help 9556c3edaf9SCong Wang Allow user-space to inject a specific trace event into the ring 9566c3edaf9SCong Wang buffer. This is mainly used for testing purpose. 9576c3edaf9SCong Wang 9586c3edaf9SCong Wang If unsure, say N. 9596c3edaf9SCong Wang 96081dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK 96181dc9f0eSSteven Rostedt (Red Hat) bool "Add tracepoint that benchmarks tracepoints" 96281dc9f0eSSteven Rostedt (Red Hat) help 96381dc9f0eSSteven Rostedt (Red Hat) This option creates the tracepoint "benchmark:benchmark_event". 96481dc9f0eSSteven Rostedt (Red Hat) When the tracepoint is enabled, it kicks off a kernel thread that 96569268094SRolf Eike Beer goes into an infinite loop (calling cond_resched() to let other tasks 96681dc9f0eSSteven Rostedt (Red Hat) run), and calls the tracepoint. Each iteration will record the time 96781dc9f0eSSteven Rostedt (Red Hat) it took to write to the tracepoint and the next iteration that 96881dc9f0eSSteven Rostedt (Red Hat) data will be passed to the tracepoint itself. That is, the tracepoint 96981dc9f0eSSteven Rostedt (Red Hat) will report the time it took to do the previous tracepoint. 97081dc9f0eSSteven Rostedt (Red Hat) The string written to the tracepoint is a static string of 128 bytes 97181dc9f0eSSteven Rostedt (Red Hat) to keep the time the same. The initial string is simply a write of 97281dc9f0eSSteven Rostedt (Red Hat) "START". The second string records the cold cache time of the first 97381dc9f0eSSteven Rostedt (Red Hat) write which is not added to the rest of the calculations. 97481dc9f0eSSteven Rostedt (Red Hat) 97581dc9f0eSSteven Rostedt (Red Hat) As it is a tight loop, it benchmarks as hot cache. That's fine because 97681dc9f0eSSteven Rostedt (Red Hat) we care most about hot paths that are probably in cache already. 97781dc9f0eSSteven Rostedt (Red Hat) 97881dc9f0eSSteven Rostedt (Red Hat) An example of the output: 97981dc9f0eSSteven Rostedt (Red Hat) 98081dc9f0eSSteven Rostedt (Red Hat) START 98181dc9f0eSSteven Rostedt (Red Hat) first=3672 [COLD CACHED] 98281dc9f0eSSteven Rostedt (Red Hat) last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712 98381dc9f0eSSteven Rostedt (Red Hat) last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337 98481dc9f0eSSteven Rostedt (Red Hat) last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064 98581dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411 98681dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389 98781dc9f0eSSteven Rostedt (Red Hat) last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666 98881dc9f0eSSteven Rostedt (Red Hat) 98981dc9f0eSSteven Rostedt (Red Hat) 9905092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK 9915092dbc9SSteven Rostedt tristate "Ring buffer benchmark stress tester" 9925092dbc9SSteven Rostedt depends on RING_BUFFER 9935092dbc9SSteven Rostedt help 9945092dbc9SSteven Rostedt This option creates a test to stress the ring buffer and benchmark it. 99540892367SRandy Dunlap It creates its own ring buffer such that it will not interfere with 9965092dbc9SSteven Rostedt any other users of the ring buffer (such as ftrace). It then creates 9975092dbc9SSteven Rostedt a producer and consumer that will run for 10 seconds and sleep for 9985092dbc9SSteven Rostedt 10 seconds. Each interval it will print out the number of events 9995092dbc9SSteven Rostedt it recorded and give a rough estimate of how long each iteration took. 10005092dbc9SSteven Rostedt 10015092dbc9SSteven Rostedt It does not disable interrupts or raise its priority, so it may be 10025092dbc9SSteven Rostedt affected by processes that are running. 10035092dbc9SSteven Rostedt 100440892367SRandy Dunlap If unsure, say N. 10055092dbc9SSteven Rostedt 10061e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE 10071e837945SSteven Rostedt (VMware) bool "Show eval mappings for trace events" 10081e837945SSteven Rostedt (VMware) depends on TRACING 10091e837945SSteven Rostedt (VMware) help 10101e837945SSteven Rostedt (VMware) The "print fmt" of the trace events will show the enum/sizeof names 10111e837945SSteven Rostedt (VMware) instead of their values. This can cause problems for user space tools 10121e837945SSteven Rostedt (VMware) that use this string to parse the raw data as user space does not know 10131e837945SSteven Rostedt (VMware) how to convert the string to its value. 10141e837945SSteven Rostedt (VMware) 10151e837945SSteven Rostedt (VMware) To fix this, there's a special macro in the kernel that can be used 10161e837945SSteven Rostedt (VMware) to convert an enum/sizeof into its value. If this macro is used, then 10171e837945SSteven Rostedt (VMware) the print fmt strings will be converted to their values. 10181e837945SSteven Rostedt (VMware) 10191e837945SSteven Rostedt (VMware) If something does not get converted properly, this option can be 10201e837945SSteven Rostedt (VMware) used to show what enums/sizeof the kernel tried to convert. 10211e837945SSteven Rostedt (VMware) 10221e837945SSteven Rostedt (VMware) This option is for debugging the conversions. A file is created 10231e837945SSteven Rostedt (VMware) in the tracing directory called "eval_map" that will show the 10241e837945SSteven Rostedt (VMware) names matched with their values and what trace event system they 10251e837945SSteven Rostedt (VMware) belong too. 10261e837945SSteven Rostedt (VMware) 10271e837945SSteven Rostedt (VMware) Normally, the mapping of the strings to values will be freed after 10281e837945SSteven Rostedt (VMware) boot up or module load. With this option, they will not be freed, as 10291e837945SSteven Rostedt (VMware) they are needed for the "eval_map" file. Enabling this option will 10301e837945SSteven Rostedt (VMware) increase the memory footprint of the running kernel. 10311e837945SSteven Rostedt (VMware) 10321e837945SSteven Rostedt (VMware) If unsure, say N. 10331e837945SSteven Rostedt (VMware) 1034773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION 1035773c1670SSteven Rostedt (VMware) bool "Record functions that recurse in function tracing" 1036773c1670SSteven Rostedt (VMware) depends on FUNCTION_TRACER 1037773c1670SSteven Rostedt (VMware) help 1038773c1670SSteven Rostedt (VMware) All callbacks that attach to the function tracing have some sort 1039773c1670SSteven Rostedt (VMware) of protection against recursion. Even though the protection exists, 1040773c1670SSteven Rostedt (VMware) it adds overhead. This option will create a file in the tracefs 1041773c1670SSteven Rostedt (VMware) file system called "recursed_functions" that will list the functions 1042773c1670SSteven Rostedt (VMware) that triggered a recursion. 1043773c1670SSteven Rostedt (VMware) 1044773c1670SSteven Rostedt (VMware) This will add more overhead to cases that have recursion. 1045773c1670SSteven Rostedt (VMware) 1046773c1670SSteven Rostedt (VMware) If unsure, say N 1047773c1670SSteven Rostedt (VMware) 1048773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE 1049773c1670SSteven Rostedt (VMware) int "Max number of recursed functions to record" 1050773c1670SSteven Rostedt (VMware) default 128 1051773c1670SSteven Rostedt (VMware) depends on FTRACE_RECORD_RECURSION 1052773c1670SSteven Rostedt (VMware) help 1053773c1670SSteven Rostedt (VMware) This defines the limit of number of functions that can be 1054773c1670SSteven Rostedt (VMware) listed in the "recursed_functions" file, that lists all 1055773c1670SSteven Rostedt (VMware) the functions that caused a recursion to happen. 1056773c1670SSteven Rostedt (VMware) This file can be reset, but the limit can not change in 1057773c1670SSteven Rostedt (VMware) size at runtime. 1058773c1670SSteven Rostedt (VMware) 1059b0e28a4bSAndrii Nakryikoconfig FTRACE_VALIDATE_RCU_IS_WATCHING 1060b0e28a4bSAndrii Nakryiko bool "Validate RCU is on during ftrace execution" 1061b0e28a4bSAndrii Nakryiko depends on FUNCTION_TRACER 1062b0e28a4bSAndrii Nakryiko depends on ARCH_WANTS_NO_INSTR 1063b0e28a4bSAndrii Nakryiko help 1064b0e28a4bSAndrii Nakryiko All callbacks that attach to the function tracing have some sort of 1065b0e28a4bSAndrii Nakryiko protection against recursion. This option is only to verify that 1066b0e28a4bSAndrii Nakryiko ftrace (and other users of ftrace_test_recursion_trylock()) are not 1067b0e28a4bSAndrii Nakryiko called outside of RCU, as if they are, it can cause a race. But it 1068b0e28a4bSAndrii Nakryiko also has a noticeable overhead when enabled. 1069b0e28a4bSAndrii Nakryiko 1070b0e28a4bSAndrii Nakryiko If unsure, say N 1071b0e28a4bSAndrii Nakryiko 107228575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION 107328575c61SSteven Rostedt (VMware) bool "Record functions that recurse in the ring buffer" 107428575c61SSteven Rostedt (VMware) depends on FTRACE_RECORD_RECURSION 107528575c61SSteven Rostedt (VMware) # default y, because it is coupled with FTRACE_RECORD_RECURSION 107628575c61SSteven Rostedt (VMware) default y 107728575c61SSteven Rostedt (VMware) help 107828575c61SSteven Rostedt (VMware) The ring buffer has its own internal recursion. Although when 1079ac28d0a0SRandy Dunlap recursion happens it won't cause harm because of the protection, 1080ac28d0a0SRandy Dunlap but it does cause unwanted overhead. Enabling this option will 108128575c61SSteven Rostedt (VMware) place where recursion was detected into the ftrace "recursed_functions" 108228575c61SSteven Rostedt (VMware) file. 108328575c61SSteven Rostedt (VMware) 108428575c61SSteven Rostedt (VMware) This will add more overhead to cases that have recursion. 108528575c61SSteven Rostedt (VMware) 10861e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE 10871e837945SSteven Rostedt (VMware) bool "Enable GCOV profiling on ftrace subsystem" 10881e837945SSteven Rostedt (VMware) depends on GCOV_KERNEL 10891e837945SSteven Rostedt (VMware) help 10901e837945SSteven Rostedt (VMware) Enable GCOV profiling on ftrace subsystem for checking 10911e837945SSteven Rostedt (VMware) which functions/lines are tested. 10921e837945SSteven Rostedt (VMware) 10931e837945SSteven Rostedt (VMware) If unsure, say N. 10941e837945SSteven Rostedt (VMware) 10951e837945SSteven Rostedt (VMware) Note that on a kernel compiled with this config, ftrace will 10961e837945SSteven Rostedt (VMware) run significantly slower. 10971e837945SSteven Rostedt (VMware) 10981e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST 10991e837945SSteven Rostedt (VMware) bool 11001e837945SSteven Rostedt (VMware) 11011e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST 11021e837945SSteven Rostedt (VMware) bool "Perform a startup test on ftrace" 11031e837945SSteven Rostedt (VMware) depends on GENERIC_TRACER 11041e837945SSteven Rostedt (VMware) select FTRACE_SELFTEST 11051e837945SSteven Rostedt (VMware) help 11061e837945SSteven Rostedt (VMware) This option performs a series of startup tests on ftrace. On bootup 11071e837945SSteven Rostedt (VMware) a series of tests are made to verify that the tracer is 11081e837945SSteven Rostedt (VMware) functioning properly. It will do tests on all the configured 11091e837945SSteven Rostedt (VMware) tracers of ftrace. 11101e837945SSteven Rostedt (VMware) 11111e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST 11121e837945SSteven Rostedt (VMware) bool "Run selftest on trace events" 11131e837945SSteven Rostedt (VMware) depends on FTRACE_STARTUP_TEST 11141e837945SSteven Rostedt (VMware) default y 11151e837945SSteven Rostedt (VMware) help 11161e837945SSteven Rostedt (VMware) This option performs a test on all trace events in the system. 11171e837945SSteven Rostedt (VMware) It basically just enables each event and runs some code that 11181e837945SSteven Rostedt (VMware) will trigger events (not necessarily the event it enables) 11191e837945SSteven Rostedt (VMware) This may take some time run as there are a lot of events. 11201e837945SSteven Rostedt (VMware) 11211e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS 11221e837945SSteven Rostedt (VMware) bool "Run selftest on syscall events" 11231e837945SSteven Rostedt (VMware) depends on EVENT_TRACE_STARTUP_TEST 11241e837945SSteven Rostedt (VMware) help 11251e837945SSteven Rostedt (VMware) This option will also enable testing every syscall event. 11261e837945SSteven Rostedt (VMware) It only enables the event and disables it and runs various loads 11271e837945SSteven Rostedt (VMware) with the event enabled. This adds a bit more time for kernel boot 11281e837945SSteven Rostedt (VMware) up since it runs this on every system call defined. 11291e837945SSteven Rostedt (VMware) 11301e837945SSteven Rostedt (VMware) TBD - enable a way to actually call the syscalls as we test their 11311e837945SSteven Rostedt (VMware) events 11321e837945SSteven Rostedt (VMware) 11338147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST 11348147dc78SSteven Rostedt (VMware) bool "Verify compile time sorting of ftrace functions" 11358147dc78SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE 11366b9b6413SSteven Rostedt (Google) depends on BUILDTIME_MCOUNT_SORT 11378147dc78SSteven Rostedt (VMware) help 11388147dc78SSteven Rostedt (VMware) Sorting of the mcount_loc sections that is used to find the 11398147dc78SSteven Rostedt (VMware) where the ftrace knows where to patch functions for tracing 11408147dc78SSteven Rostedt (VMware) and other callbacks is done at compile time. But if the sort 11418147dc78SSteven Rostedt (VMware) is not done correctly, it will cause non-deterministic failures. 11428147dc78SSteven Rostedt (VMware) When this is set, the sorted sections will be verified that they 11438147dc78SSteven Rostedt (VMware) are in deed sorted and will warn if they are not. 11448147dc78SSteven Rostedt (VMware) 11458147dc78SSteven Rostedt (VMware) If unsure, say N 11468147dc78SSteven Rostedt (VMware) 11476c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST 11486c43e554SSteven Rostedt (Red Hat) bool "Ring buffer startup self test" 11496c43e554SSteven Rostedt (Red Hat) depends on RING_BUFFER 11506c43e554SSteven Rostedt (Red Hat) help 11516c43e554SSteven Rostedt (Red Hat) Run a simple self test on the ring buffer on boot up. Late in the 11526c43e554SSteven Rostedt (Red Hat) kernel boot sequence, the test will start that kicks off 11536c43e554SSteven Rostedt (Red Hat) a thread per cpu. Each thread will write various size events 11546c43e554SSteven Rostedt (Red Hat) into the ring buffer. Another thread is created to send IPIs 11556c43e554SSteven Rostedt (Red Hat) to each of the threads, where the IPI handler will also write 11566c43e554SSteven Rostedt (Red Hat) to the ring buffer, to test/stress the nesting ability. 11576c43e554SSteven Rostedt (Red Hat) If any anomalies are discovered, a warning will be displayed 11586c43e554SSteven Rostedt (Red Hat) and all ring buffers will be disabled. 11596c43e554SSteven Rostedt (Red Hat) 11606c43e554SSteven Rostedt (Red Hat) The test runs for 10 seconds. This will slow your boot time 11616c43e554SSteven Rostedt (Red Hat) by at least 10 more seconds. 11626c43e554SSteven Rostedt (Red Hat) 1163ac28d0a0SRandy Dunlap At the end of the test, statistics and more checks are done. 1164ac28d0a0SRandy Dunlap It will output the stats of each per cpu buffer: What 11656c43e554SSteven Rostedt (Red Hat) was written, the sizes, what was read, what was lost, and 11666c43e554SSteven Rostedt (Red Hat) other similar details. 11676c43e554SSteven Rostedt (Red Hat) 11686c43e554SSteven Rostedt (Red Hat) If unsure, say N 11696c43e554SSteven Rostedt (Red Hat) 11705b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS 11715b7be9c7SSteven Rostedt (VMware) bool "Verify ring buffer time stamp deltas" 11725b7be9c7SSteven Rostedt (VMware) depends on RING_BUFFER 11735b7be9c7SSteven Rostedt (VMware) help 11745b7be9c7SSteven Rostedt (VMware) This will audit the time stamps on the ring buffer sub 11755b7be9c7SSteven Rostedt (VMware) buffer to make sure that all the time deltas for the 11765b7be9c7SSteven Rostedt (VMware) events on a sub buffer matches the current time stamp. 11775b7be9c7SSteven Rostedt (VMware) This audit is performed for every event that is not 11785b7be9c7SSteven Rostedt (VMware) interrupted, or interrupting another event. A check 11795b7be9c7SSteven Rostedt (VMware) is also made when traversing sub buffers to make sure 11805b7be9c7SSteven Rostedt (VMware) that all the deltas on the previous sub buffer do not 11815b7be9c7SSteven Rostedt (VMware) add up to be greater than the current time stamp. 11825b7be9c7SSteven Rostedt (VMware) 11835b7be9c7SSteven Rostedt (VMware) NOTE: This adds significant overhead to recording of events, 11845b7be9c7SSteven Rostedt (VMware) and should only be used to test the logic of the ring buffer. 11855b7be9c7SSteven Rostedt (VMware) Do not use it on production systems. 11865b7be9c7SSteven Rostedt (VMware) 11875b7be9c7SSteven Rostedt (VMware) Only say Y if you understand what this does, and you 11885b7be9c7SSteven Rostedt (VMware) still want it enabled. Otherwise say N 11895b7be9c7SSteven Rostedt (VMware) 1190a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST 1191a48fc4f5SSteven Rostedt (VMware) tristate "Test module for mmiotrace" 1192a48fc4f5SSteven Rostedt (VMware) depends on MMIOTRACE && m 1193a48fc4f5SSteven Rostedt (VMware) help 1194a48fc4f5SSteven Rostedt (VMware) This is a dumb module for testing mmiotrace. It is very dangerous 1195a48fc4f5SSteven Rostedt (VMware) as it will write garbage to IO memory starting at a given address. 1196a48fc4f5SSteven Rostedt (VMware) However, it should be safe to use on e.g. unused portion of VRAM. 1197a48fc4f5SSteven Rostedt (VMware) 1198a48fc4f5SSteven Rostedt (VMware) Say N, unless you absolutely know what you are doing. 1199a48fc4f5SSteven Rostedt (VMware) 1200f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST 1201a48fc4f5SSteven Rostedt (VMware) tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers" 1202f96e8577SJoel Fernandes (Google) depends on m 1203f96e8577SJoel Fernandes (Google) help 1204f96e8577SJoel Fernandes (Google) Select this option to build a test module that can help test latency 1205f96e8577SJoel Fernandes (Google) tracers by executing a preempt or irq disable section with a user 1206f96e8577SJoel Fernandes (Google) configurable delay. The module busy waits for the duration of the 1207f96e8577SJoel Fernandes (Google) critical section. 1208f96e8577SJoel Fernandes (Google) 120979393723SViktor Rosendahl (BMW) For example, the following invocation generates a burst of three 121079393723SViktor Rosendahl (BMW) irq-disabled critical sections for 500us: 121179393723SViktor Rosendahl (BMW) modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3 1212f96e8577SJoel Fernandes (Google) 12134b9091e1SSong Chen What's more, if you want to attach the test on the cpu which the latency 12144b9091e1SSong Chen tracer is running on, specify cpu_affinity=cpu_num at the end of the 12154b9091e1SSong Chen command. 12164b9091e1SSong Chen 1217f96e8577SJoel Fernandes (Google) If unsure, say N 1218f96e8577SJoel Fernandes (Google) 12199fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST 12209fe41efaSTom Zanussi tristate "Test module for in-kernel synthetic event generation" 12213572bd56SMasami Hiramatsu (Google) depends on SYNTH_EVENTS && m 12229fe41efaSTom Zanussi help 12239fe41efaSTom Zanussi This option creates a test module to check the base 12249fe41efaSTom Zanussi functionality of in-kernel synthetic event definition and 12259fe41efaSTom Zanussi generation. 12269fe41efaSTom Zanussi 12279fe41efaSTom Zanussi To test, insert the module, and then check the trace buffer 12289fe41efaSTom Zanussi for the generated sample events. 12299fe41efaSTom Zanussi 12309fe41efaSTom Zanussi If unsure, say N. 12319fe41efaSTom Zanussi 123264836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST 123364836248STom Zanussi tristate "Test module for in-kernel kprobe event generation" 12343572bd56SMasami Hiramatsu (Google) depends on KPROBE_EVENTS && m 123564836248STom Zanussi help 123664836248STom Zanussi This option creates a test module to check the base 123764836248STom Zanussi functionality of in-kernel kprobe event definition. 123864836248STom Zanussi 123964836248STom Zanussi To test, insert the module, and then check the trace buffer 124064836248STom Zanussi for the generated kprobe events. 124164836248STom Zanussi 124264836248STom Zanussi If unsure, say N. 124364836248STom Zanussi 12442d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG 12452d19bd79STom Zanussi bool "Hist trigger debug support" 12462d19bd79STom Zanussi depends on HIST_TRIGGERS 12472d19bd79STom Zanussi help 12482d19bd79STom Zanussi Add "hist_debug" file for each event, which when read will 12492d19bd79STom Zanussi dump out a bunch of internal details about the hist triggers 12502d19bd79STom Zanussi defined on that event. 12512d19bd79STom Zanussi 12522d19bd79STom Zanussi The hist_debug file serves a couple of purposes: 12532d19bd79STom Zanussi 12542d19bd79STom Zanussi - Helps developers verify that nothing is broken. 12552d19bd79STom Zanussi 12562d19bd79STom Zanussi - Provides educational information to support the details 12572d19bd79STom Zanussi of the hist trigger internals as described by 12582d19bd79STom Zanussi Documentation/trace/histogram-design.rst. 12592d19bd79STom Zanussi 12602d19bd79STom Zanussi The hist_debug output only covers the data structures 12612d19bd79STom Zanussi related to the histogram definitions themselves and doesn't 12622d19bd79STom Zanussi display the internals of map buckets or variable values of 12632d19bd79STom Zanussi running histograms. 12642d19bd79STom Zanussi 12652d19bd79STom Zanussi If unsure, say N. 12662d19bd79STom Zanussi 1267102227b9SDaniel Bristot de Oliveirasource "kernel/trace/rv/Kconfig" 1268102227b9SDaniel Bristot de Oliveira 12694ed9f071SSteven Rostedtendif # FTRACE 1270