xref: /linux/kernel/trace/Kconfig (revision 7f5a08c79df35e68f1a43033450c5050f12bc155)
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
734ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT
744ed308c4SSteven Rostedt (Google)       bool
754ed308c4SSteven Rostedt (Google)       help
764ed308c4SSteven Rostedt (Google)         An architecture selects this if it sorts the mcount_loc section
774ed308c4SSteven Rostedt (Google)	 at build time.
784ed308c4SSteven Rostedt (Google)
796b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
806b9b6413SSteven Rostedt (Google)       bool
816b9b6413SSteven Rostedt (Google)       default y
824ed308c4SSteven Rostedt (Google)       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
836b9b6413SSteven Rostedt (Google)       help
846b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
856b9b6413SSteven Rostedt (Google)
86352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
87352ad25aSSteven Rostedt	bool
88352ad25aSSteven Rostedt
89ea632e9fSJosh Triplettconfig TRACE_CLOCK
90ea632e9fSJosh Triplett	bool
91ea632e9fSJosh Triplett
927a8e76a3SSteven Rostedtconfig RING_BUFFER
937a8e76a3SSteven Rostedt	bool
94ea632e9fSJosh Triplett	select TRACE_CLOCK
9522287688SSteven Rostedt (Red Hat)	select IRQ_WORK
967a8e76a3SSteven Rostedt
975f77a88bSTom Zanussiconfig EVENT_TRACING
98b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
9960f1d5e3SMasami Hiramatsu	select GLOB
100b11c53e1SZhaolei	bool
101b11c53e1SZhaolei
102b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
1035f77a88bSTom Zanussi	bool
1045f77a88bSTom Zanussi
10585bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
10685bac32cSSteven Rostedt	bool
10785bac32cSSteven Rostedt	help
10885bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
10985bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
11085bac32cSSteven Rostedt
111c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
112c3bc8fd6SJoel Fernandes (Google)	bool
113c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
114c3bc8fd6SJoel Fernandes (Google)	select TRACING
115c3bc8fd6SJoel Fernandes (Google)	default y
116c3bc8fd6SJoel Fernandes (Google)	help
117c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
118c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
119c3bc8fd6SJoel Fernandes (Google)
1205e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1215e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1225e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1235e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1245e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
12540892367SRandy Dunlap# hiding of the automatic options.
1265e0a0939SSteven Rostedt
127bc0c38d1SSteven Rostedtconfig TRACING
128bc0c38d1SSteven Rostedt	bool
1297a8e76a3SSteven Rostedt	select RING_BUFFER
130c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1315f87f112SIngo Molnar	select TRACEPOINTS
132f3384b28SSteven Rostedt	select NOP_TRACER
133769b0441SFrederic Weisbecker	select BINARY_PRINTF
1345f77a88bSTom Zanussi	select EVENT_TRACING
135ea632e9fSJosh Triplett	select TRACE_CLOCK
136bc0c38d1SSteven Rostedt
1375e0a0939SSteven Rostedtconfig GENERIC_TRACER
1385e0a0939SSteven Rostedt	bool
1395e0a0939SSteven Rostedt	select TRACING
1405e0a0939SSteven Rostedt
14140ada30fSIngo Molnar#
14240ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
14340ada30fSIngo Molnar# be able to offer generic tracing facilities:
14440ada30fSIngo Molnar#
14540ada30fSIngo Molnarconfig TRACING_SUPPORT
14640ada30fSIngo Molnar	bool
1470ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
14840ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
149422d3c7aSKOSAKI Motohiro	default y
15040ada30fSIngo Molnar
1514ed9f071SSteven Rostedtmenuconfig FTRACE
1524ed9f071SSteven Rostedt	bool "Tracers"
153de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
15465b77242SSteven Rostedt	default y if DEBUG_KERNEL
1554ed9f071SSteven Rostedt	help
1564ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1574ed9f071SSteven Rostedt
1584ed9f071SSteven Rostedtif FTRACE
15917d80fd0SPeter Zijlstra
1601e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
1611e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
162d8a953ddSMasami Hiramatsu	depends on TRACING
163d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
1641e837945SSteven Rostedt (VMware)	help
1651e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
1661e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
1671e837945SSteven Rostedt (VMware)	  initialization and boot process.
1681e837945SSteven Rostedt (VMware)
169606576ceSSteven Rostedtconfig FUNCTION_TRACER
1701b29b018SSteven Rostedt	bool "Kernel Function Tracer"
171606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1724d7a077cSSteven Rostedt	select KALLSYMS
1735e0a0939SSteven Rostedt	select GENERIC_TRACER
17435e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
17560f1d5e3SMasami Hiramatsu	select GLOB
17601b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
177e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
1781b29b018SSteven Rostedt	help
1791b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1801b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
18140892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
1821b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
1831b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
1841b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
1851b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
18635e8e302SSteven Rostedt
187fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
188fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
189fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
19015e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
191eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
192764f3b95SIngo Molnar	default y
19315e6cb36SFrederic Weisbecker	help
194fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
195fb52607aSFrederic Weisbecker	  and its entry.
196692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
197692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
198692105b8SMatt LaPlante	  the return value. This is done by setting the current return
199692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
20015e6cb36SFrederic Weisbecker
20161778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
20261778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
20361778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
20461778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
20561778cd7SSteven Rostedt (VMware)	default y
20661778cd7SSteven Rostedt (VMware)	help
20761778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
20861778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
20961778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
21061778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
21161778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
21261778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
21361778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
21461778cd7SSteven Rostedt (VMware)	  performance of the system.
21561778cd7SSteven Rostedt (VMware)
21661778cd7SSteven Rostedt (VMware)	  See the files in /sys/kernel/debug/tracing:
21761778cd7SSteven Rostedt (VMware)	    available_filter_functions
21861778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
21961778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
22061778cd7SSteven Rostedt (VMware)
22161778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
22261778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
22361778cd7SSteven Rostedt (VMware)
22461778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
22561778cd7SSteven Rostedt (VMware)	def_bool y
22661778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
22761778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
22861778cd7SSteven Rostedt (VMware)
22961778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
23061778cd7SSteven Rostedt (VMware)	def_bool y
23149a962c0SNaveen N. Rao	depends on DYNAMIC_FTRACE_WITH_REGS
23261778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
23361778cd7SSteven Rostedt (VMware)
23412f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
23512f9951dSLukas Bulwahn	def_bool y
23612f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
23712f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
23812f9951dSLukas Bulwahn
23961778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
24061778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
24161778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
24261778cd7SSteven Rostedt (VMware)	default n
24361778cd7SSteven Rostedt (VMware)	help
24461778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
24561778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
24661778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
24761778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
24861778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
24961778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
25061778cd7SSteven Rostedt (VMware)
25161778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
25261778cd7SSteven Rostedt (VMware)
25361778cd7SSteven Rostedt (VMware)config STACK_TRACER
25461778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
25561778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
25661778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
25761778cd7SSteven Rostedt (VMware)	select STACKTRACE
25861778cd7SSteven Rostedt (VMware)	select KALLSYMS
25961778cd7SSteven Rostedt (VMware)	help
26061778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
26161778cd7SSteven Rostedt (VMware)	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
26261778cd7SSteven Rostedt (VMware)
26361778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
26461778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
26561778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
26661778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
26761778cd7SSteven Rostedt (VMware)	  is disabled.
26861778cd7SSteven Rostedt (VMware)
26961778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
27061778cd7SSteven Rostedt (VMware)	  on the kernel command line.
27161778cd7SSteven Rostedt (VMware)
27261778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
27361778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
27461778cd7SSteven Rostedt (VMware)
27561778cd7SSteven Rostedt (VMware)	  Say N if unsure.
27661778cd7SSteven Rostedt (VMware)
277c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
278c3bc8fd6SJoel Fernandes (Google)	bool
279c3bc8fd6SJoel Fernandes (Google)	help
280c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
281c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
282bac429f0SSteven Rostedt
28381d68a96SSteven Rostedtconfig IRQSOFF_TRACER
28481d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
28581d68a96SSteven Rostedt	default n
28681d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
28781d68a96SSteven Rostedt	select TRACE_IRQFLAGS
2885e0a0939SSteven Rostedt	select GENERIC_TRACER
28981d68a96SSteven Rostedt	select TRACER_MAX_TRACE
29085bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
29122cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2920b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
29381d68a96SSteven Rostedt	help
29481d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
29581d68a96SSteven Rostedt	  sections, with microsecond accuracy.
29681d68a96SSteven Rostedt
29781d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
29881d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
29981d68a96SSteven Rostedt	  via:
30081d68a96SSteven Rostedt
301156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
30281d68a96SSteven Rostedt
30340892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3046cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
3056cd8a4bbSSteven Rostedt	  used together or separately.)
3066cd8a4bbSSteven Rostedt
3076cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
3086cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
3096cd8a4bbSSteven Rostedt	default n
31030c93704SThomas Gleixner	depends on PREEMPTION
3115e0a0939SSteven Rostedt	select GENERIC_TRACER
3126cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
31385bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
31422cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3150b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
316c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
3176cd8a4bbSSteven Rostedt	help
31840892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
3196cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
3206cd8a4bbSSteven Rostedt
3216cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
3226cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
3236cd8a4bbSSteven Rostedt	  via:
3246cd8a4bbSSteven Rostedt
325156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
3266cd8a4bbSSteven Rostedt
32740892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3286cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
3296cd8a4bbSSteven Rostedt	  used together or separately.)
3306cd8a4bbSSteven Rostedt
331352ad25aSSteven Rostedtconfig SCHED_TRACER
332352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
3335e0a0939SSteven Rostedt	select GENERIC_TRACER
334352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
335352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
33622cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
337352ad25aSSteven Rostedt	help
338352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
339352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
340352ad25aSSteven Rostedt
341e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
342e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
343e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
344e7c15cd8SSteven Rostedt (Red Hat)	help
345e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
346c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
347e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
348e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
349e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
350e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
351e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
352e7c15cd8SSteven Rostedt (Red Hat)
353e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
354e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
355e7c15cd8SSteven Rostedt (Red Hat)
356e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
357e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
358e7c15cd8SSteven Rostedt (Red Hat)				     iteration
359e7c15cd8SSteven Rostedt (Red Hat)
360e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
361c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
362e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
363e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
364e7c15cd8SSteven Rostedt (Red Hat)
365e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
366e7c15cd8SSteven Rostedt (Red Hat)
367e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
368e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
369e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
370e7c15cd8SSteven Rostedt (Red Hat)	 production system.
371e7c15cd8SSteven Rostedt (Red Hat)
372e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
373e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
374e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
375e7c15cd8SSteven Rostedt (Red Hat)
376bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
377bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
378bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
379bce29ac9SDaniel Bristot de Oliveira	help
380bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
381bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
382bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
383bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
384bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
385bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
386bce29ac9SDaniel Bristot de Oliveira
387bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
388bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
389bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
390bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
391bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
392bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
393bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
394bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
395bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
396bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
397bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
398bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
399bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
400bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
401bce29ac9SDaniel Bristot de Oliveira
402bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
403bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
404bce29ac9SDaniel Bristot de Oliveira
405bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
406bce29ac9SDaniel Bristot de Oliveira
407bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
408bce29ac9SDaniel Bristot de Oliveira          file.
409bce29ac9SDaniel Bristot de Oliveira
410a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
411a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
412a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
413a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
414a955d7eaSDaniel Bristot de Oliveira	help
415a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
416a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
417a955d7eaSDaniel Bristot de Oliveira
418a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
419a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
420a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
421a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
422a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
423a955d7eaSDaniel Bristot de Oliveira	  to expire.
424a955d7eaSDaniel Bristot de Oliveira
425a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
426a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
427a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
428a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
429a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
430a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
431a955d7eaSDaniel Bristot de Oliveira
432a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
433a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
434a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
435a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
436a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
437a955d7eaSDaniel Bristot de Oliveira
43821b3ce30SSteven Rostedt (VMware)config MMIOTRACE
43921b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
44021b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
44121b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
44221b3ce30SSteven Rostedt (VMware)	help
44321b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
44421b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
44521b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
44621b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
44721b3ce30SSteven Rostedt (VMware)
44821b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
44921b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
45021b3ce30SSteven Rostedt (VMware)
451897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
452897f17a6SSteven Rostedt	bool "Trace process context switches and events"
4535e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
454b77e38aaSSteven Rostedt	select TRACING
455b77e38aaSSteven Rostedt	help
45640892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
457b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
458897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
459a7abe97fSSteven Rostedt
460ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
461ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
46266700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
4635e0a0939SSteven Rostedt	select GENERIC_TRACER
4640ea1c415SFrederic Weisbecker	select KALLSYMS
465ee08c6ecSFrederic Weisbecker	help
466ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
467ee08c6ecSFrederic Weisbecker
468debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
469debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
470debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
471debdd57fSHiraku Toyooka	help
472debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
473debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
474debdd57fSHiraku Toyooka
475debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
476debdd57fSHiraku Toyooka	      cat snapshot
477debdd57fSHiraku Toyooka
4780b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
4790b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
4800b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
4810b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
4820b85ffc2SSteven Rostedt (Red Hat)	help
4830b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
4840b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
4850b85ffc2SSteven Rostedt (Red Hat)	  allowed:
4860b85ffc2SSteven Rostedt (Red Hat)
4870b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
4880b85ffc2SSteven Rostedt (Red Hat)
4890b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
4900b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
4910b85ffc2SSteven Rostedt (Red Hat)
4920b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
4930b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
4940b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
4950b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
4960b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
4970b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
4980b85ffc2SSteven Rostedt (Red Hat)
4992ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
5009ae5b879SSteven Rostedt	bool
5015e0a0939SSteven Rostedt	select GENERIC_TRACER
5029ae5b879SSteven Rostedt
5039ae5b879SSteven Rostedtchoice
5049ae5b879SSteven Rostedt	prompt "Branch Profiling"
5059ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
5069ae5b879SSteven Rostedt	help
5079ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
5089ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
5099ae5b879SSteven Rostedt
5109ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
5119ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
5129ae5b879SSteven Rostedt
51340892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
5149ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
51540892367SRandy Dunlap	 profiler.
5169ae5b879SSteven Rostedt
51740892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
51840892367SRandy Dunlap	 If unsure, choose "No branch profiling".
5199ae5b879SSteven Rostedt
5209ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
5219ae5b879SSteven Rostedt	bool "No branch profiling"
5229ae5b879SSteven Rostedt	help
5239ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
5249ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
5259ae5b879SSteven Rostedt	  Otherwise keep it disabled.
5269ae5b879SSteven Rostedt
5279ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
5289ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
5299ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5301f0d69a9SSteven Rostedt	help
53159bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
5321f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
5331f0d69a9SSteven Rostedt
53413e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
5351f0d69a9SSteven Rostedt
53640892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
5371f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
5381f0d69a9SSteven Rostedt
5392bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
54068e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
5419ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5422bcd521aSSteven Rostedt	help
5432bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
5442bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
5452bcd521aSSteven Rostedt	  The results will be displayed in:
5462bcd521aSSteven Rostedt
54713e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
5482bcd521aSSteven Rostedt
5499ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
5509ae5b879SSteven Rostedt
5512bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
5522bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
55340892367SRandy Dunlap	  is to be analyzed in much detail.
5549ae5b879SSteven Rostedtendchoice
5552bcd521aSSteven Rostedt
5562ed84eebSSteven Rostedtconfig TRACING_BRANCHES
55752f232cbSSteven Rostedt	bool
55852f232cbSSteven Rostedt	help
55952f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
56052f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
56152f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
56252f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
56352f232cbSSteven Rostedt
5642ed84eebSSteven Rostedtconfig BRANCH_TRACER
56552f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
5662ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
5672ed84eebSSteven Rostedt	select TRACING_BRANCHES
56852f232cbSSteven Rostedt	help
56952f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
57052f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
57152f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
57252f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
57352f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
57452f232cbSSteven Rostedt	  events happened, as well as their results.
57552f232cbSSteven Rostedt
57652f232cbSSteven Rostedt	  Say N if unsure.
57752f232cbSSteven Rostedt
5782db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
57940892367SRandy Dunlap	bool "Support for tracing block IO actions"
5802db270a8SFrederic Weisbecker	depends on SYSFS
5811dfba05dSIngo Molnar	depends on BLOCK
5822db270a8SFrederic Weisbecker	select RELAY
5832db270a8SFrederic Weisbecker	select DEBUG_FS
5842db270a8SFrederic Weisbecker	select TRACEPOINTS
5855e0a0939SSteven Rostedt	select GENERIC_TRACER
5862db270a8SFrederic Weisbecker	select STACKTRACE
5872db270a8SFrederic Weisbecker	help
5882db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
5892db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
5902db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
5912db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
5922db270a8SFrederic Weisbecker
5932db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
5942db270a8SFrederic Weisbecker
5952db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
5962db270a8SFrederic Weisbecker
5972db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
5982db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
5992db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
6002db270a8SFrederic Weisbecker
6012db270a8SFrederic Weisbecker	  If unsure, say N.
60236994e58SFrederic Weisbecker
6036b0b7551SAnton Blanchardconfig KPROBE_EVENTS
604413d37d1SMasami Hiramatsu	depends on KPROBES
605f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
60677b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
607413d37d1SMasami Hiramatsu	select TRACING
6088ab83f56SSrikar Dronamraju	select PROBE_EVENTS
6096212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
61077b44d1bSMasami Hiramatsu	default y
611413d37d1SMasami Hiramatsu	help
61240892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
61340892367SRandy Dunlap	  on the fly via the ftrace interface. See
6145fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
61577b44d1bSMasami Hiramatsu
61677b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
61777b44d1bSMasami Hiramatsu	  various register and memory values.
61877b44d1bSMasami Hiramatsu
61940892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
62040892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
621413d37d1SMasami Hiramatsu
62245408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
62345408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
62445408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
6257bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
62645408c4fSMasami Hiramatsu	default n
62745408c4fSMasami Hiramatsu	help
62845408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
62945408c4fSMasami Hiramatsu	  using kprobe events.
63045408c4fSMasami Hiramatsu
63145408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
63228cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
63345408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
63445408c4fSMasami Hiramatsu	  crash.
63545408c4fSMasami Hiramatsu
63645408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
63745408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
63845408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
63945408c4fSMasami Hiramatsu
64045408c4fSMasami Hiramatsu	  If unsure, say N.
64145408c4fSMasami Hiramatsu
6426b0b7551SAnton Blanchardconfig UPROBE_EVENTS
643f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
644f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
645f3f096cfSSrikar Dronamraju	depends on MMU
64609294e31SDavid A. Long	depends on PERF_EVENTS
647f3f096cfSSrikar Dronamraju	select UPROBES
648f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
6490597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
650f3f096cfSSrikar Dronamraju	select TRACING
65161f35d75SArnaldo Carvalho de Melo	default y
652f3f096cfSSrikar Dronamraju	help
653f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
654f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
655f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
656f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
657f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
658f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
659f3f096cfSSrikar Dronamraju
660e1abf2ccSIngo Molnarconfig BPF_EVENTS
661e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
6626b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
663e1abf2ccSIngo Molnar	bool
664e1abf2ccSIngo Molnar	default y
665e1abf2ccSIngo Molnar	help
6665cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
6675cbd22c1SPeter Wu	  tracepoint events.
668e1abf2ccSIngo Molnar
6695448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
6705448d44cSMasami Hiramatsu	def_bool n
6715448d44cSMasami Hiramatsu
6728ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
6738ab83f56SSrikar Dronamraju	def_bool n
6748ab83f56SSrikar Dronamraju
6759802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
6769802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
6779802d865SJosef Bacik	depends on BPF_EVENTS
678540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
6799802d865SJosef Bacik	default n
6809802d865SJosef Bacik	help
6819802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
6829802d865SJosef Bacik	 set a different return value.  This is used for error injection.
6839802d865SJosef Bacik
6848da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
6858da3821bSSteven Rostedt	def_bool y
6868da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
6878da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
6888da3821bSSteven Rostedt
6893b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
6903b15cdc1SSami Tolvanen	bool
6913b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
6923b15cdc1SSami Tolvanen
6933b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
6943b15cdc1SSami Tolvanen	def_bool y
6953b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
6963b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
6973b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
6983b15cdc1SSami Tolvanen
69922c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
70022c8542dSSami Tolvanen	def_bool y
70122c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
70222c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
70322c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
70422c8542dSSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
70522c8542dSSami Tolvanen
7063b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
7073b15cdc1SSami Tolvanen	def_bool y
7083b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7093b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
71022c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
7113b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7123b15cdc1SSami Tolvanen
71308d43a5fSTom Zanussiconfig TRACING_MAP
71408d43a5fSTom Zanussi	bool
71508d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
71608d43a5fSTom Zanussi	help
71708d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
71808d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
71908d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
72008d43a5fSTom Zanussi	  generally used outside of that context, and is normally
72108d43a5fSTom Zanussi	  selected by tracers that use it.
72208d43a5fSTom Zanussi
723726721a5STom Zanussiconfig SYNTH_EVENTS
724726721a5STom Zanussi	bool "Synthetic trace events"
725726721a5STom Zanussi	select TRACING
726726721a5STom Zanussi	select DYNAMIC_EVENTS
727726721a5STom Zanussi	default n
728726721a5STom Zanussi	help
729726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
730726721a5STom Zanussi	  used to combine data from other trace events or in fact any
731726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
732726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
733726721a5STom Zanussi	  by way of an in-kernel API.
734726721a5STom Zanussi
735726721a5STom Zanussi	  See Documentation/trace/events.rst or
736726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
737726721a5STom Zanussi
738726721a5STom Zanussi	  If in doubt, say N.
739726721a5STom Zanussi
740*7f5a08c7SBeau Belgraveconfig USER_EVENTS
741*7f5a08c7SBeau Belgrave	bool "User trace events"
742*7f5a08c7SBeau Belgrave	select TRACING
743*7f5a08c7SBeau Belgrave	select DYNAMIC_EVENTS
744*7f5a08c7SBeau Belgrave	help
745*7f5a08c7SBeau Belgrave	  User trace events are user-defined trace events that
746*7f5a08c7SBeau Belgrave	  can be used like an existing kernel trace event.  User trace
747*7f5a08c7SBeau Belgrave	  events are generated by writing to a tracefs file.  User
748*7f5a08c7SBeau Belgrave	  processes can determine if their tracing events should be
749*7f5a08c7SBeau Belgrave	  generated by memory mapping a tracefs file and checking for
750*7f5a08c7SBeau Belgrave	  an associated byte being non-zero.
751*7f5a08c7SBeau Belgrave
752*7f5a08c7SBeau Belgrave	  If in doubt, say N.
753*7f5a08c7SBeau Belgrave
7547ef224d1STom Zanussiconfig HIST_TRIGGERS
7557ef224d1STom Zanussi	bool "Histogram triggers"
7567ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
7577ef224d1STom Zanussi	select TRACING_MAP
7587ad8fb61STom Zanussi	select TRACING
7597bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
760726721a5STom Zanussi	select SYNTH_EVENTS
7617ef224d1STom Zanussi	default n
7627ef224d1STom Zanussi	help
7637ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
7647ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
7657ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
7667ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
7677ef224d1STom Zanussi	  event activity as an initial guide for further investigation
7687ef224d1STom Zanussi	  using more advanced tools.
7697ef224d1STom Zanussi
77089e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
77189e270c1STom Zanussi	  supported using hist triggers under this option.
77289e270c1STom Zanussi
773ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
7747ef224d1STom Zanussi	  If in doubt, say N.
7757ef224d1STom Zanussi
7766c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
7776c3edaf9SCong Wang	bool "Trace event injection"
7786c3edaf9SCong Wang	depends on TRACING
7796c3edaf9SCong Wang	help
7806c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
7816c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
7826c3edaf9SCong Wang
7836c3edaf9SCong Wang	  If unsure, say N.
7846c3edaf9SCong Wang
78581dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
78681dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
78781dc9f0eSSteven Rostedt (Red Hat)	help
78881dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
78981dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
79069268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
79181dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
79281dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
79381dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
79481dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
79581dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
79681dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
79781dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
79881dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
79981dc9f0eSSteven Rostedt (Red Hat)
80081dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
80181dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
80281dc9f0eSSteven Rostedt (Red Hat)
80381dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
80481dc9f0eSSteven Rostedt (Red Hat)
80581dc9f0eSSteven Rostedt (Red Hat)	      START
80681dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
80781dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
80881dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
80981dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
81081dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
81181dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
81281dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
81381dc9f0eSSteven Rostedt (Red Hat)
81481dc9f0eSSteven Rostedt (Red Hat)
8155092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
8165092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
8175092dbc9SSteven Rostedt	depends on RING_BUFFER
8185092dbc9SSteven Rostedt	help
8195092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
82040892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
8215092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
8225092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
8235092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
8245092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
8255092dbc9SSteven Rostedt
8265092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
8275092dbc9SSteven Rostedt	  affected by processes that are running.
8285092dbc9SSteven Rostedt
82940892367SRandy Dunlap	  If unsure, say N.
8305092dbc9SSteven Rostedt
8311e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
8321e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
8331e837945SSteven Rostedt (VMware)       depends on TRACING
8341e837945SSteven Rostedt (VMware)       help
8351e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
8361e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
8371e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
8381e837945SSteven Rostedt (VMware)	how to convert the string to its value.
8391e837945SSteven Rostedt (VMware)
8401e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
8411e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
8421e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
8431e837945SSteven Rostedt (VMware)
8441e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
8451e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
8461e837945SSteven Rostedt (VMware)
8471e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
8481e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
8491e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
8501e837945SSteven Rostedt (VMware)	belong too.
8511e837945SSteven Rostedt (VMware)
8521e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
8531e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
8541e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
8551e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
8561e837945SSteven Rostedt (VMware)
8571e837945SSteven Rostedt (VMware)	If unsure, say N.
8581e837945SSteven Rostedt (VMware)
859773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
860773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
861773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
862773c1670SSteven Rostedt (VMware)	help
863773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
864773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
865773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
866773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
867773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
868773c1670SSteven Rostedt (VMware)
869773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
870773c1670SSteven Rostedt (VMware)
871773c1670SSteven Rostedt (VMware)	  If unsure, say N
872773c1670SSteven Rostedt (VMware)
873773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
874773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
875773c1670SSteven Rostedt (VMware)	default	128
876773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
877773c1670SSteven Rostedt (VMware)	help
878773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
879773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
880773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
881773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
882773c1670SSteven Rostedt (VMware)	  size at runtime.
883773c1670SSteven Rostedt (VMware)
88428575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
88528575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
88628575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
88728575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
88828575c61SSteven Rostedt (VMware)	default y
88928575c61SSteven Rostedt (VMware)	help
89028575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
89128575c61SSteven Rostedt (VMware)	  recursion happens it wont cause harm because of the protection,
89228575c61SSteven Rostedt (VMware)	  but it does cause an unwanted overhead. Enabling this option will
89328575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
89428575c61SSteven Rostedt (VMware)	  file.
89528575c61SSteven Rostedt (VMware)
89628575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
89728575c61SSteven Rostedt (VMware)
8981e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
8991e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
9001e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
9011e837945SSteven Rostedt (VMware)	help
9021e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
9031e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
9041e837945SSteven Rostedt (VMware)
9051e837945SSteven Rostedt (VMware)	  If unsure, say N.
9061e837945SSteven Rostedt (VMware)
9071e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
9081e837945SSteven Rostedt (VMware)	  run significantly slower.
9091e837945SSteven Rostedt (VMware)
9101e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
9111e837945SSteven Rostedt (VMware)	bool
9121e837945SSteven Rostedt (VMware)
9131e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
9141e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
9151e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
9161e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
9171e837945SSteven Rostedt (VMware)	help
9181e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
9191e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
9201e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
9211e837945SSteven Rostedt (VMware)	  tracers of ftrace.
9221e837945SSteven Rostedt (VMware)
9231e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
9241e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
9251e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
9261e837945SSteven Rostedt (VMware)	default y
9271e837945SSteven Rostedt (VMware)	help
9281e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
9291e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
9301e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
9311e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
9321e837945SSteven Rostedt (VMware)
9331e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
9341e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
9351e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
9361e837945SSteven Rostedt (VMware)	help
9371e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
9381e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
9391e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
9401e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
9411e837945SSteven Rostedt (VMware)
9421e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
9431e837945SSteven Rostedt (VMware)	       events
9441e837945SSteven Rostedt (VMware)
9458147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
9468147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
9478147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
9486b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
9498147dc78SSteven Rostedt (VMware)       help
9508147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
9518147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
9528147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
9538147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
9548147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
9558147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
9568147dc78SSteven Rostedt (VMware)
9578147dc78SSteven Rostedt (VMware)	 If unsure, say N
9588147dc78SSteven Rostedt (VMware)
9596c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
9606c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
9616c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
9626c43e554SSteven Rostedt (Red Hat)       help
9636c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
9646c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
9656c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
9666c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
9676c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
9686c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
9696c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
9706c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
9716c43e554SSteven Rostedt (Red Hat)
9726c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
9736c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
9746c43e554SSteven Rostedt (Red Hat)
9756c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
9766c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
9776c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
9786c43e554SSteven Rostedt (Red Hat)	 other similar details.
9796c43e554SSteven Rostedt (Red Hat)
9806c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
9816c43e554SSteven Rostedt (Red Hat)
9825b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
9835b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
9845b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
9855b7be9c7SSteven Rostedt (VMware)	help
9865b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
9875b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
9885b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
9895b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
9905b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
9915b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
9925b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
9935b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
9945b7be9c7SSteven Rostedt (VMware)
9955b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
9965b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
9975b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
9985b7be9c7SSteven Rostedt (VMware)
9995b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
10005b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
10015b7be9c7SSteven Rostedt (VMware)
1002a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
1003a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
1004a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
1005a48fc4f5SSteven Rostedt (VMware)	help
1006a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
1007a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
1008a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
1009a48fc4f5SSteven Rostedt (VMware)
1010a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
1011a48fc4f5SSteven Rostedt (VMware)
1012f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
1013a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
1014f96e8577SJoel Fernandes (Google)	depends on m
1015f96e8577SJoel Fernandes (Google)	help
1016f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
1017f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
1018f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
1019f96e8577SJoel Fernandes (Google)	  critical section.
1020f96e8577SJoel Fernandes (Google)
102179393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
102279393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
102379393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1024f96e8577SJoel Fernandes (Google)
10254b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
10264b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
10274b9091e1SSong Chen	  command.
10284b9091e1SSong Chen
1029f96e8577SJoel Fernandes (Google)	  If unsure, say N
1030f96e8577SJoel Fernandes (Google)
10319fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
10329fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
1033726721a5STom Zanussi	depends on SYNTH_EVENTS
10349fe41efaSTom Zanussi	help
10359fe41efaSTom Zanussi          This option creates a test module to check the base
10369fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
10379fe41efaSTom Zanussi          generation.
10389fe41efaSTom Zanussi
10399fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
10409fe41efaSTom Zanussi	  for the generated sample events.
10419fe41efaSTom Zanussi
10429fe41efaSTom Zanussi	  If unsure, say N.
10439fe41efaSTom Zanussi
104464836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
104564836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
104664836248STom Zanussi	depends on KPROBE_EVENTS
104764836248STom Zanussi	help
104864836248STom Zanussi          This option creates a test module to check the base
104964836248STom Zanussi          functionality of in-kernel kprobe event definition.
105064836248STom Zanussi
105164836248STom Zanussi          To test, insert the module, and then check the trace buffer
105264836248STom Zanussi	  for the generated kprobe events.
105364836248STom Zanussi
105464836248STom Zanussi	  If unsure, say N.
105564836248STom Zanussi
10562d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
10572d19bd79STom Zanussi	bool "Hist trigger debug support"
10582d19bd79STom Zanussi	depends on HIST_TRIGGERS
10592d19bd79STom Zanussi	help
10602d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
10612d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
10622d19bd79STom Zanussi          defined on that event.
10632d19bd79STom Zanussi
10642d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
10652d19bd79STom Zanussi
10662d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
10672d19bd79STom Zanussi
10682d19bd79STom Zanussi            - Provides educational information to support the details
10692d19bd79STom Zanussi              of the hist trigger internals as described by
10702d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
10712d19bd79STom Zanussi
10722d19bd79STom Zanussi          The hist_debug output only covers the data structures
10732d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
10742d19bd79STom Zanussi          display the internals of map buckets or variable values of
10752d19bd79STom Zanussi          running histograms.
10762d19bd79STom Zanussi
10772d19bd79STom Zanussi          If unsure, say N.
10782d19bd79STom Zanussi
10794ed9f071SSteven Rostedtendif # FTRACE
1080