xref: /linux/kernel/trace/Kconfig (revision 41677970ad8e5729a6ea74b506cfc3f24f1babc4)
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
34a3ed4157SMasami Hiramatsu (Google)config HAVE_FUNCTION_GRAPH_FREGS
35a1be9cccSDonglin Peng	bool
36a1be9cccSDonglin Peng
37a762e926SMasami Hiramatsu (Google)config HAVE_FTRACE_GRAPH_FUNC
38a762e926SMasami Hiramatsu (Google)	bool
39a762e926SMasami Hiramatsu (Google)	help
40a762e926SMasami Hiramatsu (Google)	  True if ftrace_graph_func() is defined.
41a762e926SMasami Hiramatsu (Google)
42677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
43677aa9f7SSteven Rostedt	bool
44555f386cSMike Frysinger	help
455fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
46677aa9f7SSteven Rostedt
4706aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
4806aeaaeaSMasami Hiramatsu	bool
4906aeaaeaSMasami Hiramatsu
50763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
51763e34e7SSteven Rostedt (VMware)	bool
52763e34e7SSteven Rostedt (VMware)
53cbad0fb2SMark Rutlandconfig HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
54cbad0fb2SMark Rutland	bool
55cbad0fb2SMark Rutland
5602a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS
5702a474caSSteven Rostedt (VMware)	bool
5802a474caSSteven Rostedt (VMware)	help
5902a474caSSteven Rostedt (VMware)	 If this is set, then arguments and stack can be found from
6094d095ffSMark Rutland	 the ftrace_regs passed into the function callback regs parameter
6102a474caSSteven Rostedt (VMware)	 by default, even without setting the REGS flag in the ftrace_ops.
6294d095ffSMark Rutland	 This allows for use of ftrace_regs_get_argument() and
6394d095ffSMark Rutland	 ftrace_regs_get_stack_pointer().
6402a474caSSteven Rostedt (VMware)
65762abbc0SMasami Hiramatsu (Google)config HAVE_FTRACE_REGS_HAVING_PT_REGS
66762abbc0SMasami Hiramatsu (Google)	bool
67762abbc0SMasami Hiramatsu (Google)	help
68762abbc0SMasami Hiramatsu (Google)	 If this is set, ftrace_regs has pt_regs, thus it can convert to
69762abbc0SMasami Hiramatsu (Google)	 pt_regs without allocating memory.
70762abbc0SMasami Hiramatsu (Google)
719440155cSPeter Zijlstra (Intel)config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
729440155cSPeter Zijlstra (Intel)	bool
739440155cSPeter Zijlstra (Intel)	help
749440155cSPeter Zijlstra (Intel)	  If the architecture generates __patchable_function_entries sections
759440155cSPeter Zijlstra (Intel)	  but does not want them included in the ftrace locations.
769440155cSPeter Zijlstra (Intel)
778da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
788da3821bSSteven Rostedt	bool
79555f386cSMike Frysinger	help
805fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
818da3821bSSteven Rostedt
8266700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
83ee08c6ecSFrederic Weisbecker	bool
84555f386cSMike Frysinger	help
855fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
86ee08c6ecSFrederic Weisbecker
87a2546faeSSteven Rostedtconfig HAVE_FENTRY
88a2546faeSSteven Rostedt	bool
89a2546faeSSteven Rostedt	help
90a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
91a2546faeSSteven Rostedt
922f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
932f4df001SVasily Gorbik	bool
942f4df001SVasily Gorbik	help
952f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
962f4df001SVasily Gorbik
9722c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT
9822c8542dSSami Tolvanen	bool
9922c8542dSSami Tolvanen	help
10022c8542dSSami Tolvanen	  Arch supports objtool --mcount
10122c8542dSSami Tolvanen
102280981d6SSathvika Vasireddyconfig HAVE_OBJTOOL_NOP_MCOUNT
103280981d6SSathvika Vasireddy	bool
104280981d6SSathvika Vasireddy	help
105280981d6SSathvika Vasireddy	  Arch supports the objtool options --mcount with --mnop.
106280981d6SSathvika Vasireddy	  An architecture can select this if it wants to enable nop'ing
107280981d6SSathvika Vasireddy	  of ftrace locations.
108280981d6SSathvika Vasireddy
109cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
11072441cb1SSteven Rostedt	bool
11172441cb1SSteven Rostedt	help
11272441cb1SSteven Rostedt	  C version of recordmcount available?
11372441cb1SSteven Rostedt
1144ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT
1154ed308c4SSteven Rostedt (Google)       bool
1164ed308c4SSteven Rostedt (Google)       help
1174ed308c4SSteven Rostedt (Google)         An architecture selects this if it sorts the mcount_loc section
1184ed308c4SSteven Rostedt (Google)	 at build time.
1194ed308c4SSteven Rostedt (Google)
1206b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
1216b9b6413SSteven Rostedt (Google)       bool
1226b9b6413SSteven Rostedt (Google)       default y
1234ed308c4SSteven Rostedt (Google)       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
1246b9b6413SSteven Rostedt (Google)       help
1256b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
1266b9b6413SSteven Rostedt (Google)
127352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
128352ad25aSSteven Rostedt	bool
129352ad25aSSteven Rostedt
130ea632e9fSJosh Triplettconfig TRACE_CLOCK
131ea632e9fSJosh Triplett	bool
132ea632e9fSJosh Triplett
1337a8e76a3SSteven Rostedtconfig RING_BUFFER
1347a8e76a3SSteven Rostedt	bool
135ea632e9fSJosh Triplett	select TRACE_CLOCK
13622287688SSteven Rostedt (Red Hat)	select IRQ_WORK
1377a8e76a3SSteven Rostedt
1385f77a88bSTom Zanussiconfig EVENT_TRACING
139b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
14060f1d5e3SMasami Hiramatsu	select GLOB
141b11c53e1SZhaolei	bool
142b11c53e1SZhaolei
143b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
1445f77a88bSTom Zanussi	bool
1455f77a88bSTom Zanussi
14685bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
14785bac32cSSteven Rostedt	bool
14885bac32cSSteven Rostedt	help
14985bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
15085bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
15185bac32cSSteven Rostedt
152c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
153c3bc8fd6SJoel Fernandes (Google)	bool
154c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
155c3bc8fd6SJoel Fernandes (Google)	select TRACING
156c3bc8fd6SJoel Fernandes (Google)	default y
157c3bc8fd6SJoel Fernandes (Google)	help
158c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
159c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
160c3bc8fd6SJoel Fernandes (Google)
1615e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1625e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1635e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1645e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1655e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
16640892367SRandy Dunlap# hiding of the automatic options.
1675e0a0939SSteven Rostedt
168bc0c38d1SSteven Rostedtconfig TRACING
169bc0c38d1SSteven Rostedt	bool
1707a8e76a3SSteven Rostedt	select RING_BUFFER
171c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1725f87f112SIngo Molnar	select TRACEPOINTS
173f3384b28SSteven Rostedt	select NOP_TRACER
174769b0441SFrederic Weisbecker	select BINARY_PRINTF
1755f77a88bSTom Zanussi	select EVENT_TRACING
176ea632e9fSJosh Triplett	select TRACE_CLOCK
17702b3c5fcSPaul E. McKenney	select NEED_TASKS_RCU
178bc0c38d1SSteven Rostedt
1795e0a0939SSteven Rostedtconfig GENERIC_TRACER
1805e0a0939SSteven Rostedt	bool
1815e0a0939SSteven Rostedt	select TRACING
1825e0a0939SSteven Rostedt
18340ada30fSIngo Molnar#
18440ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
18540ada30fSIngo Molnar# be able to offer generic tracing facilities:
18640ada30fSIngo Molnar#
18740ada30fSIngo Molnarconfig TRACING_SUPPORT
18840ada30fSIngo Molnar	bool
1890ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
19040ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
191422d3c7aSKOSAKI Motohiro	default y
19240ada30fSIngo Molnar
1934ed9f071SSteven Rostedtmenuconfig FTRACE
1944ed9f071SSteven Rostedt	bool "Tracers"
195de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
19665b77242SSteven Rostedt	default y if DEBUG_KERNEL
1974ed9f071SSteven Rostedt	help
1984ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1994ed9f071SSteven Rostedt
2004ed9f071SSteven Rostedtif FTRACE
20117d80fd0SPeter Zijlstra
2021e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
2031e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
204d8a953ddSMasami Hiramatsu	depends on TRACING
205d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
2061e837945SSteven Rostedt (VMware)	help
2071e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
2081e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
2091e837945SSteven Rostedt (VMware)	  initialization and boot process.
2101e837945SSteven Rostedt (VMware)
211606576ceSSteven Rostedtconfig FUNCTION_TRACER
2121b29b018SSteven Rostedt	bool "Kernel Function Tracer"
213606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
2144d7a077cSSteven Rostedt	select KALLSYMS
2155e0a0939SSteven Rostedt	select GENERIC_TRACER
21635e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
21760f1d5e3SMasami Hiramatsu	select GLOB
21802b3c5fcSPaul E. McKenney	select NEED_TASKS_RCU
219e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
2201b29b018SSteven Rostedt	help
2211b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
2221b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
22340892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
2241b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
2251b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
2261b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
2270a6d7d45SSteven Rostedt (Google)	  small and not measurable even in micro-benchmarks (at least on
2280a6d7d45SSteven Rostedt (Google)	  x86, but may have impact on other architectures).
22935e8e302SSteven Rostedt
230fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
231fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
232fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
23315e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
234eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
235764f3b95SIngo Molnar	default y
23615e6cb36SFrederic Weisbecker	help
237fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
238fb52607aSFrederic Weisbecker	  and its entry.
239692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
240692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
241692105b8SMatt LaPlante	  the return value. This is done by setting the current return
242692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
24315e6cb36SFrederic Weisbecker
244a1be9cccSDonglin Pengconfig FUNCTION_GRAPH_RETVAL
245a1be9cccSDonglin Peng	bool "Kernel Function Graph Return Value"
246a3ed4157SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_GRAPH_FREGS
247a1be9cccSDonglin Peng	depends on FUNCTION_GRAPH_TRACER
248a1be9cccSDonglin Peng	default n
249a1be9cccSDonglin Peng	help
250a1be9cccSDonglin Peng	  Support recording and printing the function return value when
251a1be9cccSDonglin Peng	  using function graph tracer. It can be helpful to locate functions
252a1be9cccSDonglin Peng	  that return errors. This feature is off by default, and you can
253a1be9cccSDonglin Peng	  enable it via the trace option funcgraph-retval.
254a1be9cccSDonglin Peng	  See Documentation/trace/ftrace.rst
255a1be9cccSDonglin Peng
25621e92806SDonglin Pengconfig FUNCTION_GRAPH_RETADDR
25721e92806SDonglin Peng	bool "Kernel Function Graph Return Address"
25821e92806SDonglin Peng	depends on FUNCTION_GRAPH_TRACER
25921e92806SDonglin Peng	default n
26021e92806SDonglin Peng	help
26121e92806SDonglin Peng	  Support recording and printing the function return address when
26221e92806SDonglin Peng	  using function graph tracer. It can be helpful to locate code line that
26321e92806SDonglin Peng	  the function is called. This feature is off by default, and you can
26421e92806SDonglin Peng	  enable it via the trace option funcgraph-retaddr.
26521e92806SDonglin Peng
266533c20b0SSven Schnelleconfig FUNCTION_TRACE_ARGS
267533c20b0SSven Schnelle       bool
268*b81ff11cSSteven Rostedt	depends on PROBE_EVENTS_BTF_ARGS
269533c20b0SSven Schnelle	default y
270ff5c9c57SSven Schnelle	help
271ff5c9c57SSven Schnelle	  If supported with function argument access API and BTF, then
272ff5c9c57SSven Schnelle	  the function tracer and function graph tracer will support printing
273ff5c9c57SSven Schnelle	  of function arguments. This feature is off by default, and can be
274ff5c9c57SSven Schnelle	  enabled via the trace option func-args (for the function tracer) and
275ff5c9c57SSven Schnelle	  funcgraph-args (for the function graph tracer)
276533c20b0SSven Schnelle
27761778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
27861778cd7SSteven Rostedt (VMware)	bool "enable/disable function tracing dynamically"
27961778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
28061778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
28161778cd7SSteven Rostedt (VMware)	default y
28261778cd7SSteven Rostedt (VMware)	help
28361778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
28461778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
28561778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
28661778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
28761778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
28861778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
28961778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
29061778cd7SSteven Rostedt (VMware)	  performance of the system.
29161778cd7SSteven Rostedt (VMware)
2922455f0e1SRoss Zwisler	  See the files in /sys/kernel/tracing:
29361778cd7SSteven Rostedt (VMware)	    available_filter_functions
29461778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
29561778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
29661778cd7SSteven Rostedt (VMware)
29761778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
29861778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
29961778cd7SSteven Rostedt (VMware)
30061778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
30161778cd7SSteven Rostedt (VMware)	def_bool y
30261778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
30361778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
30461778cd7SSteven Rostedt (VMware)
30561778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
30661778cd7SSteven Rostedt (VMware)	def_bool y
30760c89718SFlorent Revest	depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS
30861778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
30961778cd7SSteven Rostedt (VMware)
310cbad0fb2SMark Rutlandconfig DYNAMIC_FTRACE_WITH_CALL_OPS
311cbad0fb2SMark Rutland	def_bool y
312cbad0fb2SMark Rutland	depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
313cbad0fb2SMark Rutland
31412f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
31512f9951dSLukas Bulwahn	def_bool y
31612f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
31712f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
31812f9951dSLukas Bulwahn
319cad9931fSMasami Hiramatsuconfig FPROBE
320cad9931fSMasami Hiramatsu	bool "Kernel Function Probe (fprobe)"
3214346ba16SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_GRAPH_FREGS && HAVE_FTRACE_GRAPH_FUNC
3224346ba16SMasami Hiramatsu (Google)	depends on DYNAMIC_FTRACE_WITH_ARGS
3234346ba16SMasami Hiramatsu (Google)	select FUNCTION_GRAPH_TRACER
324cad9931fSMasami Hiramatsu	default n
325cad9931fSMasami Hiramatsu	help
3265b0ab789SMasami Hiramatsu	  This option enables kernel function probe (fprobe) based on ftrace.
3275b0ab789SMasami Hiramatsu	  The fprobe is similar to kprobes, but probes only for kernel function
3285b0ab789SMasami Hiramatsu	  entries and exits. This also can probe multiple functions by one
3295b0ab789SMasami Hiramatsu	  fprobe.
330cad9931fSMasami Hiramatsu
331cad9931fSMasami Hiramatsu	  If unsure, say N.
332cad9931fSMasami Hiramatsu
33361778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
33461778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
33561778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
33661778cd7SSteven Rostedt (VMware)	default n
33761778cd7SSteven Rostedt (VMware)	help
33861778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
33961778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
34061778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
34161778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
34261778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
34361778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
34461778cd7SSteven Rostedt (VMware)
34561778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
34661778cd7SSteven Rostedt (VMware)
34761778cd7SSteven Rostedt (VMware)config STACK_TRACER
34861778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
34961778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
35061778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
35161778cd7SSteven Rostedt (VMware)	select STACKTRACE
35261778cd7SSteven Rostedt (VMware)	select KALLSYMS
35361778cd7SSteven Rostedt (VMware)	help
35461778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
3552455f0e1SRoss Zwisler	  kernel and displays it in /sys/kernel/tracing/stack_trace.
35661778cd7SSteven Rostedt (VMware)
35761778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
35861778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
35961778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
36061778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
36161778cd7SSteven Rostedt (VMware)	  is disabled.
36261778cd7SSteven Rostedt (VMware)
36361778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
36461778cd7SSteven Rostedt (VMware)	  on the kernel command line.
36561778cd7SSteven Rostedt (VMware)
36661778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
36761778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
36861778cd7SSteven Rostedt (VMware)
36961778cd7SSteven Rostedt (VMware)	  Say N if unsure.
37061778cd7SSteven Rostedt (VMware)
371c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
372c3bc8fd6SJoel Fernandes (Google)	bool
373c3bc8fd6SJoel Fernandes (Google)	help
374c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
375c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
376bac429f0SSteven Rostedt
37781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
37881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
37981d68a96SSteven Rostedt	default n
38081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
38181d68a96SSteven Rostedt	select TRACE_IRQFLAGS
3825e0a0939SSteven Rostedt	select GENERIC_TRACER
38381d68a96SSteven Rostedt	select TRACER_MAX_TRACE
38485bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
38522cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
3860b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
38781d68a96SSteven Rostedt	help
38881d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
38981d68a96SSteven Rostedt	  sections, with microsecond accuracy.
39081d68a96SSteven Rostedt
39181d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
39281d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
39381d68a96SSteven Rostedt	  via:
39481d68a96SSteven Rostedt
3952455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
39681d68a96SSteven Rostedt
39740892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
3986cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
3996cd8a4bbSSteven Rostedt	  used together or separately.)
4006cd8a4bbSSteven Rostedt
4016cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
4026cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
4036cd8a4bbSSteven Rostedt	default n
40430c93704SThomas Gleixner	depends on PREEMPTION
4055e0a0939SSteven Rostedt	select GENERIC_TRACER
4066cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
40785bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
40822cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
4090b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
410c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
4116cd8a4bbSSteven Rostedt	help
41240892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
4136cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
4146cd8a4bbSSteven Rostedt
4156cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
4166cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
4176cd8a4bbSSteven Rostedt	  via:
4186cd8a4bbSSteven Rostedt
4192455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
4206cd8a4bbSSteven Rostedt
42140892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
4226cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
4236cd8a4bbSSteven Rostedt	  used together or separately.)
4246cd8a4bbSSteven Rostedt
425352ad25aSSteven Rostedtconfig SCHED_TRACER
426352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
4275e0a0939SSteven Rostedt	select GENERIC_TRACER
428352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
429352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
43022cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
431352ad25aSSteven Rostedt	help
432352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
433352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
434352ad25aSSteven Rostedt
435e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
436e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
437e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
438e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
439e7c15cd8SSteven Rostedt (Red Hat)	help
440e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
441c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
442e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
443e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
444e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
445e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
446e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
447e7c15cd8SSteven Rostedt (Red Hat)
448e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
449e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
450e7c15cd8SSteven Rostedt (Red Hat)
451e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
452e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
453e7c15cd8SSteven Rostedt (Red Hat)				     iteration
454e7c15cd8SSteven Rostedt (Red Hat)
455e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
456c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
457e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
458e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
459e7c15cd8SSteven Rostedt (Red Hat)
460e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
461e7c15cd8SSteven Rostedt (Red Hat)
462e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
463e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
464e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
465e7c15cd8SSteven Rostedt (Red Hat)	 production system.
466e7c15cd8SSteven Rostedt (Red Hat)
467e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
468e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
469e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
470e7c15cd8SSteven Rostedt (Red Hat)
471bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
472bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
473bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
474e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
475bce29ac9SDaniel Bristot de Oliveira	help
476bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
477bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
478bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
479bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
480bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
481bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
482bce29ac9SDaniel Bristot de Oliveira
483bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
484bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
485bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
486bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
487bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
488bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
489bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
490bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
491bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
492bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
493bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
494bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
495bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
496bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
497bce29ac9SDaniel Bristot de Oliveira
498bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
499bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
500bce29ac9SDaniel Bristot de Oliveira
501bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
502bce29ac9SDaniel Bristot de Oliveira
503bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
504bce29ac9SDaniel Bristot de Oliveira          file.
505bce29ac9SDaniel Bristot de Oliveira
506a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
507a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
508a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
509a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
510a955d7eaSDaniel Bristot de Oliveira	help
511a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
512a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
513a955d7eaSDaniel Bristot de Oliveira
514a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
515a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
516a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
517a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
518a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
519a955d7eaSDaniel Bristot de Oliveira	  to expire.
520a955d7eaSDaniel Bristot de Oliveira
521a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
522a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
523a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
524a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
525a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
526a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
527a955d7eaSDaniel Bristot de Oliveira
528a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
529a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
530a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
531a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
532a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
533a955d7eaSDaniel Bristot de Oliveira
53421b3ce30SSteven Rostedt (VMware)config MMIOTRACE
53521b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
53621b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
53721b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
53821b3ce30SSteven Rostedt (VMware)	help
53921b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
54021b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
54121b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
54221b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
54321b3ce30SSteven Rostedt (VMware)
54421b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
54521b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
54621b3ce30SSteven Rostedt (VMware)
547897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
548897f17a6SSteven Rostedt	bool "Trace process context switches and events"
5495e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
550b77e38aaSSteven Rostedt	select TRACING
551b77e38aaSSteven Rostedt	help
55240892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
553b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
554897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
555a7abe97fSSteven Rostedt
556ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
557ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
55866700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
5595e0a0939SSteven Rostedt	select GENERIC_TRACER
5600ea1c415SFrederic Weisbecker	select KALLSYMS
561ee08c6ecSFrederic Weisbecker	help
562ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
563ee08c6ecSFrederic Weisbecker
564debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
565debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
566debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
567debdd57fSHiraku Toyooka	help
568debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
569debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
570debdd57fSHiraku Toyooka
5712455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/snapshot
572debdd57fSHiraku Toyooka	      cat snapshot
573debdd57fSHiraku Toyooka
5740b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
5750b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
5760b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
5770b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
5780b85ffc2SSteven Rostedt (Red Hat)	help
5790b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
5800b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
5810b85ffc2SSteven Rostedt (Red Hat)	  allowed:
5820b85ffc2SSteven Rostedt (Red Hat)
5832455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot
5840b85ffc2SSteven Rostedt (Red Hat)
5850b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
5860b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
5870b85ffc2SSteven Rostedt (Red Hat)
5880b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
5890b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
5900b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
5910b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
5920b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
5930b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
5940b85ffc2SSteven Rostedt (Red Hat)
5952ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
5969ae5b879SSteven Rostedt	bool
5975e0a0939SSteven Rostedt	select GENERIC_TRACER
5989ae5b879SSteven Rostedt
5999ae5b879SSteven Rostedtchoice
6009ae5b879SSteven Rostedt	prompt "Branch Profiling"
6019ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
6029ae5b879SSteven Rostedt	help
6039ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
6049ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
6059ae5b879SSteven Rostedt
6069ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
6079ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
6089ae5b879SSteven Rostedt
60940892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
6109ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
61140892367SRandy Dunlap	 profiler.
6129ae5b879SSteven Rostedt
61340892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
61440892367SRandy Dunlap	 If unsure, choose "No branch profiling".
6159ae5b879SSteven Rostedt
6169ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
6179ae5b879SSteven Rostedt	bool "No branch profiling"
6189ae5b879SSteven Rostedt	help
6199ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
6209ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
6219ae5b879SSteven Rostedt	  Otherwise keep it disabled.
6229ae5b879SSteven Rostedt
6239ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
6249ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
6259ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
6261f0d69a9SSteven Rostedt	help
62759bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
6281f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
6291f0d69a9SSteven Rostedt
6302455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_annotated
6311f0d69a9SSteven Rostedt
63240892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
6331f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
6341f0d69a9SSteven Rostedt
6352bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
63668e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
6379ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
6382bcd521aSSteven Rostedt	help
6392bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
6402bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
6412bcd521aSSteven Rostedt	  The results will be displayed in:
6422bcd521aSSteven Rostedt
6432455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_all
6442bcd521aSSteven Rostedt
6459ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
6469ae5b879SSteven Rostedt
6472bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
6482bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
64940892367SRandy Dunlap	  is to be analyzed in much detail.
6509ae5b879SSteven Rostedtendchoice
6512bcd521aSSteven Rostedt
6522ed84eebSSteven Rostedtconfig TRACING_BRANCHES
65352f232cbSSteven Rostedt	bool
65452f232cbSSteven Rostedt	help
65552f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
65652f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
65752f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
65852f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
65952f232cbSSteven Rostedt
6602ed84eebSSteven Rostedtconfig BRANCH_TRACER
66152f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
6622ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
6632ed84eebSSteven Rostedt	select TRACING_BRANCHES
66452f232cbSSteven Rostedt	help
66552f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
66652f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
66752f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
66852f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
66952f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
67052f232cbSSteven Rostedt	  events happened, as well as their results.
67152f232cbSSteven Rostedt
67252f232cbSSteven Rostedt	  Say N if unsure.
67352f232cbSSteven Rostedt
6742db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
67540892367SRandy Dunlap	bool "Support for tracing block IO actions"
6762db270a8SFrederic Weisbecker	depends on SYSFS
6771dfba05dSIngo Molnar	depends on BLOCK
6782db270a8SFrederic Weisbecker	select RELAY
6792db270a8SFrederic Weisbecker	select DEBUG_FS
6802db270a8SFrederic Weisbecker	select TRACEPOINTS
6815e0a0939SSteven Rostedt	select GENERIC_TRACER
6822db270a8SFrederic Weisbecker	select STACKTRACE
6832db270a8SFrederic Weisbecker	help
6842db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
6852db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
6862db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
6872db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
6882db270a8SFrederic Weisbecker
6892db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
6902db270a8SFrederic Weisbecker
6912db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
6922db270a8SFrederic Weisbecker
6932db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
6942455f0e1SRoss Zwisler	    echo blk > /sys/kernel/tracing/current_tracer
6952455f0e1SRoss Zwisler	    cat /sys/kernel/tracing/trace_pipe
6962db270a8SFrederic Weisbecker
6972db270a8SFrederic Weisbecker	  If unsure, say N.
69836994e58SFrederic Weisbecker
699334e5519SMasami Hiramatsu (Google)config FPROBE_EVENTS
700334e5519SMasami Hiramatsu (Google)	depends on FPROBE
701334e5519SMasami Hiramatsu (Google)	depends on HAVE_REGS_AND_STACK_ACCESS_API
702334e5519SMasami Hiramatsu (Google)	bool "Enable fprobe-based dynamic events"
703334e5519SMasami Hiramatsu (Google)	select TRACING
704334e5519SMasami Hiramatsu (Google)	select PROBE_EVENTS
705334e5519SMasami Hiramatsu (Google)	select DYNAMIC_EVENTS
706334e5519SMasami Hiramatsu (Google)	default y
707334e5519SMasami Hiramatsu (Google)	help
708334e5519SMasami Hiramatsu (Google)	  This allows user to add tracing events on the function entry and
709334e5519SMasami Hiramatsu (Google)	  exit via ftrace interface. The syntax is same as the kprobe events
710334e5519SMasami Hiramatsu (Google)	  and the kprobe events on function entry and exit will be
711334e5519SMasami Hiramatsu (Google)	  transparently converted to this fprobe events.
712334e5519SMasami Hiramatsu (Google)
713b576e097SMasami Hiramatsu (Google)config PROBE_EVENTS_BTF_ARGS
714b576e097SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_ARG_ACCESS_API
715b576e097SMasami Hiramatsu (Google)	depends on FPROBE_EVENTS || KPROBE_EVENTS
716b576e097SMasami Hiramatsu (Google)	depends on DEBUG_INFO_BTF && BPF_SYSCALL
717b576e097SMasami Hiramatsu (Google)	bool "Support BTF function arguments for probe events"
718b576e097SMasami Hiramatsu (Google)	default y
719b576e097SMasami Hiramatsu (Google)	help
720b576e097SMasami Hiramatsu (Google)	  The user can specify the arguments of the probe event using the names
721b576e097SMasami Hiramatsu (Google)	  of the arguments of the probed function, when the probe location is a
722b576e097SMasami Hiramatsu (Google)	  kernel function entry or a tracepoint.
723b576e097SMasami Hiramatsu (Google)	  This is available only if BTF (BPF Type Format) support is enabled.
724b576e097SMasami Hiramatsu (Google)
7256b0b7551SAnton Blanchardconfig KPROBE_EVENTS
726413d37d1SMasami Hiramatsu	depends on KPROBES
727f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
72877b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
729413d37d1SMasami Hiramatsu	select TRACING
7308ab83f56SSrikar Dronamraju	select PROBE_EVENTS
7316212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
73277b44d1bSMasami Hiramatsu	default y
733413d37d1SMasami Hiramatsu	help
73440892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
73540892367SRandy Dunlap	  on the fly via the ftrace interface. See
7365fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
73777b44d1bSMasami Hiramatsu
73877b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
73977b44d1bSMasami Hiramatsu	  various register and memory values.
74077b44d1bSMasami Hiramatsu
74140892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
74240892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
743413d37d1SMasami Hiramatsu
74445408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
74545408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
74645408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
7477bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
74845408c4fSMasami Hiramatsu	default n
74945408c4fSMasami Hiramatsu	help
75045408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
75145408c4fSMasami Hiramatsu	  using kprobe events.
75245408c4fSMasami Hiramatsu
75345408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
75428cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
75545408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
75645408c4fSMasami Hiramatsu	  crash.
75745408c4fSMasami Hiramatsu
75845408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
75945408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
76045408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
76145408c4fSMasami Hiramatsu
76245408c4fSMasami Hiramatsu	  If unsure, say N.
76345408c4fSMasami Hiramatsu
7646b0b7551SAnton Blanchardconfig UPROBE_EVENTS
765f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
766f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
767f3f096cfSSrikar Dronamraju	depends on MMU
76809294e31SDavid A. Long	depends on PERF_EVENTS
769f3f096cfSSrikar Dronamraju	select UPROBES
770f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
7710597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
772f3f096cfSSrikar Dronamraju	select TRACING
77361f35d75SArnaldo Carvalho de Melo	default y
774f3f096cfSSrikar Dronamraju	help
775f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
776f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
777f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
778f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
779f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
780f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
781f3f096cfSSrikar Dronamraju
782e1abf2ccSIngo Molnarconfig BPF_EVENTS
783e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
7846b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
785e1abf2ccSIngo Molnar	bool
786e1abf2ccSIngo Molnar	default y
787e1abf2ccSIngo Molnar	help
7885cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
7895cbd22c1SPeter Wu	  tracepoint events.
790e1abf2ccSIngo Molnar
7915448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
7925448d44cSMasami Hiramatsu	def_bool n
7935448d44cSMasami Hiramatsu
7948ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
7958ab83f56SSrikar Dronamraju	def_bool n
7968ab83f56SSrikar Dronamraju
7979802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
7989802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
7999802d865SJosef Bacik	depends on BPF_EVENTS
800540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
8019802d865SJosef Bacik	default n
8029802d865SJosef Bacik	help
8039802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
8049802d865SJosef Bacik	 set a different return value.  This is used for error injection.
8059802d865SJosef Bacik
8068da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
8078da3821bSSteven Rostedt	def_bool y
8088da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
8098da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
8108da3821bSSteven Rostedt
8113b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8123b15cdc1SSami Tolvanen	bool
8133b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
8143b15cdc1SSami Tolvanen
8153b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
8163b15cdc1SSami Tolvanen	def_bool y
8173b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
8183b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8193b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
8203b15cdc1SSami Tolvanen
82122c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
82222c8542dSSami Tolvanen	def_bool y
82322c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
82422c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
82522c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
82622c8542dSSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
82703f16cd0SJosh Poimboeuf	select OBJTOOL
82822c8542dSSami Tolvanen
8293b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
8303b15cdc1SSami Tolvanen	def_bool y
8313b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8323b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
83322c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
8343b15cdc1SSami Tolvanen	depends on FTRACE_MCOUNT_RECORD
8353b15cdc1SSami Tolvanen
83608d43a5fSTom Zanussiconfig TRACING_MAP
83708d43a5fSTom Zanussi	bool
83808d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
83908d43a5fSTom Zanussi	help
84008d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
84108d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
84208d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
84308d43a5fSTom Zanussi	  generally used outside of that context, and is normally
84408d43a5fSTom Zanussi	  selected by tracers that use it.
84508d43a5fSTom Zanussi
846726721a5STom Zanussiconfig SYNTH_EVENTS
847726721a5STom Zanussi	bool "Synthetic trace events"
848726721a5STom Zanussi	select TRACING
849726721a5STom Zanussi	select DYNAMIC_EVENTS
850726721a5STom Zanussi	default n
851726721a5STom Zanussi	help
852726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
853726721a5STom Zanussi	  used to combine data from other trace events or in fact any
854726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
855726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
856726721a5STom Zanussi	  by way of an in-kernel API.
857726721a5STom Zanussi
858726721a5STom Zanussi	  See Documentation/trace/events.rst or
859726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
860726721a5STom Zanussi
861726721a5STom Zanussi	  If in doubt, say N.
862726721a5STom Zanussi
8637f5a08c7SBeau Belgraveconfig USER_EVENTS
8647f5a08c7SBeau Belgrave	bool "User trace events"
8657f5a08c7SBeau Belgrave	select TRACING
8667f5a08c7SBeau Belgrave	select DYNAMIC_EVENTS
8677f5a08c7SBeau Belgrave	help
8687f5a08c7SBeau Belgrave	  User trace events are user-defined trace events that
8697f5a08c7SBeau Belgrave	  can be used like an existing kernel trace event.  User trace
8707f5a08c7SBeau Belgrave	  events are generated by writing to a tracefs file.  User
8717f5a08c7SBeau Belgrave	  processes can determine if their tracing events should be
87272357590SBeau Belgrave	  generated by registering a value and bit with the kernel
87372357590SBeau Belgrave	  that reflects when it is enabled or not.
8747f5a08c7SBeau Belgrave
87572357590SBeau Belgrave	  See Documentation/trace/user_events.rst.
8767f5a08c7SBeau Belgrave	  If in doubt, say N.
8777f5a08c7SBeau Belgrave
8787ef224d1STom Zanussiconfig HIST_TRIGGERS
8797ef224d1STom Zanussi	bool "Histogram triggers"
8807ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
8817ef224d1STom Zanussi	select TRACING_MAP
8827ad8fb61STom Zanussi	select TRACING
8837bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
884726721a5STom Zanussi	select SYNTH_EVENTS
8857ef224d1STom Zanussi	default n
8867ef224d1STom Zanussi	help
8877ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
8887ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
8897ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
8907ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
8917ef224d1STom Zanussi	  event activity as an initial guide for further investigation
8927ef224d1STom Zanussi	  using more advanced tools.
8937ef224d1STom Zanussi
89489e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
89589e270c1STom Zanussi	  supported using hist triggers under this option.
89689e270c1STom Zanussi
897ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
8987ef224d1STom Zanussi	  If in doubt, say N.
8997ef224d1STom Zanussi
9006c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
9016c3edaf9SCong Wang	bool "Trace event injection"
9026c3edaf9SCong Wang	depends on TRACING
9036c3edaf9SCong Wang	help
9046c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
9056c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
9066c3edaf9SCong Wang
9076c3edaf9SCong Wang	  If unsure, say N.
9086c3edaf9SCong Wang
90981dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
91081dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
91181dc9f0eSSteven Rostedt (Red Hat)	help
91281dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
91381dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
91469268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
91581dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
91681dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
91781dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
91881dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
91981dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
92081dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
92181dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
92281dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
92381dc9f0eSSteven Rostedt (Red Hat)
92481dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
92581dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
92681dc9f0eSSteven Rostedt (Red Hat)
92781dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
92881dc9f0eSSteven Rostedt (Red Hat)
92981dc9f0eSSteven Rostedt (Red Hat)	      START
93081dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
93181dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
93281dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
93381dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
93481dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
93581dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
93681dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
93781dc9f0eSSteven Rostedt (Red Hat)
93881dc9f0eSSteven Rostedt (Red Hat)
9395092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
9405092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
9415092dbc9SSteven Rostedt	depends on RING_BUFFER
9425092dbc9SSteven Rostedt	help
9435092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
94440892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
9455092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
9465092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
9475092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
9485092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
9495092dbc9SSteven Rostedt
9505092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
9515092dbc9SSteven Rostedt	  affected by processes that are running.
9525092dbc9SSteven Rostedt
95340892367SRandy Dunlap	  If unsure, say N.
9545092dbc9SSteven Rostedt
9551e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
9561e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
9571e837945SSteven Rostedt (VMware)       depends on TRACING
9581e837945SSteven Rostedt (VMware)       help
9591e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
9601e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
9611e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
9621e837945SSteven Rostedt (VMware)	how to convert the string to its value.
9631e837945SSteven Rostedt (VMware)
9641e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
9651e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
9661e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
9671e837945SSteven Rostedt (VMware)
9681e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
9691e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
9701e837945SSteven Rostedt (VMware)
9711e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
9721e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
9731e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
9741e837945SSteven Rostedt (VMware)	belong too.
9751e837945SSteven Rostedt (VMware)
9761e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
9771e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
9781e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
9791e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
9801e837945SSteven Rostedt (VMware)
9811e837945SSteven Rostedt (VMware)	If unsure, say N.
9821e837945SSteven Rostedt (VMware)
983773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
984773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
985773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
986773c1670SSteven Rostedt (VMware)	help
987773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
988773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
989773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
990773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
991773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
992773c1670SSteven Rostedt (VMware)
993773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
994773c1670SSteven Rostedt (VMware)
995773c1670SSteven Rostedt (VMware)	  If unsure, say N
996773c1670SSteven Rostedt (VMware)
997773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
998773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
999773c1670SSteven Rostedt (VMware)	default 128
1000773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
1001773c1670SSteven Rostedt (VMware)	help
1002773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
1003773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
1004773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
1005773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
1006773c1670SSteven Rostedt (VMware)	  size at runtime.
1007773c1670SSteven Rostedt (VMware)
1008b0e28a4bSAndrii Nakryikoconfig FTRACE_VALIDATE_RCU_IS_WATCHING
1009b0e28a4bSAndrii Nakryiko	bool "Validate RCU is on during ftrace execution"
1010b0e28a4bSAndrii Nakryiko	depends on FUNCTION_TRACER
1011b0e28a4bSAndrii Nakryiko	depends on ARCH_WANTS_NO_INSTR
1012b0e28a4bSAndrii Nakryiko	help
1013b0e28a4bSAndrii Nakryiko	  All callbacks that attach to the function tracing have some sort of
1014b0e28a4bSAndrii Nakryiko	  protection against recursion. This option is only to verify that
1015b0e28a4bSAndrii Nakryiko	  ftrace (and other users of ftrace_test_recursion_trylock()) are not
1016b0e28a4bSAndrii Nakryiko	  called outside of RCU, as if they are, it can cause a race. But it
1017b0e28a4bSAndrii Nakryiko	  also has a noticeable overhead when enabled.
1018b0e28a4bSAndrii Nakryiko
1019b0e28a4bSAndrii Nakryiko	  If unsure, say N
1020b0e28a4bSAndrii Nakryiko
102128575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
102228575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
102328575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
102428575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
102528575c61SSteven Rostedt (VMware)	default y
102628575c61SSteven Rostedt (VMware)	help
102728575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
1028ac28d0a0SRandy Dunlap	  recursion happens it won't cause harm because of the protection,
1029ac28d0a0SRandy Dunlap	  but it does cause unwanted overhead. Enabling this option will
103028575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
103128575c61SSteven Rostedt (VMware)	  file.
103228575c61SSteven Rostedt (VMware)
103328575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
103428575c61SSteven Rostedt (VMware)
10351e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
10361e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
10371e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
10381e837945SSteven Rostedt (VMware)	help
10391e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
10401e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
10411e837945SSteven Rostedt (VMware)
10421e837945SSteven Rostedt (VMware)	  If unsure, say N.
10431e837945SSteven Rostedt (VMware)
10441e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
10451e837945SSteven Rostedt (VMware)	  run significantly slower.
10461e837945SSteven Rostedt (VMware)
10471e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
10481e837945SSteven Rostedt (VMware)	bool
10491e837945SSteven Rostedt (VMware)
10501e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
10511e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
10521e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
10531e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
10541e837945SSteven Rostedt (VMware)	help
10551e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
10561e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
10571e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
10581e837945SSteven Rostedt (VMware)	  tracers of ftrace.
10591e837945SSteven Rostedt (VMware)
10601e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
10611e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
10621e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
10631e837945SSteven Rostedt (VMware)	default y
10641e837945SSteven Rostedt (VMware)	help
10651e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
10661e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
10671e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
10681e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
10691e837945SSteven Rostedt (VMware)
10701e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
10711e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
10721e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
10731e837945SSteven Rostedt (VMware)	help
10741e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
10751e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
10761e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
10771e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
10781e837945SSteven Rostedt (VMware)
10791e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
10801e837945SSteven Rostedt (VMware)	       events
10811e837945SSteven Rostedt (VMware)
10828147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
10838147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
10848147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
10856b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
10868147dc78SSteven Rostedt (VMware)       help
10878147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
10888147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
10898147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
10908147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
10918147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
10928147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
10938147dc78SSteven Rostedt (VMware)
10948147dc78SSteven Rostedt (VMware)	 If unsure, say N
10958147dc78SSteven Rostedt (VMware)
10966c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
10976c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
10986c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
10996c43e554SSteven Rostedt (Red Hat)       help
11006c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
11016c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
11026c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
11036c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
11046c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
11056c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
11066c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
11076c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
11086c43e554SSteven Rostedt (Red Hat)
11096c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
11106c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
11116c43e554SSteven Rostedt (Red Hat)
1112ac28d0a0SRandy Dunlap	 At the end of the test, statistics and more checks are done.
1113ac28d0a0SRandy Dunlap	 It will output the stats of each per cpu buffer: What
11146c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
11156c43e554SSteven Rostedt (Red Hat)	 other similar details.
11166c43e554SSteven Rostedt (Red Hat)
11176c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
11186c43e554SSteven Rostedt (Red Hat)
11195b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
11205b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
11215b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
11225b7be9c7SSteven Rostedt (VMware)	help
11235b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
11245b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
11255b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
11265b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
11275b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
11285b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
11295b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
11305b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
11315b7be9c7SSteven Rostedt (VMware)
11325b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
11335b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
11345b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
11355b7be9c7SSteven Rostedt (VMware)
11365b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
11375b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
11385b7be9c7SSteven Rostedt (VMware)
1139a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
1140a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
1141a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
1142a48fc4f5SSteven Rostedt (VMware)	help
1143a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
1144a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
1145a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
1146a48fc4f5SSteven Rostedt (VMware)
1147a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
1148a48fc4f5SSteven Rostedt (VMware)
1149f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
1150a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
1151f96e8577SJoel Fernandes (Google)	depends on m
1152f96e8577SJoel Fernandes (Google)	help
1153f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
1154f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
1155f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
1156f96e8577SJoel Fernandes (Google)	  critical section.
1157f96e8577SJoel Fernandes (Google)
115879393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
115979393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
116079393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1161f96e8577SJoel Fernandes (Google)
11624b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
11634b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
11644b9091e1SSong Chen	  command.
11654b9091e1SSong Chen
1166f96e8577SJoel Fernandes (Google)	  If unsure, say N
1167f96e8577SJoel Fernandes (Google)
11689fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
11699fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
11703572bd56SMasami Hiramatsu (Google)	depends on SYNTH_EVENTS && m
11719fe41efaSTom Zanussi	help
11729fe41efaSTom Zanussi          This option creates a test module to check the base
11739fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
11749fe41efaSTom Zanussi          generation.
11759fe41efaSTom Zanussi
11769fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
11779fe41efaSTom Zanussi	  for the generated sample events.
11789fe41efaSTom Zanussi
11799fe41efaSTom Zanussi	  If unsure, say N.
11809fe41efaSTom Zanussi
118164836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
118264836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
11833572bd56SMasami Hiramatsu (Google)	depends on KPROBE_EVENTS && m
118464836248STom Zanussi	help
118564836248STom Zanussi          This option creates a test module to check the base
118664836248STom Zanussi          functionality of in-kernel kprobe event definition.
118764836248STom Zanussi
118864836248STom Zanussi          To test, insert the module, and then check the trace buffer
118964836248STom Zanussi	  for the generated kprobe events.
119064836248STom Zanussi
119164836248STom Zanussi	  If unsure, say N.
119264836248STom Zanussi
11932d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
11942d19bd79STom Zanussi	bool "Hist trigger debug support"
11952d19bd79STom Zanussi	depends on HIST_TRIGGERS
11962d19bd79STom Zanussi	help
11972d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
11982d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
11992d19bd79STom Zanussi          defined on that event.
12002d19bd79STom Zanussi
12012d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
12022d19bd79STom Zanussi
12032d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
12042d19bd79STom Zanussi
12052d19bd79STom Zanussi            - Provides educational information to support the details
12062d19bd79STom Zanussi              of the hist trigger internals as described by
12072d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
12082d19bd79STom Zanussi
12092d19bd79STom Zanussi          The hist_debug output only covers the data structures
12102d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
12112d19bd79STom Zanussi          display the internals of map buckets or variable values of
12122d19bd79STom Zanussi          running histograms.
12132d19bd79STom Zanussi
12142d19bd79STom Zanussi          If unsure, say N.
12152d19bd79STom Zanussi
1216102227b9SDaniel Bristot de Oliveirasource "kernel/trace/rv/Kconfig"
1217102227b9SDaniel Bristot de Oliveira
12184ed9f071SSteven Rostedtendif # FTRACE
1219