xref: /linux/kernel/trace/Kconfig (revision 726721a51838e3983023f906580722fc83f804ee)
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
1378d904b4SSteven Rostedtconfig HAVE_FTRACE_NMI_ENTER
1478d904b4SSteven Rostedt	bool
15555f386cSMike Frysinger	help
165fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
1778d904b4SSteven Rostedt
18606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
1916444a8aSArnaldo Carvalho de Melo	bool
20555f386cSMike Frysinger	help
215fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
22bc0c38d1SSteven Rostedt
23fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER
2415e6cb36SFrederic Weisbecker	bool
25555f386cSMike Frysinger	help
265fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
2715e6cb36SFrederic Weisbecker
28677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
29677aa9f7SSteven Rostedt	bool
30555f386cSMike Frysinger	help
315fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
32677aa9f7SSteven Rostedt
3306aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
3406aeaaeaSMasami Hiramatsu	bool
3506aeaaeaSMasami Hiramatsu
36763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
37763e34e7SSteven Rostedt (VMware)	bool
38763e34e7SSteven Rostedt (VMware)
398da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
408da3821bSSteven Rostedt	bool
41555f386cSMike Frysinger	help
425fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
438da3821bSSteven Rostedt
4466700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
45ee08c6ecSFrederic Weisbecker	bool
46555f386cSMike Frysinger	help
475fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
48ee08c6ecSFrederic Weisbecker
49a2546faeSSteven Rostedtconfig HAVE_FENTRY
50a2546faeSSteven Rostedt	bool
51a2546faeSSteven Rostedt	help
52a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
53a2546faeSSteven Rostedt
542f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
552f4df001SVasily Gorbik	bool
562f4df001SVasily Gorbik	help
572f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
582f4df001SVasily Gorbik
59cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
6072441cb1SSteven Rostedt	bool
6172441cb1SSteven Rostedt	help
6272441cb1SSteven Rostedt	  C version of recordmcount available?
6372441cb1SSteven Rostedt
64352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
65352ad25aSSteven Rostedt	bool
66352ad25aSSteven Rostedt
67ea632e9fSJosh Triplettconfig TRACE_CLOCK
68ea632e9fSJosh Triplett	bool
69ea632e9fSJosh Triplett
707a8e76a3SSteven Rostedtconfig RING_BUFFER
717a8e76a3SSteven Rostedt	bool
72ea632e9fSJosh Triplett	select TRACE_CLOCK
7322287688SSteven Rostedt (Red Hat)	select IRQ_WORK
747a8e76a3SSteven Rostedt
7578d904b4SSteven Rostedtconfig FTRACE_NMI_ENTER
7678d904b4SSteven Rostedt       bool
7778d904b4SSteven Rostedt       depends on HAVE_FTRACE_NMI_ENTER
7878d904b4SSteven Rostedt       default y
7978d904b4SSteven Rostedt
805f77a88bSTom Zanussiconfig EVENT_TRACING
81b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
8260f1d5e3SMasami Hiramatsu	select GLOB
83b11c53e1SZhaolei	bool
84b11c53e1SZhaolei
85b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
865f77a88bSTom Zanussi	bool
875f77a88bSTom Zanussi
8885bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
8985bac32cSSteven Rostedt	bool
9085bac32cSSteven Rostedt	help
9185bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
9285bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
9385bac32cSSteven Rostedt
94c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
95c3bc8fd6SJoel Fernandes (Google)	bool
96c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
97c3bc8fd6SJoel Fernandes (Google)	select TRACING
98c3bc8fd6SJoel Fernandes (Google)	default y
99c3bc8fd6SJoel Fernandes (Google)	help
100c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
101c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
102c3bc8fd6SJoel Fernandes (Google)
1035e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1045e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1055e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1065e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1075e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
10840892367SRandy Dunlap# hiding of the automatic options.
1095e0a0939SSteven Rostedt
110bc0c38d1SSteven Rostedtconfig TRACING
111bc0c38d1SSteven Rostedt	bool
1127a8e76a3SSteven Rostedt	select RING_BUFFER
113c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1145f87f112SIngo Molnar	select TRACEPOINTS
115f3384b28SSteven Rostedt	select NOP_TRACER
116769b0441SFrederic Weisbecker	select BINARY_PRINTF
1175f77a88bSTom Zanussi	select EVENT_TRACING
118ea632e9fSJosh Triplett	select TRACE_CLOCK
119bc0c38d1SSteven Rostedt
1205e0a0939SSteven Rostedtconfig GENERIC_TRACER
1215e0a0939SSteven Rostedt	bool
1225e0a0939SSteven Rostedt	select TRACING
1235e0a0939SSteven Rostedt
12440ada30fSIngo Molnar#
12540ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
12640ada30fSIngo Molnar# be able to offer generic tracing facilities:
12740ada30fSIngo Molnar#
12840ada30fSIngo Molnarconfig TRACING_SUPPORT
12940ada30fSIngo Molnar	bool
1300ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
13140ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
132422d3c7aSKOSAKI Motohiro	default y
13340ada30fSIngo Molnar
13440ada30fSIngo Molnarif TRACING_SUPPORT
13540ada30fSIngo Molnar
1364ed9f071SSteven Rostedtmenuconfig FTRACE
1374ed9f071SSteven Rostedt	bool "Tracers"
13865b77242SSteven Rostedt	default y if DEBUG_KERNEL
1394ed9f071SSteven Rostedt	help
1404ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1414ed9f071SSteven Rostedt
1424ed9f071SSteven Rostedtif FTRACE
14317d80fd0SPeter Zijlstra
1441e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
1451e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
146d8a953ddSMasami Hiramatsu	depends on TRACING
147d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
1481e837945SSteven Rostedt (VMware)	help
1491e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
1501e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
1511e837945SSteven Rostedt (VMware)	  initialization and boot process.
1521e837945SSteven Rostedt (VMware)
153606576ceSSteven Rostedtconfig FUNCTION_TRACER
1541b29b018SSteven Rostedt	bool "Kernel Function Tracer"
155606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1564d7a077cSSteven Rostedt	select KALLSYMS
1575e0a0939SSteven Rostedt	select GENERIC_TRACER
15835e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
15960f1d5e3SMasami Hiramatsu	select GLOB
16001b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
1611b29b018SSteven Rostedt	help
1621b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1631b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
16440892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
1651b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
1661b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
1671b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
1681b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
16935e8e302SSteven Rostedt
170fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
171fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
172fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
17315e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
174eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
175764f3b95SIngo Molnar	default y
17615e6cb36SFrederic Weisbecker	help
177fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
178fb52607aSFrederic Weisbecker	  and its entry.
179692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
180692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
181692105b8SMatt LaPlante	  the return value. This is done by setting the current return
182692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
18315e6cb36SFrederic Weisbecker
18461778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
18561778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
18661778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
18761778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
18861778cd7SSteven Rostedt (VMware)	default y
18961778cd7SSteven Rostedt (VMware)	help
19061778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
19161778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
19261778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
19361778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
19461778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
19561778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
19661778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
19761778cd7SSteven Rostedt (VMware)	  performance of the system.
19861778cd7SSteven Rostedt (VMware)
19961778cd7SSteven Rostedt (VMware)	  See the files in /sys/kernel/debug/tracing:
20061778cd7SSteven Rostedt (VMware)	    available_filter_functions
20161778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
20261778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
20361778cd7SSteven Rostedt (VMware)
20461778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
20561778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
20661778cd7SSteven Rostedt (VMware)
20761778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
20861778cd7SSteven Rostedt (VMware)	def_bool y
20961778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
21061778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
21161778cd7SSteven Rostedt (VMware)
21261778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
21361778cd7SSteven Rostedt (VMware)	def_bool y
21461778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
21561778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
21661778cd7SSteven Rostedt (VMware)
21761778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
21861778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
21961778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
22061778cd7SSteven Rostedt (VMware)	default n
22161778cd7SSteven Rostedt (VMware)	help
22261778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
22361778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
22461778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
22561778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
22661778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
22761778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
22861778cd7SSteven Rostedt (VMware)
22961778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
23061778cd7SSteven Rostedt (VMware)
23161778cd7SSteven Rostedt (VMware)config STACK_TRACER
23261778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
23361778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
23461778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
23561778cd7SSteven Rostedt (VMware)	select STACKTRACE
23661778cd7SSteven Rostedt (VMware)	select KALLSYMS
23761778cd7SSteven Rostedt (VMware)	help
23861778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
23961778cd7SSteven Rostedt (VMware)	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
24061778cd7SSteven Rostedt (VMware)
24161778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
24261778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
24361778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
24461778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
24561778cd7SSteven Rostedt (VMware)	  is disabled.
24661778cd7SSteven Rostedt (VMware)
24761778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
24861778cd7SSteven Rostedt (VMware)	  on the kernel command line.
24961778cd7SSteven Rostedt (VMware)
25061778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
25161778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
25261778cd7SSteven Rostedt (VMware)
25361778cd7SSteven Rostedt (VMware)	  Say N if unsure.
25461778cd7SSteven Rostedt (VMware)
255c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
256c3bc8fd6SJoel Fernandes (Google)	bool
257c3bc8fd6SJoel Fernandes (Google)	help
258c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
259c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
260bac429f0SSteven Rostedt
261d5915816SJoel Fernandesconfig PREEMPTIRQ_EVENTS
262d5915816SJoel Fernandes	bool "Enable trace events for preempt and irq disable/enable"
263d5915816SJoel Fernandes	select TRACE_IRQFLAGS
26430c93704SThomas Gleixner	select TRACE_PREEMPT_TOGGLE if PREEMPTION
265c3bc8fd6SJoel Fernandes (Google)	select GENERIC_TRACER
266d5915816SJoel Fernandes	default n
267d5915816SJoel Fernandes	help
268d5915816SJoel Fernandes	  Enable tracing of disable and enable events for preemption and irqs.
269d5915816SJoel Fernandes
27081d68a96SSteven Rostedtconfig IRQSOFF_TRACER
27181d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
27281d68a96SSteven Rostedt	default n
27381d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
274592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
27581d68a96SSteven Rostedt	select TRACE_IRQFLAGS
2765e0a0939SSteven Rostedt	select GENERIC_TRACER
27781d68a96SSteven Rostedt	select TRACER_MAX_TRACE
27885bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
27922cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2800b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
28181d68a96SSteven Rostedt	help
28281d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
28381d68a96SSteven Rostedt	  sections, with microsecond accuracy.
28481d68a96SSteven Rostedt
28581d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
28681d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
28781d68a96SSteven Rostedt	  via:
28881d68a96SSteven Rostedt
289156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
29081d68a96SSteven Rostedt
29140892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2926cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
2936cd8a4bbSSteven Rostedt	  used together or separately.)
2946cd8a4bbSSteven Rostedt
2956cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
2966cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
2976cd8a4bbSSteven Rostedt	default n
298592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
29930c93704SThomas Gleixner	depends on PREEMPTION
3005e0a0939SSteven Rostedt	select GENERIC_TRACER
3016cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
30285bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
30322cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3040b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
305c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
3066cd8a4bbSSteven Rostedt	help
30740892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
3086cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
3096cd8a4bbSSteven Rostedt
3106cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
3116cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
3126cd8a4bbSSteven Rostedt	  via:
3136cd8a4bbSSteven Rostedt
314156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
3156cd8a4bbSSteven Rostedt
31640892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3176cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
3186cd8a4bbSSteven Rostedt	  used together or separately.)
3196cd8a4bbSSteven Rostedt
320352ad25aSSteven Rostedtconfig SCHED_TRACER
321352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
3225e0a0939SSteven Rostedt	select GENERIC_TRACER
323352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
324352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
32522cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
326352ad25aSSteven Rostedt	help
327352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
328352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
329352ad25aSSteven Rostedt
330e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
331e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
332e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
333e7c15cd8SSteven Rostedt (Red Hat)	help
334e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
335c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
336e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
337e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
338e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
339e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
340e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
341e7c15cd8SSteven Rostedt (Red Hat)
342e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
343e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
344e7c15cd8SSteven Rostedt (Red Hat)
345e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
346e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
347e7c15cd8SSteven Rostedt (Red Hat)				     iteration
348e7c15cd8SSteven Rostedt (Red Hat)
349e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
350c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
351e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
352e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
353e7c15cd8SSteven Rostedt (Red Hat)
354e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
355e7c15cd8SSteven Rostedt (Red Hat)
356e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
357e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
358e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
359e7c15cd8SSteven Rostedt (Red Hat)	 production system.
360e7c15cd8SSteven Rostedt (Red Hat)
361e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
362e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
363e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
364e7c15cd8SSteven Rostedt (Red Hat)
36521b3ce30SSteven Rostedt (VMware)config MMIOTRACE
36621b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
36721b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
36821b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
36921b3ce30SSteven Rostedt (VMware)	help
37021b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
37121b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
37221b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
37321b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
37421b3ce30SSteven Rostedt (VMware)
37521b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
37621b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
37721b3ce30SSteven Rostedt (VMware)
378897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
379897f17a6SSteven Rostedt	bool "Trace process context switches and events"
3805e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
381b77e38aaSSteven Rostedt	select TRACING
382b77e38aaSSteven Rostedt	help
38340892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
384b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
385897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
386a7abe97fSSteven Rostedt
387ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
388ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
38966700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
3905e0a0939SSteven Rostedt	select GENERIC_TRACER
3910ea1c415SFrederic Weisbecker	select KALLSYMS
392ee08c6ecSFrederic Weisbecker	help
393ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
394ee08c6ecSFrederic Weisbecker
395debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
396debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
397debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
398debdd57fSHiraku Toyooka	help
399debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
400debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
401debdd57fSHiraku Toyooka
402debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
403debdd57fSHiraku Toyooka	      cat snapshot
404debdd57fSHiraku Toyooka
4050b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
4060b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
4070b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
4080b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
4090b85ffc2SSteven Rostedt (Red Hat)	help
4100b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
4110b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
4120b85ffc2SSteven Rostedt (Red Hat)	  allowed:
4130b85ffc2SSteven Rostedt (Red Hat)
4140b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
4150b85ffc2SSteven Rostedt (Red Hat)
4160b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
4170b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
4180b85ffc2SSteven Rostedt (Red Hat)
4190b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
4200b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
4210b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
4220b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
4230b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
4240b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
4250b85ffc2SSteven Rostedt (Red Hat)
4262ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
4279ae5b879SSteven Rostedt	bool
4285e0a0939SSteven Rostedt	select GENERIC_TRACER
4299ae5b879SSteven Rostedt
4309ae5b879SSteven Rostedtchoice
4319ae5b879SSteven Rostedt	prompt "Branch Profiling"
4329ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
4339ae5b879SSteven Rostedt	help
4349ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
4359ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
4369ae5b879SSteven Rostedt
4379ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
4389ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
4399ae5b879SSteven Rostedt
44040892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
4419ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
44240892367SRandy Dunlap	 profiler.
4439ae5b879SSteven Rostedt
44440892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
44540892367SRandy Dunlap	 If unsure, choose "No branch profiling".
4469ae5b879SSteven Rostedt
4479ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
4489ae5b879SSteven Rostedt	bool "No branch profiling"
4499ae5b879SSteven Rostedt	help
4509ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
4519ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
4529ae5b879SSteven Rostedt	  Otherwise keep it disabled.
4539ae5b879SSteven Rostedt
4549ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
4559ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
4569ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
4571f0d69a9SSteven Rostedt	help
45859bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
4591f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
4601f0d69a9SSteven Rostedt
46113e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
4621f0d69a9SSteven Rostedt
46340892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
4641f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
4651f0d69a9SSteven Rostedt
4662bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
46768e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
4689ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
4692bcd521aSSteven Rostedt	help
4702bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
4712bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
4722bcd521aSSteven Rostedt	  The results will be displayed in:
4732bcd521aSSteven Rostedt
47413e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
4752bcd521aSSteven Rostedt
4769ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
4779ae5b879SSteven Rostedt
4782bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
4792bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
48040892367SRandy Dunlap	  is to be analyzed in much detail.
4819ae5b879SSteven Rostedtendchoice
4822bcd521aSSteven Rostedt
4832ed84eebSSteven Rostedtconfig TRACING_BRANCHES
48452f232cbSSteven Rostedt	bool
48552f232cbSSteven Rostedt	help
48652f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
48752f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
48852f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
48952f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
49052f232cbSSteven Rostedt
4912ed84eebSSteven Rostedtconfig BRANCH_TRACER
49252f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
4932ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
4942ed84eebSSteven Rostedt	select TRACING_BRANCHES
49552f232cbSSteven Rostedt	help
49652f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
49752f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
49852f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
49952f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
50052f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
50152f232cbSSteven Rostedt	  events happened, as well as their results.
50252f232cbSSteven Rostedt
50352f232cbSSteven Rostedt	  Say N if unsure.
50452f232cbSSteven Rostedt
5052db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
50640892367SRandy Dunlap	bool "Support for tracing block IO actions"
5072db270a8SFrederic Weisbecker	depends on SYSFS
5081dfba05dSIngo Molnar	depends on BLOCK
5092db270a8SFrederic Weisbecker	select RELAY
5102db270a8SFrederic Weisbecker	select DEBUG_FS
5112db270a8SFrederic Weisbecker	select TRACEPOINTS
5125e0a0939SSteven Rostedt	select GENERIC_TRACER
5132db270a8SFrederic Weisbecker	select STACKTRACE
5142db270a8SFrederic Weisbecker	help
5152db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
5162db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
5172db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
5182db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
5192db270a8SFrederic Weisbecker
5202db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
5212db270a8SFrederic Weisbecker
5222db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
5232db270a8SFrederic Weisbecker
5242db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
5252db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
5262db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
5272db270a8SFrederic Weisbecker
5282db270a8SFrederic Weisbecker	  If unsure, say N.
52936994e58SFrederic Weisbecker
5306b0b7551SAnton Blanchardconfig KPROBE_EVENTS
531413d37d1SMasami Hiramatsu	depends on KPROBES
532f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
53377b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
534413d37d1SMasami Hiramatsu	select TRACING
5358ab83f56SSrikar Dronamraju	select PROBE_EVENTS
5366212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
53777b44d1bSMasami Hiramatsu	default y
538413d37d1SMasami Hiramatsu	help
53940892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
54040892367SRandy Dunlap	  on the fly via the ftrace interface. See
5415fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
54277b44d1bSMasami Hiramatsu
54377b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
54477b44d1bSMasami Hiramatsu	  various register and memory values.
54577b44d1bSMasami Hiramatsu
54640892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
54740892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
548413d37d1SMasami Hiramatsu
54945408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
55045408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
55145408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
55245408c4fSMasami Hiramatsu	depends on KPROBES_ON_FTRACE
55345408c4fSMasami Hiramatsu	default n
55445408c4fSMasami Hiramatsu	help
55545408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
55645408c4fSMasami Hiramatsu	  using kprobe events.
55745408c4fSMasami Hiramatsu
55845408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
55945408c4fSMasami Hiramatsu	  functions are protected from kprobe-events to prevent an infinit
56045408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
56145408c4fSMasami Hiramatsu	  crash.
56245408c4fSMasami Hiramatsu
56345408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
56445408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
56545408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
56645408c4fSMasami Hiramatsu
56745408c4fSMasami Hiramatsu	  If unsure, say N.
56845408c4fSMasami Hiramatsu
5696b0b7551SAnton Blanchardconfig UPROBE_EVENTS
570f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
571f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
572f3f096cfSSrikar Dronamraju	depends on MMU
57309294e31SDavid A. Long	depends on PERF_EVENTS
574f3f096cfSSrikar Dronamraju	select UPROBES
575f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
5760597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
577f3f096cfSSrikar Dronamraju	select TRACING
57861f35d75SArnaldo Carvalho de Melo	default y
579f3f096cfSSrikar Dronamraju	help
580f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
581f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
582f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
583f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
584f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
585f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
586f3f096cfSSrikar Dronamraju
587e1abf2ccSIngo Molnarconfig BPF_EVENTS
588e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
5896b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
590e1abf2ccSIngo Molnar	bool
591e1abf2ccSIngo Molnar	default y
592e1abf2ccSIngo Molnar	help
5935cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
5945cbd22c1SPeter Wu	  tracepoint events.
595e1abf2ccSIngo Molnar
5965448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
5975448d44cSMasami Hiramatsu	def_bool n
5985448d44cSMasami Hiramatsu
5998ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
6008ab83f56SSrikar Dronamraju	def_bool n
6018ab83f56SSrikar Dronamraju
6029802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
6039802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
6049802d865SJosef Bacik	depends on BPF_EVENTS
605540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
6069802d865SJosef Bacik	default n
6079802d865SJosef Bacik	help
6089802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
6099802d865SJosef Bacik	 set a different return value.  This is used for error injection.
6109802d865SJosef Bacik
6118da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
6128da3821bSSteven Rostedt	def_bool y
6138da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
6148da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
6158da3821bSSteven Rostedt
61608d43a5fSTom Zanussiconfig TRACING_MAP
61708d43a5fSTom Zanussi	bool
61808d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
61908d43a5fSTom Zanussi	help
62008d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
62108d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
62208d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
62308d43a5fSTom Zanussi	  generally used outside of that context, and is normally
62408d43a5fSTom Zanussi	  selected by tracers that use it.
62508d43a5fSTom Zanussi
626*726721a5STom Zanussiconfig SYNTH_EVENTS
627*726721a5STom Zanussi	bool "Synthetic trace events"
628*726721a5STom Zanussi	select TRACING
629*726721a5STom Zanussi	select DYNAMIC_EVENTS
630*726721a5STom Zanussi	default n
631*726721a5STom Zanussi	help
632*726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
633*726721a5STom Zanussi	  used to combine data from other trace events or in fact any
634*726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
635*726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
636*726721a5STom Zanussi	  by way of an in-kernel API.
637*726721a5STom Zanussi
638*726721a5STom Zanussi	  See Documentation/trace/events.rst or
639*726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
640*726721a5STom Zanussi
641*726721a5STom Zanussi	  If in doubt, say N.
642*726721a5STom Zanussi
6437ef224d1STom Zanussiconfig HIST_TRIGGERS
6447ef224d1STom Zanussi	bool "Histogram triggers"
6457ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
6467ef224d1STom Zanussi	select TRACING_MAP
6477ad8fb61STom Zanussi	select TRACING
6487bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
649*726721a5STom Zanussi	select SYNTH_EVENTS
6507ef224d1STom Zanussi	default n
6517ef224d1STom Zanussi	help
6527ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
6537ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
6547ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
6557ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
6567ef224d1STom Zanussi	  event activity as an initial guide for further investigation
6577ef224d1STom Zanussi	  using more advanced tools.
6587ef224d1STom Zanussi
65989e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
66089e270c1STom Zanussi	  supported using hist triggers under this option.
66189e270c1STom Zanussi
662ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
6637ef224d1STom Zanussi	  If in doubt, say N.
6647ef224d1STom Zanussi
6656c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
6666c3edaf9SCong Wang	bool "Trace event injection"
6676c3edaf9SCong Wang	depends on TRACING
6686c3edaf9SCong Wang	help
6696c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
6706c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
6716c3edaf9SCong Wang
6726c3edaf9SCong Wang	  If unsure, say N.
6736c3edaf9SCong Wang
67481dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
67581dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
67681dc9f0eSSteven Rostedt (Red Hat)	help
67781dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
67881dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
67981dc9f0eSSteven Rostedt (Red Hat)	 goes into an infinite loop (calling cond_sched() to let other tasks
68081dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
68181dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
68281dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
68381dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
68481dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
68581dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
68681dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
68781dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
68881dc9f0eSSteven Rostedt (Red Hat)
68981dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
69081dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
69181dc9f0eSSteven Rostedt (Red Hat)
69281dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
69381dc9f0eSSteven Rostedt (Red Hat)
69481dc9f0eSSteven Rostedt (Red Hat)	      START
69581dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
69681dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
69781dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
69881dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
69981dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
70081dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
70181dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
70281dc9f0eSSteven Rostedt (Red Hat)
70381dc9f0eSSteven Rostedt (Red Hat)
7045092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
7055092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
7065092dbc9SSteven Rostedt	depends on RING_BUFFER
7075092dbc9SSteven Rostedt	help
7085092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
70940892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
7105092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
7115092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
7125092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
7135092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
7145092dbc9SSteven Rostedt
7155092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
7165092dbc9SSteven Rostedt	  affected by processes that are running.
7175092dbc9SSteven Rostedt
71840892367SRandy Dunlap	  If unsure, say N.
7195092dbc9SSteven Rostedt
7201e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
7211e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
7221e837945SSteven Rostedt (VMware)       depends on TRACING
7231e837945SSteven Rostedt (VMware)       help
7241e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
7251e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
7261e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
7271e837945SSteven Rostedt (VMware)	how to convert the string to its value.
7281e837945SSteven Rostedt (VMware)
7291e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
7301e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
7311e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
7321e837945SSteven Rostedt (VMware)
7331e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
7341e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
7351e837945SSteven Rostedt (VMware)
7361e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
7371e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
7381e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
7391e837945SSteven Rostedt (VMware)	belong too.
7401e837945SSteven Rostedt (VMware)
7411e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
7421e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
7431e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
7441e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
7451e837945SSteven Rostedt (VMware)
7461e837945SSteven Rostedt (VMware)	If unsure, say N.
7471e837945SSteven Rostedt (VMware)
7481e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
7491e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
7501e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
7511e837945SSteven Rostedt (VMware)	help
7521e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
7531e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
7541e837945SSteven Rostedt (VMware)
7551e837945SSteven Rostedt (VMware)	  If unsure, say N.
7561e837945SSteven Rostedt (VMware)
7571e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
7581e837945SSteven Rostedt (VMware)	  run significantly slower.
7591e837945SSteven Rostedt (VMware)
7601e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
7611e837945SSteven Rostedt (VMware)	bool
7621e837945SSteven Rostedt (VMware)
7631e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
7641e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
7651e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
7661e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
7671e837945SSteven Rostedt (VMware)	help
7681e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
7691e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
7701e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
7711e837945SSteven Rostedt (VMware)	  tracers of ftrace.
7721e837945SSteven Rostedt (VMware)
7731e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
7741e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
7751e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
7761e837945SSteven Rostedt (VMware)	default y
7771e837945SSteven Rostedt (VMware)	help
7781e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
7791e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
7801e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
7811e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
7821e837945SSteven Rostedt (VMware)
7831e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
7841e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
7851e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
7861e837945SSteven Rostedt (VMware)	help
7871e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
7881e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
7891e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
7901e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
7911e837945SSteven Rostedt (VMware)
7921e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
7931e837945SSteven Rostedt (VMware)	       events
7941e837945SSteven Rostedt (VMware)
7956c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
7966c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
7976c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
7986c43e554SSteven Rostedt (Red Hat)       help
7996c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
8006c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
8016c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
8026c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
8036c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
8046c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
8056c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
8066c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
8076c43e554SSteven Rostedt (Red Hat)
8086c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
8096c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
8106c43e554SSteven Rostedt (Red Hat)
8116c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
8126c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
8136c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
8146c43e554SSteven Rostedt (Red Hat)	 other similar details.
8156c43e554SSteven Rostedt (Red Hat)
8166c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
8176c43e554SSteven Rostedt (Red Hat)
818a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
819a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
820a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
821a48fc4f5SSteven Rostedt (VMware)	help
822a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
823a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
824a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
825a48fc4f5SSteven Rostedt (VMware)
826a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
827a48fc4f5SSteven Rostedt (VMware)
828f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
829a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
830f96e8577SJoel Fernandes (Google)	depends on m
831f96e8577SJoel Fernandes (Google)	help
832f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
833f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
834f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
835f96e8577SJoel Fernandes (Google)	  critical section.
836f96e8577SJoel Fernandes (Google)
83779393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
83879393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
83979393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
840f96e8577SJoel Fernandes (Google)
841f96e8577SJoel Fernandes (Google)	  If unsure, say N
842f96e8577SJoel Fernandes (Google)
8439fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
8449fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
845*726721a5STom Zanussi	depends on SYNTH_EVENTS
8469fe41efaSTom Zanussi	help
8479fe41efaSTom Zanussi          This option creates a test module to check the base
8489fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
8499fe41efaSTom Zanussi          generation.
8509fe41efaSTom Zanussi
8519fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
8529fe41efaSTom Zanussi	  for the generated sample events.
8539fe41efaSTom Zanussi
8549fe41efaSTom Zanussi	  If unsure, say N.
8559fe41efaSTom Zanussi
85664836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
85764836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
85864836248STom Zanussi	depends on KPROBE_EVENTS
85964836248STom Zanussi	help
86064836248STom Zanussi          This option creates a test module to check the base
86164836248STom Zanussi          functionality of in-kernel kprobe event definition.
86264836248STom Zanussi
86364836248STom Zanussi          To test, insert the module, and then check the trace buffer
86464836248STom Zanussi	  for the generated kprobe events.
86564836248STom Zanussi
86664836248STom Zanussi	  If unsure, say N.
86764836248STom Zanussi
8682d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
8692d19bd79STom Zanussi	bool "Hist trigger debug support"
8702d19bd79STom Zanussi	depends on HIST_TRIGGERS
8712d19bd79STom Zanussi	help
8722d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
8732d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
8742d19bd79STom Zanussi          defined on that event.
8752d19bd79STom Zanussi
8762d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
8772d19bd79STom Zanussi
8782d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
8792d19bd79STom Zanussi
8802d19bd79STom Zanussi            - Provides educational information to support the details
8812d19bd79STom Zanussi              of the hist trigger internals as described by
8822d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
8832d19bd79STom Zanussi
8842d19bd79STom Zanussi          The hist_debug output only covers the data structures
8852d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
8862d19bd79STom Zanussi          display the internals of map buckets or variable values of
8872d19bd79STom Zanussi          running histograms.
8882d19bd79STom Zanussi
8892d19bd79STom Zanussi          If unsure, say N.
8902d19bd79STom Zanussi
8914ed9f071SSteven Rostedtendif # FTRACE
89240ada30fSIngo Molnar
89340ada30fSIngo Molnarendif # TRACING_SUPPORT
89440ada30fSIngo Molnar
895