116444a8aSArnaldo Carvalho de Melo# 2606576ceSSteven Rostedt# Architectures that offer an FUNCTION_TRACER implementation should 3606576ceSSteven Rostedt# select HAVE_FUNCTION_TRACER: 416444a8aSArnaldo Carvalho de Melo# 52a3a4f66SFrédéric Weisbecker 68d26487fSTörök Edwinconfig USER_STACKTRACE_SUPPORT 78d26487fSTörök Edwin bool 88d26487fSTörök Edwin 92a3a4f66SFrédéric Weisbeckerconfig NOP_TRACER 102a3a4f66SFrédéric Weisbecker bool 112a3a4f66SFrédéric Weisbecker 1278d904b4SSteven Rostedtconfig HAVE_FTRACE_NMI_ENTER 1378d904b4SSteven Rostedt bool 14555f386cSMike Frysinger help 155fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 1678d904b4SSteven Rostedt 17606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER 1816444a8aSArnaldo Carvalho de Melo bool 19555f386cSMike Frysinger help 205fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 21bc0c38d1SSteven Rostedt 22fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER 2315e6cb36SFrederic Weisbecker bool 24555f386cSMike Frysinger help 255fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 2615e6cb36SFrederic Weisbecker 27677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 28677aa9f7SSteven Rostedt bool 29555f386cSMike Frysinger help 305fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 31677aa9f7SSteven Rostedt 3206aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS 3306aeaaeaSMasami Hiramatsu bool 3406aeaaeaSMasami Hiramatsu 358da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD 368da3821bSSteven Rostedt bool 37555f386cSMike Frysinger help 385fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 398da3821bSSteven Rostedt 4066700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS 41ee08c6ecSFrederic Weisbecker bool 42555f386cSMike Frysinger help 435fb94e9cSMauro Carvalho Chehab See Documentation/trace/ftrace-design.rst 44ee08c6ecSFrederic Weisbecker 45a2546faeSSteven Rostedtconfig HAVE_FENTRY 46a2546faeSSteven Rostedt bool 47a2546faeSSteven Rostedt help 48a2546faeSSteven Rostedt Arch supports the gcc options -pg with -mfentry 49a2546faeSSteven Rostedt 502f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT 512f4df001SVasily Gorbik bool 522f4df001SVasily Gorbik help 532f4df001SVasily Gorbik Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount 542f4df001SVasily Gorbik 55cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT 5672441cb1SSteven Rostedt bool 5772441cb1SSteven Rostedt help 5872441cb1SSteven Rostedt C version of recordmcount available? 5972441cb1SSteven Rostedt 60352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 61352ad25aSSteven Rostedt bool 62352ad25aSSteven Rostedt 63ea632e9fSJosh Triplettconfig TRACE_CLOCK 64ea632e9fSJosh Triplett bool 65ea632e9fSJosh Triplett 667a8e76a3SSteven Rostedtconfig RING_BUFFER 677a8e76a3SSteven Rostedt bool 68ea632e9fSJosh Triplett select TRACE_CLOCK 6922287688SSteven Rostedt (Red Hat) select IRQ_WORK 707a8e76a3SSteven Rostedt 7178d904b4SSteven Rostedtconfig FTRACE_NMI_ENTER 7278d904b4SSteven Rostedt bool 7378d904b4SSteven Rostedt depends on HAVE_FTRACE_NMI_ENTER 7478d904b4SSteven Rostedt default y 7578d904b4SSteven Rostedt 765f77a88bSTom Zanussiconfig EVENT_TRACING 77b11c53e1SZhaolei select CONTEXT_SWITCH_TRACER 7860f1d5e3SMasami Hiramatsu select GLOB 79b11c53e1SZhaolei bool 80b11c53e1SZhaolei 81b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER 825f77a88bSTom Zanussi bool 835f77a88bSTom Zanussi 8485bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP 8585bac32cSSteven Rostedt bool 8685bac32cSSteven Rostedt help 8785bac32cSSteven Rostedt Allow the use of ring_buffer_swap_cpu. 8885bac32cSSteven Rostedt Adds a very slight overhead to tracing when enabled. 8985bac32cSSteven Rostedt 90c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS 91c3bc8fd6SJoel Fernandes (Google) bool 92c3bc8fd6SJoel Fernandes (Google) depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS 93c3bc8fd6SJoel Fernandes (Google) select TRACING 94c3bc8fd6SJoel Fernandes (Google) default y 95c3bc8fd6SJoel Fernandes (Google) help 96c3bc8fd6SJoel Fernandes (Google) Create preempt/irq toggle tracepoints if needed, so that other parts 97c3bc8fd6SJoel Fernandes (Google) of the kernel can use them to generate or add hooks to them. 98c3bc8fd6SJoel Fernandes (Google) 995e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are 1005e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING. 1015e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the 1025e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options 1035e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the 10440892367SRandy Dunlap# hiding of the automatic options. 1055e0a0939SSteven Rostedt 106bc0c38d1SSteven Rostedtconfig TRACING 107bc0c38d1SSteven Rostedt bool 108bc0c38d1SSteven Rostedt select DEBUG_FS 1097a8e76a3SSteven Rostedt select RING_BUFFER 110c2c80529SAl Viro select STACKTRACE if STACKTRACE_SUPPORT 1115f87f112SIngo Molnar select TRACEPOINTS 112f3384b28SSteven Rostedt select NOP_TRACER 113769b0441SFrederic Weisbecker select BINARY_PRINTF 1145f77a88bSTom Zanussi select EVENT_TRACING 115ea632e9fSJosh Triplett select TRACE_CLOCK 116bc0c38d1SSteven Rostedt 1175e0a0939SSteven Rostedtconfig GENERIC_TRACER 1185e0a0939SSteven Rostedt bool 1195e0a0939SSteven Rostedt select TRACING 1205e0a0939SSteven Rostedt 12140ada30fSIngo Molnar# 12240ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to 12340ada30fSIngo Molnar# be able to offer generic tracing facilities: 12440ada30fSIngo Molnar# 12540ada30fSIngo Molnarconfig TRACING_SUPPORT 12640ada30fSIngo Molnar bool 1270ea5ee03SMichael Ellerman depends on TRACE_IRQFLAGS_SUPPORT 12840ada30fSIngo Molnar depends on STACKTRACE_SUPPORT 129422d3c7aSKOSAKI Motohiro default y 13040ada30fSIngo Molnar 13140ada30fSIngo Molnarif TRACING_SUPPORT 13240ada30fSIngo Molnar 1334ed9f071SSteven Rostedtmenuconfig FTRACE 1344ed9f071SSteven Rostedt bool "Tracers" 13565b77242SSteven Rostedt default y if DEBUG_KERNEL 1364ed9f071SSteven Rostedt help 1374ed9f071SSteven Rostedt Enable the kernel tracing infrastructure. 1384ed9f071SSteven Rostedt 1394ed9f071SSteven Rostedtif FTRACE 14017d80fd0SPeter Zijlstra 141606576ceSSteven Rostedtconfig FUNCTION_TRACER 1421b29b018SSteven Rostedt bool "Kernel Function Tracer" 143606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 1444d7a077cSSteven Rostedt select KALLSYMS 1455e0a0939SSteven Rostedt select GENERIC_TRACER 14635e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 14760f1d5e3SMasami Hiramatsu select GLOB 1480598e4f0SSteven Rostedt (VMware) select TASKS_RCU if PREEMPT 1491b29b018SSteven Rostedt help 1501b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 1511b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 15240892367SRandy Dunlap instruction at the beginning of every kernel function, which NOP 1531b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 1541b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 1551b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 1561b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 15735e8e302SSteven Rostedt 158fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER 159fb52607aSFrederic Weisbecker bool "Kernel Function Graph Tracer" 160fb52607aSFrederic Weisbecker depends on HAVE_FUNCTION_GRAPH_TRACER 16115e6cb36SFrederic Weisbecker depends on FUNCTION_TRACER 162eb4a0378SSteven Rostedt depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE 163764f3b95SIngo Molnar default y 16415e6cb36SFrederic Weisbecker help 165fb52607aSFrederic Weisbecker Enable the kernel to trace a function at both its return 166fb52607aSFrederic Weisbecker and its entry. 167692105b8SMatt LaPlante Its first purpose is to trace the duration of functions and 168692105b8SMatt LaPlante draw a call graph for each thread with some information like 169692105b8SMatt LaPlante the return value. This is done by setting the current return 170692105b8SMatt LaPlante address on the current task structure into a stack of calls. 17115e6cb36SFrederic Weisbecker 172c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE 173c3bc8fd6SJoel Fernandes (Google) bool 174c3bc8fd6SJoel Fernandes (Google) help 175c3bc8fd6SJoel Fernandes (Google) Enables hooks which will be called when preemption is first disabled, 176c3bc8fd6SJoel Fernandes (Google) and last enabled. 177bac429f0SSteven Rostedt 178d5915816SJoel Fernandesconfig PREEMPTIRQ_EVENTS 179d5915816SJoel Fernandes bool "Enable trace events for preempt and irq disable/enable" 180d5915816SJoel Fernandes select TRACE_IRQFLAGS 181c3bc8fd6SJoel Fernandes (Google) select TRACE_PREEMPT_TOGGLE if PREEMPT 182c3bc8fd6SJoel Fernandes (Google) select GENERIC_TRACER 183d5915816SJoel Fernandes default n 184d5915816SJoel Fernandes help 185d5915816SJoel Fernandes Enable tracing of disable and enable events for preemption and irqs. 186d5915816SJoel Fernandes 18781d68a96SSteven Rostedtconfig IRQSOFF_TRACER 18881d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 18981d68a96SSteven Rostedt default n 19081d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 191592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 19281d68a96SSteven Rostedt select TRACE_IRQFLAGS 1935e0a0939SSteven Rostedt select GENERIC_TRACER 19481d68a96SSteven Rostedt select TRACER_MAX_TRACE 19585bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 19622cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 1970b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 19881d68a96SSteven Rostedt help 19981d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 20081d68a96SSteven Rostedt sections, with microsecond accuracy. 20181d68a96SSteven Rostedt 20281d68a96SSteven Rostedt The default measurement method is a maximum search, which is 20381d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 20481d68a96SSteven Rostedt via: 20581d68a96SSteven Rostedt 206156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 20781d68a96SSteven Rostedt 20840892367SRandy Dunlap (Note that kernel size and overhead increase with this option 2096cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 2106cd8a4bbSSteven Rostedt used together or separately.) 2116cd8a4bbSSteven Rostedt 2126cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 2136cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 2146cd8a4bbSSteven Rostedt default n 215592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 2166cd8a4bbSSteven Rostedt depends on PREEMPT 2175e0a0939SSteven Rostedt select GENERIC_TRACER 2186cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 21985bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 22022cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 2210b85ffc2SSteven Rostedt (Red Hat) select TRACER_SNAPSHOT_PER_CPU_SWAP 222c3bc8fd6SJoel Fernandes (Google) select TRACE_PREEMPT_TOGGLE 2236cd8a4bbSSteven Rostedt help 22440892367SRandy Dunlap This option measures the time spent in preemption-off critical 2256cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 2266cd8a4bbSSteven Rostedt 2276cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 2286cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 2296cd8a4bbSSteven Rostedt via: 2306cd8a4bbSSteven Rostedt 231156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 2326cd8a4bbSSteven Rostedt 23340892367SRandy Dunlap (Note that kernel size and overhead increase with this option 2346cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 2356cd8a4bbSSteven Rostedt used together or separately.) 2366cd8a4bbSSteven Rostedt 237352ad25aSSteven Rostedtconfig SCHED_TRACER 238352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 2395e0a0939SSteven Rostedt select GENERIC_TRACER 240352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 241352ad25aSSteven Rostedt select TRACER_MAX_TRACE 24222cffc2bSSteven Rostedt (Red Hat) select TRACER_SNAPSHOT 243352ad25aSSteven Rostedt help 244352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 245352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 246352ad25aSSteven Rostedt 247e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER 248e7c15cd8SSteven Rostedt (Red Hat) bool "Tracer to detect hardware latencies (like SMIs)" 249e7c15cd8SSteven Rostedt (Red Hat) select GENERIC_TRACER 250e7c15cd8SSteven Rostedt (Red Hat) help 251e7c15cd8SSteven Rostedt (Red Hat) This tracer, when enabled will create one or more kernel threads, 252c5c1ea75SJesper Dangaard Brouer depending on what the cpumask file is set to, which each thread 253e7c15cd8SSteven Rostedt (Red Hat) spinning in a loop looking for interruptions caused by 254e7c15cd8SSteven Rostedt (Red Hat) something other than the kernel. For example, if a 255e7c15cd8SSteven Rostedt (Red Hat) System Management Interrupt (SMI) takes a noticeable amount of 256e7c15cd8SSteven Rostedt (Red Hat) time, this tracer will detect it. This is useful for testing 257e7c15cd8SSteven Rostedt (Red Hat) if a system is reliable for Real Time tasks. 258e7c15cd8SSteven Rostedt (Red Hat) 259e7c15cd8SSteven Rostedt (Red Hat) Some files are created in the tracing directory when this 260e7c15cd8SSteven Rostedt (Red Hat) is enabled: 261e7c15cd8SSteven Rostedt (Red Hat) 262e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/width - time in usecs for how long to spin for 263e7c15cd8SSteven Rostedt (Red Hat) hwlat_detector/window - time in usecs between the start of each 264e7c15cd8SSteven Rostedt (Red Hat) iteration 265e7c15cd8SSteven Rostedt (Red Hat) 266e7c15cd8SSteven Rostedt (Red Hat) A kernel thread is created that will spin with interrupts disabled 267c5c1ea75SJesper Dangaard Brouer for "width" microseconds in every "window" cycle. It will not spin 268e7c15cd8SSteven Rostedt (Red Hat) for "window - width" microseconds, where the system can 269e7c15cd8SSteven Rostedt (Red Hat) continue to operate. 270e7c15cd8SSteven Rostedt (Red Hat) 271e7c15cd8SSteven Rostedt (Red Hat) The output will appear in the trace and trace_pipe files. 272e7c15cd8SSteven Rostedt (Red Hat) 273e7c15cd8SSteven Rostedt (Red Hat) When the tracer is not running, it has no affect on the system, 274e7c15cd8SSteven Rostedt (Red Hat) but when it is running, it can cause the system to be 275e7c15cd8SSteven Rostedt (Red Hat) periodically non responsive. Do not run this tracer on a 276e7c15cd8SSteven Rostedt (Red Hat) production system. 277e7c15cd8SSteven Rostedt (Red Hat) 278e7c15cd8SSteven Rostedt (Red Hat) To enable this tracer, echo in "hwlat" into the current_tracer 279e7c15cd8SSteven Rostedt (Red Hat) file. Every time a latency is greater than tracing_thresh, it will 280e7c15cd8SSteven Rostedt (Red Hat) be recorded into the ring buffer. 281e7c15cd8SSteven Rostedt (Red Hat) 282897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS 283897f17a6SSteven Rostedt bool "Trace process context switches and events" 2845e0a0939SSteven Rostedt depends on !GENERIC_TRACER 285b77e38aaSSteven Rostedt select TRACING 286b77e38aaSSteven Rostedt help 28740892367SRandy Dunlap This tracer hooks to various trace points in the kernel, 288b77e38aaSSteven Rostedt allowing the user to pick and choose which trace point they 289897f17a6SSteven Rostedt want to trace. It also includes the sched_switch tracer plugin. 290a7abe97fSSteven Rostedt 291ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS 292ee08c6ecSFrederic Weisbecker bool "Trace syscalls" 29366700001SJosh Stone depends on HAVE_SYSCALL_TRACEPOINTS 2945e0a0939SSteven Rostedt select GENERIC_TRACER 2950ea1c415SFrederic Weisbecker select KALLSYMS 296ee08c6ecSFrederic Weisbecker help 297ee08c6ecSFrederic Weisbecker Basic tracer to catch the syscall entry and exit events. 298ee08c6ecSFrederic Weisbecker 299debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT 300debdd57fSHiraku Toyooka bool "Create a snapshot trace buffer" 301debdd57fSHiraku Toyooka select TRACER_MAX_TRACE 302debdd57fSHiraku Toyooka help 303debdd57fSHiraku Toyooka Allow tracing users to take snapshot of the current buffer using the 304debdd57fSHiraku Toyooka ftrace interface, e.g.: 305debdd57fSHiraku Toyooka 306debdd57fSHiraku Toyooka echo 1 > /sys/kernel/debug/tracing/snapshot 307debdd57fSHiraku Toyooka cat snapshot 308debdd57fSHiraku Toyooka 3090b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP 3100b85ffc2SSteven Rostedt (Red Hat) bool "Allow snapshot to swap per CPU" 3110b85ffc2SSteven Rostedt (Red Hat) depends on TRACER_SNAPSHOT 3120b85ffc2SSteven Rostedt (Red Hat) select RING_BUFFER_ALLOW_SWAP 3130b85ffc2SSteven Rostedt (Red Hat) help 3140b85ffc2SSteven Rostedt (Red Hat) Allow doing a snapshot of a single CPU buffer instead of a 3150b85ffc2SSteven Rostedt (Red Hat) full swap (all buffers). If this is set, then the following is 3160b85ffc2SSteven Rostedt (Red Hat) allowed: 3170b85ffc2SSteven Rostedt (Red Hat) 3180b85ffc2SSteven Rostedt (Red Hat) echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot 3190b85ffc2SSteven Rostedt (Red Hat) 3200b85ffc2SSteven Rostedt (Red Hat) After which, only the tracing buffer for CPU 2 was swapped with 3210b85ffc2SSteven Rostedt (Red Hat) the main tracing buffer, and the other CPU buffers remain the same. 3220b85ffc2SSteven Rostedt (Red Hat) 3230b85ffc2SSteven Rostedt (Red Hat) When this is enabled, this adds a little more overhead to the 3240b85ffc2SSteven Rostedt (Red Hat) trace recording, as it needs to add some checks to synchronize 3250b85ffc2SSteven Rostedt (Red Hat) recording with swaps. But this does not affect the performance 3260b85ffc2SSteven Rostedt (Red Hat) of the overall system. This is enabled by default when the preempt 3270b85ffc2SSteven Rostedt (Red Hat) or irq latency tracers are enabled, as those need to swap as well 3280b85ffc2SSteven Rostedt (Red Hat) and already adds the overhead (plus a lot more). 3290b85ffc2SSteven Rostedt (Red Hat) 3302ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING 3319ae5b879SSteven Rostedt bool 3325e0a0939SSteven Rostedt select GENERIC_TRACER 3339ae5b879SSteven Rostedt 3349ae5b879SSteven Rostedtchoice 3359ae5b879SSteven Rostedt prompt "Branch Profiling" 3369ae5b879SSteven Rostedt default BRANCH_PROFILE_NONE 3379ae5b879SSteven Rostedt help 3389ae5b879SSteven Rostedt The branch profiling is a software profiler. It will add hooks 3399ae5b879SSteven Rostedt into the C conditionals to test which path a branch takes. 3409ae5b879SSteven Rostedt 3419ae5b879SSteven Rostedt The likely/unlikely profiler only looks at the conditions that 3429ae5b879SSteven Rostedt are annotated with a likely or unlikely macro. 3439ae5b879SSteven Rostedt 34440892367SRandy Dunlap The "all branch" profiler will profile every if-statement in the 3459ae5b879SSteven Rostedt kernel. This profiler will also enable the likely/unlikely 34640892367SRandy Dunlap profiler. 3479ae5b879SSteven Rostedt 34840892367SRandy Dunlap Either of the above profilers adds a bit of overhead to the system. 34940892367SRandy Dunlap If unsure, choose "No branch profiling". 3509ae5b879SSteven Rostedt 3519ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE 3529ae5b879SSteven Rostedt bool "No branch profiling" 3539ae5b879SSteven Rostedt help 3549ae5b879SSteven Rostedt No branch profiling. Branch profiling adds a bit of overhead. 3559ae5b879SSteven Rostedt Only enable it if you want to analyse the branching behavior. 3569ae5b879SSteven Rostedt Otherwise keep it disabled. 3579ae5b879SSteven Rostedt 3589ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES 3599ae5b879SSteven Rostedt bool "Trace likely/unlikely profiler" 3609ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 3611f0d69a9SSteven Rostedt help 36259bf8964SMasanari Iida This tracer profiles all likely and unlikely macros 3631f0d69a9SSteven Rostedt in the kernel. It will display the results in: 3641f0d69a9SSteven Rostedt 36513e5befaSDavid Rientjes /sys/kernel/debug/tracing/trace_stat/branch_annotated 3661f0d69a9SSteven Rostedt 36740892367SRandy Dunlap Note: this will add a significant overhead; only turn this 3681f0d69a9SSteven Rostedt on if you need to profile the system's use of these macros. 3691f0d69a9SSteven Rostedt 3702bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES 37168e76e03SRandy Dunlap bool "Profile all if conditionals" if !FORTIFY_SOURCE 3729ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 3732bcd521aSSteven Rostedt help 3742bcd521aSSteven Rostedt This tracer profiles all branch conditions. Every if () 3752bcd521aSSteven Rostedt taken in the kernel is recorded whether it hit or miss. 3762bcd521aSSteven Rostedt The results will be displayed in: 3772bcd521aSSteven Rostedt 37813e5befaSDavid Rientjes /sys/kernel/debug/tracing/trace_stat/branch_all 3792bcd521aSSteven Rostedt 3809ae5b879SSteven Rostedt This option also enables the likely/unlikely profiler. 3819ae5b879SSteven Rostedt 3822bcd521aSSteven Rostedt This configuration, when enabled, will impose a great overhead 3832bcd521aSSteven Rostedt on the system. This should only be enabled when the system 38440892367SRandy Dunlap is to be analyzed in much detail. 3859ae5b879SSteven Rostedtendchoice 3862bcd521aSSteven Rostedt 3872ed84eebSSteven Rostedtconfig TRACING_BRANCHES 38852f232cbSSteven Rostedt bool 38952f232cbSSteven Rostedt help 39052f232cbSSteven Rostedt Selected by tracers that will trace the likely and unlikely 39152f232cbSSteven Rostedt conditions. This prevents the tracers themselves from being 39252f232cbSSteven Rostedt profiled. Profiling the tracing infrastructure can only happen 39352f232cbSSteven Rostedt when the likelys and unlikelys are not being traced. 39452f232cbSSteven Rostedt 3952ed84eebSSteven Rostedtconfig BRANCH_TRACER 39652f232cbSSteven Rostedt bool "Trace likely/unlikely instances" 3972ed84eebSSteven Rostedt depends on TRACE_BRANCH_PROFILING 3982ed84eebSSteven Rostedt select TRACING_BRANCHES 39952f232cbSSteven Rostedt help 40052f232cbSSteven Rostedt This traces the events of likely and unlikely condition 40152f232cbSSteven Rostedt calls in the kernel. The difference between this and the 40252f232cbSSteven Rostedt "Trace likely/unlikely profiler" is that this is not a 40352f232cbSSteven Rostedt histogram of the callers, but actually places the calling 40452f232cbSSteven Rostedt events into a running trace buffer to see when and where the 40552f232cbSSteven Rostedt events happened, as well as their results. 40652f232cbSSteven Rostedt 40752f232cbSSteven Rostedt Say N if unsure. 40852f232cbSSteven Rostedt 409e5a81b62SSteven Rostedtconfig STACK_TRACER 410e5a81b62SSteven Rostedt bool "Trace max stack" 411606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 412606576ceSSteven Rostedt select FUNCTION_TRACER 413e5a81b62SSteven Rostedt select STACKTRACE 4144d7a077cSSteven Rostedt select KALLSYMS 415e5a81b62SSteven Rostedt help 4164519d9e5SIngo Molnar This special tracer records the maximum stack footprint of the 417156f5a78SGeunSik Lim kernel and displays it in /sys/kernel/debug/tracing/stack_trace. 4184519d9e5SIngo Molnar 4194519d9e5SIngo Molnar This tracer works by hooking into every function call that the 4204519d9e5SIngo Molnar kernel executes, and keeping a maximum stack depth value and 421f38f1d2aSSteven Rostedt stack-trace saved. If this is configured with DYNAMIC_FTRACE 422f38f1d2aSSteven Rostedt then it will not have any overhead while the stack tracer 423f38f1d2aSSteven Rostedt is disabled. 424f38f1d2aSSteven Rostedt 425f38f1d2aSSteven Rostedt To enable the stack tracer on bootup, pass in 'stacktrace' 426f38f1d2aSSteven Rostedt on the kernel command line. 427f38f1d2aSSteven Rostedt 428f38f1d2aSSteven Rostedt The stack tracer can also be enabled or disabled via the 429f38f1d2aSSteven Rostedt sysctl kernel.stack_tracer_enabled 4304519d9e5SIngo Molnar 4314519d9e5SIngo Molnar Say N if unsure. 432e5a81b62SSteven Rostedt 4332db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE 43440892367SRandy Dunlap bool "Support for tracing block IO actions" 4352db270a8SFrederic Weisbecker depends on SYSFS 4361dfba05dSIngo Molnar depends on BLOCK 4372db270a8SFrederic Weisbecker select RELAY 4382db270a8SFrederic Weisbecker select DEBUG_FS 4392db270a8SFrederic Weisbecker select TRACEPOINTS 4405e0a0939SSteven Rostedt select GENERIC_TRACER 4412db270a8SFrederic Weisbecker select STACKTRACE 4422db270a8SFrederic Weisbecker help 4432db270a8SFrederic Weisbecker Say Y here if you want to be able to trace the block layer actions 4442db270a8SFrederic Weisbecker on a given queue. Tracing allows you to see any traffic happening 4452db270a8SFrederic Weisbecker on a block device queue. For more information (and the userspace 4462db270a8SFrederic Weisbecker support tools needed), fetch the blktrace tools from: 4472db270a8SFrederic Weisbecker 4482db270a8SFrederic Weisbecker git://git.kernel.dk/blktrace.git 4492db270a8SFrederic Weisbecker 4502db270a8SFrederic Weisbecker Tracing also is possible using the ftrace interface, e.g.: 4512db270a8SFrederic Weisbecker 4522db270a8SFrederic Weisbecker echo 1 > /sys/block/sda/sda1/trace/enable 4532db270a8SFrederic Weisbecker echo blk > /sys/kernel/debug/tracing/current_tracer 4542db270a8SFrederic Weisbecker cat /sys/kernel/debug/tracing/trace_pipe 4552db270a8SFrederic Weisbecker 4562db270a8SFrederic Weisbecker If unsure, say N. 45736994e58SFrederic Weisbecker 4586b0b7551SAnton Blanchardconfig KPROBE_EVENTS 459413d37d1SMasami Hiramatsu depends on KPROBES 460f850c30cSHeiko Carstens depends on HAVE_REGS_AND_STACK_ACCESS_API 46177b44d1bSMasami Hiramatsu bool "Enable kprobes-based dynamic events" 462413d37d1SMasami Hiramatsu select TRACING 4638ab83f56SSrikar Dronamraju select PROBE_EVENTS 46477b44d1bSMasami Hiramatsu default y 465413d37d1SMasami Hiramatsu help 46640892367SRandy Dunlap This allows the user to add tracing events (similar to tracepoints) 46740892367SRandy Dunlap on the fly via the ftrace interface. See 4685fb94e9cSMauro Carvalho Chehab Documentation/trace/kprobetrace.rst for more details. 46977b44d1bSMasami Hiramatsu 47077b44d1bSMasami Hiramatsu Those events can be inserted wherever kprobes can probe, and record 47177b44d1bSMasami Hiramatsu various register and memory values. 47277b44d1bSMasami Hiramatsu 47340892367SRandy Dunlap This option is also required by perf-probe subcommand of perf tools. 47440892367SRandy Dunlap If you want to use perf tools, this option is strongly recommended. 475413d37d1SMasami Hiramatsu 47645408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE 47745408c4fSMasami Hiramatsu bool "Do NOT protect notrace function from kprobe events" 47845408c4fSMasami Hiramatsu depends on KPROBE_EVENTS 47945408c4fSMasami Hiramatsu depends on KPROBES_ON_FTRACE 48045408c4fSMasami Hiramatsu default n 48145408c4fSMasami Hiramatsu help 48245408c4fSMasami Hiramatsu This is only for the developers who want to debug ftrace itself 48345408c4fSMasami Hiramatsu using kprobe events. 48445408c4fSMasami Hiramatsu 48545408c4fSMasami Hiramatsu If kprobes can use ftrace instead of breakpoint, ftrace related 48645408c4fSMasami Hiramatsu functions are protected from kprobe-events to prevent an infinit 48745408c4fSMasami Hiramatsu recursion or any unexpected execution path which leads to a kernel 48845408c4fSMasami Hiramatsu crash. 48945408c4fSMasami Hiramatsu 49045408c4fSMasami Hiramatsu This option disables such protection and allows you to put kprobe 49145408c4fSMasami Hiramatsu events on ftrace functions for debugging ftrace by itself. 49245408c4fSMasami Hiramatsu Note that this might let you shoot yourself in the foot. 49345408c4fSMasami Hiramatsu 49445408c4fSMasami Hiramatsu If unsure, say N. 49545408c4fSMasami Hiramatsu 4966b0b7551SAnton Blanchardconfig UPROBE_EVENTS 497f3f096cfSSrikar Dronamraju bool "Enable uprobes-based dynamic events" 498f3f096cfSSrikar Dronamraju depends on ARCH_SUPPORTS_UPROBES 499f3f096cfSSrikar Dronamraju depends on MMU 50009294e31SDavid A. Long depends on PERF_EVENTS 501f3f096cfSSrikar Dronamraju select UPROBES 502f3f096cfSSrikar Dronamraju select PROBE_EVENTS 503f3f096cfSSrikar Dronamraju select TRACING 50461f35d75SArnaldo Carvalho de Melo default y 505f3f096cfSSrikar Dronamraju help 506f3f096cfSSrikar Dronamraju This allows the user to add tracing events on top of userspace 507f3f096cfSSrikar Dronamraju dynamic events (similar to tracepoints) on the fly via the trace 508f3f096cfSSrikar Dronamraju events interface. Those events can be inserted wherever uprobes 509f3f096cfSSrikar Dronamraju can probe, and record various registers. 510f3f096cfSSrikar Dronamraju This option is required if you plan to use perf-probe subcommand 511f3f096cfSSrikar Dronamraju of perf tools on user space applications. 512f3f096cfSSrikar Dronamraju 513e1abf2ccSIngo Molnarconfig BPF_EVENTS 514e1abf2ccSIngo Molnar depends on BPF_SYSCALL 5156b0b7551SAnton Blanchard depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS 516e1abf2ccSIngo Molnar bool 517e1abf2ccSIngo Molnar default y 518e1abf2ccSIngo Molnar help 519e1abf2ccSIngo Molnar This allows the user to attach BPF programs to kprobe events. 520e1abf2ccSIngo Molnar 521*5448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS 522*5448d44cSMasami Hiramatsu def_bool n 523*5448d44cSMasami Hiramatsu 5248ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS 5258ab83f56SSrikar Dronamraju def_bool n 5268ab83f56SSrikar Dronamraju 5273d083395SSteven Rostedtconfig DYNAMIC_FTRACE 528db05021dSSteven Rostedt bool "enable/disable function tracing dynamically" 529606576ceSSteven Rostedt depends on FUNCTION_TRACER 530677aa9f7SSteven Rostedt depends on HAVE_DYNAMIC_FTRACE 5313d083395SSteven Rostedt default y 5323d083395SSteven Rostedt help 533db05021dSSteven Rostedt This option will modify all the calls to function tracing 534db05021dSSteven Rostedt dynamically (will patch them out of the binary image and 535db05021dSSteven Rostedt replace them with a No-Op instruction) on boot up. During 536db05021dSSteven Rostedt compile time, a table is made of all the locations that ftrace 537db05021dSSteven Rostedt can function trace, and this table is linked into the kernel 538db05021dSSteven Rostedt image. When this is enabled, functions can be individually 539db05021dSSteven Rostedt enabled, and the functions not enabled will not affect 540db05021dSSteven Rostedt performance of the system. 541db05021dSSteven Rostedt 542db05021dSSteven Rostedt See the files in /sys/kernel/debug/tracing: 543db05021dSSteven Rostedt available_filter_functions 544db05021dSSteven Rostedt set_ftrace_filter 545db05021dSSteven Rostedt set_ftrace_notrace 5463d083395SSteven Rostedt 54740892367SRandy Dunlap This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but 54840892367SRandy Dunlap otherwise has native performance as long as no tracing is active. 5493d083395SSteven Rostedt 55006aeaaeaSMasami Hiramatsuconfig DYNAMIC_FTRACE_WITH_REGS 55106aeaaeaSMasami Hiramatsu def_bool y 55206aeaaeaSMasami Hiramatsu depends on DYNAMIC_FTRACE 55306aeaaeaSMasami Hiramatsu depends on HAVE_DYNAMIC_FTRACE_WITH_REGS 55406aeaaeaSMasami Hiramatsu 555bac429f0SSteven Rostedtconfig FUNCTION_PROFILER 556bac429f0SSteven Rostedt bool "Kernel function profiler" 557493762fcSSteven Rostedt depends on FUNCTION_TRACER 558bac429f0SSteven Rostedt default n 559bac429f0SSteven Rostedt help 560493762fcSSteven Rostedt This option enables the kernel function profiler. A file is created 561493762fcSSteven Rostedt in debugfs called function_profile_enabled which defaults to zero. 562bac429f0SSteven Rostedt When a 1 is echoed into this file profiling begins, and when a 56340892367SRandy Dunlap zero is entered, profiling stops. A "functions" file is created in 5641fee4f77SMasami Hiramatsu the trace_stat directory; this file shows the list of functions that 565bac429f0SSteven Rostedt have been hit and their counters. 566bac429f0SSteven Rostedt 56740892367SRandy Dunlap If in doubt, say N. 568bac429f0SSteven Rostedt 5699802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE 5709802d865SJosef Bacik bool "Enable BPF programs to override a kprobed function" 5719802d865SJosef Bacik depends on BPF_EVENTS 572540adea3SMasami Hiramatsu depends on FUNCTION_ERROR_INJECTION 5739802d865SJosef Bacik default n 5749802d865SJosef Bacik help 5759802d865SJosef Bacik Allows BPF to override the execution of a probed function and 5769802d865SJosef Bacik set a different return value. This is used for error injection. 5779802d865SJosef Bacik 5788da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD 5798da3821bSSteven Rostedt def_bool y 5808da3821bSSteven Rostedt depends on DYNAMIC_FTRACE 5818da3821bSSteven Rostedt depends on HAVE_FTRACE_MCOUNT_RECORD 5828da3821bSSteven Rostedt 58360a11774SSteven Rostedtconfig FTRACE_SELFTEST 58460a11774SSteven Rostedt bool 58560a11774SSteven Rostedt 58660a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST 58760a11774SSteven Rostedt bool "Perform a startup test on ftrace" 5885e0a0939SSteven Rostedt depends on GENERIC_TRACER 58960a11774SSteven Rostedt select FTRACE_SELFTEST 59060a11774SSteven Rostedt help 59160a11774SSteven Rostedt This option performs a series of startup tests on ftrace. On bootup 59260a11774SSteven Rostedt a series of tests are made to verify that the tracer is 59360a11774SSteven Rostedt functioning properly. It will do tests on all the configured 59460a11774SSteven Rostedt tracers of ftrace. 59517d80fd0SPeter Zijlstra 5961f5a6b45SSteven Rostedtconfig EVENT_TRACE_TEST_SYSCALLS 5971f5a6b45SSteven Rostedt bool "Run selftest on syscall events" 5981f5a6b45SSteven Rostedt depends on FTRACE_STARTUP_TEST 5991f5a6b45SSteven Rostedt help 6001f5a6b45SSteven Rostedt This option will also enable testing every syscall event. 6011f5a6b45SSteven Rostedt It only enables the event and disables it and runs various loads 6021f5a6b45SSteven Rostedt with the event enabled. This adds a bit more time for kernel boot 6031f5a6b45SSteven Rostedt up since it runs this on every system call defined. 6041f5a6b45SSteven Rostedt 6051f5a6b45SSteven Rostedt TBD - enable a way to actually call the syscalls as we test their 6061f5a6b45SSteven Rostedt events 6071f5a6b45SSteven Rostedt 608fe6f90e5SPekka Paalanenconfig MMIOTRACE 609fe6f90e5SPekka Paalanen bool "Memory mapped IO tracing" 61040ada30fSIngo Molnar depends on HAVE_MMIOTRACE_SUPPORT && PCI 6115e0a0939SSteven Rostedt select GENERIC_TRACER 612fe6f90e5SPekka Paalanen help 613fe6f90e5SPekka Paalanen Mmiotrace traces Memory Mapped I/O access and is meant for 614fe6f90e5SPekka Paalanen debugging and reverse engineering. It is called from the ioremap 615fe6f90e5SPekka Paalanen implementation and works via page faults. Tracing is disabled by 616fe6f90e5SPekka Paalanen default and can be enabled at run-time. 617fe6f90e5SPekka Paalanen 6185fb94e9cSMauro Carvalho Chehab See Documentation/trace/mmiotrace.rst. 619fe6f90e5SPekka Paalanen If you are not helping to develop drivers, say N. 620fe6f90e5SPekka Paalanen 62108d43a5fSTom Zanussiconfig TRACING_MAP 62208d43a5fSTom Zanussi bool 62308d43a5fSTom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 62408d43a5fSTom Zanussi help 62508d43a5fSTom Zanussi tracing_map is a special-purpose lock-free map for tracing, 62608d43a5fSTom Zanussi separated out as a stand-alone facility in order to allow it 62708d43a5fSTom Zanussi to be shared between multiple tracers. It isn't meant to be 62808d43a5fSTom Zanussi generally used outside of that context, and is normally 62908d43a5fSTom Zanussi selected by tracers that use it. 63008d43a5fSTom Zanussi 6317ef224d1STom Zanussiconfig HIST_TRIGGERS 6327ef224d1STom Zanussi bool "Histogram triggers" 6337ef224d1STom Zanussi depends on ARCH_HAVE_NMI_SAFE_CMPXCHG 6347ef224d1STom Zanussi select TRACING_MAP 6357ad8fb61STom Zanussi select TRACING 6367ef224d1STom Zanussi default n 6377ef224d1STom Zanussi help 6387ef224d1STom Zanussi Hist triggers allow one or more arbitrary trace event fields 6397ef224d1STom Zanussi to be aggregated into hash tables and dumped to stdout by 6407ef224d1STom Zanussi reading a debugfs/tracefs file. They're useful for 6417ef224d1STom Zanussi gathering quick and dirty (though precise) summaries of 6427ef224d1STom Zanussi event activity as an initial guide for further investigation 6437ef224d1STom Zanussi using more advanced tools. 6447ef224d1STom Zanussi 64589e270c1STom Zanussi Inter-event tracing of quantities such as latencies is also 64689e270c1STom Zanussi supported using hist triggers under this option. 64789e270c1STom Zanussi 648ea272257SMauro Carvalho Chehab See Documentation/trace/histogram.rst. 6497ef224d1STom Zanussi If in doubt, say N. 6507ef224d1STom Zanussi 651fe6f90e5SPekka Paalanenconfig MMIOTRACE_TEST 652fe6f90e5SPekka Paalanen tristate "Test module for mmiotrace" 653fe6f90e5SPekka Paalanen depends on MMIOTRACE && m 654fe6f90e5SPekka Paalanen help 655fe6f90e5SPekka Paalanen This is a dumb module for testing mmiotrace. It is very dangerous 656fe6f90e5SPekka Paalanen as it will write garbage to IO memory starting at a given address. 657fe6f90e5SPekka Paalanen However, it should be safe to use on e.g. unused portion of VRAM. 658fe6f90e5SPekka Paalanen 659fe6f90e5SPekka Paalanen Say N, unless you absolutely know what you are doing. 660fe6f90e5SPekka Paalanen 66181dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK 66281dc9f0eSSteven Rostedt (Red Hat) bool "Add tracepoint that benchmarks tracepoints" 66381dc9f0eSSteven Rostedt (Red Hat) help 66481dc9f0eSSteven Rostedt (Red Hat) This option creates the tracepoint "benchmark:benchmark_event". 66581dc9f0eSSteven Rostedt (Red Hat) When the tracepoint is enabled, it kicks off a kernel thread that 66681dc9f0eSSteven Rostedt (Red Hat) goes into an infinite loop (calling cond_sched() to let other tasks 66781dc9f0eSSteven Rostedt (Red Hat) run), and calls the tracepoint. Each iteration will record the time 66881dc9f0eSSteven Rostedt (Red Hat) it took to write to the tracepoint and the next iteration that 66981dc9f0eSSteven Rostedt (Red Hat) data will be passed to the tracepoint itself. That is, the tracepoint 67081dc9f0eSSteven Rostedt (Red Hat) will report the time it took to do the previous tracepoint. 67181dc9f0eSSteven Rostedt (Red Hat) The string written to the tracepoint is a static string of 128 bytes 67281dc9f0eSSteven Rostedt (Red Hat) to keep the time the same. The initial string is simply a write of 67381dc9f0eSSteven Rostedt (Red Hat) "START". The second string records the cold cache time of the first 67481dc9f0eSSteven Rostedt (Red Hat) write which is not added to the rest of the calculations. 67581dc9f0eSSteven Rostedt (Red Hat) 67681dc9f0eSSteven Rostedt (Red Hat) As it is a tight loop, it benchmarks as hot cache. That's fine because 67781dc9f0eSSteven Rostedt (Red Hat) we care most about hot paths that are probably in cache already. 67881dc9f0eSSteven Rostedt (Red Hat) 67981dc9f0eSSteven Rostedt (Red Hat) An example of the output: 68081dc9f0eSSteven Rostedt (Red Hat) 68181dc9f0eSSteven Rostedt (Red Hat) START 68281dc9f0eSSteven Rostedt (Red Hat) first=3672 [COLD CACHED] 68381dc9f0eSSteven Rostedt (Red Hat) last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712 68481dc9f0eSSteven Rostedt (Red Hat) last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337 68581dc9f0eSSteven Rostedt (Red Hat) last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064 68681dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411 68781dc9f0eSSteven Rostedt (Red Hat) last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389 68881dc9f0eSSteven Rostedt (Red Hat) last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666 68981dc9f0eSSteven Rostedt (Red Hat) 69081dc9f0eSSteven Rostedt (Red Hat) 6915092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK 6925092dbc9SSteven Rostedt tristate "Ring buffer benchmark stress tester" 6935092dbc9SSteven Rostedt depends on RING_BUFFER 6945092dbc9SSteven Rostedt help 6955092dbc9SSteven Rostedt This option creates a test to stress the ring buffer and benchmark it. 69640892367SRandy Dunlap It creates its own ring buffer such that it will not interfere with 6975092dbc9SSteven Rostedt any other users of the ring buffer (such as ftrace). It then creates 6985092dbc9SSteven Rostedt a producer and consumer that will run for 10 seconds and sleep for 6995092dbc9SSteven Rostedt 10 seconds. Each interval it will print out the number of events 7005092dbc9SSteven Rostedt it recorded and give a rough estimate of how long each iteration took. 7015092dbc9SSteven Rostedt 7025092dbc9SSteven Rostedt It does not disable interrupts or raise its priority, so it may be 7035092dbc9SSteven Rostedt affected by processes that are running. 7045092dbc9SSteven Rostedt 70540892367SRandy Dunlap If unsure, say N. 7065092dbc9SSteven Rostedt 7076c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST 7086c43e554SSteven Rostedt (Red Hat) bool "Ring buffer startup self test" 7096c43e554SSteven Rostedt (Red Hat) depends on RING_BUFFER 7106c43e554SSteven Rostedt (Red Hat) help 7116c43e554SSteven Rostedt (Red Hat) Run a simple self test on the ring buffer on boot up. Late in the 7126c43e554SSteven Rostedt (Red Hat) kernel boot sequence, the test will start that kicks off 7136c43e554SSteven Rostedt (Red Hat) a thread per cpu. Each thread will write various size events 7146c43e554SSteven Rostedt (Red Hat) into the ring buffer. Another thread is created to send IPIs 7156c43e554SSteven Rostedt (Red Hat) to each of the threads, where the IPI handler will also write 7166c43e554SSteven Rostedt (Red Hat) to the ring buffer, to test/stress the nesting ability. 7176c43e554SSteven Rostedt (Red Hat) If any anomalies are discovered, a warning will be displayed 7186c43e554SSteven Rostedt (Red Hat) and all ring buffers will be disabled. 7196c43e554SSteven Rostedt (Red Hat) 7206c43e554SSteven Rostedt (Red Hat) The test runs for 10 seconds. This will slow your boot time 7216c43e554SSteven Rostedt (Red Hat) by at least 10 more seconds. 7226c43e554SSteven Rostedt (Red Hat) 7236c43e554SSteven Rostedt (Red Hat) At the end of the test, statics and more checks are done. 7246c43e554SSteven Rostedt (Red Hat) It will output the stats of each per cpu buffer. What 7256c43e554SSteven Rostedt (Red Hat) was written, the sizes, what was read, what was lost, and 7266c43e554SSteven Rostedt (Red Hat) other similar details. 7276c43e554SSteven Rostedt (Red Hat) 7286c43e554SSteven Rostedt (Red Hat) If unsure, say N 7296c43e554SSteven Rostedt (Red Hat) 730f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST 731f96e8577SJoel Fernandes (Google) tristate "Preempt / IRQ disable delay thread to test latency tracers" 732f96e8577SJoel Fernandes (Google) depends on m 733f96e8577SJoel Fernandes (Google) help 734f96e8577SJoel Fernandes (Google) Select this option to build a test module that can help test latency 735f96e8577SJoel Fernandes (Google) tracers by executing a preempt or irq disable section with a user 736f96e8577SJoel Fernandes (Google) configurable delay. The module busy waits for the duration of the 737f96e8577SJoel Fernandes (Google) critical section. 738f96e8577SJoel Fernandes (Google) 739f96e8577SJoel Fernandes (Google) For example, the following invocation forces a one-time irq-disabled 740f96e8577SJoel Fernandes (Google) critical section for 500us: 741f96e8577SJoel Fernandes (Google) modprobe preemptirq_delay_test test_mode=irq delay=500000 742f96e8577SJoel Fernandes (Google) 743f96e8577SJoel Fernandes (Google) If unsure, say N 744f96e8577SJoel Fernandes (Google) 745681bec03SJeremy Lintonconfig TRACE_EVAL_MAP_FILE 746681bec03SJeremy Linton bool "Show eval mappings for trace events" 7479828413dSSteven Rostedt (Red Hat) depends on TRACING 7489828413dSSteven Rostedt (Red Hat) help 749681bec03SJeremy Linton The "print fmt" of the trace events will show the enum/sizeof names 750681bec03SJeremy Linton instead of their values. This can cause problems for user space tools 751681bec03SJeremy Linton that use this string to parse the raw data as user space does not know 7529828413dSSteven Rostedt (Red Hat) how to convert the string to its value. 7539828413dSSteven Rostedt (Red Hat) 7549828413dSSteven Rostedt (Red Hat) To fix this, there's a special macro in the kernel that can be used 755681bec03SJeremy Linton to convert an enum/sizeof into its value. If this macro is used, then 756681bec03SJeremy Linton the print fmt strings will be converted to their values. 7579828413dSSteven Rostedt (Red Hat) 7589828413dSSteven Rostedt (Red Hat) If something does not get converted properly, this option can be 759681bec03SJeremy Linton used to show what enums/sizeof the kernel tried to convert. 7609828413dSSteven Rostedt (Red Hat) 761681bec03SJeremy Linton This option is for debugging the conversions. A file is created 762681bec03SJeremy Linton in the tracing directory called "eval_map" that will show the 7639828413dSSteven Rostedt (Red Hat) names matched with their values and what trace event system they 7649828413dSSteven Rostedt (Red Hat) belong too. 7659828413dSSteven Rostedt (Red Hat) 7669828413dSSteven Rostedt (Red Hat) Normally, the mapping of the strings to values will be freed after 7679828413dSSteven Rostedt (Red Hat) boot up or module load. With this option, they will not be freed, as 768681bec03SJeremy Linton they are needed for the "eval_map" file. Enabling this option will 7699828413dSSteven Rostedt (Red Hat) increase the memory footprint of the running kernel. 7709828413dSSteven Rostedt (Red Hat) 7719828413dSSteven Rostedt (Red Hat) If unsure, say N 7729828413dSSteven Rostedt (Red Hat) 773ddd70280STal Shorerconfig TRACING_EVENTS_GPIO 774ddd70280STal Shorer bool "Trace gpio events" 775ddd70280STal Shorer depends on GPIOLIB 776ddd70280STal Shorer default y 777ddd70280STal Shorer help 778ddd70280STal Shorer Enable tracing events for gpio subsystem 779ddd70280STal Shorer 7806b7dca40SMasami Hiramatsuconfig GCOV_PROFILE_FTRACE 7816b7dca40SMasami Hiramatsu bool "Enable GCOV profiling on ftrace subsystem" 7826b7dca40SMasami Hiramatsu depends on GCOV_KERNEL 7836b7dca40SMasami Hiramatsu help 7846b7dca40SMasami Hiramatsu Enable GCOV profiling on ftrace subsystem for checking 7856b7dca40SMasami Hiramatsu which functions/lines are tested. 7866b7dca40SMasami Hiramatsu 7876b7dca40SMasami Hiramatsu If unsure, say N. 7886b7dca40SMasami Hiramatsu 7896b7dca40SMasami Hiramatsu Note that on a kernel compiled with this config, ftrace will 7906b7dca40SMasami Hiramatsu run significantly slower. 7916b7dca40SMasami Hiramatsu 7924ed9f071SSteven Rostedtendif # FTRACE 79340ada30fSIngo Molnar 79440ada30fSIngo Molnarendif # TRACING_SUPPORT 79540ada30fSIngo Molnar 796