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 1540892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 1678d904b4SSteven Rostedt 17606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER 1816444a8aSArnaldo Carvalho de Melo bool 19555f386cSMike Frysinger help 2040892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 21bc0c38d1SSteven Rostedt 22fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER 2315e6cb36SFrederic Weisbecker bool 24555f386cSMike Frysinger help 2540892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 2615e6cb36SFrederic Weisbecker 2771e308a2SSteven Rostedtconfig HAVE_FUNCTION_GRAPH_FP_TEST 2871e308a2SSteven Rostedt bool 2971e308a2SSteven Rostedt help 3003688970SMike Frysinger See Documentation/trace/ftrace-design.txt 3171e308a2SSteven Rostedt 3260a7ecf4SSteven Rostedtconfig HAVE_FUNCTION_TRACE_MCOUNT_TEST 3360a7ecf4SSteven Rostedt bool 3460a7ecf4SSteven Rostedt help 3540892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 3660a7ecf4SSteven Rostedt 37677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 38677aa9f7SSteven Rostedt bool 39555f386cSMike Frysinger help 4040892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 41677aa9f7SSteven Rostedt 428da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD 438da3821bSSteven Rostedt bool 44555f386cSMike Frysinger help 4540892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 468da3821bSSteven Rostedt 4766700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS 48ee08c6ecSFrederic Weisbecker bool 49555f386cSMike Frysinger help 5040892367SRandy Dunlap See Documentation/trace/ftrace-design.txt 51ee08c6ecSFrederic Weisbecker 52352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 53352ad25aSSteven Rostedt bool 54352ad25aSSteven Rostedt 557a8e76a3SSteven Rostedtconfig RING_BUFFER 567a8e76a3SSteven Rostedt bool 577a8e76a3SSteven Rostedt 5878d904b4SSteven Rostedtconfig FTRACE_NMI_ENTER 5978d904b4SSteven Rostedt bool 6078d904b4SSteven Rostedt depends on HAVE_FTRACE_NMI_ENTER 6178d904b4SSteven Rostedt default y 6278d904b4SSteven Rostedt 635f77a88bSTom Zanussiconfig EVENT_TRACING 64b11c53e1SZhaolei select CONTEXT_SWITCH_TRACER 65b11c53e1SZhaolei bool 66b11c53e1SZhaolei 67b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER 685f77a88bSTom Zanussi bool 695f77a88bSTom Zanussi 7085bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP 7185bac32cSSteven Rostedt bool 7285bac32cSSteven Rostedt help 7385bac32cSSteven Rostedt Allow the use of ring_buffer_swap_cpu. 7485bac32cSSteven Rostedt Adds a very slight overhead to tracing when enabled. 7585bac32cSSteven Rostedt 765e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are 775e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING. 785e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the 795e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options 805e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the 8140892367SRandy Dunlap# hiding of the automatic options. 825e0a0939SSteven Rostedt 83bc0c38d1SSteven Rostedtconfig TRACING 84bc0c38d1SSteven Rostedt bool 85bc0c38d1SSteven Rostedt select DEBUG_FS 867a8e76a3SSteven Rostedt select RING_BUFFER 87c2c80529SAl Viro select STACKTRACE if STACKTRACE_SUPPORT 885f87f112SIngo Molnar select TRACEPOINTS 89f3384b28SSteven Rostedt select NOP_TRACER 90769b0441SFrederic Weisbecker select BINARY_PRINTF 915f77a88bSTom Zanussi select EVENT_TRACING 92bc0c38d1SSteven Rostedt 935e0a0939SSteven Rostedtconfig GENERIC_TRACER 945e0a0939SSteven Rostedt bool 955e0a0939SSteven Rostedt select TRACING 965e0a0939SSteven Rostedt 9740ada30fSIngo Molnar# 9840ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to 9940ada30fSIngo Molnar# be able to offer generic tracing facilities: 10040ada30fSIngo Molnar# 10140ada30fSIngo Molnarconfig TRACING_SUPPORT 10240ada30fSIngo Molnar bool 10345b95608SAnton Vorontsov # PPC32 has no irqflags tracing support, but it can use most of the 10445b95608SAnton Vorontsov # tracers anyway, they were tested to build and work. Note that new 10545b95608SAnton Vorontsov # exceptions to this list aren't welcomed, better implement the 10645b95608SAnton Vorontsov # irqflags tracing for your architecture. 10745b95608SAnton Vorontsov depends on TRACE_IRQFLAGS_SUPPORT || PPC32 10840ada30fSIngo Molnar depends on STACKTRACE_SUPPORT 109422d3c7aSKOSAKI Motohiro default y 11040ada30fSIngo Molnar 11140ada30fSIngo Molnarif TRACING_SUPPORT 11240ada30fSIngo Molnar 1134ed9f071SSteven Rostedtmenuconfig FTRACE 1144ed9f071SSteven Rostedt bool "Tracers" 11565b77242SSteven Rostedt default y if DEBUG_KERNEL 1164ed9f071SSteven Rostedt help 1174ed9f071SSteven Rostedt Enable the kernel tracing infrastructure. 1184ed9f071SSteven Rostedt 1194ed9f071SSteven Rostedtif FTRACE 12017d80fd0SPeter Zijlstra 121606576ceSSteven Rostedtconfig FUNCTION_TRACER 1221b29b018SSteven Rostedt bool "Kernel Function Tracer" 123606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 1241b29b018SSteven Rostedt select FRAME_POINTER 1254d7a077cSSteven Rostedt select KALLSYMS 1265e0a0939SSteven Rostedt select GENERIC_TRACER 12735e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 1281b29b018SSteven Rostedt help 1291b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 1301b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 13140892367SRandy Dunlap instruction at the beginning of every kernel function, which NOP 1321b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 1331b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 1341b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 1351b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 13635e8e302SSteven Rostedt 137fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER 138fb52607aSFrederic Weisbecker bool "Kernel Function Graph Tracer" 139fb52607aSFrederic Weisbecker depends on HAVE_FUNCTION_GRAPH_TRACER 14015e6cb36SFrederic Weisbecker depends on FUNCTION_TRACER 141eb4a0378SSteven Rostedt depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE 142764f3b95SIngo Molnar default y 14315e6cb36SFrederic Weisbecker help 144fb52607aSFrederic Weisbecker Enable the kernel to trace a function at both its return 145fb52607aSFrederic Weisbecker and its entry. 146692105b8SMatt LaPlante Its first purpose is to trace the duration of functions and 147692105b8SMatt LaPlante draw a call graph for each thread with some information like 148692105b8SMatt LaPlante the return value. This is done by setting the current return 149692105b8SMatt LaPlante address on the current task structure into a stack of calls. 15015e6cb36SFrederic Weisbecker 151bac429f0SSteven Rostedt 15281d68a96SSteven Rostedtconfig IRQSOFF_TRACER 15381d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 15481d68a96SSteven Rostedt default n 15581d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 156*592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 15781d68a96SSteven Rostedt select TRACE_IRQFLAGS 1585e0a0939SSteven Rostedt select GENERIC_TRACER 15981d68a96SSteven Rostedt select TRACER_MAX_TRACE 16085bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 16181d68a96SSteven Rostedt help 16281d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 16381d68a96SSteven Rostedt sections, with microsecond accuracy. 16481d68a96SSteven Rostedt 16581d68a96SSteven Rostedt The default measurement method is a maximum search, which is 16681d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 16781d68a96SSteven Rostedt via: 16881d68a96SSteven Rostedt 169156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 17081d68a96SSteven Rostedt 17140892367SRandy Dunlap (Note that kernel size and overhead increase with this option 1726cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 1736cd8a4bbSSteven Rostedt used together or separately.) 1746cd8a4bbSSteven Rostedt 1756cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 1766cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 1776cd8a4bbSSteven Rostedt default n 178*592913ecSJohn Stultz depends on !ARCH_USES_GETTIMEOFFSET 1796cd8a4bbSSteven Rostedt depends on PREEMPT 1805e0a0939SSteven Rostedt select GENERIC_TRACER 1816cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 18285bac32cSSteven Rostedt select RING_BUFFER_ALLOW_SWAP 1836cd8a4bbSSteven Rostedt help 18440892367SRandy Dunlap This option measures the time spent in preemption-off critical 1856cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 1866cd8a4bbSSteven Rostedt 1876cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 1886cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 1896cd8a4bbSSteven Rostedt via: 1906cd8a4bbSSteven Rostedt 191156f5a78SGeunSik Lim echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 1926cd8a4bbSSteven Rostedt 19340892367SRandy Dunlap (Note that kernel size and overhead increase with this option 1946cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 1956cd8a4bbSSteven Rostedt used together or separately.) 1966cd8a4bbSSteven Rostedt 197f06c3810SIngo Molnarconfig SYSPROF_TRACER 198f06c3810SIngo Molnar bool "Sysprof Tracer" 1994d2df795SThomas Gleixner depends on X86 2005e0a0939SSteven Rostedt select GENERIC_TRACER 201b22f4858SFrederic Weisbecker select CONTEXT_SWITCH_TRACER 202f06c3810SIngo Molnar help 203f06c3810SIngo Molnar This tracer provides the trace needed by the 'Sysprof' userspace 204f06c3810SIngo Molnar tool. 205f06c3810SIngo Molnar 206352ad25aSSteven Rostedtconfig SCHED_TRACER 207352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 2085e0a0939SSteven Rostedt select GENERIC_TRACER 209352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 210352ad25aSSteven Rostedt select TRACER_MAX_TRACE 211352ad25aSSteven Rostedt help 212352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 213352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 214352ad25aSSteven Rostedt 215897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS 216897f17a6SSteven Rostedt bool "Trace process context switches and events" 2175e0a0939SSteven Rostedt depends on !GENERIC_TRACER 218b77e38aaSSteven Rostedt select TRACING 219b77e38aaSSteven Rostedt help 22040892367SRandy Dunlap This tracer hooks to various trace points in the kernel, 221b77e38aaSSteven Rostedt allowing the user to pick and choose which trace point they 222897f17a6SSteven Rostedt want to trace. It also includes the sched_switch tracer plugin. 223a7abe97fSSteven Rostedt 224ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS 225ee08c6ecSFrederic Weisbecker bool "Trace syscalls" 22666700001SJosh Stone depends on HAVE_SYSCALL_TRACEPOINTS 2275e0a0939SSteven Rostedt select GENERIC_TRACER 2280ea1c415SFrederic Weisbecker select KALLSYMS 229ee08c6ecSFrederic Weisbecker help 230ee08c6ecSFrederic Weisbecker Basic tracer to catch the syscall entry and exit events. 231ee08c6ecSFrederic Weisbecker 2321f5c2abbSFrédéric Weisbeckerconfig BOOT_TRACER 2331f5c2abbSFrédéric Weisbecker bool "Trace boot initcalls" 2345e0a0939SSteven Rostedt select GENERIC_TRACER 235ea31e72dSFrederic Weisbecker select CONTEXT_SWITCH_TRACER 2361f5c2abbSFrédéric Weisbecker help 2371f5c2abbSFrédéric Weisbecker This tracer helps developers to optimize boot times: it records 23898d9c66aSIngo Molnar the timings of the initcalls and traces key events and the identity 23998d9c66aSIngo Molnar of tasks that can cause boot delays, such as context-switches. 24098d9c66aSIngo Molnar 241238a24f6SLi Zefan Its aim is to be parsed by the scripts/bootgraph.pl tool to 24298d9c66aSIngo Molnar produce pretty graphics about boot inefficiencies, giving a visual 24398d9c66aSIngo Molnar representation of the delays during initcalls - but the raw 24498d9c66aSIngo Molnar /debug/tracing/trace text output is readable too. 24598d9c66aSIngo Molnar 246238a24f6SLi Zefan You must pass in initcall_debug and ftrace=initcall to the kernel 247238a24f6SLi Zefan command line to enable this on bootup. 2481f5c2abbSFrédéric Weisbecker 2492ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING 2509ae5b879SSteven Rostedt bool 2515e0a0939SSteven Rostedt select GENERIC_TRACER 2529ae5b879SSteven Rostedt 2539ae5b879SSteven Rostedtchoice 2549ae5b879SSteven Rostedt prompt "Branch Profiling" 2559ae5b879SSteven Rostedt default BRANCH_PROFILE_NONE 2569ae5b879SSteven Rostedt help 2579ae5b879SSteven Rostedt The branch profiling is a software profiler. It will add hooks 2589ae5b879SSteven Rostedt into the C conditionals to test which path a branch takes. 2599ae5b879SSteven Rostedt 2609ae5b879SSteven Rostedt The likely/unlikely profiler only looks at the conditions that 2619ae5b879SSteven Rostedt are annotated with a likely or unlikely macro. 2629ae5b879SSteven Rostedt 26340892367SRandy Dunlap The "all branch" profiler will profile every if-statement in the 2649ae5b879SSteven Rostedt kernel. This profiler will also enable the likely/unlikely 26540892367SRandy Dunlap profiler. 2669ae5b879SSteven Rostedt 26740892367SRandy Dunlap Either of the above profilers adds a bit of overhead to the system. 26840892367SRandy Dunlap If unsure, choose "No branch profiling". 2699ae5b879SSteven Rostedt 2709ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE 2719ae5b879SSteven Rostedt bool "No branch profiling" 2729ae5b879SSteven Rostedt help 2739ae5b879SSteven Rostedt No branch profiling. Branch profiling adds a bit of overhead. 2749ae5b879SSteven Rostedt Only enable it if you want to analyse the branching behavior. 2759ae5b879SSteven Rostedt Otherwise keep it disabled. 2769ae5b879SSteven Rostedt 2779ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES 2789ae5b879SSteven Rostedt bool "Trace likely/unlikely profiler" 2799ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 2801f0d69a9SSteven Rostedt help 2811f0d69a9SSteven Rostedt This tracer profiles all the the likely and unlikely macros 2821f0d69a9SSteven Rostedt in the kernel. It will display the results in: 2831f0d69a9SSteven Rostedt 284156f5a78SGeunSik Lim /sys/kernel/debug/tracing/profile_annotated_branch 2851f0d69a9SSteven Rostedt 28640892367SRandy Dunlap Note: this will add a significant overhead; only turn this 2871f0d69a9SSteven Rostedt on if you need to profile the system's use of these macros. 2881f0d69a9SSteven Rostedt 2892bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES 2902bcd521aSSteven Rostedt bool "Profile all if conditionals" 2919ae5b879SSteven Rostedt select TRACE_BRANCH_PROFILING 2922bcd521aSSteven Rostedt help 2932bcd521aSSteven Rostedt This tracer profiles all branch conditions. Every if () 2942bcd521aSSteven Rostedt taken in the kernel is recorded whether it hit or miss. 2952bcd521aSSteven Rostedt The results will be displayed in: 2962bcd521aSSteven Rostedt 297156f5a78SGeunSik Lim /sys/kernel/debug/tracing/profile_branch 2982bcd521aSSteven Rostedt 2999ae5b879SSteven Rostedt This option also enables the likely/unlikely profiler. 3009ae5b879SSteven Rostedt 3012bcd521aSSteven Rostedt This configuration, when enabled, will impose a great overhead 3022bcd521aSSteven Rostedt on the system. This should only be enabled when the system 30340892367SRandy Dunlap is to be analyzed in much detail. 3049ae5b879SSteven Rostedtendchoice 3052bcd521aSSteven Rostedt 3062ed84eebSSteven Rostedtconfig TRACING_BRANCHES 30752f232cbSSteven Rostedt bool 30852f232cbSSteven Rostedt help 30952f232cbSSteven Rostedt Selected by tracers that will trace the likely and unlikely 31052f232cbSSteven Rostedt conditions. This prevents the tracers themselves from being 31152f232cbSSteven Rostedt profiled. Profiling the tracing infrastructure can only happen 31252f232cbSSteven Rostedt when the likelys and unlikelys are not being traced. 31352f232cbSSteven Rostedt 3142ed84eebSSteven Rostedtconfig BRANCH_TRACER 31552f232cbSSteven Rostedt bool "Trace likely/unlikely instances" 3162ed84eebSSteven Rostedt depends on TRACE_BRANCH_PROFILING 3172ed84eebSSteven Rostedt select TRACING_BRANCHES 31852f232cbSSteven Rostedt help 31952f232cbSSteven Rostedt This traces the events of likely and unlikely condition 32052f232cbSSteven Rostedt calls in the kernel. The difference between this and the 32152f232cbSSteven Rostedt "Trace likely/unlikely profiler" is that this is not a 32252f232cbSSteven Rostedt histogram of the callers, but actually places the calling 32352f232cbSSteven Rostedt events into a running trace buffer to see when and where the 32452f232cbSSteven Rostedt events happened, as well as their results. 32552f232cbSSteven Rostedt 32652f232cbSSteven Rostedt Say N if unsure. 32752f232cbSSteven Rostedt 3280722db01SK.Prasadconfig KSYM_TRACER 3290722db01SK.Prasad bool "Trace read and write access on kernel memory locations" 3300722db01SK.Prasad depends on HAVE_HW_BREAKPOINT 3310722db01SK.Prasad select TRACING 3320722db01SK.Prasad help 3330722db01SK.Prasad This tracer helps find read and write operations on any given kernel 3340722db01SK.Prasad symbol i.e. /proc/kallsyms. 3350722db01SK.Prasad 3360722db01SK.Prasadconfig PROFILE_KSYM_TRACER 3370722db01SK.Prasad bool "Profile all kernel memory accesses on 'watched' variables" 3380722db01SK.Prasad depends on KSYM_TRACER 3390722db01SK.Prasad help 3400722db01SK.Prasad This tracer profiles kernel accesses on variables watched through the 3410722db01SK.Prasad ksym tracer ftrace plugin. Depending upon the hardware, all read 3420722db01SK.Prasad and write operations on kernel variables can be monitored for 3430722db01SK.Prasad accesses. 3440722db01SK.Prasad 3450722db01SK.Prasad The results will be displayed in: 3460722db01SK.Prasad /debugfs/tracing/profile_ksym 3470722db01SK.Prasad 3480722db01SK.Prasad Say N if unsure. 349f3f47a67SArjan van de Ven 350e5a81b62SSteven Rostedtconfig STACK_TRACER 351e5a81b62SSteven Rostedt bool "Trace max stack" 352606576ceSSteven Rostedt depends on HAVE_FUNCTION_TRACER 353606576ceSSteven Rostedt select FUNCTION_TRACER 354e5a81b62SSteven Rostedt select STACKTRACE 3554d7a077cSSteven Rostedt select KALLSYMS 356e5a81b62SSteven Rostedt help 3574519d9e5SIngo Molnar This special tracer records the maximum stack footprint of the 358156f5a78SGeunSik Lim kernel and displays it in /sys/kernel/debug/tracing/stack_trace. 3594519d9e5SIngo Molnar 3604519d9e5SIngo Molnar This tracer works by hooking into every function call that the 3614519d9e5SIngo Molnar kernel executes, and keeping a maximum stack depth value and 362f38f1d2aSSteven Rostedt stack-trace saved. If this is configured with DYNAMIC_FTRACE 363f38f1d2aSSteven Rostedt then it will not have any overhead while the stack tracer 364f38f1d2aSSteven Rostedt is disabled. 365f38f1d2aSSteven Rostedt 366f38f1d2aSSteven Rostedt To enable the stack tracer on bootup, pass in 'stacktrace' 367f38f1d2aSSteven Rostedt on the kernel command line. 368f38f1d2aSSteven Rostedt 369f38f1d2aSSteven Rostedt The stack tracer can also be enabled or disabled via the 370f38f1d2aSSteven Rostedt sysctl kernel.stack_tracer_enabled 3714519d9e5SIngo Molnar 3724519d9e5SIngo Molnar Say N if unsure. 373e5a81b62SSteven Rostedt 37436994e58SFrederic Weisbeckerconfig KMEMTRACE 37536994e58SFrederic Weisbecker bool "Trace SLAB allocations" 3765e0a0939SSteven Rostedt select GENERIC_TRACER 37736994e58SFrederic Weisbecker help 37836994e58SFrederic Weisbecker kmemtrace provides tracing for slab allocator functions, such as 37940892367SRandy Dunlap kmalloc, kfree, kmem_cache_alloc, kmem_cache_free, etc. Collected 38036994e58SFrederic Weisbecker data is then fed to the userspace application in order to analyse 38136994e58SFrederic Weisbecker allocation hotspots, internal fragmentation and so on, making it 38236994e58SFrederic Weisbecker possible to see how well an allocator performs, as well as debug 38336994e58SFrederic Weisbecker and profile kernel code. 38436994e58SFrederic Weisbecker 38536994e58SFrederic Weisbecker This requires an userspace application to use. See 3864d1f4372SLi Zefan Documentation/trace/kmemtrace.txt for more information. 38736994e58SFrederic Weisbecker 38836994e58SFrederic Weisbecker Saying Y will make the kernel somewhat larger and slower. However, 38936994e58SFrederic Weisbecker if you disable kmemtrace at run-time or boot-time, the performance 39036994e58SFrederic Weisbecker impact is minimal (depending on the arch the kernel is built for). 39136994e58SFrederic Weisbecker 39236994e58SFrederic Weisbecker If unsure, say N. 39336994e58SFrederic Weisbecker 394e1d8aa9fSFrederic Weisbeckerconfig WORKQUEUE_TRACER 395e1d8aa9fSFrederic Weisbecker bool "Trace workqueues" 3965e0a0939SSteven Rostedt select GENERIC_TRACER 397e1d8aa9fSFrederic Weisbecker help 39840892367SRandy Dunlap The workqueue tracer provides some statistical information 399e1d8aa9fSFrederic Weisbecker about each cpu workqueue thread such as the number of the 400e1d8aa9fSFrederic Weisbecker works inserted and executed since their creation. It can help 40140892367SRandy Dunlap to evaluate the amount of work each of them has to perform. 402e1d8aa9fSFrederic Weisbecker For example it can help a developer to decide whether he should 40340892367SRandy Dunlap choose a per-cpu workqueue instead of a singlethreaded one. 404e1d8aa9fSFrederic Weisbecker 4052db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE 40640892367SRandy Dunlap bool "Support for tracing block IO actions" 4072db270a8SFrederic Weisbecker depends on SYSFS 4081dfba05dSIngo Molnar depends on BLOCK 4092db270a8SFrederic Weisbecker select RELAY 4102db270a8SFrederic Weisbecker select DEBUG_FS 4112db270a8SFrederic Weisbecker select TRACEPOINTS 4125e0a0939SSteven Rostedt select GENERIC_TRACER 4132db270a8SFrederic Weisbecker select STACKTRACE 4142db270a8SFrederic Weisbecker help 4152db270a8SFrederic Weisbecker Say Y here if you want to be able to trace the block layer actions 4162db270a8SFrederic Weisbecker on a given queue. Tracing allows you to see any traffic happening 4172db270a8SFrederic Weisbecker on a block device queue. For more information (and the userspace 4182db270a8SFrederic Weisbecker support tools needed), fetch the blktrace tools from: 4192db270a8SFrederic Weisbecker 4202db270a8SFrederic Weisbecker git://git.kernel.dk/blktrace.git 4212db270a8SFrederic Weisbecker 4222db270a8SFrederic Weisbecker Tracing also is possible using the ftrace interface, e.g.: 4232db270a8SFrederic Weisbecker 4242db270a8SFrederic Weisbecker echo 1 > /sys/block/sda/sda1/trace/enable 4252db270a8SFrederic Weisbecker echo blk > /sys/kernel/debug/tracing/current_tracer 4262db270a8SFrederic Weisbecker cat /sys/kernel/debug/tracing/trace_pipe 4272db270a8SFrederic Weisbecker 4282db270a8SFrederic Weisbecker If unsure, say N. 42936994e58SFrederic Weisbecker 43077b44d1bSMasami Hiramatsuconfig KPROBE_EVENT 431413d37d1SMasami Hiramatsu depends on KPROBES 432f850c30cSHeiko Carstens depends on HAVE_REGS_AND_STACK_ACCESS_API 43377b44d1bSMasami Hiramatsu bool "Enable kprobes-based dynamic events" 434413d37d1SMasami Hiramatsu select TRACING 43577b44d1bSMasami Hiramatsu default y 436413d37d1SMasami Hiramatsu help 43740892367SRandy Dunlap This allows the user to add tracing events (similar to tracepoints) 43840892367SRandy Dunlap on the fly via the ftrace interface. See 43940892367SRandy Dunlap Documentation/trace/kprobetrace.txt for more details. 44077b44d1bSMasami Hiramatsu 44177b44d1bSMasami Hiramatsu Those events can be inserted wherever kprobes can probe, and record 44277b44d1bSMasami Hiramatsu various register and memory values. 44377b44d1bSMasami Hiramatsu 44440892367SRandy Dunlap This option is also required by perf-probe subcommand of perf tools. 44540892367SRandy Dunlap If you want to use perf tools, this option is strongly recommended. 446413d37d1SMasami Hiramatsu 4473d083395SSteven Rostedtconfig DYNAMIC_FTRACE 4483d083395SSteven Rostedt bool "enable/disable ftrace tracepoints dynamically" 449606576ceSSteven Rostedt depends on FUNCTION_TRACER 450677aa9f7SSteven Rostedt depends on HAVE_DYNAMIC_FTRACE 4513d083395SSteven Rostedt default y 4523d083395SSteven Rostedt help 4533d083395SSteven Rostedt This option will modify all the calls to ftrace dynamically 45440892367SRandy Dunlap (will patch them out of the binary image and replace them 4553d083395SSteven Rostedt with a No-Op instruction) as they are called. A table is 4563d083395SSteven Rostedt created to dynamically enable them again. 4573d083395SSteven Rostedt 45840892367SRandy Dunlap This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but 45940892367SRandy Dunlap otherwise has native performance as long as no tracing is active. 4603d083395SSteven Rostedt 4613d083395SSteven Rostedt The changes to the code are done by a kernel thread that 4623d083395SSteven Rostedt wakes up once a second and checks to see if any ftrace calls 4633d083395SSteven Rostedt were made. If so, it runs stop_machine (stops all CPUS) 4643d083395SSteven Rostedt and modifies the code to jump over the call to ftrace. 46560a11774SSteven Rostedt 466bac429f0SSteven Rostedtconfig FUNCTION_PROFILER 467bac429f0SSteven Rostedt bool "Kernel function profiler" 468493762fcSSteven Rostedt depends on FUNCTION_TRACER 469bac429f0SSteven Rostedt default n 470bac429f0SSteven Rostedt help 471493762fcSSteven Rostedt This option enables the kernel function profiler. A file is created 472493762fcSSteven Rostedt in debugfs called function_profile_enabled which defaults to zero. 473bac429f0SSteven Rostedt When a 1 is echoed into this file profiling begins, and when a 47440892367SRandy Dunlap zero is entered, profiling stops. A "functions" file is created in 47540892367SRandy Dunlap the trace_stats directory; this file shows the list of functions that 476bac429f0SSteven Rostedt have been hit and their counters. 477bac429f0SSteven Rostedt 47840892367SRandy Dunlap If in doubt, say N. 479bac429f0SSteven Rostedt 4808da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD 4818da3821bSSteven Rostedt def_bool y 4828da3821bSSteven Rostedt depends on DYNAMIC_FTRACE 4838da3821bSSteven Rostedt depends on HAVE_FTRACE_MCOUNT_RECORD 4848da3821bSSteven Rostedt 48560a11774SSteven Rostedtconfig FTRACE_SELFTEST 48660a11774SSteven Rostedt bool 48760a11774SSteven Rostedt 48860a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST 48960a11774SSteven Rostedt bool "Perform a startup test on ftrace" 4905e0a0939SSteven Rostedt depends on GENERIC_TRACER 49160a11774SSteven Rostedt select FTRACE_SELFTEST 49260a11774SSteven Rostedt help 49360a11774SSteven Rostedt This option performs a series of startup tests on ftrace. On bootup 49460a11774SSteven Rostedt a series of tests are made to verify that the tracer is 49560a11774SSteven Rostedt functioning properly. It will do tests on all the configured 49660a11774SSteven Rostedt tracers of ftrace. 49717d80fd0SPeter Zijlstra 4981f5a6b45SSteven Rostedtconfig EVENT_TRACE_TEST_SYSCALLS 4991f5a6b45SSteven Rostedt bool "Run selftest on syscall events" 5001f5a6b45SSteven Rostedt depends on FTRACE_STARTUP_TEST 5011f5a6b45SSteven Rostedt help 5021f5a6b45SSteven Rostedt This option will also enable testing every syscall event. 5031f5a6b45SSteven Rostedt It only enables the event and disables it and runs various loads 5041f5a6b45SSteven Rostedt with the event enabled. This adds a bit more time for kernel boot 5051f5a6b45SSteven Rostedt up since it runs this on every system call defined. 5061f5a6b45SSteven Rostedt 5071f5a6b45SSteven Rostedt TBD - enable a way to actually call the syscalls as we test their 5081f5a6b45SSteven Rostedt events 5091f5a6b45SSteven Rostedt 510fe6f90e5SPekka Paalanenconfig MMIOTRACE 511fe6f90e5SPekka Paalanen bool "Memory mapped IO tracing" 51240ada30fSIngo Molnar depends on HAVE_MMIOTRACE_SUPPORT && PCI 5135e0a0939SSteven Rostedt select GENERIC_TRACER 514fe6f90e5SPekka Paalanen help 515fe6f90e5SPekka Paalanen Mmiotrace traces Memory Mapped I/O access and is meant for 516fe6f90e5SPekka Paalanen debugging and reverse engineering. It is called from the ioremap 517fe6f90e5SPekka Paalanen implementation and works via page faults. Tracing is disabled by 518fe6f90e5SPekka Paalanen default and can be enabled at run-time. 519fe6f90e5SPekka Paalanen 5204d1f4372SLi Zefan See Documentation/trace/mmiotrace.txt. 521fe6f90e5SPekka Paalanen If you are not helping to develop drivers, say N. 522fe6f90e5SPekka Paalanen 523fe6f90e5SPekka Paalanenconfig MMIOTRACE_TEST 524fe6f90e5SPekka Paalanen tristate "Test module for mmiotrace" 525fe6f90e5SPekka Paalanen depends on MMIOTRACE && m 526fe6f90e5SPekka Paalanen help 527fe6f90e5SPekka Paalanen This is a dumb module for testing mmiotrace. It is very dangerous 528fe6f90e5SPekka Paalanen as it will write garbage to IO memory starting at a given address. 529fe6f90e5SPekka Paalanen However, it should be safe to use on e.g. unused portion of VRAM. 530fe6f90e5SPekka Paalanen 531fe6f90e5SPekka Paalanen Say N, unless you absolutely know what you are doing. 532fe6f90e5SPekka Paalanen 5335092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK 5345092dbc9SSteven Rostedt tristate "Ring buffer benchmark stress tester" 5355092dbc9SSteven Rostedt depends on RING_BUFFER 5365092dbc9SSteven Rostedt help 5375092dbc9SSteven Rostedt This option creates a test to stress the ring buffer and benchmark it. 53840892367SRandy Dunlap It creates its own ring buffer such that it will not interfere with 5395092dbc9SSteven Rostedt any other users of the ring buffer (such as ftrace). It then creates 5405092dbc9SSteven Rostedt a producer and consumer that will run for 10 seconds and sleep for 5415092dbc9SSteven Rostedt 10 seconds. Each interval it will print out the number of events 5425092dbc9SSteven Rostedt it recorded and give a rough estimate of how long each iteration took. 5435092dbc9SSteven Rostedt 5445092dbc9SSteven Rostedt It does not disable interrupts or raise its priority, so it may be 5455092dbc9SSteven Rostedt affected by processes that are running. 5465092dbc9SSteven Rostedt 54740892367SRandy Dunlap If unsure, say N. 5485092dbc9SSteven Rostedt 5494ed9f071SSteven Rostedtendif # FTRACE 55040ada30fSIngo Molnar 55140ada30fSIngo Molnarendif # TRACING_SUPPORT 55240ada30fSIngo Molnar 553