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 13606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER 1416444a8aSArnaldo Carvalho de Melo bool 15555f386cSMike Frysinger help 165fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 17bc0c38d1SSteven Rostedt 18fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER 1915e6cb36SFrederic Weisbecker bool 20555f386cSMike Frysinger help 215fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 2215e6cb36SFrederic Weisbecker 23677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 24677aa9f7SSteven Rostedt bool 25555f386cSMike Frysinger help 265fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 27677aa9f7SSteven Rostedt 2806aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS 2906aeaaeaSMasami Hiramatsu bool 3006aeaaeaSMasami Hiramatsu 31763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 32763e34e7SSteven Rostedt (VMware) bool 33763e34e7SSteven Rostedt (VMware) 348da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD 358da3821bSSteven Rostedt bool 36555f386cSMike Frysinger help 375fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 388da3821bSSteven Rostedt 3966700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS 40ee08c6ecSFrederic Weisbecker bool 41555f386cSMike Frysinger help 425fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 43ee08c6ecSFrederic Weisbecker 44a2546faeSSteven Rostedtconfig HAVE_FENTRY 45a2546faeSSteven Rostedt bool 46a2546faeSSteven Rostedt help 47a2546faeSSteven Rostedt Arch supports the gcc options -pg with -mfentry 48a2546faeSSteven Rostedt 492f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT 502f4df001SVasily Gorbik bool 512f4df001SVasily Gorbik help 522f4df001SVasily Gorbik Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount 532f4df001SVasily Gorbik 54cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT 5572441cb1SSteven Rostedt bool 5672441cb1SSteven Rostedt help 5772441cb1SSteven Rostedt C version of recordmcount available? 5872441cb1SSteven Rostedt 59352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 60352ad25aSSteven Rostedt bool 61352ad25aSSteven Rostedt 62ea632e9fSJosh Triplettconfig TRACE_CLOCK 63ea632e9fSJosh Triplett bool 64ea632e9fSJosh Triplett 657a8e76a3SSteven Rostedtconfig RING_BUFFER 667a8e76a3SSteven Rostedt bool 67ea632e9fSJosh Triplett select TRACE_CLOCK 6822287688SSteven Rostedt (Red Hat) select IRQ_WORK 697a8e76a3SSteven Rostedt 705f77a88bSTom Zanussiconfig EVENT_TRACING 71b11c53e1SZhaolei select CONTEXT_SWITCH_TRACER 7260f1d5e3SMasami Hiramatsu select GLOB 73b11c53e1SZhaolei bool 74b11c53e1SZhaolei 75b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER 765f77a88bSTom Zanussi bool 775f77a88bSTom Zanussi 7885bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP 7985bac32cSSteven Rostedt bool 8085bac32cSSteven Rostedt help 8185bac32cSSteven Rostedt Allow the use of ring_buffer_swap_cpu. 8285bac32cSSteven Rostedt Adds a very slight overhead to tracing when enabled. 8385bac32cSSteven Rostedt 84c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS 85c3bc8fd6SJoel Fernandes (Google) bool 86c3bc8fd6SJoel Fernandes (Google) depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS 87c3bc8fd6SJoel Fernandes (Google) select TRACING 88c3bc8fd6SJoel Fernandes (Google) default y 89c3bc8fd6SJoel Fernandes (Google) help 90c3bc8fd6SJoel Fernandes (Google) Create preempt/irq toggle tracepoints if needed, so that other parts 91c3bc8fd6SJoel Fernandes (Google) of the kernel can use them to generate or add hooks to them. 92c3bc8fd6SJoel Fernandes (Google) 935e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are 945e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING. 955e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the 965e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options 975e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the 9840892367SRandy Dunlap# hiding of the automatic options. 995e0a0939SSteven Rostedt 100bc0c38d1SSteven Rostedtconfig TRACING 101bc0c38d1SSteven Rostedt bool 1027a8e76a3SSteven Rostedt select RING_BUFFER 103c2c80529SAl Viro select STACKTRACE if STACKTRACE_SUPPORT 1045f87f112SIngo Molnar select TRACEPOINTS 105f3384b28SSteven Rostedt select NOP_TRACER 106769b0441SFrederic Weisbecker select BINARY_PRINTF 1075f77a88bSTom Zanussi select EVENT_TRACING 108ea632e9fSJosh Triplett select TRACE_CLOCK 109bc0c38d1SSteven Rostedt 1105e0a0939SSteven Rostedtconfig GENERIC_TRACER 1115e0a0939SSteven Rostedt bool 1125e0a0939SSteven Rostedt select TRACING 1135e0a0939SSteven Rostedt 11440ada30fSIngo Molnar# 11540ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to 11640ada30fSIngo Molnar# be able to offer generic tracing facilities: 11740ada30fSIngo Molnar# 11840ada30fSIngo Molnarconfig TRACING_SUPPORT 11940ada30fSIngo Molnar bool 1200ea5ee03SMichael Ellerman depends on TRACE_IRQFLAGS_SUPPORT 12140ada30fSIngo Molnar depends on STACKTRACE_SUPPORT 122422d3c7aSKOSAKI Motohiro default y 12340ada30fSIngo Molnar 12440ada30fSIngo Molnarif TRACING_SUPPORT 12540ada30fSIngo Molnar 1264ed9f071SSteven Rostedtmenuconfig FTRACE 1274ed9f071SSteven Rostedt bool "Tracers" 12865b77242SSteven Rostedt default y if DEBUG_KERNEL 1294ed9f071SSteven Rostedt help 1304ed9f071SSteven Rostedt Enable the kernel tracing infrastructure. 1314ed9f071SSteven Rostedt 1324ed9f071SSteven Rostedtif FTRACE 13317d80fd0SPeter Zijlstra 1341e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING 1351e837945SSteven Rostedt (VMware) bool "Boot-time Tracing support" 136d8a953ddSMasami Hiramatsu depends on TRACING 137d8a953ddSMasami Hiramatsu select BOOT_CONFIG 1381e837945SSteven Rostedt (VMware) help 1391e837945SSteven Rostedt (VMware) Enable developer to setup ftrace subsystem via supplemental 1401e837945SSteven Rostedt (VMware) kernel cmdline at boot time for debugging (tracing) driver 1411e837945SSteven Rostedt (VMware) initialization and boot process. 1421e837945SSteven Rostedt (VMware) 143606576ceSSteven Rostedtconfig FUNCTION_TRACER 1441b29b018SSteven Rostedt bool "Kernel Function Tracer" 145606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 1464d7a077cSSteven Rostedt select KALLSYMS 1475e0a0939SSteven Rostedt select GENERIC_TRACER 14835e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 14960f1d5e3SMasami Hiramatsu select GLOB 15001b1d88bSThomas Gleixner select TASKS_RCU if PREEMPTION 151e5a971d7SPaul E. McKenney select TASKS_RUDE_RCU 1521b29b018SSteven Rostedt help 1531b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 1541b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 15540892367SRandy Dunlap instruction at the beginning of every kernel function, which NOP 1561b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 1571b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 1581b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 1591b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 16035e8e302SSteven Rostedt 161fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER 162fb52607aSFrederic Weisbecker bool "Kernel Function Graph Tracer" 163fb52607aSFrederic Weisbecker depends on HAVE_FUNCTION_GRAPH_TRACER 16415e6cb36SFrederic Weisbecker depends on FUNCTION_TRACER 165eb4a0378SSteven Rostedt depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE 166764f3b95SIngo Molnar default y 16715e6cb36SFrederic Weisbecker help 168fb52607aSFrederic Weisbecker Enable the kernel to trace a function at both its return 169fb52607aSFrederic Weisbecker and its entry. 170692105b8SMatt LaPlante Its first purpose is to trace the duration of functions and 171692105b8SMatt LaPlante draw a call graph for each thread with some information like 172692105b8SMatt LaPlante the return value. This is done by setting the current return 173692105b8SMatt LaPlante address on the current task structure into a stack of calls. 17415e6cb36SFrederic Weisbecker 17561778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE 17661778cd7SSteven Rostedt (VMware) bool "enable/disable function tracing dynamically" 17761778cd7SSteven Rostedt (VMware) depends on FUNCTION_TRACER 17861778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE 17961778cd7SSteven Rostedt (VMware) default y 18061778cd7SSteven Rostedt (VMware) help 18161778cd7SSteven Rostedt (VMware) This option will modify all the calls to function tracing 18261778cd7SSteven Rostedt (VMware) dynamically (will patch them out of the binary image and 18361778cd7SSteven Rostedt (VMware) replace them with a No-Op instruction) on boot up. During 18461778cd7SSteven Rostedt (VMware) compile time, a table is made of all the locations that ftrace 18561778cd7SSteven Rostedt (VMware) can function trace, and this table is linked into the kernel 18661778cd7SSteven Rostedt (VMware) image. When this is enabled, functions can be individually 18761778cd7SSteven Rostedt (VMware) enabled, and the functions not enabled will not affect 18861778cd7SSteven Rostedt (VMware) performance of the system. 18961778cd7SSteven Rostedt (VMware) 19061778cd7SSteven Rostedt (VMware) See the files in /sys/kernel/debug/tracing: 19161778cd7SSteven Rostedt (VMware) available_filter_functions 19261778cd7SSteven Rostedt (VMware) set_ftrace_filter 19361778cd7SSteven Rostedt (VMware) set_ftrace_notrace 19461778cd7SSteven Rostedt (VMware) 19561778cd7SSteven Rostedt (VMware) This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but 19661778cd7SSteven Rostedt (VMware) otherwise has native performance as long as no tracing is active. 19761778cd7SSteven Rostedt (VMware) 19861778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS 19961778cd7SSteven Rostedt (VMware) def_bool y 20061778cd7SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE 20161778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE_WITH_REGS 20261778cd7SSteven Rostedt (VMware) 20361778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS 20461778cd7SSteven Rostedt (VMware) def_bool y 20561778cd7SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE 20661778cd7SSteven Rostedt (VMware) depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 20761778cd7SSteven Rostedt (VMware) 20861778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER 20961778cd7SSteven Rostedt (VMware) bool "Kernel function profiler" 21061778cd7SSteven Rostedt (VMware) depends on FUNCTION_TRACER 21161778cd7SSteven Rostedt (VMware) default n 21261778cd7SSteven Rostedt (VMware) help 21361778cd7SSteven Rostedt (VMware) This option enables the kernel function profiler. A file is created 21461778cd7SSteven Rostedt (VMware) in debugfs called function_profile_enabled which defaults to zero. 21561778cd7SSteven Rostedt (VMware) When a 1 is echoed into this file profiling begins, and when a 21661778cd7SSteven Rostedt (VMware) zero is entered, profiling stops. A "functions" file is created in 21761778cd7SSteven Rostedt (VMware) the trace_stat directory; this file shows the list of functions that 21861778cd7SSteven Rostedt (VMware) have been hit and their counters. 21961778cd7SSteven Rostedt (VMware) 22061778cd7SSteven Rostedt (VMware) If in doubt, say N. 22161778cd7SSteven Rostedt (VMware) 22261778cd7SSteven Rostedt (VMware)config STACK_TRACER 22361778cd7SSteven Rostedt (VMware) bool "Trace max stack" 22461778cd7SSteven Rostedt (VMware) depends on HAVE_FUNCTION_TRACER 22561778cd7SSteven Rostedt (VMware) select FUNCTION_TRACER 22661778cd7SSteven Rostedt (VMware) select STACKTRACE 22761778cd7SSteven Rostedt (VMware) select KALLSYMS 22861778cd7SSteven Rostedt (VMware) help 22961778cd7SSteven Rostedt (VMware) This special tracer records the maximum stack footprint of the 23061778cd7SSteven Rostedt (VMware) kernel and displays it in /sys/kernel/debug/tracing/stack_trace. 23161778cd7SSteven Rostedt (VMware) 23261778cd7SSteven Rostedt (VMware) This tracer works by hooking into every function call that the 23361778cd7SSteven Rostedt (VMware) kernel executes, and keeping a maximum stack depth value and 23461778cd7SSteven Rostedt (VMware) stack-trace saved. If this is configured with DYNAMIC_FTRACE 23561778cd7SSteven Rostedt (VMware) then it will not have any overhead while the stack tracer 23661778cd7SSteven Rostedt (VMware) is disabled. 23761778cd7SSteven Rostedt (VMware) 23861778cd7SSteven Rostedt (VMware) To enable the stack tracer on bootup, pass in 'stacktrace' 23961778cd7SSteven Rostedt (VMware) on the kernel command line. 24061778cd7SSteven Rostedt (VMware) 24161778cd7SSteven Rostedt (VMware) The stack tracer can also be enabled or disabled via the 24261778cd7SSteven Rostedt (VMware) sysctl kernel.stack_tracer_enabled 24361778cd7SSteven Rostedt (VMware) 24461778cd7SSteven Rostedt (VMware) Say N if unsure. 24561778cd7SSteven Rostedt (VMware) 246c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE 247c3bc8fd6SJoel Fernandes (Google) bool 248c3bc8fd6SJoel Fernandes (Google) help 249c3bc8fd6SJoel Fernandes (Google) Enables hooks which will be called when preemption is first disabled, 250c3bc8fd6SJoel Fernandes (Google) and last enabled. 251bac429f0SSteven Rostedt 25281d68a96SSteven Rostedtconfig IRQSOFF_TRACER 25381d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 25481d68a96SSteven Rostedt default n 25581d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 256592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 25781d68a96SSteven Rostedt select TRACE_IRQFLAGS 2585e0a0939SSteven Rostedt select GENERIC_TRACER 25981d68a96SSteven Rostedt select TRACER_MAX_TRACE 26085bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 26122cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 2620b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 26381d68a96SSteven Rostedt help 26481d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 26581d68a96SSteven Rostedt sections, with microsecond accuracy. 26681d68a96SSteven Rostedt 26781d68a96SSteven Rostedt The default measurement method is a maximum search, which is 26881d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 26981d68a96SSteven Rostedt via: 27081d68a96SSteven Rostedt 271156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 27281d68a96SSteven Rostedt 27340892367SRandy Dunlap (Note that kernel size and overhead increase with this option 2746cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 2756cd8a4bbSSteven Rostedt used together or separately.) 2766cd8a4bbSSteven Rostedt 2776cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 2786cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 2796cd8a4bbSSteven Rostedt default n 280592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 28130c93704SThomas Gleixner depends on PREEMPTION 2825e0a0939SSteven Rostedt select GENERIC_TRACER 2836cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 28485bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 28522cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 2860b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 287c3bc8fd6SJoel Fernandes (Google) select TRACE_PREEMPT_TOGGLE 2886cd8a4bbSSteven Rostedt help 28940892367SRandy Dunlap This option measures the time spent in preemption-off critical 2906cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 2916cd8a4bbSSteven Rostedt 2926cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 2936cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 2946cd8a4bbSSteven Rostedt via: 2956cd8a4bbSSteven Rostedt 296156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 2976cd8a4bbSSteven Rostedt 29840892367SRandy Dunlap (Note that kernel size and overhead increase with this option 2996cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 3006cd8a4bbSSteven Rostedt used together or separately.) 3016cd8a4bbSSteven Rostedt 302352ad25aSSteven Rostedtconfig SCHED_TRACER 303352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 3045e0a0939SSteven Rostedt select GENERIC_TRACER 305352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 306352ad25aSSteven Rostedt select TRACER_MAX_TRACE 30722cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 308352ad25aSSteven Rostedt help 309352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 310352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 311352ad25aSSteven Rostedt 312e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER 313e7c15cd8SSteven Rostedt (Red Hat) bool "Tracer to detect hardware latencies (like SMIs)" 314e7c15cd8SSteven Rostedt (Red Hat) select GENERIC_TRACER 315e7c15cd8SSteven Rostedt (Red Hat) help 316e7c15cd8SSteven Rostedt (Red Hat) This tracer, when enabled will create one or more kernel threads, 317c5c1ea75SJesper Dangaard Brouer depending on what the cpumask file is set to, which each thread 318e7c15cd8SSteven Rostedt (Red Hat) spinning in a loop looking for interruptions caused by 319e7c15cd8SSteven Rostedt (Red Hat) something other than the kernel. For example, if a 320e7c15cd8SSteven Rostedt (Red Hat) System Management Interrupt (SMI) takes a noticeable amount of 321e7c15cd8SSteven Rostedt (Red Hat) time, this tracer will detect it. This is useful for testing 322e7c15cd8SSteven Rostedt (Red Hat) if a system is reliable for Real Time tasks. 323e7c15cd8SSteven Rostedt (Red Hat) 324e7c15cd8SSteven Rostedt (Red Hat) Some files are created in the tracing directory when this 325e7c15cd8SSteven Rostedt (Red Hat) is enabled: 326e7c15cd8SSteven Rostedt (Red Hat) 327e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/width - time in usecs for how long to spin for 328e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/window - time in usecs between the start of each 329e7c15cd8SSteven Rostedt (Red Hat) iteration 330e7c15cd8SSteven Rostedt (Red Hat) 331e7c15cd8SSteven Rostedt (Red Hat) A kernel thread is created that will spin with interrupts disabled 332c5c1ea75SJesper Dangaard Brouer for "width" microseconds in every "window" cycle. It will not spin 333e7c15cd8SSteven Rostedt (Red Hat) for "window - width" microseconds, where the system can 334e7c15cd8SSteven Rostedt (Red Hat) continue to operate. 335e7c15cd8SSteven Rostedt (Red Hat) 336e7c15cd8SSteven Rostedt (Red Hat) The output will appear in the trace and trace_pipe files. 337e7c15cd8SSteven Rostedt (Red Hat) 338e7c15cd8SSteven Rostedt (Red Hat) When the tracer is not running, it has no affect on the system, 339e7c15cd8SSteven Rostedt (Red Hat) but when it is running, it can cause the system to be 340e7c15cd8SSteven Rostedt (Red Hat) periodically non responsive. Do not run this tracer on a 341e7c15cd8SSteven Rostedt (Red Hat) production system. 342e7c15cd8SSteven Rostedt (Red Hat) 343e7c15cd8SSteven Rostedt (Red Hat) To enable this tracer, echo in "hwlat" into the current_tracer 344e7c15cd8SSteven Rostedt (Red Hat) file. Every time a latency is greater than tracing_thresh, it will 345e7c15cd8SSteven Rostedt (Red Hat) be recorded into the ring buffer. 346e7c15cd8SSteven Rostedt (Red Hat) 34721b3ce30SSteven Rostedt (VMware)config MMIOTRACE 34821b3ce30SSteven Rostedt (VMware) bool "Memory mapped IO tracing" 34921b3ce30SSteven Rostedt (VMware) depends on HAVE_MMIOTRACE_SUPPORT && PCI 35021b3ce30SSteven Rostedt (VMware) select GENERIC_TRACER 35121b3ce30SSteven Rostedt (VMware) help 35221b3ce30SSteven Rostedt (VMware) Mmiotrace traces Memory Mapped I/O access and is meant for 35321b3ce30SSteven Rostedt (VMware) debugging and reverse engineering. It is called from the ioremap 35421b3ce30SSteven Rostedt (VMware) implementation and works via page faults. Tracing is disabled by 35521b3ce30SSteven Rostedt (VMware) default and can be enabled at run-time. 35621b3ce30SSteven Rostedt (VMware) 35721b3ce30SSteven Rostedt (VMware) See Documentation/trace/mmiotrace.rst. 35821b3ce30SSteven Rostedt (VMware) If you are not helping to develop drivers, say N. 35921b3ce30SSteven Rostedt (VMware) 360897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS 361897f17a6SSteven Rostedt bool "Trace process context switches and events" 3625e0a0939SSteven Rostedt depends on !GENERIC_TRACER 363b77e38aaSSteven Rostedt select TRACING 364b77e38aaSSteven Rostedt help 36540892367SRandy Dunlap This tracer hooks to various trace points in the kernel, 366b77e38aaSSteven Rostedt allowing the user to pick and choose which trace point they 367897f17a6SSteven Rostedt want to trace. It also includes the sched_switch tracer plugin. 368a7abe97fSSteven Rostedt 369ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS 370ee08c6ecSFrederic Weisbecker bool "Trace syscalls" 37166700001SJosh Stone depends on HAVE_SYSCALL_TRACEPOINTS 3725e0a0939SSteven Rostedt select GENERIC_TRACER 3730ea1c415SFrederic Weisbecker select KALLSYMS 374ee08c6ecSFrederic Weisbecker help 375ee08c6ecSFrederic Weisbecker Basic tracer to catch the syscall entry and exit events. 376ee08c6ecSFrederic Weisbecker 377debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT 378debdd57fSHiraku Toyooka bool "Create a snapshot trace buffer" 379debdd57fSHiraku Toyooka select TRACER_MAX_TRACE 380debdd57fSHiraku Toyooka help 381debdd57fSHiraku Toyooka Allow tracing users to take snapshot of the current buffer using the 382debdd57fSHiraku Toyooka ftrace interface, e.g.: 383debdd57fSHiraku Toyooka 384debdd57fSHiraku Toyooka echo 1 > /sys/kernel/debug/tracing/snapshot 385debdd57fSHiraku Toyooka cat snapshot 386debdd57fSHiraku Toyooka 3870b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP 3880b85ffc2SSteven Rostedt (Red Hat) bool "Allow snapshot to swap per CPU" 3890b85ffc2SSteven Rostedt (Red Hat) depends on TRACER_SNAPSHOT 3900b85ffc2SSteven Rostedt (Red Hat) select RING_BUFFER_ALLOW_SWAP 3910b85ffc2SSteven Rostedt (Red Hat) help 3920b85ffc2SSteven Rostedt (Red Hat) Allow doing a snapshot of a single CPU buffer instead of a 3930b85ffc2SSteven Rostedt (Red Hat) full swap (all buffers). If this is set, then the following is 3940b85ffc2SSteven Rostedt (Red Hat) allowed: 3950b85ffc2SSteven Rostedt (Red Hat) 3960b85ffc2SSteven Rostedt (Red Hat) echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot 3970b85ffc2SSteven Rostedt (Red Hat) 3980b85ffc2SSteven Rostedt (Red Hat) After which, only the tracing buffer for CPU 2 was swapped with 3990b85ffc2SSteven Rostedt (Red Hat) the main tracing buffer, and the other CPU buffers remain the same. 4000b85ffc2SSteven Rostedt (Red Hat) 4010b85ffc2SSteven Rostedt (Red Hat) When this is enabled, this adds a little more overhead to the 4020b85ffc2SSteven Rostedt (Red Hat) trace recording, as it needs to add some checks to synchronize 4030b85ffc2SSteven Rostedt (Red Hat) recording with swaps. But this does not affect the performance 4040b85ffc2SSteven Rostedt (Red Hat) of the overall system. This is enabled by default when the preempt 4050b85ffc2SSteven Rostedt (Red Hat) or irq latency tracers are enabled, as those need to swap as well 4060b85ffc2SSteven Rostedt (Red Hat) and already adds the overhead (plus a lot more). 4070b85ffc2SSteven Rostedt (Red Hat) 4082ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING 4099ae5b879SSteven Rostedt bool 4105e0a0939SSteven Rostedt select GENERIC_TRACER 4119ae5b879SSteven Rostedt 4129ae5b879SSteven Rostedtchoice 4139ae5b879SSteven Rostedt prompt "Branch Profiling" 4149ae5b879SSteven Rostedt default BRANCH_PROFILE_NONE 4159ae5b879SSteven Rostedt help 4169ae5b879SSteven Rostedt The branch profiling is a software profiler. It will add hooks 4179ae5b879SSteven Rostedt into the C conditionals to test which path a branch takes. 4189ae5b879SSteven Rostedt 4199ae5b879SSteven Rostedt The likely/unlikely profiler only looks at the conditions that 4209ae5b879SSteven Rostedt are annotated with a likely or unlikely macro. 4219ae5b879SSteven Rostedt 42240892367SRandy Dunlap The "all branch" profiler will profile every if-statement in the 4239ae5b879SSteven Rostedt kernel. This profiler will also enable the likely/unlikely 42440892367SRandy Dunlap profiler. 4259ae5b879SSteven Rostedt 42640892367SRandy Dunlap Either of the above profilers adds a bit of overhead to the system. 42740892367SRandy Dunlap If unsure, choose "No branch profiling". 4289ae5b879SSteven Rostedt 4299ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE 4309ae5b879SSteven Rostedt bool "No branch profiling" 4319ae5b879SSteven Rostedt help 4329ae5b879SSteven Rostedt No branch profiling. Branch profiling adds a bit of overhead. 4339ae5b879SSteven Rostedt Only enable it if you want to analyse the branching behavior. 4349ae5b879SSteven Rostedt Otherwise keep it disabled. 4359ae5b879SSteven Rostedt 4369ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES 4379ae5b879SSteven Rostedt bool "Trace likely/unlikely profiler" 4389ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 4391f0d69a9SSteven Rostedt help 44059bf8964SMasanari Iida This tracer profiles all likely and unlikely macros 4411f0d69a9SSteven Rostedt in the kernel. It will display the results in: 4421f0d69a9SSteven Rostedt 44313e5befaSDavid Rientjes /sys/kernel/debug/tracing/trace_stat/branch_annotated 4441f0d69a9SSteven Rostedt 44540892367SRandy Dunlap Note: this will add a significant overhead; only turn this 4461f0d69a9SSteven Rostedt on if you need to profile the system's use of these macros. 4471f0d69a9SSteven Rostedt 4482bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES 44968e76e03SRandy Dunlap bool "Profile all if conditionals" if !FORTIFY_SOURCE 4509ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 4512bcd521aSSteven Rostedt help 4522bcd521aSSteven Rostedt This tracer profiles all branch conditions. Every if () 4532bcd521aSSteven Rostedt taken in the kernel is recorded whether it hit or miss. 4542bcd521aSSteven Rostedt The results will be displayed in: 4552bcd521aSSteven Rostedt 45613e5befaSDavid Rientjes /sys/kernel/debug/tracing/trace_stat/branch_all 4572bcd521aSSteven Rostedt 4589ae5b879SSteven Rostedt This option also enables the likely/unlikely profiler. 4599ae5b879SSteven Rostedt 4602bcd521aSSteven Rostedt This configuration, when enabled, will impose a great overhead 4612bcd521aSSteven Rostedt on the system. This should only be enabled when the system 46240892367SRandy Dunlap is to be analyzed in much detail. 4639ae5b879SSteven Rostedtendchoice 4642bcd521aSSteven Rostedt 4652ed84eebSSteven Rostedtconfig TRACING_BRANCHES 46652f232cbSSteven Rostedt bool 46752f232cbSSteven Rostedt help 46852f232cbSSteven Rostedt Selected by tracers that will trace the likely and unlikely 46952f232cbSSteven Rostedt conditions. This prevents the tracers themselves from being 47052f232cbSSteven Rostedt profiled. Profiling the tracing infrastructure can only happen 47152f232cbSSteven Rostedt when the likelys and unlikelys are not being traced. 47252f232cbSSteven Rostedt 4732ed84eebSSteven Rostedtconfig BRANCH_TRACER 47452f232cbSSteven Rostedt bool "Trace likely/unlikely instances" 4752ed84eebSSteven Rostedt depends on TRACE_BRANCH_PROFILING 4762ed84eebSSteven Rostedt select TRACING_BRANCHES 47752f232cbSSteven Rostedt help 47852f232cbSSteven Rostedt This traces the events of likely and unlikely condition 47952f232cbSSteven Rostedt calls in the kernel. The difference between this and the 48052f232cbSSteven Rostedt "Trace likely/unlikely profiler" is that this is not a 48152f232cbSSteven Rostedt histogram of the callers, but actually places the calling 48252f232cbSSteven Rostedt events into a running trace buffer to see when and where the 48352f232cbSSteven Rostedt events happened, as well as their results. 48452f232cbSSteven Rostedt 48552f232cbSSteven Rostedt Say N if unsure. 48652f232cbSSteven Rostedt 4872db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE 48840892367SRandy Dunlap bool "Support for tracing block IO actions" 4892db270a8SFrederic Weisbecker depends on SYSFS 4901dfba05dSIngo Molnar depends on BLOCK 4912db270a8SFrederic Weisbecker select RELAY 4922db270a8SFrederic Weisbecker select DEBUG_FS 4932db270a8SFrederic Weisbecker select TRACEPOINTS 4945e0a0939SSteven Rostedt select GENERIC_TRACER 4952db270a8SFrederic Weisbecker select STACKTRACE 4962db270a8SFrederic Weisbecker help 4972db270a8SFrederic Weisbecker Say Y here if you want to be able to trace the block layer actions 4982db270a8SFrederic Weisbecker on a given queue. Tracing allows you to see any traffic happening 4992db270a8SFrederic Weisbecker on a block device queue. For more information (and the userspace 5002db270a8SFrederic Weisbecker support tools needed), fetch the blktrace tools from: 5012db270a8SFrederic Weisbecker 5022db270a8SFrederic Weisbecker git://git.kernel.dk/blktrace.git 5032db270a8SFrederic Weisbecker 5042db270a8SFrederic Weisbecker Tracing also is possible using the ftrace interface, e.g.: 5052db270a8SFrederic Weisbecker 5062db270a8SFrederic Weisbecker echo 1 > /sys/block/sda/sda1/trace/enable 5072db270a8SFrederic Weisbecker echo blk > /sys/kernel/debug/tracing/current_tracer 5082db270a8SFrederic Weisbecker cat /sys/kernel/debug/tracing/trace_pipe 5092db270a8SFrederic Weisbecker 5102db270a8SFrederic Weisbecker If unsure, say N. 51136994e58SFrederic Weisbecker 5126b0b7551SAnton Blanchardconfig KPROBE_EVENTS 513413d37d1SMasami Hiramatsu depends on KPROBES 514f850c30cSHeiko Carstens depends on HAVE_REGS_AND_STACK_ACCESS_API 51577b44d1bSMasami Hiramatsu bool "Enable kprobes-based dynamic events" 516413d37d1SMasami Hiramatsu select TRACING 5178ab83f56SSrikar Dronamraju select PROBE_EVENTS 5186212dd29SMasami Hiramatsu select DYNAMIC_EVENTS 51977b44d1bSMasami Hiramatsu default y 520413d37d1SMasami Hiramatsu help 52140892367SRandy Dunlap This allows the user to add tracing events (similar to tracepoints) 52240892367SRandy Dunlap on the fly via the ftrace interface. See 5235fb94e9cSMauro Carvalho Chehab Documentation/trace/kprobetrace.rst for more details. 52477b44d1bSMasami Hiramatsu 52577b44d1bSMasami Hiramatsu Those events can be inserted wherever kprobes can probe, and record 52677b44d1bSMasami Hiramatsu various register and memory values. 52777b44d1bSMasami Hiramatsu 52840892367SRandy Dunlap This option is also required by perf-probe subcommand of perf tools. 52940892367SRandy Dunlap If you want to use perf tools, this option is strongly recommended. 530413d37d1SMasami Hiramatsu 53145408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE 53245408c4fSMasami Hiramatsu bool "Do NOT protect notrace function from kprobe events" 53345408c4fSMasami Hiramatsu depends on KPROBE_EVENTS 53445408c4fSMasami Hiramatsu depends on KPROBES_ON_FTRACE 53545408c4fSMasami Hiramatsu default n 53645408c4fSMasami Hiramatsu help 53745408c4fSMasami Hiramatsu This is only for the developers who want to debug ftrace itself 53845408c4fSMasami Hiramatsu using kprobe events. 53945408c4fSMasami Hiramatsu 54045408c4fSMasami Hiramatsu If kprobes can use ftrace instead of breakpoint, ftrace related 54145408c4fSMasami Hiramatsu functions are protected from kprobe-events to prevent an infinit 54245408c4fSMasami Hiramatsu recursion or any unexpected execution path which leads to a kernel 54345408c4fSMasami Hiramatsu crash. 54445408c4fSMasami Hiramatsu 54545408c4fSMasami Hiramatsu This option disables such protection and allows you to put kprobe 54645408c4fSMasami Hiramatsu events on ftrace functions for debugging ftrace by itself. 54745408c4fSMasami Hiramatsu Note that this might let you shoot yourself in the foot. 54845408c4fSMasami Hiramatsu 54945408c4fSMasami Hiramatsu If unsure, say N. 55045408c4fSMasami Hiramatsu 5516b0b7551SAnton Blanchardconfig UPROBE_EVENTS 552f3f096cfSSrikar Dronamraju bool "Enable uprobes-based dynamic events" 553f3f096cfSSrikar Dronamraju depends on ARCH_SUPPORTS_UPROBES 554f3f096cfSSrikar Dronamraju depends on MMU 55509294e31SDavid A. Long depends on PERF_EVENTS 556f3f096cfSSrikar Dronamraju select UPROBES 557f3f096cfSSrikar Dronamraju select PROBE_EVENTS 5580597c49cSMasami Hiramatsu select DYNAMIC_EVENTS 559f3f096cfSSrikar Dronamraju select TRACING 56061f35d75SArnaldo Carvalho de Melo default y 561f3f096cfSSrikar Dronamraju help 562f3f096cfSSrikar Dronamraju This allows the user to add tracing events on top of userspace 563f3f096cfSSrikar Dronamraju dynamic events (similar to tracepoints) on the fly via the trace 564f3f096cfSSrikar Dronamraju events interface. Those events can be inserted wherever uprobes 565f3f096cfSSrikar Dronamraju can probe, and record various registers. 566f3f096cfSSrikar Dronamraju This option is required if you plan to use perf-probe subcommand 567f3f096cfSSrikar Dronamraju of perf tools on user space applications. 568f3f096cfSSrikar Dronamraju 569e1abf2ccSIngo Molnarconfig BPF_EVENTS 570e1abf2ccSIngo Molnar depends on BPF_SYSCALL 5716b0b7551SAnton Blanchard depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS 572e1abf2ccSIngo Molnar bool 573e1abf2ccSIngo Molnar default y 574e1abf2ccSIngo Molnar help 5755cbd22c1SPeter Wu This allows the user to attach BPF programs to kprobe, uprobe, and 5765cbd22c1SPeter Wu tracepoint events. 577e1abf2ccSIngo Molnar 5785448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS 5795448d44cSMasami Hiramatsu def_bool n 5805448d44cSMasami Hiramatsu 5818ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS 5828ab83f56SSrikar Dronamraju def_bool n 5838ab83f56SSrikar Dronamraju 5849802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE 5859802d865SJosef Bacik bool "Enable BPF programs to override a kprobed function" 5869802d865SJosef Bacik depends on BPF_EVENTS 587540adea3SMasami Hiramatsu depends on FUNCTION_ERROR_INJECTION 5889802d865SJosef Bacik default n 5899802d865SJosef Bacik help 5909802d865SJosef Bacik Allows BPF to override the execution of a probed function and 5919802d865SJosef Bacik set a different return value. This is used for error injection. 5929802d865SJosef Bacik 5938da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD 5948da3821bSSteven Rostedt def_bool y 5958da3821bSSteven Rostedt depends on DYNAMIC_FTRACE 5968da3821bSSteven Rostedt depends on HAVE_FTRACE_MCOUNT_RECORD 5978da3821bSSteven Rostedt 59808d43a5fSTom Zanussiconfig TRACING_MAP 59908d43a5fSTom Zanussi bool 60008d43a5fSTom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 60108d43a5fSTom Zanussi help 60208d43a5fSTom Zanussi tracing_map is a special-purpose lock-free map for tracing, 60308d43a5fSTom Zanussi separated out as a stand-alone facility in order to allow it 60408d43a5fSTom Zanussi to be shared between multiple tracers. It isn't meant to be 60508d43a5fSTom Zanussi generally used outside of that context, and is normally 60608d43a5fSTom Zanussi selected by tracers that use it. 60708d43a5fSTom Zanussi 608726721a5STom Zanussiconfig SYNTH_EVENTS 609726721a5STom Zanussi bool "Synthetic trace events" 610726721a5STom Zanussi select TRACING 611726721a5STom Zanussi select DYNAMIC_EVENTS 612726721a5STom Zanussi default n 613726721a5STom Zanussi help 614726721a5STom Zanussi Synthetic events are user-defined trace events that can be 615726721a5STom Zanussi used to combine data from other trace events or in fact any 616726721a5STom Zanussi data source. Synthetic events can be generated indirectly 617726721a5STom Zanussi via the trace() action of histogram triggers or directly 618726721a5STom Zanussi by way of an in-kernel API. 619726721a5STom Zanussi 620726721a5STom Zanussi See Documentation/trace/events.rst or 621726721a5STom Zanussi Documentation/trace/histogram.rst for details and examples. 622726721a5STom Zanussi 623726721a5STom Zanussi If in doubt, say N. 624726721a5STom Zanussi 6257ef224d1STom Zanussiconfig HIST_TRIGGERS 6267ef224d1STom Zanussi bool "Histogram triggers" 6277ef224d1STom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 6287ef224d1STom Zanussi select TRACING_MAP 6297ad8fb61STom Zanussi select TRACING 6307bbab38dSMasami Hiramatsu select DYNAMIC_EVENTS 631726721a5STom Zanussi select SYNTH_EVENTS 6327ef224d1STom Zanussi default n 6337ef224d1STom Zanussi help 6347ef224d1STom Zanussi Hist triggers allow one or more arbitrary trace event fields 6357ef224d1STom Zanussi to be aggregated into hash tables and dumped to stdout by 6367ef224d1STom Zanussi reading a debugfs/tracefs file. They're useful for 6377ef224d1STom Zanussi gathering quick and dirty (though precise) summaries of 6387ef224d1STom Zanussi event activity as an initial guide for further investigation 6397ef224d1STom Zanussi using more advanced tools. 6407ef224d1STom Zanussi 64189e270c1STom Zanussi Inter-event tracing of quantities such as latencies is also 64289e270c1STom Zanussi supported using hist triggers under this option. 64389e270c1STom Zanussi 644ea272257SMauro Carvalho Chehab See Documentation/trace/histogram.rst. 6457ef224d1STom Zanussi If in doubt, say N. 6467ef224d1STom Zanussi 6476c3edaf9SCong Wangconfig TRACE_EVENT_INJECT 6486c3edaf9SCong Wang bool "Trace event injection" 6496c3edaf9SCong Wang depends on TRACING 6506c3edaf9SCong Wang help 6516c3edaf9SCong Wang Allow user-space to inject a specific trace event into the ring 6526c3edaf9SCong Wang buffer. This is mainly used for testing purpose. 6536c3edaf9SCong Wang 6546c3edaf9SCong Wang If unsure, say N. 6556c3edaf9SCong Wang 65681dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK 65781dc9f0eSSteven Rostedt (Red Hat) bool "Add tracepoint that benchmarks tracepoints" 65881dc9f0eSSteven Rostedt (Red Hat) help 65981dc9f0eSSteven Rostedt (Red Hat) This option creates the tracepoint "benchmark:benchmark_event". 66081dc9f0eSSteven Rostedt (Red Hat) When the tracepoint is enabled, it kicks off a kernel thread that 66181dc9f0eSSteven Rostedt (Red Hat) goes into an infinite loop (calling cond_sched() to let other tasks 66281dc9f0eSSteven Rostedt (Red Hat) run), and calls the tracepoint. Each iteration will record the time 66381dc9f0eSSteven Rostedt (Red Hat) it took to write to the tracepoint and the next iteration that 66481dc9f0eSSteven Rostedt (Red Hat) data will be passed to the tracepoint itself. That is, the tracepoint 66581dc9f0eSSteven Rostedt (Red Hat) will report the time it took to do the previous tracepoint. 66681dc9f0eSSteven Rostedt (Red Hat) The string written to the tracepoint is a static string of 128 bytes 66781dc9f0eSSteven Rostedt (Red Hat) to keep the time the same. The initial string is simply a write of 66881dc9f0eSSteven Rostedt (Red Hat) "START". The second string records the cold cache time of the first 66981dc9f0eSSteven Rostedt (Red Hat) write which is not added to the rest of the calculations. 67081dc9f0eSSteven Rostedt (Red Hat) 67181dc9f0eSSteven Rostedt (Red Hat) As it is a tight loop, it benchmarks as hot cache. That's fine because 67281dc9f0eSSteven Rostedt (Red Hat) we care most about hot paths that are probably in cache already. 67381dc9f0eSSteven Rostedt (Red Hat) 67481dc9f0eSSteven Rostedt (Red Hat) An example of the output: 67581dc9f0eSSteven Rostedt (Red Hat) 67681dc9f0eSSteven Rostedt (Red Hat) START 67781dc9f0eSSteven Rostedt (Red Hat) first=3672 [COLD CACHED] 67881dc9f0eSSteven Rostedt (Red Hat) last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712 67981dc9f0eSSteven Rostedt (Red Hat) last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337 68081dc9f0eSSteven Rostedt (Red Hat) last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064 68181dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411 68281dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389 68381dc9f0eSSteven Rostedt (Red Hat) last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666 68481dc9f0eSSteven Rostedt (Red Hat) 68581dc9f0eSSteven Rostedt (Red Hat) 6865092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK 6875092dbc9SSteven Rostedt tristate "Ring buffer benchmark stress tester" 6885092dbc9SSteven Rostedt depends on RING_BUFFER 6895092dbc9SSteven Rostedt help 6905092dbc9SSteven Rostedt This option creates a test to stress the ring buffer and benchmark it. 69140892367SRandy Dunlap It creates its own ring buffer such that it will not interfere with 6925092dbc9SSteven Rostedt any other users of the ring buffer (such as ftrace). It then creates 6935092dbc9SSteven Rostedt a producer and consumer that will run for 10 seconds and sleep for 6945092dbc9SSteven Rostedt 10 seconds. Each interval it will print out the number of events 6955092dbc9SSteven Rostedt it recorded and give a rough estimate of how long each iteration took. 6965092dbc9SSteven Rostedt 6975092dbc9SSteven Rostedt It does not disable interrupts or raise its priority, so it may be 6985092dbc9SSteven Rostedt affected by processes that are running. 6995092dbc9SSteven Rostedt 70040892367SRandy Dunlap If unsure, say N. 7015092dbc9SSteven Rostedt 7021e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE 7031e837945SSteven Rostedt (VMware) bool "Show eval mappings for trace events" 7041e837945SSteven Rostedt (VMware) depends on TRACING 7051e837945SSteven Rostedt (VMware) help 7061e837945SSteven Rostedt (VMware) The "print fmt" of the trace events will show the enum/sizeof names 7071e837945SSteven Rostedt (VMware) instead of their values. This can cause problems for user space tools 7081e837945SSteven Rostedt (VMware) that use this string to parse the raw data as user space does not know 7091e837945SSteven Rostedt (VMware) how to convert the string to its value. 7101e837945SSteven Rostedt (VMware) 7111e837945SSteven Rostedt (VMware) To fix this, there's a special macro in the kernel that can be used 7121e837945SSteven Rostedt (VMware) to convert an enum/sizeof into its value. If this macro is used, then 7131e837945SSteven Rostedt (VMware) the print fmt strings will be converted to their values. 7141e837945SSteven Rostedt (VMware) 7151e837945SSteven Rostedt (VMware) If something does not get converted properly, this option can be 7161e837945SSteven Rostedt (VMware) used to show what enums/sizeof the kernel tried to convert. 7171e837945SSteven Rostedt (VMware) 7181e837945SSteven Rostedt (VMware) This option is for debugging the conversions. A file is created 7191e837945SSteven Rostedt (VMware) in the tracing directory called "eval_map" that will show the 7201e837945SSteven Rostedt (VMware) names matched with their values and what trace event system they 7211e837945SSteven Rostedt (VMware) belong too. 7221e837945SSteven Rostedt (VMware) 7231e837945SSteven Rostedt (VMware) Normally, the mapping of the strings to values will be freed after 7241e837945SSteven Rostedt (VMware) boot up or module load. With this option, they will not be freed, as 7251e837945SSteven Rostedt (VMware) they are needed for the "eval_map" file. Enabling this option will 7261e837945SSteven Rostedt (VMware) increase the memory footprint of the running kernel. 7271e837945SSteven Rostedt (VMware) 7281e837945SSteven Rostedt (VMware) If unsure, say N. 7291e837945SSteven Rostedt (VMware) 730*773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION 731*773c1670SSteven Rostedt (VMware) bool "Record functions that recurse in function tracing" 732*773c1670SSteven Rostedt (VMware) depends on FUNCTION_TRACER 733*773c1670SSteven Rostedt (VMware) help 734*773c1670SSteven Rostedt (VMware) All callbacks that attach to the function tracing have some sort 735*773c1670SSteven Rostedt (VMware) of protection against recursion. Even though the protection exists, 736*773c1670SSteven Rostedt (VMware) it adds overhead. This option will create a file in the tracefs 737*773c1670SSteven Rostedt (VMware) file system called "recursed_functions" that will list the functions 738*773c1670SSteven Rostedt (VMware) that triggered a recursion. 739*773c1670SSteven Rostedt (VMware) 740*773c1670SSteven Rostedt (VMware) This will add more overhead to cases that have recursion. 741*773c1670SSteven Rostedt (VMware) 742*773c1670SSteven Rostedt (VMware) If unsure, say N 743*773c1670SSteven Rostedt (VMware) 744*773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE 745*773c1670SSteven Rostedt (VMware) int "Max number of recursed functions to record" 746*773c1670SSteven Rostedt (VMware) default 128 747*773c1670SSteven Rostedt (VMware) depends on FTRACE_RECORD_RECURSION 748*773c1670SSteven Rostedt (VMware) help 749*773c1670SSteven Rostedt (VMware) This defines the limit of number of functions that can be 750*773c1670SSteven Rostedt (VMware) listed in the "recursed_functions" file, that lists all 751*773c1670SSteven Rostedt (VMware) the functions that caused a recursion to happen. 752*773c1670SSteven Rostedt (VMware) This file can be reset, but the limit can not change in 753*773c1670SSteven Rostedt (VMware) size at runtime. 754*773c1670SSteven Rostedt (VMware) 7551e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE 7561e837945SSteven Rostedt (VMware) bool "Enable GCOV profiling on ftrace subsystem" 7571e837945SSteven Rostedt (VMware) depends on GCOV_KERNEL 7581e837945SSteven Rostedt (VMware) help 7591e837945SSteven Rostedt (VMware) Enable GCOV profiling on ftrace subsystem for checking 7601e837945SSteven Rostedt (VMware) which functions/lines are tested. 7611e837945SSteven Rostedt (VMware) 7621e837945SSteven Rostedt (VMware) If unsure, say N. 7631e837945SSteven Rostedt (VMware) 7641e837945SSteven Rostedt (VMware) Note that on a kernel compiled with this config, ftrace will 7651e837945SSteven Rostedt (VMware) run significantly slower. 7661e837945SSteven Rostedt (VMware) 7671e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST 7681e837945SSteven Rostedt (VMware) bool 7691e837945SSteven Rostedt (VMware) 7701e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST 7711e837945SSteven Rostedt (VMware) bool "Perform a startup test on ftrace" 7721e837945SSteven Rostedt (VMware) depends on GENERIC_TRACER 7731e837945SSteven Rostedt (VMware) select FTRACE_SELFTEST 7741e837945SSteven Rostedt (VMware) help 7751e837945SSteven Rostedt (VMware) This option performs a series of startup tests on ftrace. On bootup 7761e837945SSteven Rostedt (VMware) a series of tests are made to verify that the tracer is 7771e837945SSteven Rostedt (VMware) functioning properly. It will do tests on all the configured 7781e837945SSteven Rostedt (VMware) tracers of ftrace. 7791e837945SSteven Rostedt (VMware) 7801e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST 7811e837945SSteven Rostedt (VMware) bool "Run selftest on trace events" 7821e837945SSteven Rostedt (VMware) depends on FTRACE_STARTUP_TEST 7831e837945SSteven Rostedt (VMware) default y 7841e837945SSteven Rostedt (VMware) help 7851e837945SSteven Rostedt (VMware) This option performs a test on all trace events in the system. 7861e837945SSteven Rostedt (VMware) It basically just enables each event and runs some code that 7871e837945SSteven Rostedt (VMware) will trigger events (not necessarily the event it enables) 7881e837945SSteven Rostedt (VMware) This may take some time run as there are a lot of events. 7891e837945SSteven Rostedt (VMware) 7901e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS 7911e837945SSteven Rostedt (VMware) bool "Run selftest on syscall events" 7921e837945SSteven Rostedt (VMware) depends on EVENT_TRACE_STARTUP_TEST 7931e837945SSteven Rostedt (VMware) help 7941e837945SSteven Rostedt (VMware) This option will also enable testing every syscall event. 7951e837945SSteven Rostedt (VMware) It only enables the event and disables it and runs various loads 7961e837945SSteven Rostedt (VMware) with the event enabled. This adds a bit more time for kernel boot 7971e837945SSteven Rostedt (VMware) up since it runs this on every system call defined. 7981e837945SSteven Rostedt (VMware) 7991e837945SSteven Rostedt (VMware) TBD - enable a way to actually call the syscalls as we test their 8001e837945SSteven Rostedt (VMware) events 8011e837945SSteven Rostedt (VMware) 8026c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST 8036c43e554SSteven Rostedt (Red Hat) bool "Ring buffer startup self test" 8046c43e554SSteven Rostedt (Red Hat) depends on RING_BUFFER 8056c43e554SSteven Rostedt (Red Hat) help 8066c43e554SSteven Rostedt (Red Hat) Run a simple self test on the ring buffer on boot up. Late in the 8076c43e554SSteven Rostedt (Red Hat) kernel boot sequence, the test will start that kicks off 8086c43e554SSteven Rostedt (Red Hat) a thread per cpu. Each thread will write various size events 8096c43e554SSteven Rostedt (Red Hat) into the ring buffer. Another thread is created to send IPIs 8106c43e554SSteven Rostedt (Red Hat) to each of the threads, where the IPI handler will also write 8116c43e554SSteven Rostedt (Red Hat) to the ring buffer, to test/stress the nesting ability. 8126c43e554SSteven Rostedt (Red Hat) If any anomalies are discovered, a warning will be displayed 8136c43e554SSteven Rostedt (Red Hat) and all ring buffers will be disabled. 8146c43e554SSteven Rostedt (Red Hat) 8156c43e554SSteven Rostedt (Red Hat) The test runs for 10 seconds. This will slow your boot time 8166c43e554SSteven Rostedt (Red Hat) by at least 10 more seconds. 8176c43e554SSteven Rostedt (Red Hat) 8186c43e554SSteven Rostedt (Red Hat) At the end of the test, statics and more checks are done. 8196c43e554SSteven Rostedt (Red Hat) It will output the stats of each per cpu buffer. What 8206c43e554SSteven Rostedt (Red Hat) was written, the sizes, what was read, what was lost, and 8216c43e554SSteven Rostedt (Red Hat) other similar details. 8226c43e554SSteven Rostedt (Red Hat) 8236c43e554SSteven Rostedt (Red Hat) If unsure, say N 8246c43e554SSteven Rostedt (Red Hat) 825a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST 826a48fc4f5SSteven Rostedt (VMware) tristate "Test module for mmiotrace" 827a48fc4f5SSteven Rostedt (VMware) depends on MMIOTRACE && m 828a48fc4f5SSteven Rostedt (VMware) help 829a48fc4f5SSteven Rostedt (VMware) This is a dumb module for testing mmiotrace. It is very dangerous 830a48fc4f5SSteven Rostedt (VMware) as it will write garbage to IO memory starting at a given address. 831a48fc4f5SSteven Rostedt (VMware) However, it should be safe to use on e.g. unused portion of VRAM. 832a48fc4f5SSteven Rostedt (VMware) 833a48fc4f5SSteven Rostedt (VMware) Say N, unless you absolutely know what you are doing. 834a48fc4f5SSteven Rostedt (VMware) 835f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST 836a48fc4f5SSteven Rostedt (VMware) tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers" 837f96e8577SJoel Fernandes (Google) depends on m 838f96e8577SJoel Fernandes (Google) help 839f96e8577SJoel Fernandes (Google) Select this option to build a test module that can help test latency 840f96e8577SJoel Fernandes (Google) tracers by executing a preempt or irq disable section with a user 841f96e8577SJoel Fernandes (Google) configurable delay. The module busy waits for the duration of the 842f96e8577SJoel Fernandes (Google) critical section. 843f96e8577SJoel Fernandes (Google) 84479393723SViktor Rosendahl (BMW) For example, the following invocation generates a burst of three 84579393723SViktor Rosendahl (BMW) irq-disabled critical sections for 500us: 84679393723SViktor Rosendahl (BMW) modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3 847f96e8577SJoel Fernandes (Google) 848f96e8577SJoel Fernandes (Google) If unsure, say N 849f96e8577SJoel Fernandes (Google) 8509fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST 8519fe41efaSTom Zanussi tristate "Test module for in-kernel synthetic event generation" 852726721a5STom Zanussi depends on SYNTH_EVENTS 8539fe41efaSTom Zanussi help 8549fe41efaSTom Zanussi This option creates a test module to check the base 8559fe41efaSTom Zanussi functionality of in-kernel synthetic event definition and 8569fe41efaSTom Zanussi generation. 8579fe41efaSTom Zanussi 8589fe41efaSTom Zanussi To test, insert the module, and then check the trace buffer 8599fe41efaSTom Zanussi for the generated sample events. 8609fe41efaSTom Zanussi 8619fe41efaSTom Zanussi If unsure, say N. 8629fe41efaSTom Zanussi 86364836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST 86464836248STom Zanussi tristate "Test module for in-kernel kprobe event generation" 86564836248STom Zanussi depends on KPROBE_EVENTS 86664836248STom Zanussi help 86764836248STom Zanussi This option creates a test module to check the base 86864836248STom Zanussi functionality of in-kernel kprobe event definition. 86964836248STom Zanussi 87064836248STom Zanussi To test, insert the module, and then check the trace buffer 87164836248STom Zanussi for the generated kprobe events. 87264836248STom Zanussi 87364836248STom Zanussi If unsure, say N. 87464836248STom Zanussi 8752d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG 8762d19bd79STom Zanussi bool "Hist trigger debug support" 8772d19bd79STom Zanussi depends on HIST_TRIGGERS 8782d19bd79STom Zanussi help 8792d19bd79STom Zanussi Add "hist_debug" file for each event, which when read will 8802d19bd79STom Zanussi dump out a bunch of internal details about the hist triggers 8812d19bd79STom Zanussi defined on that event. 8822d19bd79STom Zanussi 8832d19bd79STom Zanussi The hist_debug file serves a couple of purposes: 8842d19bd79STom Zanussi 8852d19bd79STom Zanussi - Helps developers verify that nothing is broken. 8862d19bd79STom Zanussi 8872d19bd79STom Zanussi - Provides educational information to support the details 8882d19bd79STom Zanussi of the hist trigger internals as described by 8892d19bd79STom Zanussi Documentation/trace/histogram-design.rst. 8902d19bd79STom Zanussi 8912d19bd79STom Zanussi The hist_debug output only covers the data structures 8922d19bd79STom Zanussi related to the histogram definitions themselves and doesn't 8932d19bd79STom Zanussi display the internals of map buckets or variable values of 8942d19bd79STom Zanussi running histograms. 8952d19bd79STom Zanussi 8962d19bd79STom Zanussi If unsure, say N. 8972d19bd79STom Zanussi 8984ed9f071SSteven Rostedtendif # FTRACE 89940ada30fSIngo Molnar 90040ada30fSIngo Molnarendif # TRACING_SUPPORT 90140ada30fSIngo Molnar 902