xref: /linux/kernel/trace/Kconfig (revision 6b9b6413700e104934734b72a3be622a76923b98)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
216444a8aSArnaldo Carvalho de Melo#
3606576ceSSteven Rostedt# Architectures that offer an FUNCTION_TRACER implementation should
4606576ceSSteven Rostedt#  select HAVE_FUNCTION_TRACER:
516444a8aSArnaldo Carvalho de Melo#
62a3a4f66SFrédéric Weisbecker
78d26487fSTörök Edwinconfig USER_STACKTRACE_SUPPORT
88d26487fSTörök Edwin	bool
98d26487fSTörök Edwin
102a3a4f66SFrédéric Weisbeckerconfig NOP_TRACER
112a3a4f66SFrédéric Weisbecker	bool
122a3a4f66SFrédéric Weisbecker
13606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
1416444a8aSArnaldo Carvalho de Melo	bool
15555f386cSMike Frysinger	help
165fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
17bc0c38d1SSteven Rostedt
18fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER
1915e6cb36SFrederic Weisbecker	bool
20555f386cSMike Frysinger	help
215fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
2215e6cb36SFrederic Weisbecker
23677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
24677aa9f7SSteven Rostedt	bool
25555f386cSMike Frysinger	help
265fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
27677aa9f7SSteven Rostedt
2806aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
2906aeaaeaSMasami Hiramatsu	bool
3006aeaaeaSMasami Hiramatsu
31763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
32763e34e7SSteven Rostedt (VMware)	bool
33763e34e7SSteven Rostedt (VMware)
3402a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS
3502a474caSSteven Rostedt (VMware)	bool
3602a474caSSteven Rostedt (VMware)	help
3702a474caSSteven Rostedt (VMware)	 If this is set, then arguments and stack can be found from
3802a474caSSteven Rostedt (VMware)	 the pt_regs passed into the function callback regs parameter
3902a474caSSteven Rostedt (VMware)	 by default, even without setting the REGS flag in the ftrace_ops.
4002a474caSSteven Rostedt (VMware)	 This allows for use of regs_get_kernel_argument() and
4102a474caSSteven Rostedt (VMware)	 kernel_stack_pointer().
4202a474caSSteven Rostedt (VMware)
438da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
448da3821bSSteven Rostedt	bool
45555f386cSMike Frysinger	help
465fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
478da3821bSSteven Rostedt
4866700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
49ee08c6ecSFrederic Weisbecker	bool
50555f386cSMike Frysinger	help
515fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
52ee08c6ecSFrederic Weisbecker
53a2546faeSSteven Rostedtconfig HAVE_FENTRY
54a2546faeSSteven Rostedt	bool
55a2546faeSSteven Rostedt	help
56a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
57a2546faeSSteven Rostedt
582f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
592f4df001SVasily Gorbik	bool
602f4df001SVasily Gorbik	help
612f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
622f4df001SVasily Gorbik
6322c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT
6422c8542dSSami Tolvanen	bool
6522c8542dSSami Tolvanen	help
6622c8542dSSami Tolvanen	  Arch supports objtool --mcount
6722c8542dSSami Tolvanen
68cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
6972441cb1SSteven Rostedt	bool
7072441cb1SSteven Rostedt	help
7172441cb1SSteven Rostedt	  C version of recordmcount available?
7272441cb1SSteven Rostedt
73*6b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
74*6b9b6413SSteven Rostedt (Google)       bool
75*6b9b6413SSteven Rostedt (Google)       default y
76*6b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_TABLE_SORT && !S390
77*6b9b6413SSteven Rostedt (Google)       help
78*6b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
79*6b9b6413SSteven Rostedt (Google)
80352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
81352ad25aSSteven Rostedt	bool
82352ad25aSSteven Rostedt
83ea632e9fSJosh Triplettconfig TRACE_CLOCK
84ea632e9fSJosh Triplett	bool
85ea632e9fSJosh Triplett
867a8e76a3SSteven Rostedtconfig RING_BUFFER
877a8e76a3SSteven Rostedt	bool
88ea632e9fSJosh Triplett	select TRACE_CLOCK
8922287688SSteven Rostedt (Red Hat)	select IRQ_WORK
907a8e76a3SSteven Rostedt
915f77a88bSTom Zanussiconfig EVENT_TRACING
92b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
9360f1d5e3SMasami Hiramatsu	select GLOB
94b11c53e1SZhaolei	bool
95b11c53e1SZhaolei
96b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
975f77a88bSTom Zanussi	bool
985f77a88bSTom Zanussi
9985bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
10085bac32cSSteven Rostedt	bool
10185bac32cSSteven Rostedt	help
10285bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
10385bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
10485bac32cSSteven Rostedt
105c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
106c3bc8fd6SJoel Fernandes (Google)	bool
107c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
108c3bc8fd6SJoel Fernandes (Google)	select TRACING
109c3bc8fd6SJoel Fernandes (Google)	default y
110c3bc8fd6SJoel Fernandes (Google)	help
111c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
112c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
113c3bc8fd6SJoel Fernandes (Google)
1145e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1155e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1165e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1175e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1185e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
11940892367SRandy Dunlap# hiding of the automatic options.
1205e0a0939SSteven Rostedt
121bc0c38d1SSteven Rostedtconfig TRACING
122bc0c38d1SSteven Rostedt	bool
1237a8e76a3SSteven Rostedt	select RING_BUFFER
124c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1255f87f112SIngo Molnar	select TRACEPOINTS
126f3384b28SSteven Rostedt	select NOP_TRACER
127769b0441SFrederic Weisbecker	select BINARY_PRINTF
1285f77a88bSTom Zanussi	select EVENT_TRACING
129ea632e9fSJosh Triplett	select TRACE_CLOCK
130bc0c38d1SSteven Rostedt
1315e0a0939SSteven Rostedtconfig GENERIC_TRACER
1325e0a0939SSteven Rostedt	bool
1335e0a0939SSteven Rostedt	select TRACING
1345e0a0939SSteven Rostedt
13540ada30fSIngo Molnar#
13640ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
13740ada30fSIngo Molnar# be able to offer generic tracing facilities:
13840ada30fSIngo Molnar#
13940ada30fSIngo Molnarconfig TRACING_SUPPORT
14040ada30fSIngo Molnar	bool
1410ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
14240ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
143422d3c7aSKOSAKI Motohiro	default y
14440ada30fSIngo Molnar
1454ed9f071SSteven Rostedtmenuconfig FTRACE
1464ed9f071SSteven Rostedt	bool "Tracers"
147de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
14865b77242SSteven Rostedt	default y if DEBUG_KERNEL
1494ed9f071SSteven Rostedt	help
1504ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1514ed9f071SSteven Rostedt
1524ed9f071SSteven Rostedtif FTRACE
15317d80fd0SPeter Zijlstra
1541e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
1551e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
156d8a953ddSMasami Hiramatsu	depends on TRACING
157d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
1581e837945SSteven Rostedt (VMware)	help
1591e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
1601e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
1611e837945SSteven Rostedt (VMware)	  initialization and boot process.
1621e837945SSteven Rostedt (VMware)
163606576ceSSteven Rostedtconfig FUNCTION_TRACER
1641b29b018SSteven Rostedt	bool "Kernel Function Tracer"
165606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1664d7a077cSSteven Rostedt	select KALLSYMS
1675e0a0939SSteven Rostedt	select GENERIC_TRACER
16835e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
16960f1d5e3SMasami Hiramatsu	select GLOB
17001b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
171e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
1721b29b018SSteven Rostedt	help
1731b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1741b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
17540892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
1761b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
1771b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
1781b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
1791b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
18035e8e302SSteven Rostedt
181fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
182fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
183fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
18415e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
185eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
186764f3b95SIngo Molnar	default y
18715e6cb36SFrederic Weisbecker	help
188fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
189fb52607aSFrederic Weisbecker	  and its entry.
190692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
191692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
192692105b8SMatt LaPlante	  the return value. This is done by setting the current return
193692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
19415e6cb36SFrederic Weisbecker
19561778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
19661778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
19761778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
19861778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
19961778cd7SSteven Rostedt (VMware)	default y
20061778cd7SSteven Rostedt (VMware)	help
20161778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
20261778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
20361778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
20461778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
20561778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
20661778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
20761778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
20861778cd7SSteven Rostedt (VMware)	  performance of the system.
20961778cd7SSteven Rostedt (VMware)
21061778cd7SSteven Rostedt (VMware)	  See the files in /sys/kernel/debug/tracing:
21161778cd7SSteven Rostedt (VMware)	    available_filter_functions
21261778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
21361778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
21461778cd7SSteven Rostedt (VMware)
21561778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
21661778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
21761778cd7SSteven Rostedt (VMware)
21861778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
21961778cd7SSteven Rostedt (VMware)	def_bool y
22061778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
22161778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
22261778cd7SSteven Rostedt (VMware)
22361778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
22461778cd7SSteven Rostedt (VMware)	def_bool y
22549a962c0SNaveen N. Rao	depends on DYNAMIC_FTRACE_WITH_REGS
22661778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
22761778cd7SSteven Rostedt (VMware)
22812f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
22912f9951dSLukas Bulwahn	def_bool y
23012f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
23112f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
23212f9951dSLukas Bulwahn
23361778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
23461778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
23561778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
23661778cd7SSteven Rostedt (VMware)	default n
23761778cd7SSteven Rostedt (VMware)	help
23861778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
23961778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
24061778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
24161778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
24261778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
24361778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
24461778cd7SSteven Rostedt (VMware)
24561778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
24661778cd7SSteven Rostedt (VMware)
24761778cd7SSteven Rostedt (VMware)config STACK_TRACER
24861778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
24961778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
25061778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
25161778cd7SSteven Rostedt (VMware)	select STACKTRACE
25261778cd7SSteven Rostedt (VMware)	select KALLSYMS
25361778cd7SSteven Rostedt (VMware)	help
25461778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
25561778cd7SSteven Rostedt (VMware)	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
25661778cd7SSteven Rostedt (VMware)
25761778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
25861778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
25961778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
26061778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
26161778cd7SSteven Rostedt (VMware)	  is disabled.
26261778cd7SSteven Rostedt (VMware)
26361778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
26461778cd7SSteven Rostedt (VMware)	  on the kernel command line.
26561778cd7SSteven Rostedt (VMware)
26661778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
26761778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
26861778cd7SSteven Rostedt (VMware)
26961778cd7SSteven Rostedt (VMware)	  Say N if unsure.
27061778cd7SSteven Rostedt (VMware)
271c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
272c3bc8fd6SJoel Fernandes (Google)	bool
273c3bc8fd6SJoel Fernandes (Google)	help
274c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
275c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
276bac429f0SSteven Rostedt
27781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
27881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
27981d68a96SSteven Rostedt	default n
28081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
28181d68a96SSteven Rostedt	select TRACE_IRQFLAGS
2825e0a0939SSteven Rostedt	select GENERIC_TRACER
28381d68a96SSteven Rostedt	select TRACER_MAX_TRACE
28485bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
28522cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2860b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
28781d68a96SSteven Rostedt	help
28881d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
28981d68a96SSteven Rostedt	  sections, with microsecond accuracy.
29081d68a96SSteven Rostedt
29181d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
29281d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
29381d68a96SSteven Rostedt	  via:
29481d68a96SSteven Rostedt
295156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
29681d68a96SSteven Rostedt
29740892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2986cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
2996cd8a4bbSSteven Rostedt	  used together or separately.)
3006cd8a4bbSSteven Rostedt
3016cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
3026cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
3036cd8a4bbSSteven Rostedt	default n
30430c93704SThomas Gleixner	depends on PREEMPTION
3055e0a0939SSteven Rostedt	select GENERIC_TRACER
3066cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
30785bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
30822cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3090b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
310c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
3116cd8a4bbSSteven Rostedt	help
31240892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
3136cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
3146cd8a4bbSSteven Rostedt
3156cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
3166cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
3176cd8a4bbSSteven Rostedt	  via:
3186cd8a4bbSSteven Rostedt
319156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
3206cd8a4bbSSteven Rostedt
32140892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3226cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
3236cd8a4bbSSteven Rostedt	  used together or separately.)
3246cd8a4bbSSteven Rostedt
325352ad25aSSteven Rostedtconfig SCHED_TRACER
326352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
3275e0a0939SSteven Rostedt	select GENERIC_TRACER
328352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
329352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
33022cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
331352ad25aSSteven Rostedt	help
332352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
333352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
334352ad25aSSteven Rostedt
335e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
336e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
337e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
338e7c15cd8SSteven Rostedt (Red Hat)	help
339e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
340c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
341e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
342e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
343e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
344e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
345e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
346e7c15cd8SSteven Rostedt (Red Hat)
347e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
348e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
349e7c15cd8SSteven Rostedt (Red Hat)
350e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
351e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
352e7c15cd8SSteven Rostedt (Red Hat)				     iteration
353e7c15cd8SSteven Rostedt (Red Hat)
354e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
355c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
356e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
357e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
358e7c15cd8SSteven Rostedt (Red Hat)
359e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
360e7c15cd8SSteven Rostedt (Red Hat)
361e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
362e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
363e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
364e7c15cd8SSteven Rostedt (Red Hat)	 production system.
365e7c15cd8SSteven Rostedt (Red Hat)
366e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
367e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
368e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
369e7c15cd8SSteven Rostedt (Red Hat)
370bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
371bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
372bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
373bce29ac9SDaniel Bristot de Oliveira	help
374bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
375bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
376bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
377bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
378bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
379bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
380bce29ac9SDaniel Bristot de Oliveira
381bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
382bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
383bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
384bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
385bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
386bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
387bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
388bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
389bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
390bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
391bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
392bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
393bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
394bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
395bce29ac9SDaniel Bristot de Oliveira
396bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
397bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
398bce29ac9SDaniel Bristot de Oliveira
399bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
400bce29ac9SDaniel Bristot de Oliveira
401bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
402bce29ac9SDaniel Bristot de Oliveira          file.
403bce29ac9SDaniel Bristot de Oliveira
404a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
405a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
406a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
407a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
408a955d7eaSDaniel Bristot de Oliveira	help
409a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
410a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
411a955d7eaSDaniel Bristot de Oliveira
412a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
413a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
414a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
415a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
416a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
417a955d7eaSDaniel Bristot de Oliveira	  to expire.
418a955d7eaSDaniel Bristot de Oliveira
419a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
420a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
421a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
422a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
423a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
424a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
425a955d7eaSDaniel Bristot de Oliveira
426a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
427a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
428a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
429a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
430a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
431a955d7eaSDaniel Bristot de Oliveira
43221b3ce30SSteven Rostedt (VMware)config MMIOTRACE
43321b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
43421b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
43521b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
43621b3ce30SSteven Rostedt (VMware)	help
43721b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
43821b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
43921b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
44021b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
44121b3ce30SSteven Rostedt (VMware)
44221b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
44321b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
44421b3ce30SSteven Rostedt (VMware)
445897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
446897f17a6SSteven Rostedt	bool "Trace process context switches and events"
4475e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
448b77e38aaSSteven Rostedt	select TRACING
449b77e38aaSSteven Rostedt	help
45040892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
451b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
452897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
453a7abe97fSSteven Rostedt
454ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
455ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
45666700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
4575e0a0939SSteven Rostedt	select GENERIC_TRACER
4580ea1c415SFrederic Weisbecker	select KALLSYMS
459ee08c6ecSFrederic Weisbecker	help
460ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
461ee08c6ecSFrederic Weisbecker
462debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
463debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
464debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
465debdd57fSHiraku Toyooka	help
466debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
467debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
468debdd57fSHiraku Toyooka
469debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
470debdd57fSHiraku Toyooka	      cat snapshot
471debdd57fSHiraku Toyooka
4720b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
4730b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
4740b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
4750b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
4760b85ffc2SSteven Rostedt (Red Hat)	help
4770b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
4780b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
4790b85ffc2SSteven Rostedt (Red Hat)	  allowed:
4800b85ffc2SSteven Rostedt (Red Hat)
4810b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
4820b85ffc2SSteven Rostedt (Red Hat)
4830b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
4840b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
4850b85ffc2SSteven Rostedt (Red Hat)
4860b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
4870b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
4880b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
4890b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
4900b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
4910b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
4920b85ffc2SSteven Rostedt (Red Hat)
4932ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
4949ae5b879SSteven Rostedt	bool
4955e0a0939SSteven Rostedt	select GENERIC_TRACER
4969ae5b879SSteven Rostedt
4979ae5b879SSteven Rostedtchoice
4989ae5b879SSteven Rostedt	prompt "Branch Profiling"
4999ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
5009ae5b879SSteven Rostedt	help
5019ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
5029ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
5039ae5b879SSteven Rostedt
5049ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
5059ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
5069ae5b879SSteven Rostedt
50740892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
5089ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
50940892367SRandy Dunlap	 profiler.
5109ae5b879SSteven Rostedt
51140892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
51240892367SRandy Dunlap	 If unsure, choose "No branch profiling".
5139ae5b879SSteven Rostedt
5149ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
5159ae5b879SSteven Rostedt	bool "No branch profiling"
5169ae5b879SSteven Rostedt	help
5179ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
5189ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
5199ae5b879SSteven Rostedt	  Otherwise keep it disabled.
5209ae5b879SSteven Rostedt
5219ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
5229ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
5239ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5241f0d69a9SSteven Rostedt	help
52559bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
5261f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
5271f0d69a9SSteven Rostedt
52813e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
5291f0d69a9SSteven Rostedt
53040892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
5311f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
5321f0d69a9SSteven Rostedt
5332bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
53468e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
5359ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5362bcd521aSSteven Rostedt	help
5372bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
5382bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
5392bcd521aSSteven Rostedt	  The results will be displayed in:
5402bcd521aSSteven Rostedt
54113e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
5422bcd521aSSteven Rostedt
5439ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
5449ae5b879SSteven Rostedt
5452bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
5462bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
54740892367SRandy Dunlap	  is to be analyzed in much detail.
5489ae5b879SSteven Rostedtendchoice
5492bcd521aSSteven Rostedt
5502ed84eebSSteven Rostedtconfig TRACING_BRANCHES
55152f232cbSSteven Rostedt	bool
55252f232cbSSteven Rostedt	help
55352f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
55452f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
55552f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
55652f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
55752f232cbSSteven Rostedt
5582ed84eebSSteven Rostedtconfig BRANCH_TRACER
55952f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
5602ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
5612ed84eebSSteven Rostedt	select TRACING_BRANCHES
56252f232cbSSteven Rostedt	help
56352f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
56452f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
56552f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
56652f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
56752f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
56852f232cbSSteven Rostedt	  events happened, as well as their results.
56952f232cbSSteven Rostedt
57052f232cbSSteven Rostedt	  Say N if unsure.
57152f232cbSSteven Rostedt
5722db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
57340892367SRandy Dunlap	bool "Support for tracing block IO actions"
5742db270a8SFrederic Weisbecker	depends on SYSFS
5751dfba05dSIngo Molnar	depends on BLOCK
5762db270a8SFrederic Weisbecker	select RELAY
5772db270a8SFrederic Weisbecker	select DEBUG_FS
5782db270a8SFrederic Weisbecker	select TRACEPOINTS
5795e0a0939SSteven Rostedt	select GENERIC_TRACER
5802db270a8SFrederic Weisbecker	select STACKTRACE
5812db270a8SFrederic Weisbecker	help
5822db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
5832db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
5842db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
5852db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
5862db270a8SFrederic Weisbecker
5872db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
5882db270a8SFrederic Weisbecker
5892db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
5902db270a8SFrederic Weisbecker
5912db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
5922db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
5932db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
5942db270a8SFrederic Weisbecker
5952db270a8SFrederic Weisbecker	  If unsure, say N.
59636994e58SFrederic Weisbecker
5976b0b7551SAnton Blanchardconfig KPROBE_EVENTS
598413d37d1SMasami Hiramatsu	depends on KPROBES
599f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
60077b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
601413d37d1SMasami Hiramatsu	select TRACING
6028ab83f56SSrikar Dronamraju	select PROBE_EVENTS
6036212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
60477b44d1bSMasami Hiramatsu	default y
605413d37d1SMasami Hiramatsu	help
60640892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
60740892367SRandy Dunlap	  on the fly via the ftrace interface. See
6085fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
60977b44d1bSMasami Hiramatsu
61077b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
61177b44d1bSMasami Hiramatsu	  various register and memory values.
61277b44d1bSMasami Hiramatsu
61340892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
61440892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
615413d37d1SMasami Hiramatsu
61645408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
61745408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
61845408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
6197bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
62045408c4fSMasami Hiramatsu	default n
62145408c4fSMasami Hiramatsu	help
62245408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
62345408c4fSMasami Hiramatsu	  using kprobe events.
62445408c4fSMasami Hiramatsu
62545408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
62628cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
62745408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
62845408c4fSMasami Hiramatsu	  crash.
62945408c4fSMasami Hiramatsu
63045408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
63145408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
63245408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
63345408c4fSMasami Hiramatsu
63445408c4fSMasami Hiramatsu	  If unsure, say N.
63545408c4fSMasami Hiramatsu
6366b0b7551SAnton Blanchardconfig UPROBE_EVENTS
637f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
638f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
639f3f096cfSSrikar Dronamraju	depends on MMU
64009294e31SDavid A. Long	depends on PERF_EVENTS
641f3f096cfSSrikar Dronamraju	select UPROBES
642f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
6430597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
644f3f096cfSSrikar Dronamraju	select TRACING
64561f35d75SArnaldo Carvalho de Melo	default y
646f3f096cfSSrikar Dronamraju	help
647f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
648f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
649f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
650f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
651f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
652f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
653f3f096cfSSrikar Dronamraju
654e1abf2ccSIngo Molnarconfig BPF_EVENTS
655e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
6566b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
657e1abf2ccSIngo Molnar	bool
658e1abf2ccSIngo Molnar	default y
659e1abf2ccSIngo Molnar	help
6605cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
6615cbd22c1SPeter Wu	  tracepoint events.
662e1abf2ccSIngo Molnar
6635448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
6645448d44cSMasami Hiramatsu	def_bool n
6655448d44cSMasami Hiramatsu
6668ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
6678ab83f56SSrikar Dronamraju	def_bool n
6688ab83f56SSrikar Dronamraju
6699802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
6709802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
6719802d865SJosef Bacik	depends on BPF_EVENTS
672540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
6739802d865SJosef Bacik	default n
6749802d865SJosef Bacik	help
6759802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
6769802d865SJosef Bacik	 set a different return value.  This is used for error injection.
6779802d865SJosef Bacik
6788da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
6798da3821bSSteven Rostedt	def_bool y
6808da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
6818da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
6828da3821bSSteven Rostedt
6833b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
6843b15cdc1SSami Tolvanen	bool
6853b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
6863b15cdc1SSami Tolvanen
6873b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
6883b15cdc1SSami Tolvanen	def_bool y
6893b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
6903b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
6913b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
6923b15cdc1SSami Tolvanen
69322c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
69422c8542dSSami Tolvanen	def_bool y
69522c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
69622c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
69722c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
69822c8542dSSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
69922c8542dSSami Tolvanen
7003b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
7013b15cdc1SSami Tolvanen	def_bool y
7023b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7033b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
70422c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
7053b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7063b15cdc1SSami Tolvanen
70708d43a5fSTom Zanussiconfig TRACING_MAP
70808d43a5fSTom Zanussi	bool
70908d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
71008d43a5fSTom Zanussi	help
71108d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
71208d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
71308d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
71408d43a5fSTom Zanussi	  generally used outside of that context, and is normally
71508d43a5fSTom Zanussi	  selected by tracers that use it.
71608d43a5fSTom Zanussi
717726721a5STom Zanussiconfig SYNTH_EVENTS
718726721a5STom Zanussi	bool "Synthetic trace events"
719726721a5STom Zanussi	select TRACING
720726721a5STom Zanussi	select DYNAMIC_EVENTS
721726721a5STom Zanussi	default n
722726721a5STom Zanussi	help
723726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
724726721a5STom Zanussi	  used to combine data from other trace events or in fact any
725726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
726726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
727726721a5STom Zanussi	  by way of an in-kernel API.
728726721a5STom Zanussi
729726721a5STom Zanussi	  See Documentation/trace/events.rst or
730726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
731726721a5STom Zanussi
732726721a5STom Zanussi	  If in doubt, say N.
733726721a5STom Zanussi
7347ef224d1STom Zanussiconfig HIST_TRIGGERS
7357ef224d1STom Zanussi	bool "Histogram triggers"
7367ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
7377ef224d1STom Zanussi	select TRACING_MAP
7387ad8fb61STom Zanussi	select TRACING
7397bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
740726721a5STom Zanussi	select SYNTH_EVENTS
7417ef224d1STom Zanussi	default n
7427ef224d1STom Zanussi	help
7437ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
7447ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
7457ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
7467ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
7477ef224d1STom Zanussi	  event activity as an initial guide for further investigation
7487ef224d1STom Zanussi	  using more advanced tools.
7497ef224d1STom Zanussi
75089e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
75189e270c1STom Zanussi	  supported using hist triggers under this option.
75289e270c1STom Zanussi
753ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
7547ef224d1STom Zanussi	  If in doubt, say N.
7557ef224d1STom Zanussi
7566c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
7576c3edaf9SCong Wang	bool "Trace event injection"
7586c3edaf9SCong Wang	depends on TRACING
7596c3edaf9SCong Wang	help
7606c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
7616c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
7626c3edaf9SCong Wang
7636c3edaf9SCong Wang	  If unsure, say N.
7646c3edaf9SCong Wang
76581dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
76681dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
76781dc9f0eSSteven Rostedt (Red Hat)	help
76881dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
76981dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
77069268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
77181dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
77281dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
77381dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
77481dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
77581dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
77681dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
77781dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
77881dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
77981dc9f0eSSteven Rostedt (Red Hat)
78081dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
78181dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
78281dc9f0eSSteven Rostedt (Red Hat)
78381dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
78481dc9f0eSSteven Rostedt (Red Hat)
78581dc9f0eSSteven Rostedt (Red Hat)	      START
78681dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
78781dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
78881dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
78981dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
79081dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
79181dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
79281dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
79381dc9f0eSSteven Rostedt (Red Hat)
79481dc9f0eSSteven Rostedt (Red Hat)
7955092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
7965092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
7975092dbc9SSteven Rostedt	depends on RING_BUFFER
7985092dbc9SSteven Rostedt	help
7995092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
80040892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
8015092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
8025092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
8035092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
8045092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
8055092dbc9SSteven Rostedt
8065092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
8075092dbc9SSteven Rostedt	  affected by processes that are running.
8085092dbc9SSteven Rostedt
80940892367SRandy Dunlap	  If unsure, say N.
8105092dbc9SSteven Rostedt
8111e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
8121e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
8131e837945SSteven Rostedt (VMware)       depends on TRACING
8141e837945SSteven Rostedt (VMware)       help
8151e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
8161e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
8171e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
8181e837945SSteven Rostedt (VMware)	how to convert the string to its value.
8191e837945SSteven Rostedt (VMware)
8201e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
8211e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
8221e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
8231e837945SSteven Rostedt (VMware)
8241e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
8251e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
8261e837945SSteven Rostedt (VMware)
8271e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
8281e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
8291e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
8301e837945SSteven Rostedt (VMware)	belong too.
8311e837945SSteven Rostedt (VMware)
8321e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
8331e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
8341e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
8351e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
8361e837945SSteven Rostedt (VMware)
8371e837945SSteven Rostedt (VMware)	If unsure, say N.
8381e837945SSteven Rostedt (VMware)
839773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
840773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
841773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
842773c1670SSteven Rostedt (VMware)	help
843773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
844773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
845773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
846773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
847773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
848773c1670SSteven Rostedt (VMware)
849773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
850773c1670SSteven Rostedt (VMware)
851773c1670SSteven Rostedt (VMware)	  If unsure, say N
852773c1670SSteven Rostedt (VMware)
853773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
854773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
855773c1670SSteven Rostedt (VMware)	default	128
856773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
857773c1670SSteven Rostedt (VMware)	help
858773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
859773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
860773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
861773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
862773c1670SSteven Rostedt (VMware)	  size at runtime.
863773c1670SSteven Rostedt (VMware)
86428575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
86528575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
86628575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
86728575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
86828575c61SSteven Rostedt (VMware)	default y
86928575c61SSteven Rostedt (VMware)	help
87028575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
87128575c61SSteven Rostedt (VMware)	  recursion happens it wont cause harm because of the protection,
87228575c61SSteven Rostedt (VMware)	  but it does cause an unwanted overhead. Enabling this option will
87328575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
87428575c61SSteven Rostedt (VMware)	  file.
87528575c61SSteven Rostedt (VMware)
87628575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
87728575c61SSteven Rostedt (VMware)
8781e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
8791e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
8801e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
8811e837945SSteven Rostedt (VMware)	help
8821e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
8831e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
8841e837945SSteven Rostedt (VMware)
8851e837945SSteven Rostedt (VMware)	  If unsure, say N.
8861e837945SSteven Rostedt (VMware)
8871e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
8881e837945SSteven Rostedt (VMware)	  run significantly slower.
8891e837945SSteven Rostedt (VMware)
8901e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
8911e837945SSteven Rostedt (VMware)	bool
8921e837945SSteven Rostedt (VMware)
8931e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
8941e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
8951e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
8961e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
8971e837945SSteven Rostedt (VMware)	help
8981e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
8991e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
9001e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
9011e837945SSteven Rostedt (VMware)	  tracers of ftrace.
9021e837945SSteven Rostedt (VMware)
9031e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
9041e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
9051e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
9061e837945SSteven Rostedt (VMware)	default y
9071e837945SSteven Rostedt (VMware)	help
9081e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
9091e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
9101e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
9111e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
9121e837945SSteven Rostedt (VMware)
9131e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
9141e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
9151e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
9161e837945SSteven Rostedt (VMware)	help
9171e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
9181e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
9191e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
9201e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
9211e837945SSteven Rostedt (VMware)
9221e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
9231e837945SSteven Rostedt (VMware)	       events
9241e837945SSteven Rostedt (VMware)
9258147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
9268147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
9278147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
928*6b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
9298147dc78SSteven Rostedt (VMware)       help
9308147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
9318147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
9328147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
9338147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
9348147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
9358147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
9368147dc78SSteven Rostedt (VMware)
9378147dc78SSteven Rostedt (VMware)	 If unsure, say N
9388147dc78SSteven Rostedt (VMware)
9396c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
9406c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
9416c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
9426c43e554SSteven Rostedt (Red Hat)       help
9436c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
9446c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
9456c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
9466c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
9476c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
9486c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
9496c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
9506c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
9516c43e554SSteven Rostedt (Red Hat)
9526c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
9536c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
9546c43e554SSteven Rostedt (Red Hat)
9556c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
9566c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
9576c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
9586c43e554SSteven Rostedt (Red Hat)	 other similar details.
9596c43e554SSteven Rostedt (Red Hat)
9606c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
9616c43e554SSteven Rostedt (Red Hat)
9625b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
9635b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
9645b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
9655b7be9c7SSteven Rostedt (VMware)	help
9665b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
9675b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
9685b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
9695b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
9705b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
9715b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
9725b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
9735b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
9745b7be9c7SSteven Rostedt (VMware)
9755b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
9765b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
9775b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
9785b7be9c7SSteven Rostedt (VMware)
9795b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
9805b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
9815b7be9c7SSteven Rostedt (VMware)
982a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
983a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
984a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
985a48fc4f5SSteven Rostedt (VMware)	help
986a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
987a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
988a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
989a48fc4f5SSteven Rostedt (VMware)
990a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
991a48fc4f5SSteven Rostedt (VMware)
992f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
993a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
994f96e8577SJoel Fernandes (Google)	depends on m
995f96e8577SJoel Fernandes (Google)	help
996f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
997f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
998f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
999f96e8577SJoel Fernandes (Google)	  critical section.
1000f96e8577SJoel Fernandes (Google)
100179393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
100279393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
100379393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1004f96e8577SJoel Fernandes (Google)
10054b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
10064b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
10074b9091e1SSong Chen	  command.
10084b9091e1SSong Chen
1009f96e8577SJoel Fernandes (Google)	  If unsure, say N
1010f96e8577SJoel Fernandes (Google)
10119fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
10129fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
1013726721a5STom Zanussi	depends on SYNTH_EVENTS
10149fe41efaSTom Zanussi	help
10159fe41efaSTom Zanussi          This option creates a test module to check the base
10169fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
10179fe41efaSTom Zanussi          generation.
10189fe41efaSTom Zanussi
10199fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
10209fe41efaSTom Zanussi	  for the generated sample events.
10219fe41efaSTom Zanussi
10229fe41efaSTom Zanussi	  If unsure, say N.
10239fe41efaSTom Zanussi
102464836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
102564836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
102664836248STom Zanussi	depends on KPROBE_EVENTS
102764836248STom Zanussi	help
102864836248STom Zanussi          This option creates a test module to check the base
102964836248STom Zanussi          functionality of in-kernel kprobe event definition.
103064836248STom Zanussi
103164836248STom Zanussi          To test, insert the module, and then check the trace buffer
103264836248STom Zanussi	  for the generated kprobe events.
103364836248STom Zanussi
103464836248STom Zanussi	  If unsure, say N.
103564836248STom Zanussi
10362d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
10372d19bd79STom Zanussi	bool "Hist trigger debug support"
10382d19bd79STom Zanussi	depends on HIST_TRIGGERS
10392d19bd79STom Zanussi	help
10402d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
10412d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
10422d19bd79STom Zanussi          defined on that event.
10432d19bd79STom Zanussi
10442d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
10452d19bd79STom Zanussi
10462d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
10472d19bd79STom Zanussi
10482d19bd79STom Zanussi            - Provides educational information to support the details
10492d19bd79STom Zanussi              of the hist trigger internals as described by
10502d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
10512d19bd79STom Zanussi
10522d19bd79STom Zanussi          The hist_debug output only covers the data structures
10532d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
10542d19bd79STom Zanussi          display the internals of map buckets or variable values of
10552d19bd79STom Zanussi          running histograms.
10562d19bd79STom Zanussi
10572d19bd79STom Zanussi          If unsure, say N.
10582d19bd79STom Zanussi
10594ed9f071SSteven Rostedtendif # FTRACE
1060