xref: /linux/kernel/trace/Kconfig (revision e25e43a4e5d8cb2323553d8b6a7ba08d2ebab21f)
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
1354ecbe6fSMasami Hiramatsuconfig HAVE_RETHOOK
1454ecbe6fSMasami Hiramatsu	bool
1554ecbe6fSMasami Hiramatsu
1654ecbe6fSMasami Hiramatsuconfig RETHOOK
1754ecbe6fSMasami Hiramatsu	bool
1854ecbe6fSMasami Hiramatsu	depends on HAVE_RETHOOK
1954ecbe6fSMasami Hiramatsu	help
2054ecbe6fSMasami Hiramatsu	  Enable generic return hooking feature. This is an internal
2154ecbe6fSMasami Hiramatsu	  API, which will be used by other function-entry hooking
2254ecbe6fSMasami Hiramatsu	  features like fprobe and kprobes.
2354ecbe6fSMasami Hiramatsu
24606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
2516444a8aSArnaldo Carvalho de Melo	bool
26555f386cSMike Frysinger	help
275fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
28bc0c38d1SSteven Rostedt
29fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER
3015e6cb36SFrederic Weisbecker	bool
31555f386cSMike Frysinger	help
325fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
3315e6cb36SFrederic Weisbecker
34677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
35677aa9f7SSteven Rostedt	bool
36555f386cSMike Frysinger	help
375fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
38677aa9f7SSteven Rostedt
3906aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
4006aeaaeaSMasami Hiramatsu	bool
4106aeaaeaSMasami Hiramatsu
42763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
43763e34e7SSteven Rostedt (VMware)	bool
44763e34e7SSteven Rostedt (VMware)
4502a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS
4602a474caSSteven Rostedt (VMware)	bool
4702a474caSSteven Rostedt (VMware)	help
4802a474caSSteven Rostedt (VMware)	 If this is set, then arguments and stack can be found from
4902a474caSSteven Rostedt (VMware)	 the pt_regs passed into the function callback regs parameter
5002a474caSSteven Rostedt (VMware)	 by default, even without setting the REGS flag in the ftrace_ops.
5102a474caSSteven Rostedt (VMware)	 This allows for use of regs_get_kernel_argument() and
5202a474caSSteven Rostedt (VMware)	 kernel_stack_pointer().
5302a474caSSteven Rostedt (VMware)
549440155cSPeter Zijlstra (Intel)config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
559440155cSPeter Zijlstra (Intel)	bool
569440155cSPeter Zijlstra (Intel)	help
579440155cSPeter Zijlstra (Intel)	  If the architecture generates __patchable_function_entries sections
589440155cSPeter Zijlstra (Intel)	  but does not want them included in the ftrace locations.
599440155cSPeter Zijlstra (Intel)
608da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
618da3821bSSteven Rostedt	bool
62555f386cSMike Frysinger	help
635fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
648da3821bSSteven Rostedt
6566700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
66ee08c6ecSFrederic Weisbecker	bool
67555f386cSMike Frysinger	help
685fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
69ee08c6ecSFrederic Weisbecker
70a2546faeSSteven Rostedtconfig HAVE_FENTRY
71a2546faeSSteven Rostedt	bool
72a2546faeSSteven Rostedt	help
73a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
74a2546faeSSteven Rostedt
752f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
762f4df001SVasily Gorbik	bool
772f4df001SVasily Gorbik	help
782f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
792f4df001SVasily Gorbik
8022c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT
8122c8542dSSami Tolvanen	bool
8222c8542dSSami Tolvanen	help
8322c8542dSSami Tolvanen	  Arch supports objtool --mcount
8422c8542dSSami Tolvanen
85cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
8672441cb1SSteven Rostedt	bool
8772441cb1SSteven Rostedt	help
8872441cb1SSteven Rostedt	  C version of recordmcount available?
8972441cb1SSteven Rostedt
904ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT
914ed308c4SSteven Rostedt (Google)       bool
924ed308c4SSteven Rostedt (Google)       help
934ed308c4SSteven Rostedt (Google)         An architecture selects this if it sorts the mcount_loc section
944ed308c4SSteven Rostedt (Google)	 at build time.
954ed308c4SSteven Rostedt (Google)
966b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
976b9b6413SSteven Rostedt (Google)       bool
986b9b6413SSteven Rostedt (Google)       default y
994ed308c4SSteven Rostedt (Google)       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
1006b9b6413SSteven Rostedt (Google)       help
1016b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
1026b9b6413SSteven Rostedt (Google)
103352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
104352ad25aSSteven Rostedt	bool
105352ad25aSSteven Rostedt
106ea632e9fSJosh Triplettconfig TRACE_CLOCK
107ea632e9fSJosh Triplett	bool
108ea632e9fSJosh Triplett
1097a8e76a3SSteven Rostedtconfig RING_BUFFER
1107a8e76a3SSteven Rostedt	bool
111ea632e9fSJosh Triplett	select TRACE_CLOCK
11222287688SSteven Rostedt (Red Hat)	select IRQ_WORK
1137a8e76a3SSteven Rostedt
1145f77a88bSTom Zanussiconfig EVENT_TRACING
115b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
11660f1d5e3SMasami Hiramatsu	select GLOB
117b11c53e1SZhaolei	bool
118b11c53e1SZhaolei
119b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
1205f77a88bSTom Zanussi	bool
1215f77a88bSTom Zanussi
12285bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
12385bac32cSSteven Rostedt	bool
12485bac32cSSteven Rostedt	help
12585bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
12685bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
12785bac32cSSteven Rostedt
128c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
129c3bc8fd6SJoel Fernandes (Google)	bool
130c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
131c3bc8fd6SJoel Fernandes (Google)	select TRACING
132c3bc8fd6SJoel Fernandes (Google)	default y
133c3bc8fd6SJoel Fernandes (Google)	help
134c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
135c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
136c3bc8fd6SJoel Fernandes (Google)
1375e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1385e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1395e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1405e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1415e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
14240892367SRandy Dunlap# hiding of the automatic options.
1435e0a0939SSteven Rostedt
144bc0c38d1SSteven Rostedtconfig TRACING
145bc0c38d1SSteven Rostedt	bool
1467a8e76a3SSteven Rostedt	select RING_BUFFER
147c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1485f87f112SIngo Molnar	select TRACEPOINTS
149f3384b28SSteven Rostedt	select NOP_TRACER
150769b0441SFrederic Weisbecker	select BINARY_PRINTF
1515f77a88bSTom Zanussi	select EVENT_TRACING
152ea632e9fSJosh Triplett	select TRACE_CLOCK
153835f14edSPaul E. McKenney	select TASKS_RCU if PREEMPTION
154bc0c38d1SSteven Rostedt
1555e0a0939SSteven Rostedtconfig GENERIC_TRACER
1565e0a0939SSteven Rostedt	bool
1575e0a0939SSteven Rostedt	select TRACING
1585e0a0939SSteven Rostedt
15940ada30fSIngo Molnar#
16040ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
16140ada30fSIngo Molnar# be able to offer generic tracing facilities:
16240ada30fSIngo Molnar#
16340ada30fSIngo Molnarconfig TRACING_SUPPORT
16440ada30fSIngo Molnar	bool
1650ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
16640ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
167422d3c7aSKOSAKI Motohiro	default y
16840ada30fSIngo Molnar
1694ed9f071SSteven Rostedtmenuconfig FTRACE
1704ed9f071SSteven Rostedt	bool "Tracers"
171de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
17265b77242SSteven Rostedt	default y if DEBUG_KERNEL
1734ed9f071SSteven Rostedt	help
1744ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1754ed9f071SSteven Rostedt
1764ed9f071SSteven Rostedtif FTRACE
17717d80fd0SPeter Zijlstra
1781e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
1791e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
180d8a953ddSMasami Hiramatsu	depends on TRACING
181d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
1821e837945SSteven Rostedt (VMware)	help
1831e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
1841e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
1851e837945SSteven Rostedt (VMware)	  initialization and boot process.
1861e837945SSteven Rostedt (VMware)
187606576ceSSteven Rostedtconfig FUNCTION_TRACER
1881b29b018SSteven Rostedt	bool "Kernel Function Tracer"
189606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1904d7a077cSSteven Rostedt	select KALLSYMS
1915e0a0939SSteven Rostedt	select GENERIC_TRACER
19235e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
19360f1d5e3SMasami Hiramatsu	select GLOB
19401b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
195e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
1961b29b018SSteven Rostedt	help
1971b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1981b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
19940892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
2001b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
2011b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
2021b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
2030a6d7d45SSteven Rostedt (Google)	  small and not measurable even in micro-benchmarks (at least on
2040a6d7d45SSteven Rostedt (Google)	  x86, but may have impact on other architectures).
20535e8e302SSteven Rostedt
206fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
207fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
208fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
20915e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
210eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
211764f3b95SIngo Molnar	default y
21215e6cb36SFrederic Weisbecker	help
213fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
214fb52607aSFrederic Weisbecker	  and its entry.
215692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
216692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
217692105b8SMatt LaPlante	  the return value. This is done by setting the current return
218692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
21915e6cb36SFrederic Weisbecker
22061778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
22161778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
22261778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
22361778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
22461778cd7SSteven Rostedt (VMware)	default y
22561778cd7SSteven Rostedt (VMware)	help
22661778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
22761778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
22861778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
22961778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
23061778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
23161778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
23261778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
23361778cd7SSteven Rostedt (VMware)	  performance of the system.
23461778cd7SSteven Rostedt (VMware)
23561778cd7SSteven Rostedt (VMware)	  See the files in /sys/kernel/debug/tracing:
23661778cd7SSteven Rostedt (VMware)	    available_filter_functions
23761778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
23861778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
23961778cd7SSteven Rostedt (VMware)
24061778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
24161778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
24261778cd7SSteven Rostedt (VMware)
24361778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
24461778cd7SSteven Rostedt (VMware)	def_bool y
24561778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
24661778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
24761778cd7SSteven Rostedt (VMware)
24861778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
24961778cd7SSteven Rostedt (VMware)	def_bool y
25049a962c0SNaveen N. Rao	depends on DYNAMIC_FTRACE_WITH_REGS
25161778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
25261778cd7SSteven Rostedt (VMware)
25312f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
25412f9951dSLukas Bulwahn	def_bool y
25512f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
25612f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
25712f9951dSLukas Bulwahn
258cad9931fSMasami Hiramatsuconfig FPROBE
259cad9931fSMasami Hiramatsu	bool "Kernel Function Probe (fprobe)"
260cad9931fSMasami Hiramatsu	depends on FUNCTION_TRACER
261cad9931fSMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
2625b0ab789SMasami Hiramatsu	depends on HAVE_RETHOOK
2635b0ab789SMasami Hiramatsu	select RETHOOK
264cad9931fSMasami Hiramatsu	default n
265cad9931fSMasami Hiramatsu	help
2665b0ab789SMasami Hiramatsu	  This option enables kernel function probe (fprobe) based on ftrace.
2675b0ab789SMasami Hiramatsu	  The fprobe is similar to kprobes, but probes only for kernel function
2685b0ab789SMasami Hiramatsu	  entries and exits. This also can probe multiple functions by one
2695b0ab789SMasami Hiramatsu	  fprobe.
270cad9931fSMasami Hiramatsu
271cad9931fSMasami Hiramatsu	  If unsure, say N.
272cad9931fSMasami Hiramatsu
27361778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
27461778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
27561778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
27661778cd7SSteven Rostedt (VMware)	default n
27761778cd7SSteven Rostedt (VMware)	help
27861778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
27961778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
28061778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
28161778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
28261778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
28361778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
28461778cd7SSteven Rostedt (VMware)
28561778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
28661778cd7SSteven Rostedt (VMware)
28761778cd7SSteven Rostedt (VMware)config STACK_TRACER
28861778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
28961778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
29061778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
29161778cd7SSteven Rostedt (VMware)	select STACKTRACE
29261778cd7SSteven Rostedt (VMware)	select KALLSYMS
29361778cd7SSteven Rostedt (VMware)	help
29461778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
29561778cd7SSteven Rostedt (VMware)	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
29661778cd7SSteven Rostedt (VMware)
29761778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
29861778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
29961778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
30061778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
30161778cd7SSteven Rostedt (VMware)	  is disabled.
30261778cd7SSteven Rostedt (VMware)
30361778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
30461778cd7SSteven Rostedt (VMware)	  on the kernel command line.
30561778cd7SSteven Rostedt (VMware)
30661778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
30761778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
30861778cd7SSteven Rostedt (VMware)
30961778cd7SSteven Rostedt (VMware)	  Say N if unsure.
31061778cd7SSteven Rostedt (VMware)
311c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
312c3bc8fd6SJoel Fernandes (Google)	bool
313c3bc8fd6SJoel Fernandes (Google)	help
314c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
315c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
316bac429f0SSteven Rostedt
31781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
31881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
31981d68a96SSteven Rostedt	default n
32081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
32181d68a96SSteven Rostedt	select TRACE_IRQFLAGS
3225e0a0939SSteven Rostedt	select GENERIC_TRACER
32381d68a96SSteven Rostedt	select TRACER_MAX_TRACE
32485bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
32522cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3260b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
32781d68a96SSteven Rostedt	help
32881d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
32981d68a96SSteven Rostedt	  sections, with microsecond accuracy.
33081d68a96SSteven Rostedt
33181d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
33281d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
33381d68a96SSteven Rostedt	  via:
33481d68a96SSteven Rostedt
335156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
33681d68a96SSteven Rostedt
33740892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3386cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
3396cd8a4bbSSteven Rostedt	  used together or separately.)
3406cd8a4bbSSteven Rostedt
3416cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
3426cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
3436cd8a4bbSSteven Rostedt	default n
34430c93704SThomas Gleixner	depends on PREEMPTION
3455e0a0939SSteven Rostedt	select GENERIC_TRACER
3466cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
34785bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
34822cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3490b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
350c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
3516cd8a4bbSSteven Rostedt	help
35240892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
3536cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
3546cd8a4bbSSteven Rostedt
3556cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
3566cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
3576cd8a4bbSSteven Rostedt	  via:
3586cd8a4bbSSteven Rostedt
359156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
3606cd8a4bbSSteven Rostedt
36140892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3626cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
3636cd8a4bbSSteven Rostedt	  used together or separately.)
3646cd8a4bbSSteven Rostedt
365352ad25aSSteven Rostedtconfig SCHED_TRACER
366352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
3675e0a0939SSteven Rostedt	select GENERIC_TRACER
368352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
369352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
37022cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
371352ad25aSSteven Rostedt	help
372352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
373352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
374352ad25aSSteven Rostedt
375e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
376e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
377e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
378*e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
379e7c15cd8SSteven Rostedt (Red Hat)	help
380e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
381c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
382e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
383e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
384e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
385e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
386e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
387e7c15cd8SSteven Rostedt (Red Hat)
388e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
389e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
390e7c15cd8SSteven Rostedt (Red Hat)
391e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
392e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
393e7c15cd8SSteven Rostedt (Red Hat)				     iteration
394e7c15cd8SSteven Rostedt (Red Hat)
395e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
396c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
397e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
398e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
399e7c15cd8SSteven Rostedt (Red Hat)
400e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
401e7c15cd8SSteven Rostedt (Red Hat)
402e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
403e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
404e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
405e7c15cd8SSteven Rostedt (Red Hat)	 production system.
406e7c15cd8SSteven Rostedt (Red Hat)
407e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
408e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
409e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
410e7c15cd8SSteven Rostedt (Red Hat)
411bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
412bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
413bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
414*e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
415bce29ac9SDaniel Bristot de Oliveira	help
416bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
417bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
418bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
419bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
420bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
421bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
422bce29ac9SDaniel Bristot de Oliveira
423bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
424bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
425bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
426bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
427bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
428bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
429bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
430bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
431bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
432bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
433bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
434bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
435bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
436bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
437bce29ac9SDaniel Bristot de Oliveira
438bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
439bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
440bce29ac9SDaniel Bristot de Oliveira
441bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
442bce29ac9SDaniel Bristot de Oliveira
443bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
444bce29ac9SDaniel Bristot de Oliveira          file.
445bce29ac9SDaniel Bristot de Oliveira
446a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
447a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
448a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
449a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
450a955d7eaSDaniel Bristot de Oliveira	help
451a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
452a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
453a955d7eaSDaniel Bristot de Oliveira
454a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
455a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
456a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
457a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
458a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
459a955d7eaSDaniel Bristot de Oliveira	  to expire.
460a955d7eaSDaniel Bristot de Oliveira
461a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
462a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
463a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
464a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
465a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
466a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
467a955d7eaSDaniel Bristot de Oliveira
468a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
469a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
470a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
471a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
472a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
473a955d7eaSDaniel Bristot de Oliveira
47421b3ce30SSteven Rostedt (VMware)config MMIOTRACE
47521b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
47621b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
47721b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
47821b3ce30SSteven Rostedt (VMware)	help
47921b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
48021b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
48121b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
48221b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
48321b3ce30SSteven Rostedt (VMware)
48421b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
48521b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
48621b3ce30SSteven Rostedt (VMware)
487897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
488897f17a6SSteven Rostedt	bool "Trace process context switches and events"
4895e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
490b77e38aaSSteven Rostedt	select TRACING
491b77e38aaSSteven Rostedt	help
49240892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
493b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
494897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
495a7abe97fSSteven Rostedt
496ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
497ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
49866700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
4995e0a0939SSteven Rostedt	select GENERIC_TRACER
5000ea1c415SFrederic Weisbecker	select KALLSYMS
501ee08c6ecSFrederic Weisbecker	help
502ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
503ee08c6ecSFrederic Weisbecker
504debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
505debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
506debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
507debdd57fSHiraku Toyooka	help
508debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
509debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
510debdd57fSHiraku Toyooka
511debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
512debdd57fSHiraku Toyooka	      cat snapshot
513debdd57fSHiraku Toyooka
5140b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
5150b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
5160b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
5170b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
5180b85ffc2SSteven Rostedt (Red Hat)	help
5190b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
5200b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
5210b85ffc2SSteven Rostedt (Red Hat)	  allowed:
5220b85ffc2SSteven Rostedt (Red Hat)
5230b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
5240b85ffc2SSteven Rostedt (Red Hat)
5250b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
5260b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
5270b85ffc2SSteven Rostedt (Red Hat)
5280b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
5290b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
5300b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
5310b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
5320b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
5330b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
5340b85ffc2SSteven Rostedt (Red Hat)
5352ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
5369ae5b879SSteven Rostedt	bool
5375e0a0939SSteven Rostedt	select GENERIC_TRACER
5389ae5b879SSteven Rostedt
5399ae5b879SSteven Rostedtchoice
5409ae5b879SSteven Rostedt	prompt "Branch Profiling"
5419ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
5429ae5b879SSteven Rostedt	help
5439ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
5449ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
5459ae5b879SSteven Rostedt
5469ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
5479ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
5489ae5b879SSteven Rostedt
54940892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
5509ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
55140892367SRandy Dunlap	 profiler.
5529ae5b879SSteven Rostedt
55340892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
55440892367SRandy Dunlap	 If unsure, choose "No branch profiling".
5559ae5b879SSteven Rostedt
5569ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
5579ae5b879SSteven Rostedt	bool "No branch profiling"
5589ae5b879SSteven Rostedt	help
5599ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
5609ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
5619ae5b879SSteven Rostedt	  Otherwise keep it disabled.
5629ae5b879SSteven Rostedt
5639ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
5649ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
5659ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5661f0d69a9SSteven Rostedt	help
56759bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
5681f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
5691f0d69a9SSteven Rostedt
57013e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
5711f0d69a9SSteven Rostedt
57240892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
5731f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
5741f0d69a9SSteven Rostedt
5752bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
57668e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
5779ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5782bcd521aSSteven Rostedt	help
5792bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
5802bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
5812bcd521aSSteven Rostedt	  The results will be displayed in:
5822bcd521aSSteven Rostedt
58313e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
5842bcd521aSSteven Rostedt
5859ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
5869ae5b879SSteven Rostedt
5872bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
5882bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
58940892367SRandy Dunlap	  is to be analyzed in much detail.
5909ae5b879SSteven Rostedtendchoice
5912bcd521aSSteven Rostedt
5922ed84eebSSteven Rostedtconfig TRACING_BRANCHES
59352f232cbSSteven Rostedt	bool
59452f232cbSSteven Rostedt	help
59552f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
59652f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
59752f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
59852f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
59952f232cbSSteven Rostedt
6002ed84eebSSteven Rostedtconfig BRANCH_TRACER
60152f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
6022ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
6032ed84eebSSteven Rostedt	select TRACING_BRANCHES
60452f232cbSSteven Rostedt	help
60552f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
60652f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
60752f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
60852f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
60952f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
61052f232cbSSteven Rostedt	  events happened, as well as their results.
61152f232cbSSteven Rostedt
61252f232cbSSteven Rostedt	  Say N if unsure.
61352f232cbSSteven Rostedt
6142db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
61540892367SRandy Dunlap	bool "Support for tracing block IO actions"
6162db270a8SFrederic Weisbecker	depends on SYSFS
6171dfba05dSIngo Molnar	depends on BLOCK
6182db270a8SFrederic Weisbecker	select RELAY
6192db270a8SFrederic Weisbecker	select DEBUG_FS
6202db270a8SFrederic Weisbecker	select TRACEPOINTS
6215e0a0939SSteven Rostedt	select GENERIC_TRACER
6222db270a8SFrederic Weisbecker	select STACKTRACE
6232db270a8SFrederic Weisbecker	help
6242db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
6252db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
6262db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
6272db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
6282db270a8SFrederic Weisbecker
6292db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
6302db270a8SFrederic Weisbecker
6312db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
6322db270a8SFrederic Weisbecker
6332db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
6342db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
6352db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
6362db270a8SFrederic Weisbecker
6372db270a8SFrederic Weisbecker	  If unsure, say N.
63836994e58SFrederic Weisbecker
6396b0b7551SAnton Blanchardconfig KPROBE_EVENTS
640413d37d1SMasami Hiramatsu	depends on KPROBES
641f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
64277b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
643413d37d1SMasami Hiramatsu	select TRACING
6448ab83f56SSrikar Dronamraju	select PROBE_EVENTS
6456212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
64677b44d1bSMasami Hiramatsu	default y
647413d37d1SMasami Hiramatsu	help
64840892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
64940892367SRandy Dunlap	  on the fly via the ftrace interface. See
6505fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
65177b44d1bSMasami Hiramatsu
65277b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
65377b44d1bSMasami Hiramatsu	  various register and memory values.
65477b44d1bSMasami Hiramatsu
65540892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
65640892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
657413d37d1SMasami Hiramatsu
65845408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
65945408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
66045408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
6617bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
66245408c4fSMasami Hiramatsu	default n
66345408c4fSMasami Hiramatsu	help
66445408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
66545408c4fSMasami Hiramatsu	  using kprobe events.
66645408c4fSMasami Hiramatsu
66745408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
66828cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
66945408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
67045408c4fSMasami Hiramatsu	  crash.
67145408c4fSMasami Hiramatsu
67245408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
67345408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
67445408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
67545408c4fSMasami Hiramatsu
67645408c4fSMasami Hiramatsu	  If unsure, say N.
67745408c4fSMasami Hiramatsu
6786b0b7551SAnton Blanchardconfig UPROBE_EVENTS
679f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
680f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
681f3f096cfSSrikar Dronamraju	depends on MMU
68209294e31SDavid A. Long	depends on PERF_EVENTS
683f3f096cfSSrikar Dronamraju	select UPROBES
684f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
6850597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
686f3f096cfSSrikar Dronamraju	select TRACING
68761f35d75SArnaldo Carvalho de Melo	default y
688f3f096cfSSrikar Dronamraju	help
689f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
690f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
691f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
692f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
693f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
694f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
695f3f096cfSSrikar Dronamraju
696e1abf2ccSIngo Molnarconfig BPF_EVENTS
697e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
6986b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
699e1abf2ccSIngo Molnar	bool
700e1abf2ccSIngo Molnar	default y
701e1abf2ccSIngo Molnar	help
7025cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
7035cbd22c1SPeter Wu	  tracepoint events.
704e1abf2ccSIngo Molnar
7055448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
7065448d44cSMasami Hiramatsu	def_bool n
7075448d44cSMasami Hiramatsu
7088ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
7098ab83f56SSrikar Dronamraju	def_bool n
7108ab83f56SSrikar Dronamraju
7119802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
7129802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
7139802d865SJosef Bacik	depends on BPF_EVENTS
714540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
7159802d865SJosef Bacik	default n
7169802d865SJosef Bacik	help
7179802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
7189802d865SJosef Bacik	 set a different return value.  This is used for error injection.
7199802d865SJosef Bacik
7208da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
7218da3821bSSteven Rostedt	def_bool y
7228da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
7238da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
7248da3821bSSteven Rostedt
7253b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7263b15cdc1SSami Tolvanen	bool
7273b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7283b15cdc1SSami Tolvanen
7293b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
7303b15cdc1SSami Tolvanen	def_bool y
7313b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
7323b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7333b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7343b15cdc1SSami Tolvanen
73522c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
73622c8542dSSami Tolvanen	def_bool y
73722c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
73822c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
73922c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
74022c8542dSSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
74103f16cd0SJosh Poimboeuf	select OBJTOOL
74222c8542dSSami Tolvanen
7433b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
7443b15cdc1SSami Tolvanen	def_bool y
7453b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7463b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
74722c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
7483b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7493b15cdc1SSami Tolvanen
75008d43a5fSTom Zanussiconfig TRACING_MAP
75108d43a5fSTom Zanussi	bool
75208d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
75308d43a5fSTom Zanussi	help
75408d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
75508d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
75608d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
75708d43a5fSTom Zanussi	  generally used outside of that context, and is normally
75808d43a5fSTom Zanussi	  selected by tracers that use it.
75908d43a5fSTom Zanussi
760726721a5STom Zanussiconfig SYNTH_EVENTS
761726721a5STom Zanussi	bool "Synthetic trace events"
762726721a5STom Zanussi	select TRACING
763726721a5STom Zanussi	select DYNAMIC_EVENTS
764726721a5STom Zanussi	default n
765726721a5STom Zanussi	help
766726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
767726721a5STom Zanussi	  used to combine data from other trace events or in fact any
768726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
769726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
770726721a5STom Zanussi	  by way of an in-kernel API.
771726721a5STom Zanussi
772726721a5STom Zanussi	  See Documentation/trace/events.rst or
773726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
774726721a5STom Zanussi
775726721a5STom Zanussi	  If in doubt, say N.
776726721a5STom Zanussi
7777f5a08c7SBeau Belgraveconfig USER_EVENTS
7787f5a08c7SBeau Belgrave	bool "User trace events"
7797f5a08c7SBeau Belgrave	select TRACING
7807f5a08c7SBeau Belgrave	select DYNAMIC_EVENTS
7811cd927adSSteven Rostedt (Google)	depends on BROKEN || COMPILE_TEST # API needs to be straighten out
7827f5a08c7SBeau Belgrave	help
7837f5a08c7SBeau Belgrave	  User trace events are user-defined trace events that
7847f5a08c7SBeau Belgrave	  can be used like an existing kernel trace event.  User trace
7857f5a08c7SBeau Belgrave	  events are generated by writing to a tracefs file.  User
7867f5a08c7SBeau Belgrave	  processes can determine if their tracing events should be
7877f5a08c7SBeau Belgrave	  generated by memory mapping a tracefs file and checking for
7887f5a08c7SBeau Belgrave	  an associated byte being non-zero.
7897f5a08c7SBeau Belgrave
7907f5a08c7SBeau Belgrave	  If in doubt, say N.
7917f5a08c7SBeau Belgrave
7927ef224d1STom Zanussiconfig HIST_TRIGGERS
7937ef224d1STom Zanussi	bool "Histogram triggers"
7947ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
7957ef224d1STom Zanussi	select TRACING_MAP
7967ad8fb61STom Zanussi	select TRACING
7977bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
798726721a5STom Zanussi	select SYNTH_EVENTS
7997ef224d1STom Zanussi	default n
8007ef224d1STom Zanussi	help
8017ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
8027ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
8037ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
8047ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
8057ef224d1STom Zanussi	  event activity as an initial guide for further investigation
8067ef224d1STom Zanussi	  using more advanced tools.
8077ef224d1STom Zanussi
80889e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
80989e270c1STom Zanussi	  supported using hist triggers under this option.
81089e270c1STom Zanussi
811ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
8127ef224d1STom Zanussi	  If in doubt, say N.
8137ef224d1STom Zanussi
8146c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
8156c3edaf9SCong Wang	bool "Trace event injection"
8166c3edaf9SCong Wang	depends on TRACING
8176c3edaf9SCong Wang	help
8186c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
8196c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
8206c3edaf9SCong Wang
8216c3edaf9SCong Wang	  If unsure, say N.
8226c3edaf9SCong Wang
82381dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
82481dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
82581dc9f0eSSteven Rostedt (Red Hat)	help
82681dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
82781dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
82869268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
82981dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
83081dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
83181dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
83281dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
83381dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
83481dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
83581dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
83681dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
83781dc9f0eSSteven Rostedt (Red Hat)
83881dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
83981dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
84081dc9f0eSSteven Rostedt (Red Hat)
84181dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
84281dc9f0eSSteven Rostedt (Red Hat)
84381dc9f0eSSteven Rostedt (Red Hat)	      START
84481dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
84581dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
84681dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
84781dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
84881dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
84981dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
85081dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
85181dc9f0eSSteven Rostedt (Red Hat)
85281dc9f0eSSteven Rostedt (Red Hat)
8535092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
8545092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
8555092dbc9SSteven Rostedt	depends on RING_BUFFER
8565092dbc9SSteven Rostedt	help
8575092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
85840892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
8595092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
8605092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
8615092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
8625092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
8635092dbc9SSteven Rostedt
8645092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
8655092dbc9SSteven Rostedt	  affected by processes that are running.
8665092dbc9SSteven Rostedt
86740892367SRandy Dunlap	  If unsure, say N.
8685092dbc9SSteven Rostedt
8691e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
8701e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
8711e837945SSteven Rostedt (VMware)       depends on TRACING
8721e837945SSteven Rostedt (VMware)       help
8731e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
8741e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
8751e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
8761e837945SSteven Rostedt (VMware)	how to convert the string to its value.
8771e837945SSteven Rostedt (VMware)
8781e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
8791e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
8801e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
8811e837945SSteven Rostedt (VMware)
8821e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
8831e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
8841e837945SSteven Rostedt (VMware)
8851e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
8861e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
8871e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
8881e837945SSteven Rostedt (VMware)	belong too.
8891e837945SSteven Rostedt (VMware)
8901e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
8911e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
8921e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
8931e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
8941e837945SSteven Rostedt (VMware)
8951e837945SSteven Rostedt (VMware)	If unsure, say N.
8961e837945SSteven Rostedt (VMware)
897773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
898773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
899773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
900773c1670SSteven Rostedt (VMware)	help
901773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
902773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
903773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
904773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
905773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
906773c1670SSteven Rostedt (VMware)
907773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
908773c1670SSteven Rostedt (VMware)
909773c1670SSteven Rostedt (VMware)	  If unsure, say N
910773c1670SSteven Rostedt (VMware)
911773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
912773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
913773c1670SSteven Rostedt (VMware)	default	128
914773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
915773c1670SSteven Rostedt (VMware)	help
916773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
917773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
918773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
919773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
920773c1670SSteven Rostedt (VMware)	  size at runtime.
921773c1670SSteven Rostedt (VMware)
92228575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
92328575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
92428575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
92528575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
92628575c61SSteven Rostedt (VMware)	default y
92728575c61SSteven Rostedt (VMware)	help
92828575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
92928575c61SSteven Rostedt (VMware)	  recursion happens it wont cause harm because of the protection,
93028575c61SSteven Rostedt (VMware)	  but it does cause an unwanted overhead. Enabling this option will
93128575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
93228575c61SSteven Rostedt (VMware)	  file.
93328575c61SSteven Rostedt (VMware)
93428575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
93528575c61SSteven Rostedt (VMware)
9361e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
9371e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
9381e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
9391e837945SSteven Rostedt (VMware)	help
9401e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
9411e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
9421e837945SSteven Rostedt (VMware)
9431e837945SSteven Rostedt (VMware)	  If unsure, say N.
9441e837945SSteven Rostedt (VMware)
9451e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
9461e837945SSteven Rostedt (VMware)	  run significantly slower.
9471e837945SSteven Rostedt (VMware)
9481e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
9491e837945SSteven Rostedt (VMware)	bool
9501e837945SSteven Rostedt (VMware)
9511e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
9521e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
9531e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
9541e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
9551e837945SSteven Rostedt (VMware)	help
9561e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
9571e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
9581e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
9591e837945SSteven Rostedt (VMware)	  tracers of ftrace.
9601e837945SSteven Rostedt (VMware)
9611e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
9621e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
9631e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
9641e837945SSteven Rostedt (VMware)	default y
9651e837945SSteven Rostedt (VMware)	help
9661e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
9671e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
9681e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
9691e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
9701e837945SSteven Rostedt (VMware)
9711e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
9721e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
9731e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
9741e837945SSteven Rostedt (VMware)	help
9751e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
9761e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
9771e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
9781e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
9791e837945SSteven Rostedt (VMware)
9801e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
9811e837945SSteven Rostedt (VMware)	       events
9821e837945SSteven Rostedt (VMware)
9838147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
9848147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
9858147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
9866b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
9878147dc78SSteven Rostedt (VMware)       help
9888147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
9898147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
9908147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
9918147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
9928147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
9938147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
9948147dc78SSteven Rostedt (VMware)
9958147dc78SSteven Rostedt (VMware)	 If unsure, say N
9968147dc78SSteven Rostedt (VMware)
9976c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
9986c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
9996c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
10006c43e554SSteven Rostedt (Red Hat)       help
10016c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
10026c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
10036c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
10046c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
10056c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
10066c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
10076c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
10086c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
10096c43e554SSteven Rostedt (Red Hat)
10106c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
10116c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
10126c43e554SSteven Rostedt (Red Hat)
10136c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
10146c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
10156c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
10166c43e554SSteven Rostedt (Red Hat)	 other similar details.
10176c43e554SSteven Rostedt (Red Hat)
10186c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
10196c43e554SSteven Rostedt (Red Hat)
10205b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
10215b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
10225b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
10235b7be9c7SSteven Rostedt (VMware)	help
10245b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
10255b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
10265b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
10275b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
10285b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
10295b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
10305b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
10315b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
10325b7be9c7SSteven Rostedt (VMware)
10335b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
10345b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
10355b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
10365b7be9c7SSteven Rostedt (VMware)
10375b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
10385b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
10395b7be9c7SSteven Rostedt (VMware)
1040a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
1041a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
1042a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
1043a48fc4f5SSteven Rostedt (VMware)	help
1044a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
1045a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
1046a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
1047a48fc4f5SSteven Rostedt (VMware)
1048a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
1049a48fc4f5SSteven Rostedt (VMware)
1050f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
1051a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
1052f96e8577SJoel Fernandes (Google)	depends on m
1053f96e8577SJoel Fernandes (Google)	help
1054f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
1055f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
1056f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
1057f96e8577SJoel Fernandes (Google)	  critical section.
1058f96e8577SJoel Fernandes (Google)
105979393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
106079393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
106179393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1062f96e8577SJoel Fernandes (Google)
10634b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
10644b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
10654b9091e1SSong Chen	  command.
10664b9091e1SSong Chen
1067f96e8577SJoel Fernandes (Google)	  If unsure, say N
1068f96e8577SJoel Fernandes (Google)
10699fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
10709fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
1071726721a5STom Zanussi	depends on SYNTH_EVENTS
10729fe41efaSTom Zanussi	help
10739fe41efaSTom Zanussi          This option creates a test module to check the base
10749fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
10759fe41efaSTom Zanussi          generation.
10769fe41efaSTom Zanussi
10779fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
10789fe41efaSTom Zanussi	  for the generated sample events.
10799fe41efaSTom Zanussi
10809fe41efaSTom Zanussi	  If unsure, say N.
10819fe41efaSTom Zanussi
108264836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
108364836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
108464836248STom Zanussi	depends on KPROBE_EVENTS
108564836248STom Zanussi	help
108664836248STom Zanussi          This option creates a test module to check the base
108764836248STom Zanussi          functionality of in-kernel kprobe event definition.
108864836248STom Zanussi
108964836248STom Zanussi          To test, insert the module, and then check the trace buffer
109064836248STom Zanussi	  for the generated kprobe events.
109164836248STom Zanussi
109264836248STom Zanussi	  If unsure, say N.
109364836248STom Zanussi
10942d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
10952d19bd79STom Zanussi	bool "Hist trigger debug support"
10962d19bd79STom Zanussi	depends on HIST_TRIGGERS
10972d19bd79STom Zanussi	help
10982d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
10992d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
11002d19bd79STom Zanussi          defined on that event.
11012d19bd79STom Zanussi
11022d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
11032d19bd79STom Zanussi
11042d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
11052d19bd79STom Zanussi
11062d19bd79STom Zanussi            - Provides educational information to support the details
11072d19bd79STom Zanussi              of the hist trigger internals as described by
11082d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
11092d19bd79STom Zanussi
11102d19bd79STom Zanussi          The hist_debug output only covers the data structures
11112d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
11122d19bd79STom Zanussi          display the internals of map buckets or variable values of
11132d19bd79STom Zanussi          running histograms.
11142d19bd79STom Zanussi
11152d19bd79STom Zanussi          If unsure, say N.
11162d19bd79STom Zanussi
1117102227b9SDaniel Bristot de Oliveirasource "kernel/trace/rv/Kconfig"
1118102227b9SDaniel Bristot de Oliveira
11194ed9f071SSteven Rostedtendif # FTRACE
1120