xref: /openbmc/linux/kernel/trace/Kconfig (revision 57904291176fa16a981cefca5cbe1a0b50196792)
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
34a1be9cccSDonglin Pengconfig HAVE_FUNCTION_GRAPH_RETVAL
35a1be9cccSDonglin Peng	bool
36a1be9cccSDonglin Peng
37677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
38677aa9f7SSteven Rostedt	bool
39555f386cSMike Frysinger	help
405fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
41677aa9f7SSteven Rostedt
4206aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
4306aeaaeaSMasami Hiramatsu	bool
4406aeaaeaSMasami Hiramatsu
45763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
46763e34e7SSteven Rostedt (VMware)	bool
47763e34e7SSteven Rostedt (VMware)
48cbad0fb2SMark Rutlandconfig HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
49cbad0fb2SMark Rutland	bool
50cbad0fb2SMark Rutland
5102a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS
5202a474caSSteven Rostedt (VMware)	bool
5302a474caSSteven Rostedt (VMware)	help
5402a474caSSteven Rostedt (VMware)	 If this is set, then arguments and stack can be found from
5594d095ffSMark Rutland	 the ftrace_regs passed into the function callback regs parameter
5602a474caSSteven Rostedt (VMware)	 by default, even without setting the REGS flag in the ftrace_ops.
5794d095ffSMark Rutland	 This allows for use of ftrace_regs_get_argument() and
5894d095ffSMark Rutland	 ftrace_regs_get_stack_pointer().
5902a474caSSteven Rostedt (VMware)
609440155cSPeter Zijlstra (Intel)config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
619440155cSPeter Zijlstra (Intel)	bool
629440155cSPeter Zijlstra (Intel)	help
639440155cSPeter Zijlstra (Intel)	  If the architecture generates __patchable_function_entries sections
649440155cSPeter Zijlstra (Intel)	  but does not want them included in the ftrace locations.
659440155cSPeter Zijlstra (Intel)
668da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
678da3821bSSteven Rostedt	bool
68555f386cSMike Frysinger	help
695fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
708da3821bSSteven Rostedt
7166700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
72ee08c6ecSFrederic Weisbecker	bool
73555f386cSMike Frysinger	help
745fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
75ee08c6ecSFrederic Weisbecker
76a2546faeSSteven Rostedtconfig HAVE_FENTRY
77a2546faeSSteven Rostedt	bool
78a2546faeSSteven Rostedt	help
79a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
80a2546faeSSteven Rostedt
812f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
822f4df001SVasily Gorbik	bool
832f4df001SVasily Gorbik	help
842f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
852f4df001SVasily Gorbik
8622c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT
8722c8542dSSami Tolvanen	bool
8822c8542dSSami Tolvanen	help
8922c8542dSSami Tolvanen	  Arch supports objtool --mcount
9022c8542dSSami Tolvanen
91280981d6SSathvika Vasireddyconfig HAVE_OBJTOOL_NOP_MCOUNT
92280981d6SSathvika Vasireddy	bool
93280981d6SSathvika Vasireddy	help
94280981d6SSathvika Vasireddy	  Arch supports the objtool options --mcount with --mnop.
95280981d6SSathvika Vasireddy	  An architecture can select this if it wants to enable nop'ing
96280981d6SSathvika Vasireddy	  of ftrace locations.
97280981d6SSathvika Vasireddy
98cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
9972441cb1SSteven Rostedt	bool
10072441cb1SSteven Rostedt	help
10172441cb1SSteven Rostedt	  C version of recordmcount available?
10272441cb1SSteven Rostedt
1034ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT
1044ed308c4SSteven Rostedt (Google)       bool
1054ed308c4SSteven Rostedt (Google)       help
1064ed308c4SSteven Rostedt (Google)         An architecture selects this if it sorts the mcount_loc section
1074ed308c4SSteven Rostedt (Google)	 at build time.
1084ed308c4SSteven Rostedt (Google)
1096b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
1106b9b6413SSteven Rostedt (Google)       bool
1116b9b6413SSteven Rostedt (Google)       default y
1124ed308c4SSteven Rostedt (Google)       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
1136b9b6413SSteven Rostedt (Google)       help
1146b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
1156b9b6413SSteven Rostedt (Google)
116352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
117352ad25aSSteven Rostedt	bool
118352ad25aSSteven Rostedt
119ea632e9fSJosh Triplettconfig TRACE_CLOCK
120ea632e9fSJosh Triplett	bool
121ea632e9fSJosh Triplett
1227a8e76a3SSteven Rostedtconfig RING_BUFFER
1237a8e76a3SSteven Rostedt	bool
124ea632e9fSJosh Triplett	select TRACE_CLOCK
12522287688SSteven Rostedt (Red Hat)	select IRQ_WORK
1267a8e76a3SSteven Rostedt
1275f77a88bSTom Zanussiconfig EVENT_TRACING
128b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
12960f1d5e3SMasami Hiramatsu	select GLOB
130b11c53e1SZhaolei	bool
131b11c53e1SZhaolei
132b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
1335f77a88bSTom Zanussi	bool
1345f77a88bSTom Zanussi
13585bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
13685bac32cSSteven Rostedt	bool
13785bac32cSSteven Rostedt	help
13885bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
13985bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
14085bac32cSSteven Rostedt
141c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
142c3bc8fd6SJoel Fernandes (Google)	bool
143c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
144c3bc8fd6SJoel Fernandes (Google)	select TRACING
145c3bc8fd6SJoel Fernandes (Google)	default y
146c3bc8fd6SJoel Fernandes (Google)	help
147c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
148c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
149c3bc8fd6SJoel Fernandes (Google)
1505e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1515e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1525e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1535e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1545e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
15540892367SRandy Dunlap# hiding of the automatic options.
1565e0a0939SSteven Rostedt
157bc0c38d1SSteven Rostedtconfig TRACING
158bc0c38d1SSteven Rostedt	bool
1597a8e76a3SSteven Rostedt	select RING_BUFFER
160c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1615f87f112SIngo Molnar	select TRACEPOINTS
162f3384b28SSteven Rostedt	select NOP_TRACER
163769b0441SFrederic Weisbecker	select BINARY_PRINTF
1645f77a88bSTom Zanussi	select EVENT_TRACING
165ea632e9fSJosh Triplett	select TRACE_CLOCK
166835f14edSPaul E. McKenney	select TASKS_RCU if PREEMPTION
167bc0c38d1SSteven Rostedt
1685e0a0939SSteven Rostedtconfig GENERIC_TRACER
1695e0a0939SSteven Rostedt	bool
1705e0a0939SSteven Rostedt	select TRACING
1715e0a0939SSteven Rostedt
17240ada30fSIngo Molnar#
17340ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
17440ada30fSIngo Molnar# be able to offer generic tracing facilities:
17540ada30fSIngo Molnar#
17640ada30fSIngo Molnarconfig TRACING_SUPPORT
17740ada30fSIngo Molnar	bool
1780ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
17940ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
180422d3c7aSKOSAKI Motohiro	default y
18140ada30fSIngo Molnar
1824ed9f071SSteven Rostedtmenuconfig FTRACE
1834ed9f071SSteven Rostedt	bool "Tracers"
184de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
18565b77242SSteven Rostedt	default y if DEBUG_KERNEL
1864ed9f071SSteven Rostedt	help
1874ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1884ed9f071SSteven Rostedt
1894ed9f071SSteven Rostedtif FTRACE
19017d80fd0SPeter Zijlstra
1911e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
1921e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
193d8a953ddSMasami Hiramatsu	depends on TRACING
194d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
1951e837945SSteven Rostedt (VMware)	help
1961e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
1971e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
1981e837945SSteven Rostedt (VMware)	  initialization and boot process.
1991e837945SSteven Rostedt (VMware)
200606576ceSSteven Rostedtconfig FUNCTION_TRACER
2011b29b018SSteven Rostedt	bool "Kernel Function Tracer"
202606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
2034d7a077cSSteven Rostedt	select KALLSYMS
2045e0a0939SSteven Rostedt	select GENERIC_TRACER
20535e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
20660f1d5e3SMasami Hiramatsu	select GLOB
20701b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
208e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
2091b29b018SSteven Rostedt	help
2101b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
2111b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
21240892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
2131b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
2141b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
2151b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
2160a6d7d45SSteven Rostedt (Google)	  small and not measurable even in micro-benchmarks (at least on
2170a6d7d45SSteven Rostedt (Google)	  x86, but may have impact on other architectures).
21835e8e302SSteven Rostedt
219fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
220fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
221fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
22215e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
223eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
224764f3b95SIngo Molnar	default y
22515e6cb36SFrederic Weisbecker	help
226fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
227fb52607aSFrederic Weisbecker	  and its entry.
228692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
229692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
230692105b8SMatt LaPlante	  the return value. This is done by setting the current return
231692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
23215e6cb36SFrederic Weisbecker
233a1be9cccSDonglin Pengconfig FUNCTION_GRAPH_RETVAL
234a1be9cccSDonglin Peng	bool "Kernel Function Graph Return Value"
235a1be9cccSDonglin Peng	depends on HAVE_FUNCTION_GRAPH_RETVAL
236a1be9cccSDonglin Peng	depends on FUNCTION_GRAPH_TRACER
237a1be9cccSDonglin Peng	default n
238a1be9cccSDonglin Peng	help
239a1be9cccSDonglin Peng	  Support recording and printing the function return value when
240a1be9cccSDonglin Peng	  using function graph tracer. It can be helpful to locate functions
241a1be9cccSDonglin Peng	  that return errors. This feature is off by default, and you can
242a1be9cccSDonglin Peng	  enable it via the trace option funcgraph-retval.
243a1be9cccSDonglin Peng	  See Documentation/trace/ftrace.rst
244a1be9cccSDonglin Peng
24561778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
24661778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
24761778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
24861778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
24961778cd7SSteven Rostedt (VMware)	default y
25061778cd7SSteven Rostedt (VMware)	help
25161778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
25261778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
25361778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
25461778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
25561778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
25661778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
25761778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
25861778cd7SSteven Rostedt (VMware)	  performance of the system.
25961778cd7SSteven Rostedt (VMware)
2602455f0e1SRoss Zwisler	  See the files in /sys/kernel/tracing:
26161778cd7SSteven Rostedt (VMware)	    available_filter_functions
26261778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
26361778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
26461778cd7SSteven Rostedt (VMware)
26561778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
26661778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
26761778cd7SSteven Rostedt (VMware)
26861778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
26961778cd7SSteven Rostedt (VMware)	def_bool y
27061778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
27161778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
27261778cd7SSteven Rostedt (VMware)
27361778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
27461778cd7SSteven Rostedt (VMware)	def_bool y
27560c89718SFlorent Revest	depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS
27661778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
27761778cd7SSteven Rostedt (VMware)
278cbad0fb2SMark Rutlandconfig DYNAMIC_FTRACE_WITH_CALL_OPS
279cbad0fb2SMark Rutland	def_bool y
280cbad0fb2SMark Rutland	depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
281cbad0fb2SMark Rutland
28212f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
28312f9951dSLukas Bulwahn	def_bool y
28412f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
28512f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
28612f9951dSLukas Bulwahn
287cad9931fSMasami Hiramatsuconfig FPROBE
288cad9931fSMasami Hiramatsu	bool "Kernel Function Probe (fprobe)"
289cad9931fSMasami Hiramatsu	depends on FUNCTION_TRACER
290cad9931fSMasami Hiramatsu	depends on DYNAMIC_FTRACE_WITH_REGS
2915b0ab789SMasami Hiramatsu	depends on HAVE_RETHOOK
2925b0ab789SMasami Hiramatsu	select RETHOOK
293cad9931fSMasami Hiramatsu	default n
294cad9931fSMasami Hiramatsu	help
2955b0ab789SMasami Hiramatsu	  This option enables kernel function probe (fprobe) based on ftrace.
2965b0ab789SMasami Hiramatsu	  The fprobe is similar to kprobes, but probes only for kernel function
2975b0ab789SMasami Hiramatsu	  entries and exits. This also can probe multiple functions by one
2985b0ab789SMasami Hiramatsu	  fprobe.
299cad9931fSMasami Hiramatsu
300cad9931fSMasami Hiramatsu	  If unsure, say N.
301cad9931fSMasami Hiramatsu
30261778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
30361778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
30461778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
30561778cd7SSteven Rostedt (VMware)	default n
30661778cd7SSteven Rostedt (VMware)	help
30761778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
30861778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
30961778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
31061778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
31161778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
31261778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
31361778cd7SSteven Rostedt (VMware)
31461778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
31561778cd7SSteven Rostedt (VMware)
31661778cd7SSteven Rostedt (VMware)config STACK_TRACER
31761778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
31861778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
31961778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
32061778cd7SSteven Rostedt (VMware)	select STACKTRACE
32161778cd7SSteven Rostedt (VMware)	select KALLSYMS
32261778cd7SSteven Rostedt (VMware)	help
32361778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
3242455f0e1SRoss Zwisler	  kernel and displays it in /sys/kernel/tracing/stack_trace.
32561778cd7SSteven Rostedt (VMware)
32661778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
32761778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
32861778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
32961778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
33061778cd7SSteven Rostedt (VMware)	  is disabled.
33161778cd7SSteven Rostedt (VMware)
33261778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
33361778cd7SSteven Rostedt (VMware)	  on the kernel command line.
33461778cd7SSteven Rostedt (VMware)
33561778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
33661778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
33761778cd7SSteven Rostedt (VMware)
33861778cd7SSteven Rostedt (VMware)	  Say N if unsure.
33961778cd7SSteven Rostedt (VMware)
340c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
341c3bc8fd6SJoel Fernandes (Google)	bool
342c3bc8fd6SJoel Fernandes (Google)	help
343c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
344c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
345bac429f0SSteven Rostedt
34681d68a96SSteven Rostedtconfig IRQSOFF_TRACER
34781d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
34881d68a96SSteven Rostedt	default n
34981d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
35081d68a96SSteven Rostedt	select TRACE_IRQFLAGS
3515e0a0939SSteven Rostedt	select GENERIC_TRACER
35281d68a96SSteven Rostedt	select TRACER_MAX_TRACE
35385bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
35422cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3550b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
35681d68a96SSteven Rostedt	help
35781d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
35881d68a96SSteven Rostedt	  sections, with microsecond accuracy.
35981d68a96SSteven Rostedt
36081d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
36181d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
36281d68a96SSteven Rostedt	  via:
36381d68a96SSteven Rostedt
3642455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
36581d68a96SSteven Rostedt
36640892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3676cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
3686cd8a4bbSSteven Rostedt	  used together or separately.)
3696cd8a4bbSSteven Rostedt
3706cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
3716cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
3726cd8a4bbSSteven Rostedt	default n
37330c93704SThomas Gleixner	depends on PREEMPTION
3745e0a0939SSteven Rostedt	select GENERIC_TRACER
3756cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
37685bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
37722cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3780b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
379c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
3806cd8a4bbSSteven Rostedt	help
38140892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
3826cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
3836cd8a4bbSSteven Rostedt
3846cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
3856cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
3866cd8a4bbSSteven Rostedt	  via:
3876cd8a4bbSSteven Rostedt
3882455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
3896cd8a4bbSSteven Rostedt
39040892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3916cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
3926cd8a4bbSSteven Rostedt	  used together or separately.)
3936cd8a4bbSSteven Rostedt
394352ad25aSSteven Rostedtconfig SCHED_TRACER
395352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
3965e0a0939SSteven Rostedt	select GENERIC_TRACER
397352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
398352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
39922cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
400352ad25aSSteven Rostedt	help
401352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
402352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
403352ad25aSSteven Rostedt
404e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
405e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
406e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
407e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
408e7c15cd8SSteven Rostedt (Red Hat)	help
409e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
410c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
411e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
412e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
413e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
414e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
415e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
416e7c15cd8SSteven Rostedt (Red Hat)
417e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
418e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
419e7c15cd8SSteven Rostedt (Red Hat)
420e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
421e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
422e7c15cd8SSteven Rostedt (Red Hat)				     iteration
423e7c15cd8SSteven Rostedt (Red Hat)
424e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
425c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
426e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
427e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
428e7c15cd8SSteven Rostedt (Red Hat)
429e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
430e7c15cd8SSteven Rostedt (Red Hat)
431e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
432e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
433e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
434e7c15cd8SSteven Rostedt (Red Hat)	 production system.
435e7c15cd8SSteven Rostedt (Red Hat)
436e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
437e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
438e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
439e7c15cd8SSteven Rostedt (Red Hat)
440bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
441bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
442bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
443e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
444bce29ac9SDaniel Bristot de Oliveira	help
445bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
446bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
447bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
448bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
449bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
450bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
451bce29ac9SDaniel Bristot de Oliveira
452bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
453bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
454bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
455bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
456bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
457bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
458bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
459bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
460bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
461bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
462bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
463bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
464bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
465bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
466bce29ac9SDaniel Bristot de Oliveira
467bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
468bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
469bce29ac9SDaniel Bristot de Oliveira
470bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
471bce29ac9SDaniel Bristot de Oliveira
472bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
473bce29ac9SDaniel Bristot de Oliveira          file.
474bce29ac9SDaniel Bristot de Oliveira
475a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
476a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
477a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
478a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
479a955d7eaSDaniel Bristot de Oliveira	help
480a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
481a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
482a955d7eaSDaniel Bristot de Oliveira
483a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
484a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
485a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
486a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
487a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
488a955d7eaSDaniel Bristot de Oliveira	  to expire.
489a955d7eaSDaniel Bristot de Oliveira
490a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
491a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
492a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
493a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
494a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
495a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
496a955d7eaSDaniel Bristot de Oliveira
497a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
498a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
499a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
500a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
501a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
502a955d7eaSDaniel Bristot de Oliveira
50321b3ce30SSteven Rostedt (VMware)config MMIOTRACE
50421b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
50521b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
50621b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
50721b3ce30SSteven Rostedt (VMware)	help
50821b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
50921b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
51021b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
51121b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
51221b3ce30SSteven Rostedt (VMware)
51321b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
51421b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
51521b3ce30SSteven Rostedt (VMware)
516897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
517897f17a6SSteven Rostedt	bool "Trace process context switches and events"
5185e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
519b77e38aaSSteven Rostedt	select TRACING
520b77e38aaSSteven Rostedt	help
52140892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
522b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
523897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
524a7abe97fSSteven Rostedt
525ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
526ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
52766700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
5285e0a0939SSteven Rostedt	select GENERIC_TRACER
5290ea1c415SFrederic Weisbecker	select KALLSYMS
530ee08c6ecSFrederic Weisbecker	help
531ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
532ee08c6ecSFrederic Weisbecker
533debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
534debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
535debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
536debdd57fSHiraku Toyooka	help
537debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
538debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
539debdd57fSHiraku Toyooka
5402455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/snapshot
541debdd57fSHiraku Toyooka	      cat snapshot
542debdd57fSHiraku Toyooka
5430b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
5440b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
5450b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
5460b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
5470b85ffc2SSteven Rostedt (Red Hat)	help
5480b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
5490b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
5500b85ffc2SSteven Rostedt (Red Hat)	  allowed:
5510b85ffc2SSteven Rostedt (Red Hat)
5522455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot
5530b85ffc2SSteven Rostedt (Red Hat)
5540b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
5550b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
5560b85ffc2SSteven Rostedt (Red Hat)
5570b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
5580b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
5590b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
5600b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
5610b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
5620b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
5630b85ffc2SSteven Rostedt (Red Hat)
5642ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
5659ae5b879SSteven Rostedt	bool
5665e0a0939SSteven Rostedt	select GENERIC_TRACER
5679ae5b879SSteven Rostedt
5689ae5b879SSteven Rostedtchoice
5699ae5b879SSteven Rostedt	prompt "Branch Profiling"
5709ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
5719ae5b879SSteven Rostedt	help
5729ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
5739ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
5749ae5b879SSteven Rostedt
5759ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
5769ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
5779ae5b879SSteven Rostedt
57840892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
5799ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
58040892367SRandy Dunlap	 profiler.
5819ae5b879SSteven Rostedt
58240892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
58340892367SRandy Dunlap	 If unsure, choose "No branch profiling".
5849ae5b879SSteven Rostedt
5859ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
5869ae5b879SSteven Rostedt	bool "No branch profiling"
5879ae5b879SSteven Rostedt	help
5889ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
5899ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
5909ae5b879SSteven Rostedt	  Otherwise keep it disabled.
5919ae5b879SSteven Rostedt
5929ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
5939ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
5949ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
5951f0d69a9SSteven Rostedt	help
59659bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
5971f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
5981f0d69a9SSteven Rostedt
5992455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_annotated
6001f0d69a9SSteven Rostedt
60140892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
6021f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
6031f0d69a9SSteven Rostedt
6042bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
60568e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
6069ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
6072bcd521aSSteven Rostedt	help
6082bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
6092bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
6102bcd521aSSteven Rostedt	  The results will be displayed in:
6112bcd521aSSteven Rostedt
6122455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_all
6132bcd521aSSteven Rostedt
6149ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
6159ae5b879SSteven Rostedt
6162bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
6172bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
61840892367SRandy Dunlap	  is to be analyzed in much detail.
6199ae5b879SSteven Rostedtendchoice
6202bcd521aSSteven Rostedt
6212ed84eebSSteven Rostedtconfig TRACING_BRANCHES
62252f232cbSSteven Rostedt	bool
62352f232cbSSteven Rostedt	help
62452f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
62552f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
62652f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
62752f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
62852f232cbSSteven Rostedt
6292ed84eebSSteven Rostedtconfig BRANCH_TRACER
63052f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
6312ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
6322ed84eebSSteven Rostedt	select TRACING_BRANCHES
63352f232cbSSteven Rostedt	help
63452f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
63552f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
63652f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
63752f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
63852f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
63952f232cbSSteven Rostedt	  events happened, as well as their results.
64052f232cbSSteven Rostedt
64152f232cbSSteven Rostedt	  Say N if unsure.
64252f232cbSSteven Rostedt
6432db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
64440892367SRandy Dunlap	bool "Support for tracing block IO actions"
6452db270a8SFrederic Weisbecker	depends on SYSFS
6461dfba05dSIngo Molnar	depends on BLOCK
6472db270a8SFrederic Weisbecker	select RELAY
6482db270a8SFrederic Weisbecker	select DEBUG_FS
6492db270a8SFrederic Weisbecker	select TRACEPOINTS
6505e0a0939SSteven Rostedt	select GENERIC_TRACER
6512db270a8SFrederic Weisbecker	select STACKTRACE
6522db270a8SFrederic Weisbecker	help
6532db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
6542db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
6552db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
6562db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
6572db270a8SFrederic Weisbecker
6582db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
6592db270a8SFrederic Weisbecker
6602db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
6612db270a8SFrederic Weisbecker
6622db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
6632455f0e1SRoss Zwisler	    echo blk > /sys/kernel/tracing/current_tracer
6642455f0e1SRoss Zwisler	    cat /sys/kernel/tracing/trace_pipe
6652db270a8SFrederic Weisbecker
6662db270a8SFrederic Weisbecker	  If unsure, say N.
66736994e58SFrederic Weisbecker
668334e5519SMasami Hiramatsu (Google)config FPROBE_EVENTS
669334e5519SMasami Hiramatsu (Google)	depends on FPROBE
670334e5519SMasami Hiramatsu (Google)	depends on HAVE_REGS_AND_STACK_ACCESS_API
671334e5519SMasami Hiramatsu (Google)	bool "Enable fprobe-based dynamic events"
672334e5519SMasami Hiramatsu (Google)	select TRACING
673334e5519SMasami Hiramatsu (Google)	select PROBE_EVENTS
674334e5519SMasami Hiramatsu (Google)	select DYNAMIC_EVENTS
675334e5519SMasami Hiramatsu (Google)	default y
676334e5519SMasami Hiramatsu (Google)	help
677334e5519SMasami Hiramatsu (Google)	  This allows user to add tracing events on the function entry and
678334e5519SMasami Hiramatsu (Google)	  exit via ftrace interface. The syntax is same as the kprobe events
679334e5519SMasami Hiramatsu (Google)	  and the kprobe events on function entry and exit will be
680334e5519SMasami Hiramatsu (Google)	  transparently converted to this fprobe events.
681334e5519SMasami Hiramatsu (Google)
682b576e097SMasami Hiramatsu (Google)config PROBE_EVENTS_BTF_ARGS
683b576e097SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_ARG_ACCESS_API
684b576e097SMasami Hiramatsu (Google)	depends on FPROBE_EVENTS || KPROBE_EVENTS
685b576e097SMasami Hiramatsu (Google)	depends on DEBUG_INFO_BTF && BPF_SYSCALL
686b576e097SMasami Hiramatsu (Google)	bool "Support BTF function arguments for probe events"
687b576e097SMasami Hiramatsu (Google)	default y
688b576e097SMasami Hiramatsu (Google)	help
689b576e097SMasami Hiramatsu (Google)	  The user can specify the arguments of the probe event using the names
690b576e097SMasami Hiramatsu (Google)	  of the arguments of the probed function, when the probe location is a
691b576e097SMasami Hiramatsu (Google)	  kernel function entry or a tracepoint.
692b576e097SMasami Hiramatsu (Google)	  This is available only if BTF (BPF Type Format) support is enabled.
693b576e097SMasami Hiramatsu (Google)
6946b0b7551SAnton Blanchardconfig KPROBE_EVENTS
695413d37d1SMasami Hiramatsu	depends on KPROBES
696f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
69777b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
698413d37d1SMasami Hiramatsu	select TRACING
6998ab83f56SSrikar Dronamraju	select PROBE_EVENTS
7006212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
70177b44d1bSMasami Hiramatsu	default y
702413d37d1SMasami Hiramatsu	help
70340892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
70440892367SRandy Dunlap	  on the fly via the ftrace interface. See
7055fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
70677b44d1bSMasami Hiramatsu
70777b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
70877b44d1bSMasami Hiramatsu	  various register and memory values.
70977b44d1bSMasami Hiramatsu
71040892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
71140892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
712413d37d1SMasami Hiramatsu
71345408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
71445408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
71545408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
7167bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
71745408c4fSMasami Hiramatsu	default n
71845408c4fSMasami Hiramatsu	help
71945408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
72045408c4fSMasami Hiramatsu	  using kprobe events.
72145408c4fSMasami Hiramatsu
72245408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
72328cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
72445408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
72545408c4fSMasami Hiramatsu	  crash.
72645408c4fSMasami Hiramatsu
72745408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
72845408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
72945408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
73045408c4fSMasami Hiramatsu
73145408c4fSMasami Hiramatsu	  If unsure, say N.
73245408c4fSMasami Hiramatsu
7336b0b7551SAnton Blanchardconfig UPROBE_EVENTS
734f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
735f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
736f3f096cfSSrikar Dronamraju	depends on MMU
73709294e31SDavid A. Long	depends on PERF_EVENTS
738f3f096cfSSrikar Dronamraju	select UPROBES
739f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
7400597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
741f3f096cfSSrikar Dronamraju	select TRACING
74261f35d75SArnaldo Carvalho de Melo	default y
743f3f096cfSSrikar Dronamraju	help
744f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
745f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
746f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
747f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
748f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
749f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
750f3f096cfSSrikar Dronamraju
751e1abf2ccSIngo Molnarconfig BPF_EVENTS
752e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
7536b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
754e1abf2ccSIngo Molnar	bool
755e1abf2ccSIngo Molnar	default y
756e1abf2ccSIngo Molnar	help
7575cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
7585cbd22c1SPeter Wu	  tracepoint events.
759e1abf2ccSIngo Molnar
7605448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
7615448d44cSMasami Hiramatsu	def_bool n
7625448d44cSMasami Hiramatsu
7638ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
7648ab83f56SSrikar Dronamraju	def_bool n
7658ab83f56SSrikar Dronamraju
7669802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
7679802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
7689802d865SJosef Bacik	depends on BPF_EVENTS
769540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
7709802d865SJosef Bacik	default n
7719802d865SJosef Bacik	help
7729802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
7739802d865SJosef Bacik	 set a different return value.  This is used for error injection.
7749802d865SJosef Bacik
7758da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
7768da3821bSSteven Rostedt	def_bool y
7778da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
7788da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
7798da3821bSSteven Rostedt
7803b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7813b15cdc1SSami Tolvanen	bool
7823b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7833b15cdc1SSami Tolvanen
7843b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
7853b15cdc1SSami Tolvanen	def_bool y
7863b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
7873b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
7883b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
7893b15cdc1SSami Tolvanen
79022c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
79122c8542dSSami Tolvanen	def_bool y
79222c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
79322c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
79422c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
79522c8542dSSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
79603f16cd0SJosh Poimboeuf	select OBJTOOL
79722c8542dSSami Tolvanen
7983b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
7993b15cdc1SSami Tolvanen	def_bool y
8003b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8013b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
80222c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
8033b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
8043b15cdc1SSami Tolvanen
80508d43a5fSTom Zanussiconfig TRACING_MAP
80608d43a5fSTom Zanussi	bool
80708d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
80808d43a5fSTom Zanussi	help
80908d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
81008d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
81108d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
81208d43a5fSTom Zanussi	  generally used outside of that context, and is normally
81308d43a5fSTom Zanussi	  selected by tracers that use it.
81408d43a5fSTom Zanussi
815726721a5STom Zanussiconfig SYNTH_EVENTS
816726721a5STom Zanussi	bool "Synthetic trace events"
817726721a5STom Zanussi	select TRACING
818726721a5STom Zanussi	select DYNAMIC_EVENTS
819726721a5STom Zanussi	default n
820726721a5STom Zanussi	help
821726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
822726721a5STom Zanussi	  used to combine data from other trace events or in fact any
823726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
824726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
825726721a5STom Zanussi	  by way of an in-kernel API.
826726721a5STom Zanussi
827726721a5STom Zanussi	  See Documentation/trace/events.rst or
828726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
829726721a5STom Zanussi
830726721a5STom Zanussi	  If in doubt, say N.
831726721a5STom Zanussi
8327f5a08c7SBeau Belgraveconfig USER_EVENTS
8337f5a08c7SBeau Belgrave	bool "User trace events"
8347f5a08c7SBeau Belgrave	select TRACING
8357f5a08c7SBeau Belgrave	select DYNAMIC_EVENTS
8367f5a08c7SBeau Belgrave	help
8377f5a08c7SBeau Belgrave	  User trace events are user-defined trace events that
8387f5a08c7SBeau Belgrave	  can be used like an existing kernel trace event.  User trace
8397f5a08c7SBeau Belgrave	  events are generated by writing to a tracefs file.  User
8407f5a08c7SBeau Belgrave	  processes can determine if their tracing events should be
84172357590SBeau Belgrave	  generated by registering a value and bit with the kernel
84272357590SBeau Belgrave	  that reflects when it is enabled or not.
8437f5a08c7SBeau Belgrave
84472357590SBeau Belgrave	  See Documentation/trace/user_events.rst.
8457f5a08c7SBeau Belgrave	  If in doubt, say N.
8467f5a08c7SBeau Belgrave
8477ef224d1STom Zanussiconfig HIST_TRIGGERS
8487ef224d1STom Zanussi	bool "Histogram triggers"
8497ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
8507ef224d1STom Zanussi	select TRACING_MAP
8517ad8fb61STom Zanussi	select TRACING
8527bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
853726721a5STom Zanussi	select SYNTH_EVENTS
8547ef224d1STom Zanussi	default n
8557ef224d1STom Zanussi	help
8567ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
8577ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
8587ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
8597ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
8607ef224d1STom Zanussi	  event activity as an initial guide for further investigation
8617ef224d1STom Zanussi	  using more advanced tools.
8627ef224d1STom Zanussi
86389e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
86489e270c1STom Zanussi	  supported using hist triggers under this option.
86589e270c1STom Zanussi
866ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
8677ef224d1STom Zanussi	  If in doubt, say N.
8687ef224d1STom Zanussi
8696c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
8706c3edaf9SCong Wang	bool "Trace event injection"
8716c3edaf9SCong Wang	depends on TRACING
8726c3edaf9SCong Wang	help
8736c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
8746c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
8756c3edaf9SCong Wang
8766c3edaf9SCong Wang	  If unsure, say N.
8776c3edaf9SCong Wang
87881dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
87981dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
88081dc9f0eSSteven Rostedt (Red Hat)	help
88181dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
88281dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
88369268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
88481dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
88581dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
88681dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
88781dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
88881dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
88981dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
89081dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
89181dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
89281dc9f0eSSteven Rostedt (Red Hat)
89381dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
89481dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
89581dc9f0eSSteven Rostedt (Red Hat)
89681dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
89781dc9f0eSSteven Rostedt (Red Hat)
89881dc9f0eSSteven Rostedt (Red Hat)	      START
89981dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
90081dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
90181dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
90281dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
90381dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
90481dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
90581dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
90681dc9f0eSSteven Rostedt (Red Hat)
90781dc9f0eSSteven Rostedt (Red Hat)
9085092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
9095092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
9105092dbc9SSteven Rostedt	depends on RING_BUFFER
9115092dbc9SSteven Rostedt	help
9125092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
91340892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
9145092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
9155092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
9165092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
9175092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
9185092dbc9SSteven Rostedt
9195092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
9205092dbc9SSteven Rostedt	  affected by processes that are running.
9215092dbc9SSteven Rostedt
92240892367SRandy Dunlap	  If unsure, say N.
9235092dbc9SSteven Rostedt
9241e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
9251e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
9261e837945SSteven Rostedt (VMware)       depends on TRACING
9271e837945SSteven Rostedt (VMware)       help
9281e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
9291e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
9301e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
9311e837945SSteven Rostedt (VMware)	how to convert the string to its value.
9321e837945SSteven Rostedt (VMware)
9331e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
9341e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
9351e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
9361e837945SSteven Rostedt (VMware)
9371e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
9381e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
9391e837945SSteven Rostedt (VMware)
9401e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
9411e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
9421e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
9431e837945SSteven Rostedt (VMware)	belong too.
9441e837945SSteven Rostedt (VMware)
9451e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
9461e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
9471e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
9481e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
9491e837945SSteven Rostedt (VMware)
9501e837945SSteven Rostedt (VMware)	If unsure, say N.
9511e837945SSteven Rostedt (VMware)
952773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
953773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
954773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
955773c1670SSteven Rostedt (VMware)	help
956773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
957773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
958773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
959773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
960773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
961773c1670SSteven Rostedt (VMware)
962773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
963773c1670SSteven Rostedt (VMware)
964773c1670SSteven Rostedt (VMware)	  If unsure, say N
965773c1670SSteven Rostedt (VMware)
966773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
967773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
968773c1670SSteven Rostedt (VMware)	default	128
969773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
970773c1670SSteven Rostedt (VMware)	help
971773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
972773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
973773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
974773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
975773c1670SSteven Rostedt (VMware)	  size at runtime.
976773c1670SSteven Rostedt (VMware)
97728575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
97828575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
97928575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
98028575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
98128575c61SSteven Rostedt (VMware)	default y
98228575c61SSteven Rostedt (VMware)	help
98328575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
984ac28d0a0SRandy Dunlap	  recursion happens it won't cause harm because of the protection,
985ac28d0a0SRandy Dunlap	  but it does cause unwanted overhead. Enabling this option will
98628575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
98728575c61SSteven Rostedt (VMware)	  file.
98828575c61SSteven Rostedt (VMware)
98928575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
99028575c61SSteven Rostedt (VMware)
9911e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
9921e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
9931e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
9941e837945SSteven Rostedt (VMware)	help
9951e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
9961e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
9971e837945SSteven Rostedt (VMware)
9981e837945SSteven Rostedt (VMware)	  If unsure, say N.
9991e837945SSteven Rostedt (VMware)
10001e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
10011e837945SSteven Rostedt (VMware)	  run significantly slower.
10021e837945SSteven Rostedt (VMware)
10031e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
10041e837945SSteven Rostedt (VMware)	bool
10051e837945SSteven Rostedt (VMware)
10061e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
10071e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
10081e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
10091e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
10101e837945SSteven Rostedt (VMware)	help
10111e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
10121e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
10131e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
10141e837945SSteven Rostedt (VMware)	  tracers of ftrace.
10151e837945SSteven Rostedt (VMware)
10161e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
10171e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
10181e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
10191e837945SSteven Rostedt (VMware)	default y
10201e837945SSteven Rostedt (VMware)	help
10211e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
10221e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
10231e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
10241e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
10251e837945SSteven Rostedt (VMware)
10261e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
10271e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
10281e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
10291e837945SSteven Rostedt (VMware)	help
10301e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
10311e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
10321e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
10331e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
10341e837945SSteven Rostedt (VMware)
10351e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
10361e837945SSteven Rostedt (VMware)	       events
10371e837945SSteven Rostedt (VMware)
10388147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
10398147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
10408147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
10416b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
10428147dc78SSteven Rostedt (VMware)       help
10438147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
10448147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
10458147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
10468147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
10478147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
10488147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
10498147dc78SSteven Rostedt (VMware)
10508147dc78SSteven Rostedt (VMware)	 If unsure, say N
10518147dc78SSteven Rostedt (VMware)
10526c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
10536c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
10546c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
10556c43e554SSteven Rostedt (Red Hat)       help
10566c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
10576c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
10586c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
10596c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
10606c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
10616c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
10626c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
10636c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
10646c43e554SSteven Rostedt (Red Hat)
10656c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
10666c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
10676c43e554SSteven Rostedt (Red Hat)
1068ac28d0a0SRandy Dunlap	 At the end of the test, statistics and more checks are done.
1069ac28d0a0SRandy Dunlap	 It will output the stats of each per cpu buffer: What
10706c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
10716c43e554SSteven Rostedt (Red Hat)	 other similar details.
10726c43e554SSteven Rostedt (Red Hat)
10736c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
10746c43e554SSteven Rostedt (Red Hat)
10755b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
10765b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
10775b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
10785b7be9c7SSteven Rostedt (VMware)	help
10795b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
10805b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
10815b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
10825b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
10835b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
10845b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
10855b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
10865b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
10875b7be9c7SSteven Rostedt (VMware)
10885b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
10895b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
10905b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
10915b7be9c7SSteven Rostedt (VMware)
10925b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
10935b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
10945b7be9c7SSteven Rostedt (VMware)
1095a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
1096a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
1097a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
1098a48fc4f5SSteven Rostedt (VMware)	help
1099a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
1100a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
1101a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
1102a48fc4f5SSteven Rostedt (VMware)
1103a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
1104a48fc4f5SSteven Rostedt (VMware)
1105f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
1106a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
1107f96e8577SJoel Fernandes (Google)	depends on m
1108f96e8577SJoel Fernandes (Google)	help
1109f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
1110f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
1111f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
1112f96e8577SJoel Fernandes (Google)	  critical section.
1113f96e8577SJoel Fernandes (Google)
111479393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
111579393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
111679393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1117f96e8577SJoel Fernandes (Google)
11184b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
11194b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
11204b9091e1SSong Chen	  command.
11214b9091e1SSong Chen
1122f96e8577SJoel Fernandes (Google)	  If unsure, say N
1123f96e8577SJoel Fernandes (Google)
11249fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
11259fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
1126*55d5d081SMasami Hiramatsu (Google)	depends on SYNTH_EVENTS && m
11279fe41efaSTom Zanussi	help
11289fe41efaSTom Zanussi          This option creates a test module to check the base
11299fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
11309fe41efaSTom Zanussi          generation.
11319fe41efaSTom Zanussi
11329fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
11339fe41efaSTom Zanussi	  for the generated sample events.
11349fe41efaSTom Zanussi
11359fe41efaSTom Zanussi	  If unsure, say N.
11369fe41efaSTom Zanussi
113764836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
113864836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
1139*55d5d081SMasami Hiramatsu (Google)	depends on KPROBE_EVENTS && m
114064836248STom Zanussi	help
114164836248STom Zanussi          This option creates a test module to check the base
114264836248STom Zanussi          functionality of in-kernel kprobe event definition.
114364836248STom Zanussi
114464836248STom Zanussi          To test, insert the module, and then check the trace buffer
114564836248STom Zanussi	  for the generated kprobe events.
114664836248STom Zanussi
114764836248STom Zanussi	  If unsure, say N.
114864836248STom Zanussi
11492d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
11502d19bd79STom Zanussi	bool "Hist trigger debug support"
11512d19bd79STom Zanussi	depends on HIST_TRIGGERS
11522d19bd79STom Zanussi	help
11532d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
11542d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
11552d19bd79STom Zanussi          defined on that event.
11562d19bd79STom Zanussi
11572d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
11582d19bd79STom Zanussi
11592d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
11602d19bd79STom Zanussi
11612d19bd79STom Zanussi            - Provides educational information to support the details
11622d19bd79STom Zanussi              of the hist trigger internals as described by
11632d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
11642d19bd79STom Zanussi
11652d19bd79STom Zanussi          The hist_debug output only covers the data structures
11662d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
11672d19bd79STom Zanussi          display the internals of map buckets or variable values of
11682d19bd79STom Zanussi          running histograms.
11692d19bd79STom Zanussi
11702d19bd79STom Zanussi          If unsure, say N.
11712d19bd79STom Zanussi
1172102227b9SDaniel Bristot de Oliveirasource "kernel/trace/rv/Kconfig"
1173102227b9SDaniel Bristot de Oliveira
11744ed9f071SSteven Rostedtendif # FTRACE
1175