xref: /linux/kernel/trace/Kconfig (revision 6439079365dcb33c6701f5f0e480ac2c17312b6b)
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)
53424f6a36SJiri Olsaconfig HAVE_SINGLE_FTRACE_DIRECT_OPS
54424f6a36SJiri Olsa	bool
55424f6a36SJiri Olsa
56cbad0fb2SMark Rutlandconfig HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
57cbad0fb2SMark Rutland	bool
58cbad0fb2SMark Rutland
599f0cb917SSteven Rostedtconfig HAVE_EXTRA_IPI_TRACEPOINTS
609f0cb917SSteven Rostedt	bool
619f0cb917SSteven Rostedt	help
629f0cb917SSteven Rostedt	 For architectures that use ipi_raise, ipi_entry and ipi_exit
639f0cb917SSteven Rostedt	 tracepoints.
649f0cb917SSteven Rostedt
6502a474caSSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_ARGS
6602a474caSSteven Rostedt (VMware)	bool
6702a474caSSteven Rostedt (VMware)	help
6802a474caSSteven Rostedt (VMware)	 If this is set, then arguments and stack can be found from
6994d095ffSMark Rutland	 the ftrace_regs passed into the function callback regs parameter
7002a474caSSteven Rostedt (VMware)	 by default, even without setting the REGS flag in the ftrace_ops.
7194d095ffSMark Rutland	 This allows for use of ftrace_regs_get_argument() and
7294d095ffSMark Rutland	 ftrace_regs_get_stack_pointer().
7302a474caSSteven Rostedt (VMware)
74762abbc0SMasami Hiramatsu (Google)config HAVE_FTRACE_REGS_HAVING_PT_REGS
75762abbc0SMasami Hiramatsu (Google)	bool
76762abbc0SMasami Hiramatsu (Google)	help
77762abbc0SMasami Hiramatsu (Google)	 If this is set, ftrace_regs has pt_regs, thus it can convert to
78762abbc0SMasami Hiramatsu (Google)	 pt_regs without allocating memory.
79762abbc0SMasami Hiramatsu (Google)
809440155cSPeter Zijlstra (Intel)config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
819440155cSPeter Zijlstra (Intel)	bool
829440155cSPeter Zijlstra (Intel)	help
839440155cSPeter Zijlstra (Intel)	  If the architecture generates __patchable_function_entries sections
849440155cSPeter Zijlstra (Intel)	  but does not want them included in the ftrace locations.
859440155cSPeter Zijlstra (Intel)
8625e4e356SMenglong Dongconfig HAVE_DYNAMIC_FTRACE_WITH_JMP
8725e4e356SMenglong Dong	bool
8825e4e356SMenglong Dong	help
8925e4e356SMenglong Dong	  If the architecture supports to replace the __fentry__ with a
9025e4e356SMenglong Dong	  "jmp" instruction.
9125e4e356SMenglong Dong
9266700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
93ee08c6ecSFrederic Weisbecker	bool
94555f386cSMike Frysinger	help
955fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
96ee08c6ecSFrederic Weisbecker
97a2546faeSSteven Rostedtconfig HAVE_FENTRY
98a2546faeSSteven Rostedt	bool
99a2546faeSSteven Rostedt	help
100a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
101a2546faeSSteven Rostedt
1022f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
1032f4df001SVasily Gorbik	bool
1042f4df001SVasily Gorbik	help
1052f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
1062f4df001SVasily Gorbik
10722c8542dSSami Tolvanenconfig HAVE_OBJTOOL_MCOUNT
10822c8542dSSami Tolvanen	bool
10922c8542dSSami Tolvanen	help
11022c8542dSSami Tolvanen	  Arch supports objtool --mcount
11122c8542dSSami Tolvanen
112280981d6SSathvika Vasireddyconfig HAVE_OBJTOOL_NOP_MCOUNT
113280981d6SSathvika Vasireddy	bool
114280981d6SSathvika Vasireddy	help
115280981d6SSathvika Vasireddy	  Arch supports the objtool options --mcount with --mnop.
116280981d6SSathvika Vasireddy	  An architecture can select this if it wants to enable nop'ing
117280981d6SSathvika Vasireddy	  of ftrace locations.
118280981d6SSathvika Vasireddy
119cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
12072441cb1SSteven Rostedt	bool
12172441cb1SSteven Rostedt	help
12272441cb1SSteven Rostedt	  C version of recordmcount available?
12372441cb1SSteven Rostedt
1244ed308c4SSteven Rostedt (Google)config HAVE_BUILDTIME_MCOUNT_SORT
1254ed308c4SSteven Rostedt (Google)       bool
1264ed308c4SSteven Rostedt (Google)       help
1274ed308c4SSteven Rostedt (Google)         An architecture selects this if it sorts the mcount_loc section
1284ed308c4SSteven Rostedt (Google)	 at build time.
1294ed308c4SSteven Rostedt (Google)
1306b9b6413SSteven Rostedt (Google)config BUILDTIME_MCOUNT_SORT
1316b9b6413SSteven Rostedt (Google)       bool
1326b9b6413SSteven Rostedt (Google)       default y
1334ed308c4SSteven Rostedt (Google)       depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE
1346b9b6413SSteven Rostedt (Google)       help
1356b9b6413SSteven Rostedt (Google)         Sort the mcount_loc section at build time.
1366b9b6413SSteven Rostedt (Google)
137352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
138352ad25aSSteven Rostedt	bool
139c4f1fe47SSteven Rostedt	select TRACER_SNAPSHOT
140352ad25aSSteven Rostedt
141ea632e9fSJosh Triplettconfig TRACE_CLOCK
142ea632e9fSJosh Triplett	bool
143ea632e9fSJosh Triplett
1447a8e76a3SSteven Rostedtconfig RING_BUFFER
1457a8e76a3SSteven Rostedt	bool
146ea632e9fSJosh Triplett	select TRACE_CLOCK
14722287688SSteven Rostedt (Red Hat)	select IRQ_WORK
1487a8e76a3SSteven Rostedt
1495f77a88bSTom Zanussiconfig EVENT_TRACING
150b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
15160f1d5e3SMasami Hiramatsu	select GLOB
152b11c53e1SZhaolei	bool
153b11c53e1SZhaolei
154b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
1555f77a88bSTom Zanussi	bool
1565f77a88bSTom Zanussi
15785bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
15885bac32cSSteven Rostedt	bool
15985bac32cSSteven Rostedt	help
16085bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
16185bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
16285bac32cSSteven Rostedt
163c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
164c3bc8fd6SJoel Fernandes (Google)	bool
165c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
166c3bc8fd6SJoel Fernandes (Google)	select TRACING
167c3bc8fd6SJoel Fernandes (Google)	default y
168c3bc8fd6SJoel Fernandes (Google)	help
169c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
170c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
171c3bc8fd6SJoel Fernandes (Google)
1725e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1735e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1745e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1755e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1765e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
17740892367SRandy Dunlap# hiding of the automatic options.
1785e0a0939SSteven Rostedt
179bc0c38d1SSteven Rostedtconfig TRACING
180bc0c38d1SSteven Rostedt	bool
1817a8e76a3SSteven Rostedt	select RING_BUFFER
182c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1835f87f112SIngo Molnar	select TRACEPOINTS
184f3384b28SSteven Rostedt	select NOP_TRACER
185769b0441SFrederic Weisbecker	select BINARY_PRINTF
1865f77a88bSTom Zanussi	select EVENT_TRACING
187ea632e9fSJosh Triplett	select TRACE_CLOCK
18802b3c5fcSPaul E. McKenney	select NEED_TASKS_RCU
189bc0c38d1SSteven Rostedt
1905e0a0939SSteven Rostedtconfig GENERIC_TRACER
1915e0a0939SSteven Rostedt	bool
1925e0a0939SSteven Rostedt	select TRACING
1935e0a0939SSteven Rostedt
19440ada30fSIngo Molnar#
19540ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
19640ada30fSIngo Molnar# be able to offer generic tracing facilities:
19740ada30fSIngo Molnar#
19840ada30fSIngo Molnarconfig TRACING_SUPPORT
19940ada30fSIngo Molnar	bool
2000ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
20140ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
202422d3c7aSKOSAKI Motohiro	default y
20340ada30fSIngo Molnar
2044ed9f071SSteven Rostedtmenuconfig FTRACE
2054ed9f071SSteven Rostedt	bool "Tracers"
206de32951bSMasahiro Yamada	depends on TRACING_SUPPORT
20765b77242SSteven Rostedt	default y if DEBUG_KERNEL
2084ed9f071SSteven Rostedt	help
2094ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
2104ed9f071SSteven Rostedt
2114ed9f071SSteven Rostedtif FTRACE
21217d80fd0SPeter Zijlstra
2139ba817fbSSteven Rostedtconfig TRACEFS_AUTOMOUNT_DEPRECATED
2149ba817fbSSteven Rostedt	bool "Automount tracefs on debugfs [DEPRECATED]"
2159ba817fbSSteven Rostedt	depends on TRACING
2169ba817fbSSteven Rostedt	default y
2179ba817fbSSteven Rostedt	help
2189ba817fbSSteven Rostedt	  The tracing interface was moved from /sys/kernel/debug/tracing
2199ba817fbSSteven Rostedt	  to /sys/kernel/tracing in 2015, but the tracing file system
2209ba817fbSSteven Rostedt	  was still automounted in /sys/kernel/debug for backward
2219ba817fbSSteven Rostedt	  compatibility with tooling.
2229ba817fbSSteven Rostedt
2239ba817fbSSteven Rostedt	  The new interface has been around for more than 10 years and
2249ba817fbSSteven Rostedt	  the old debug mount will soon be removed.
2259ba817fbSSteven Rostedt
2261e837945SSteven Rostedt (VMware)config BOOTTIME_TRACING
2271e837945SSteven Rostedt (VMware)	bool "Boot-time Tracing support"
228d8a953ddSMasami Hiramatsu	depends on TRACING
229d8a953ddSMasami Hiramatsu	select BOOT_CONFIG
2301e837945SSteven Rostedt (VMware)	help
2311e837945SSteven Rostedt (VMware)	  Enable developer to setup ftrace subsystem via supplemental
2321e837945SSteven Rostedt (VMware)	  kernel cmdline at boot time for debugging (tracing) driver
2331e837945SSteven Rostedt (VMware)	  initialization and boot process.
2341e837945SSteven Rostedt (VMware)
235606576ceSSteven Rostedtconfig FUNCTION_TRACER
2361b29b018SSteven Rostedt	bool "Kernel Function Tracer"
237606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
2384d7a077cSSteven Rostedt	select KALLSYMS
2395e0a0939SSteven Rostedt	select GENERIC_TRACER
24035e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
24160f1d5e3SMasami Hiramatsu	select GLOB
24202b3c5fcSPaul E. McKenney	select NEED_TASKS_RCU
243e5a971d7SPaul E. McKenney	select TASKS_RUDE_RCU
2441b29b018SSteven Rostedt	help
2451b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
2461b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
24740892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
2481b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
2491b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
2501b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
2510a6d7d45SSteven Rostedt (Google)	  small and not measurable even in micro-benchmarks (at least on
2520a6d7d45SSteven Rostedt (Google)	  x86, but may have impact on other architectures).
25335e8e302SSteven Rostedt
254fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
255fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
256fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
25715e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
258eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
259764f3b95SIngo Molnar	default y
26015e6cb36SFrederic Weisbecker	help
261fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
262fb52607aSFrederic Weisbecker	  and its entry.
263692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
264692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
265692105b8SMatt LaPlante	  the return value. This is done by setting the current return
266692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
26715e6cb36SFrederic Weisbecker
268a1be9cccSDonglin Pengconfig FUNCTION_GRAPH_RETVAL
269a1be9cccSDonglin Peng	bool "Kernel Function Graph Return Value"
270a3ed4157SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_GRAPH_FREGS
271a1be9cccSDonglin Peng	depends on FUNCTION_GRAPH_TRACER
272a1be9cccSDonglin Peng	default n
273a1be9cccSDonglin Peng	help
274a1be9cccSDonglin Peng	  Support recording and printing the function return value when
275a1be9cccSDonglin Peng	  using function graph tracer. It can be helpful to locate functions
276a1be9cccSDonglin Peng	  that return errors. This feature is off by default, and you can
277a1be9cccSDonglin Peng	  enable it via the trace option funcgraph-retval.
278a1be9cccSDonglin Peng	  See Documentation/trace/ftrace.rst
279a1be9cccSDonglin Peng
28021e92806SDonglin Pengconfig FUNCTION_GRAPH_RETADDR
28121e92806SDonglin Peng	bool "Kernel Function Graph Return Address"
28221e92806SDonglin Peng	depends on FUNCTION_GRAPH_TRACER
28321e92806SDonglin Peng	default n
28421e92806SDonglin Peng	help
28521e92806SDonglin Peng	  Support recording and printing the function return address when
28621e92806SDonglin Peng	  using function graph tracer. It can be helpful to locate code line that
28721e92806SDonglin Peng	  the function is called. This feature is off by default, and you can
28821e92806SDonglin Peng	  enable it via the trace option funcgraph-retaddr.
28921e92806SDonglin Peng
290533c20b0SSven Schnelleconfig FUNCTION_TRACE_ARGS
291533c20b0SSven Schnelle       bool
292b81ff11cSSteven Rostedt	depends on PROBE_EVENTS_BTF_ARGS
293533c20b0SSven Schnelle	default y
294ff5c9c57SSven Schnelle	help
295ff5c9c57SSven Schnelle	  If supported with function argument access API and BTF, then
296ff5c9c57SSven Schnelle	  the function tracer and function graph tracer will support printing
297ff5c9c57SSven Schnelle	  of function arguments. This feature is off by default, and can be
298ff5c9c57SSven Schnelle	  enabled via the trace option func-args (for the function tracer) and
299ff5c9c57SSven Schnelle	  funcgraph-args (for the function graph tracer)
300533c20b0SSven Schnelle
30161778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE
3029b4d5d33SSteven Rostedt	bool
30361778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
30461778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE
30561778cd7SSteven Rostedt (VMware)	default y
30661778cd7SSteven Rostedt (VMware)	help
30761778cd7SSteven Rostedt (VMware)	  This option will modify all the calls to function tracing
30861778cd7SSteven Rostedt (VMware)	  dynamically (will patch them out of the binary image and
30961778cd7SSteven Rostedt (VMware)	  replace them with a No-Op instruction) on boot up. During
31061778cd7SSteven Rostedt (VMware)	  compile time, a table is made of all the locations that ftrace
31161778cd7SSteven Rostedt (VMware)	  can function trace, and this table is linked into the kernel
31261778cd7SSteven Rostedt (VMware)	  image. When this is enabled, functions can be individually
31361778cd7SSteven Rostedt (VMware)	  enabled, and the functions not enabled will not affect
31461778cd7SSteven Rostedt (VMware)	  performance of the system.
31561778cd7SSteven Rostedt (VMware)
3162455f0e1SRoss Zwisler	  See the files in /sys/kernel/tracing:
31761778cd7SSteven Rostedt (VMware)	    available_filter_functions
31861778cd7SSteven Rostedt (VMware)	    set_ftrace_filter
31961778cd7SSteven Rostedt (VMware)	    set_ftrace_notrace
32061778cd7SSteven Rostedt (VMware)
32161778cd7SSteven Rostedt (VMware)	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
32261778cd7SSteven Rostedt (VMware)	  otherwise has native performance as long as no tracing is active.
32361778cd7SSteven Rostedt (VMware)
32461778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_REGS
32561778cd7SSteven Rostedt (VMware)	def_bool y
32661778cd7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
32761778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
32861778cd7SSteven Rostedt (VMware)
32961778cd7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
33061778cd7SSteven Rostedt (VMware)	def_bool y
33160c89718SFlorent Revest	depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS
33261778cd7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
33361778cd7SSteven Rostedt (VMware)
334cbad0fb2SMark Rutlandconfig DYNAMIC_FTRACE_WITH_CALL_OPS
335cbad0fb2SMark Rutland	def_bool y
336cbad0fb2SMark Rutland	depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
337cbad0fb2SMark Rutland
33812f9951dSLukas Bulwahnconfig DYNAMIC_FTRACE_WITH_ARGS
33912f9951dSLukas Bulwahn	def_bool y
34012f9951dSLukas Bulwahn	depends on DYNAMIC_FTRACE
34112f9951dSLukas Bulwahn	depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS
34212f9951dSLukas Bulwahn
34325e4e356SMenglong Dongconfig DYNAMIC_FTRACE_WITH_JMP
34425e4e356SMenglong Dong	def_bool y
34525e4e356SMenglong Dong	depends on DYNAMIC_FTRACE
34625e4e356SMenglong Dong	depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS
34725e4e356SMenglong Dong	depends on HAVE_DYNAMIC_FTRACE_WITH_JMP
34825e4e356SMenglong Dong
349f93a7d0cSSteven Rostedtconfig FUNCTION_SELF_TRACING
350f93a7d0cSSteven Rostedt	bool "Function trace tracing code"
351f93a7d0cSSteven Rostedt	depends on FUNCTION_TRACER
352f93a7d0cSSteven Rostedt	help
353f93a7d0cSSteven Rostedt	  Normally all the tracing code is set to notrace, where the function
354f93a7d0cSSteven Rostedt	  tracer will ignore all the tracing functions. Sometimes it is useful
355f93a7d0cSSteven Rostedt	  for debugging to trace some of the tracing infratructure itself.
356f93a7d0cSSteven Rostedt	  Enable this to allow some of the tracing infrastructure to be traced
357f93a7d0cSSteven Rostedt	  by the function tracer. Note, this will likely add noise to function
358f93a7d0cSSteven Rostedt	  tracing if events and other tracing features are enabled along with
359f93a7d0cSSteven Rostedt	  function tracing.
360f93a7d0cSSteven Rostedt
361f93a7d0cSSteven Rostedt	  If unsure, say N.
362f93a7d0cSSteven Rostedt
363cad9931fSMasami Hiramatsuconfig FPROBE
364cad9931fSMasami Hiramatsu	bool "Kernel Function Probe (fprobe)"
3654346ba16SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_GRAPH_FREGS && HAVE_FTRACE_GRAPH_FUNC
3664346ba16SMasami Hiramatsu (Google)	depends on DYNAMIC_FTRACE_WITH_ARGS
3674346ba16SMasami Hiramatsu (Google)	select FUNCTION_GRAPH_TRACER
368cad9931fSMasami Hiramatsu	default n
369cad9931fSMasami Hiramatsu	help
3705b0ab789SMasami Hiramatsu	  This option enables kernel function probe (fprobe) based on ftrace.
3715b0ab789SMasami Hiramatsu	  The fprobe is similar to kprobes, but probes only for kernel function
3725b0ab789SMasami Hiramatsu	  entries and exits. This also can probe multiple functions by one
3735b0ab789SMasami Hiramatsu	  fprobe.
374cad9931fSMasami Hiramatsu
375cad9931fSMasami Hiramatsu	  If unsure, say N.
376cad9931fSMasami Hiramatsu
37761778cd7SSteven Rostedt (VMware)config FUNCTION_PROFILER
37861778cd7SSteven Rostedt (VMware)	bool "Kernel function profiler"
37961778cd7SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
38061778cd7SSteven Rostedt (VMware)	default n
38161778cd7SSteven Rostedt (VMware)	help
38261778cd7SSteven Rostedt (VMware)	  This option enables the kernel function profiler. A file is created
38361778cd7SSteven Rostedt (VMware)	  in debugfs called function_profile_enabled which defaults to zero.
38461778cd7SSteven Rostedt (VMware)	  When a 1 is echoed into this file profiling begins, and when a
38561778cd7SSteven Rostedt (VMware)	  zero is entered, profiling stops. A "functions" file is created in
38661778cd7SSteven Rostedt (VMware)	  the trace_stat directory; this file shows the list of functions that
38761778cd7SSteven Rostedt (VMware)	  have been hit and their counters.
38861778cd7SSteven Rostedt (VMware)
38961778cd7SSteven Rostedt (VMware)	  If in doubt, say N.
39061778cd7SSteven Rostedt (VMware)
39161778cd7SSteven Rostedt (VMware)config STACK_TRACER
39261778cd7SSteven Rostedt (VMware)	bool "Trace max stack"
39361778cd7SSteven Rostedt (VMware)	depends on HAVE_FUNCTION_TRACER
39461778cd7SSteven Rostedt (VMware)	select FUNCTION_TRACER
39561778cd7SSteven Rostedt (VMware)	select STACKTRACE
39661778cd7SSteven Rostedt (VMware)	select KALLSYMS
39761778cd7SSteven Rostedt (VMware)	help
39861778cd7SSteven Rostedt (VMware)	  This special tracer records the maximum stack footprint of the
3992455f0e1SRoss Zwisler	  kernel and displays it in /sys/kernel/tracing/stack_trace.
40061778cd7SSteven Rostedt (VMware)
40161778cd7SSteven Rostedt (VMware)	  This tracer works by hooking into every function call that the
40261778cd7SSteven Rostedt (VMware)	  kernel executes, and keeping a maximum stack depth value and
40361778cd7SSteven Rostedt (VMware)	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
40461778cd7SSteven Rostedt (VMware)	  then it will not have any overhead while the stack tracer
40561778cd7SSteven Rostedt (VMware)	  is disabled.
40661778cd7SSteven Rostedt (VMware)
40761778cd7SSteven Rostedt (VMware)	  To enable the stack tracer on bootup, pass in 'stacktrace'
40861778cd7SSteven Rostedt (VMware)	  on the kernel command line.
40961778cd7SSteven Rostedt (VMware)
41061778cd7SSteven Rostedt (VMware)	  The stack tracer can also be enabled or disabled via the
41161778cd7SSteven Rostedt (VMware)	  sysctl kernel.stack_tracer_enabled
41261778cd7SSteven Rostedt (VMware)
41361778cd7SSteven Rostedt (VMware)	  Say N if unsure.
41461778cd7SSteven Rostedt (VMware)
415c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
416c3bc8fd6SJoel Fernandes (Google)	bool
417c3bc8fd6SJoel Fernandes (Google)	help
418c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
419c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
420bac429f0SSteven Rostedt
42181d68a96SSteven Rostedtconfig IRQSOFF_TRACER
42281d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
42381d68a96SSteven Rostedt	default n
42481d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
42581d68a96SSteven Rostedt	select TRACE_IRQFLAGS
4265e0a0939SSteven Rostedt	select GENERIC_TRACER
42781d68a96SSteven Rostedt	select TRACER_MAX_TRACE
42885bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
4290b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
43081d68a96SSteven Rostedt	help
43181d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
43281d68a96SSteven Rostedt	  sections, with microsecond accuracy.
43381d68a96SSteven Rostedt
43481d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
43581d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
43681d68a96SSteven Rostedt	  via:
43781d68a96SSteven Rostedt
4382455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
43981d68a96SSteven Rostedt
44040892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
4416cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
4426cd8a4bbSSteven Rostedt	  used together or separately.)
4436cd8a4bbSSteven Rostedt
4446cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
4456cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
4466cd8a4bbSSteven Rostedt	default n
44730c93704SThomas Gleixner	depends on PREEMPTION
4485e0a0939SSteven Rostedt	select GENERIC_TRACER
4496cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
45085bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
4510b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
452c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
4536cd8a4bbSSteven Rostedt	help
45440892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
4556cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
4566cd8a4bbSSteven Rostedt
4576cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
4586cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
4596cd8a4bbSSteven Rostedt	  via:
4606cd8a4bbSSteven Rostedt
4612455f0e1SRoss Zwisler	      echo 0 > /sys/kernel/tracing/tracing_max_latency
4626cd8a4bbSSteven Rostedt
46340892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
4646cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
4656cd8a4bbSSteven Rostedt	  used together or separately.)
4666cd8a4bbSSteven Rostedt
467352ad25aSSteven Rostedtconfig SCHED_TRACER
468352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
4695e0a0939SSteven Rostedt	select GENERIC_TRACER
470352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
471352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
472352ad25aSSteven Rostedt	help
473352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
474352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
475352ad25aSSteven Rostedt
476e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
477e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
478e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
479e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
480e7c15cd8SSteven Rostedt (Red Hat)	help
481e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
482c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
483e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
484e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
485e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
486e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
487e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
488e7c15cd8SSteven Rostedt (Red Hat)
489e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
490e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
491e7c15cd8SSteven Rostedt (Red Hat)
492e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
493e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
494e7c15cd8SSteven Rostedt (Red Hat)				     iteration
495e7c15cd8SSteven Rostedt (Red Hat)
496e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
497c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
498e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
499e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
500e7c15cd8SSteven Rostedt (Red Hat)
501e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
502e7c15cd8SSteven Rostedt (Red Hat)
503e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
504e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
505e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
506e7c15cd8SSteven Rostedt (Red Hat)	 production system.
507e7c15cd8SSteven Rostedt (Red Hat)
508e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
509e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
510e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
511e7c15cd8SSteven Rostedt (Red Hat)
512bce29ac9SDaniel Bristot de Oliveiraconfig OSNOISE_TRACER
513bce29ac9SDaniel Bristot de Oliveira	bool "OS Noise tracer"
514bce29ac9SDaniel Bristot de Oliveira	select GENERIC_TRACER
515e25e43a4SMasami Hiramatsu (Google)	select TRACER_MAX_TRACE
516bce29ac9SDaniel Bristot de Oliveira	help
517bce29ac9SDaniel Bristot de Oliveira	  In the context of high-performance computing (HPC), the Operating
518bce29ac9SDaniel Bristot de Oliveira	  System Noise (osnoise) refers to the interference experienced by an
519bce29ac9SDaniel Bristot de Oliveira	  application due to activities inside the operating system. In the
520bce29ac9SDaniel Bristot de Oliveira	  context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread
521bce29ac9SDaniel Bristot de Oliveira	  can cause noise to the system. Moreover, hardware-related jobs can
522bce29ac9SDaniel Bristot de Oliveira	  also cause noise, for example, via SMIs.
523bce29ac9SDaniel Bristot de Oliveira
524bce29ac9SDaniel Bristot de Oliveira	  The osnoise tracer leverages the hwlat_detector by running a similar
525bce29ac9SDaniel Bristot de Oliveira	  loop with preemption, SoftIRQs and IRQs enabled, thus allowing all
526bce29ac9SDaniel Bristot de Oliveira	  the sources of osnoise during its execution. The osnoise tracer takes
527bce29ac9SDaniel Bristot de Oliveira	  note of the entry and exit point of any source of interferences,
528bce29ac9SDaniel Bristot de Oliveira	  increasing a per-cpu interference counter. It saves an interference
529bce29ac9SDaniel Bristot de Oliveira	  counter for each source of interference. The interference counter for
530bce29ac9SDaniel Bristot de Oliveira	  NMI, IRQs, SoftIRQs, and threads is increased anytime the tool
531bce29ac9SDaniel Bristot de Oliveira	  observes these interferences' entry events. When a noise happens
532bce29ac9SDaniel Bristot de Oliveira	  without any interference from the operating system level, the
533bce29ac9SDaniel Bristot de Oliveira	  hardware noise counter increases, pointing to a hardware-related
534bce29ac9SDaniel Bristot de Oliveira	  noise. In this way, osnoise can account for any source of
535bce29ac9SDaniel Bristot de Oliveira	  interference. At the end of the period, the osnoise tracer prints
536bce29ac9SDaniel Bristot de Oliveira	  the sum of all noise, the max single noise, the percentage of CPU
537bce29ac9SDaniel Bristot de Oliveira	  available for the thread, and the counters for the noise sources.
538bce29ac9SDaniel Bristot de Oliveira
539bce29ac9SDaniel Bristot de Oliveira	  In addition to the tracer, a set of tracepoints were added to
540bce29ac9SDaniel Bristot de Oliveira	  facilitate the identification of the osnoise source.
541bce29ac9SDaniel Bristot de Oliveira
542bce29ac9SDaniel Bristot de Oliveira	  The output will appear in the trace and trace_pipe files.
543bce29ac9SDaniel Bristot de Oliveira
544bce29ac9SDaniel Bristot de Oliveira	  To enable this tracer, echo in "osnoise" into the current_tracer
545bce29ac9SDaniel Bristot de Oliveira          file.
546bce29ac9SDaniel Bristot de Oliveira
547a955d7eaSDaniel Bristot de Oliveiraconfig TIMERLAT_TRACER
548a955d7eaSDaniel Bristot de Oliveira	bool "Timerlat tracer"
549a955d7eaSDaniel Bristot de Oliveira	select OSNOISE_TRACER
550a955d7eaSDaniel Bristot de Oliveira	select GENERIC_TRACER
551a955d7eaSDaniel Bristot de Oliveira	help
552a955d7eaSDaniel Bristot de Oliveira	  The timerlat tracer aims to help the preemptive kernel developers
553a955d7eaSDaniel Bristot de Oliveira	  to find sources of wakeup latencies of real-time threads.
554a955d7eaSDaniel Bristot de Oliveira
555a955d7eaSDaniel Bristot de Oliveira	  The tracer creates a per-cpu kernel thread with real-time priority.
556a955d7eaSDaniel Bristot de Oliveira	  The tracer thread sets a periodic timer to wakeup itself, and goes
557a955d7eaSDaniel Bristot de Oliveira	  to sleep waiting for the timer to fire. At the wakeup, the thread
558a955d7eaSDaniel Bristot de Oliveira	  then computes a wakeup latency value as the difference between
559a955d7eaSDaniel Bristot de Oliveira	  the current time and the absolute time that the timer was set
560a955d7eaSDaniel Bristot de Oliveira	  to expire.
561a955d7eaSDaniel Bristot de Oliveira
562a955d7eaSDaniel Bristot de Oliveira	  The tracer prints two lines at every activation. The first is the
563a955d7eaSDaniel Bristot de Oliveira	  timer latency observed at the hardirq context before the
564a955d7eaSDaniel Bristot de Oliveira	  activation of the thread. The second is the timer latency observed
565a955d7eaSDaniel Bristot de Oliveira	  by the thread, which is the same level that cyclictest reports. The
566a955d7eaSDaniel Bristot de Oliveira	  ACTIVATION ID field serves to relate the irq execution to its
567a955d7eaSDaniel Bristot de Oliveira	  respective thread execution.
568a955d7eaSDaniel Bristot de Oliveira
569a955d7eaSDaniel Bristot de Oliveira	  The tracer is build on top of osnoise tracer, and the osnoise:
570a955d7eaSDaniel Bristot de Oliveira	  events can be used to trace the source of interference from NMI,
571a955d7eaSDaniel Bristot de Oliveira	  IRQs and other threads. It also enables the capture of the
572a955d7eaSDaniel Bristot de Oliveira	  stacktrace at the IRQ context, which helps to identify the code
573a955d7eaSDaniel Bristot de Oliveira	  path that can cause thread delay.
574a955d7eaSDaniel Bristot de Oliveira
57521b3ce30SSteven Rostedt (VMware)config MMIOTRACE
57621b3ce30SSteven Rostedt (VMware)	bool "Memory mapped IO tracing"
57721b3ce30SSteven Rostedt (VMware)	depends on HAVE_MMIOTRACE_SUPPORT && PCI
57821b3ce30SSteven Rostedt (VMware)	select GENERIC_TRACER
57921b3ce30SSteven Rostedt (VMware)	help
58021b3ce30SSteven Rostedt (VMware)	  Mmiotrace traces Memory Mapped I/O access and is meant for
58121b3ce30SSteven Rostedt (VMware)	  debugging and reverse engineering. It is called from the ioremap
58221b3ce30SSteven Rostedt (VMware)	  implementation and works via page faults. Tracing is disabled by
58321b3ce30SSteven Rostedt (VMware)	  default and can be enabled at run-time.
58421b3ce30SSteven Rostedt (VMware)
58521b3ce30SSteven Rostedt (VMware)	  See Documentation/trace/mmiotrace.rst.
58621b3ce30SSteven Rostedt (VMware)	  If you are not helping to develop drivers, say N.
58721b3ce30SSteven Rostedt (VMware)
588897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
589897f17a6SSteven Rostedt	bool "Trace process context switches and events"
5905e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
591b77e38aaSSteven Rostedt	select TRACING
592b77e38aaSSteven Rostedt	help
59340892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
594b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
595897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
596a7abe97fSSteven Rostedt
597ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
598ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
59966700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
6005e0a0939SSteven Rostedt	select GENERIC_TRACER
6010ea1c415SFrederic Weisbecker	select KALLSYMS
602ee08c6ecSFrederic Weisbecker	help
603ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
604ee08c6ecSFrederic Weisbecker
605299ea67eSSteven Rostedtconfig TRACE_SYSCALL_BUF_SIZE_DEFAULT
606299ea67eSSteven Rostedt	int "System call user read max size"
607299ea67eSSteven Rostedt	range 0 165
608299ea67eSSteven Rostedt	default 63
609299ea67eSSteven Rostedt	depends on FTRACE_SYSCALLS
610299ea67eSSteven Rostedt	help
611299ea67eSSteven Rostedt	 Some system call trace events will record the data from a user
612299ea67eSSteven Rostedt	 space address that one of the parameters point to. The amount of
613299ea67eSSteven Rostedt	 data per event is limited. That limit is set by this config and
614299ea67eSSteven Rostedt	 this config also affects how much user space data perf can read.
615299ea67eSSteven Rostedt
616299ea67eSSteven Rostedt	 For a tracing instance, this size may be changed by writing into
617299ea67eSSteven Rostedt	 its syscall_user_buf_size file.
618299ea67eSSteven Rostedt
619debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
620debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
621debdd57fSHiraku Toyooka	help
622debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
623debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
624debdd57fSHiraku Toyooka
6252455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/snapshot
626debdd57fSHiraku Toyooka	      cat snapshot
627debdd57fSHiraku Toyooka
628c4f1fe47SSteven Rostedt	  Note, the latency tracers select this option. To disable it,
629c4f1fe47SSteven Rostedt	  all the latency tracers need to be disabled.
630c4f1fe47SSteven Rostedt
6310b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
6320b85ffc2SSteven Rostedt (Red Hat)	bool "Allow snapshot to swap per CPU"
6330b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
6340b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
6350b85ffc2SSteven Rostedt (Red Hat)	help
6360b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
6370b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
6380b85ffc2SSteven Rostedt (Red Hat)	  allowed:
6390b85ffc2SSteven Rostedt (Red Hat)
6402455f0e1SRoss Zwisler	      echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot
6410b85ffc2SSteven Rostedt (Red Hat)
6420b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
6430b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
6440b85ffc2SSteven Rostedt (Red Hat)
6450b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
6460b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
6470b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
6480b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
6490b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
6500b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
6510b85ffc2SSteven Rostedt (Red Hat)
6522ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
6539ae5b879SSteven Rostedt	bool
6545e0a0939SSteven Rostedt	select GENERIC_TRACER
6559ae5b879SSteven Rostedt
6569ae5b879SSteven Rostedtchoice
6579ae5b879SSteven Rostedt	prompt "Branch Profiling"
6589ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
6599ae5b879SSteven Rostedt	help
6609ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
6619ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
6629ae5b879SSteven Rostedt
6639ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
6649ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
6659ae5b879SSteven Rostedt
66640892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
6679ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
66840892367SRandy Dunlap	 profiler.
6699ae5b879SSteven Rostedt
67040892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
67140892367SRandy Dunlap	 If unsure, choose "No branch profiling".
6729ae5b879SSteven Rostedt
6739ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
6749ae5b879SSteven Rostedt	bool "No branch profiling"
6759ae5b879SSteven Rostedt	help
6769ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
6779ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
6789ae5b879SSteven Rostedt	  Otherwise keep it disabled.
6799ae5b879SSteven Rostedt
6809ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
6819ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
6829ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
6831f0d69a9SSteven Rostedt	help
68459bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
6851f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
6861f0d69a9SSteven Rostedt
6872455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_annotated
6881f0d69a9SSteven Rostedt
68940892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
6901f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
6911f0d69a9SSteven Rostedt
6922bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
69368e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
6949ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
6952bcd521aSSteven Rostedt	help
6962bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
6972bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
6982bcd521aSSteven Rostedt	  The results will be displayed in:
6992bcd521aSSteven Rostedt
7002455f0e1SRoss Zwisler	  /sys/kernel/tracing/trace_stat/branch_all
7012bcd521aSSteven Rostedt
7029ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
7039ae5b879SSteven Rostedt
7042bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
7052bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
70640892367SRandy Dunlap	  is to be analyzed in much detail.
7079ae5b879SSteven Rostedtendchoice
7082bcd521aSSteven Rostedt
7092ed84eebSSteven Rostedtconfig TRACING_BRANCHES
71052f232cbSSteven Rostedt	bool
71152f232cbSSteven Rostedt	help
71252f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
71352f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
71452f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
71552f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
71652f232cbSSteven Rostedt
7172ed84eebSSteven Rostedtconfig BRANCH_TRACER
71852f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
7192ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
7202ed84eebSSteven Rostedt	select TRACING_BRANCHES
72152f232cbSSteven Rostedt	help
72252f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
72352f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
72452f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
72552f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
72652f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
72752f232cbSSteven Rostedt	  events happened, as well as their results.
72852f232cbSSteven Rostedt
72952f232cbSSteven Rostedt	  Say N if unsure.
73052f232cbSSteven Rostedt
7312db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
73240892367SRandy Dunlap	bool "Support for tracing block IO actions"
7332db270a8SFrederic Weisbecker	depends on SYSFS
7341dfba05dSIngo Molnar	depends on BLOCK
7352db270a8SFrederic Weisbecker	select RELAY
7362db270a8SFrederic Weisbecker	select DEBUG_FS
7372db270a8SFrederic Weisbecker	select TRACEPOINTS
7385e0a0939SSteven Rostedt	select GENERIC_TRACER
7392db270a8SFrederic Weisbecker	select STACKTRACE
7402db270a8SFrederic Weisbecker	help
7412db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
7422db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
7432db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
7442db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
7452db270a8SFrederic Weisbecker
7462db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
7472db270a8SFrederic Weisbecker
7482db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
7492db270a8SFrederic Weisbecker
7502db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
7512455f0e1SRoss Zwisler	    echo blk > /sys/kernel/tracing/current_tracer
7522455f0e1SRoss Zwisler	    cat /sys/kernel/tracing/trace_pipe
7532db270a8SFrederic Weisbecker
7542db270a8SFrederic Weisbecker	  If unsure, say N.
75536994e58SFrederic Weisbecker
756334e5519SMasami Hiramatsu (Google)config FPROBE_EVENTS
757334e5519SMasami Hiramatsu (Google)	depends on FPROBE
758334e5519SMasami Hiramatsu (Google)	depends on HAVE_REGS_AND_STACK_ACCESS_API
759334e5519SMasami Hiramatsu (Google)	bool "Enable fprobe-based dynamic events"
760334e5519SMasami Hiramatsu (Google)	select TRACING
761334e5519SMasami Hiramatsu (Google)	select PROBE_EVENTS
762334e5519SMasami Hiramatsu (Google)	select DYNAMIC_EVENTS
763334e5519SMasami Hiramatsu (Google)	default y
764334e5519SMasami Hiramatsu (Google)	help
765334e5519SMasami Hiramatsu (Google)	  This allows user to add tracing events on the function entry and
766334e5519SMasami Hiramatsu (Google)	  exit via ftrace interface. The syntax is same as the kprobe events
767334e5519SMasami Hiramatsu (Google)	  and the kprobe events on function entry and exit will be
768334e5519SMasami Hiramatsu (Google)	  transparently converted to this fprobe events.
769334e5519SMasami Hiramatsu (Google)
770b576e097SMasami Hiramatsu (Google)config PROBE_EVENTS_BTF_ARGS
771b576e097SMasami Hiramatsu (Google)	depends on HAVE_FUNCTION_ARG_ACCESS_API
772b576e097SMasami Hiramatsu (Google)	depends on FPROBE_EVENTS || KPROBE_EVENTS
773b576e097SMasami Hiramatsu (Google)	depends on DEBUG_INFO_BTF && BPF_SYSCALL
774b576e097SMasami Hiramatsu (Google)	bool "Support BTF function arguments for probe events"
775b576e097SMasami Hiramatsu (Google)	default y
776b576e097SMasami Hiramatsu (Google)	help
777b576e097SMasami Hiramatsu (Google)	  The user can specify the arguments of the probe event using the names
778b576e097SMasami Hiramatsu (Google)	  of the arguments of the probed function, when the probe location is a
779b576e097SMasami Hiramatsu (Google)	  kernel function entry or a tracepoint.
780b576e097SMasami Hiramatsu (Google)	  This is available only if BTF (BPF Type Format) support is enabled.
781b576e097SMasami Hiramatsu (Google)
782*dccddc39SMasami Hiramatsu (Google)config PROBE_EVENTS_DUMP_FETCHARG
783*dccddc39SMasami Hiramatsu (Google)	bool "Dump of dynamic probe event fetch-arguments"
784*dccddc39SMasami Hiramatsu (Google)	depends on PROBE_EVENTS
785*dccddc39SMasami Hiramatsu (Google)	default n
786*dccddc39SMasami Hiramatsu (Google)	help
787*dccddc39SMasami Hiramatsu (Google)	  This shows the dump of fetch-arguments of dynamic probe events
788*dccddc39SMasami Hiramatsu (Google)	  alongside their event definitions in the dynamic_events file
789*dccddc39SMasami Hiramatsu (Google)	  as comment lines. This is useful to debug the probe events.
790*dccddc39SMasami Hiramatsu (Google)	  Since this exposes the raw values in the dynamic_events file,
791*dccddc39SMasami Hiramatsu (Google)	  it might be a security risk. Only enable it if you need to debug
792*dccddc39SMasami Hiramatsu (Google)	  probe events themselves.
793*dccddc39SMasami Hiramatsu (Google)
7946b0b7551SAnton Blanchardconfig KPROBE_EVENTS
795413d37d1SMasami Hiramatsu	depends on KPROBES
796f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
79777b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
798413d37d1SMasami Hiramatsu	select TRACING
7998ab83f56SSrikar Dronamraju	select PROBE_EVENTS
8006212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
80177b44d1bSMasami Hiramatsu	default y
802413d37d1SMasami Hiramatsu	help
80340892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
80440892367SRandy Dunlap	  on the fly via the ftrace interface. See
8055fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
80677b44d1bSMasami Hiramatsu
80777b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
80877b44d1bSMasami Hiramatsu	  various register and memory values.
80977b44d1bSMasami Hiramatsu
81040892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
81140892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
812413d37d1SMasami Hiramatsu
81345408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
81445408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
81545408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
8167bb83f6fSMasami Hiramatsu	depends on DYNAMIC_FTRACE
81745408c4fSMasami Hiramatsu	default n
81845408c4fSMasami Hiramatsu	help
81945408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
82045408c4fSMasami Hiramatsu	  using kprobe events.
82145408c4fSMasami Hiramatsu
82245408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
82328cc65a1SColin Ian King	  functions are protected from kprobe-events to prevent an infinite
82445408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
82545408c4fSMasami Hiramatsu	  crash.
82645408c4fSMasami Hiramatsu
82745408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
82845408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
82945408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
83045408c4fSMasami Hiramatsu
83145408c4fSMasami Hiramatsu	  If unsure, say N.
83245408c4fSMasami Hiramatsu
8336b0b7551SAnton Blanchardconfig UPROBE_EVENTS
834f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
835f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
836f3f096cfSSrikar Dronamraju	depends on MMU
83709294e31SDavid A. Long	depends on PERF_EVENTS
838f3f096cfSSrikar Dronamraju	select UPROBES
839f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
8400597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
841f3f096cfSSrikar Dronamraju	select TRACING
84261f35d75SArnaldo Carvalho de Melo	default y
843f3f096cfSSrikar Dronamraju	help
844f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
845f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
846f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
847f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
848f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
849f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
850f3f096cfSSrikar Dronamraju
8510dd1274aSSteven Rostedtconfig EPROBE_EVENTS
8520dd1274aSSteven Rostedt	bool "Enable event-based dynamic events"
8530dd1274aSSteven Rostedt	depends on TRACING
8540dd1274aSSteven Rostedt	depends on HAVE_REGS_AND_STACK_ACCESS_API
8550dd1274aSSteven Rostedt	select PROBE_EVENTS
8560dd1274aSSteven Rostedt	select DYNAMIC_EVENTS
8570dd1274aSSteven Rostedt	default y
8580dd1274aSSteven Rostedt	help
8590dd1274aSSteven Rostedt	  Eprobes are dynamic events that can be placed on other existing
8600dd1274aSSteven Rostedt	  events. It can be used to limit what fields are recorded in
8610dd1274aSSteven Rostedt	  an event or even dereference a field of an event. It can
8620dd1274aSSteven Rostedt	  convert the type of an event field. For example, turn an
8630dd1274aSSteven Rostedt	  address into a string.
8640dd1274aSSteven Rostedt
865e1abf2ccSIngo Molnarconfig BPF_EVENTS
866e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
8676b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
868e1abf2ccSIngo Molnar	bool
869e1abf2ccSIngo Molnar	default y
870e1abf2ccSIngo Molnar	help
8715cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
8725cbd22c1SPeter Wu	  tracepoint events.
873e1abf2ccSIngo Molnar
8745448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
8755448d44cSMasami Hiramatsu	def_bool n
8765448d44cSMasami Hiramatsu
8778ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
8788ab83f56SSrikar Dronamraju	def_bool n
8798ab83f56SSrikar Dronamraju
8809802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
8819802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
8829802d865SJosef Bacik	depends on BPF_EVENTS
883540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
8849802d865SJosef Bacik	default n
8859802d865SJosef Bacik	help
8869802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
8879802d865SJosef Bacik	 set a different return value.  This is used for error injection.
8889802d865SJosef Bacik
8893b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8903b15cdc1SSami Tolvanen	bool
8914d6d0a62SSteven Rostedt	depends on DYNAMIC_FTRACE
8923b15cdc1SSami Tolvanen
8933b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_CC
8943b15cdc1SSami Tolvanen	def_bool y
8953b15cdc1SSami Tolvanen	depends on $(cc-option,-mrecord-mcount)
8963b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
8974d6d0a62SSteven Rostedt	depends on DYNAMIC_FTRACE
8983b15cdc1SSami Tolvanen
89922c8542dSSami Tolvanenconfig FTRACE_MCOUNT_USE_OBJTOOL
90022c8542dSSami Tolvanen	def_bool y
90122c8542dSSami Tolvanen	depends on HAVE_OBJTOOL_MCOUNT
90222c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
90322c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
9044d6d0a62SSteven Rostedt	depends on DYNAMIC_FTRACE
90503f16cd0SJosh Poimboeuf	select OBJTOOL
90622c8542dSSami Tolvanen
9073b15cdc1SSami Tolvanenconfig FTRACE_MCOUNT_USE_RECORDMCOUNT
9083b15cdc1SSami Tolvanen	def_bool y
9093b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
9103b15cdc1SSami Tolvanen	depends on !FTRACE_MCOUNT_USE_CC
91122c8542dSSami Tolvanen	depends on !FTRACE_MCOUNT_USE_OBJTOOL
9124d6d0a62SSteven Rostedt	depends on DYNAMIC_FTRACE
9133b15cdc1SSami Tolvanen
91408d43a5fSTom Zanussiconfig TRACING_MAP
91508d43a5fSTom Zanussi	bool
91608d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
91708d43a5fSTom Zanussi	help
91808d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
91908d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
92008d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
92108d43a5fSTom Zanussi	  generally used outside of that context, and is normally
92208d43a5fSTom Zanussi	  selected by tracers that use it.
92308d43a5fSTom Zanussi
924726721a5STom Zanussiconfig SYNTH_EVENTS
925726721a5STom Zanussi	bool "Synthetic trace events"
926726721a5STom Zanussi	select TRACING
927726721a5STom Zanussi	select DYNAMIC_EVENTS
928726721a5STom Zanussi	default n
929726721a5STom Zanussi	help
930726721a5STom Zanussi	  Synthetic events are user-defined trace events that can be
931726721a5STom Zanussi	  used to combine data from other trace events or in fact any
932726721a5STom Zanussi	  data source.  Synthetic events can be generated indirectly
933726721a5STom Zanussi	  via the trace() action of histogram triggers or directly
934726721a5STom Zanussi	  by way of an in-kernel API.
935726721a5STom Zanussi
936726721a5STom Zanussi	  See Documentation/trace/events.rst or
937726721a5STom Zanussi	  Documentation/trace/histogram.rst for details and examples.
938726721a5STom Zanussi
939726721a5STom Zanussi	  If in doubt, say N.
940726721a5STom Zanussi
9417f5a08c7SBeau Belgraveconfig USER_EVENTS
9427f5a08c7SBeau Belgrave	bool "User trace events"
9437f5a08c7SBeau Belgrave	select TRACING
9447f5a08c7SBeau Belgrave	select DYNAMIC_EVENTS
9457f5a08c7SBeau Belgrave	help
9467f5a08c7SBeau Belgrave	  User trace events are user-defined trace events that
9477f5a08c7SBeau Belgrave	  can be used like an existing kernel trace event.  User trace
9487f5a08c7SBeau Belgrave	  events are generated by writing to a tracefs file.  User
9497f5a08c7SBeau Belgrave	  processes can determine if their tracing events should be
95072357590SBeau Belgrave	  generated by registering a value and bit with the kernel
95172357590SBeau Belgrave	  that reflects when it is enabled or not.
9527f5a08c7SBeau Belgrave
95372357590SBeau Belgrave	  See Documentation/trace/user_events.rst.
9547f5a08c7SBeau Belgrave	  If in doubt, say N.
9557f5a08c7SBeau Belgrave
9567ef224d1STom Zanussiconfig HIST_TRIGGERS
9577ef224d1STom Zanussi	bool "Histogram triggers"
9587ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
9597ef224d1STom Zanussi	select TRACING_MAP
9607ad8fb61STom Zanussi	select TRACING
9617bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
962726721a5STom Zanussi	select SYNTH_EVENTS
9637ef224d1STom Zanussi	default n
9647ef224d1STom Zanussi	help
9657ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
9667ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
9677ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
9687ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
9697ef224d1STom Zanussi	  event activity as an initial guide for further investigation
9707ef224d1STom Zanussi	  using more advanced tools.
9717ef224d1STom Zanussi
97289e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
97389e270c1STom Zanussi	  supported using hist triggers under this option.
97489e270c1STom Zanussi
975ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
9767ef224d1STom Zanussi	  If in doubt, say N.
9777ef224d1STom Zanussi
9786c3edaf9SCong Wangconfig TRACE_EVENT_INJECT
9796c3edaf9SCong Wang	bool "Trace event injection"
9806c3edaf9SCong Wang	depends on TRACING
9816c3edaf9SCong Wang	help
9826c3edaf9SCong Wang	  Allow user-space to inject a specific trace event into the ring
9836c3edaf9SCong Wang	  buffer. This is mainly used for testing purpose.
9846c3edaf9SCong Wang
9856c3edaf9SCong Wang	  If unsure, say N.
9866c3edaf9SCong Wang
98781dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
98881dc9f0eSSteven Rostedt (Red Hat)	bool "Add tracepoint that benchmarks tracepoints"
98981dc9f0eSSteven Rostedt (Red Hat)	help
99081dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
99181dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
99269268094SRolf Eike Beer	 goes into an infinite loop (calling cond_resched() to let other tasks
99381dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
99481dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
99581dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
99681dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
99781dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
99881dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
99981dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
100081dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
100181dc9f0eSSteven Rostedt (Red Hat)
100281dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
100381dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
100481dc9f0eSSteven Rostedt (Red Hat)
100581dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
100681dc9f0eSSteven Rostedt (Red Hat)
100781dc9f0eSSteven Rostedt (Red Hat)	      START
100881dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
100981dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
101081dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
101181dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
101281dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
101381dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
101481dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
101581dc9f0eSSteven Rostedt (Red Hat)
101681dc9f0eSSteven Rostedt (Red Hat)
10175092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
10185092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
10195092dbc9SSteven Rostedt	depends on RING_BUFFER
10205092dbc9SSteven Rostedt	help
10215092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
102240892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
10235092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
10245092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
10255092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
10265092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
10275092dbc9SSteven Rostedt
10285092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
10295092dbc9SSteven Rostedt	  affected by processes that are running.
10305092dbc9SSteven Rostedt
103140892367SRandy Dunlap	  If unsure, say N.
10325092dbc9SSteven Rostedt
10331e837945SSteven Rostedt (VMware)config TRACE_EVAL_MAP_FILE
10341e837945SSteven Rostedt (VMware)       bool "Show eval mappings for trace events"
10351e837945SSteven Rostedt (VMware)       depends on TRACING
10361e837945SSteven Rostedt (VMware)       help
10371e837945SSteven Rostedt (VMware)	The "print fmt" of the trace events will show the enum/sizeof names
10381e837945SSteven Rostedt (VMware)	instead of their values. This can cause problems for user space tools
10391e837945SSteven Rostedt (VMware)	that use this string to parse the raw data as user space does not know
10401e837945SSteven Rostedt (VMware)	how to convert the string to its value.
10411e837945SSteven Rostedt (VMware)
10421e837945SSteven Rostedt (VMware)	To fix this, there's a special macro in the kernel that can be used
10431e837945SSteven Rostedt (VMware)	to convert an enum/sizeof into its value. If this macro is used, then
10441e837945SSteven Rostedt (VMware)	the print fmt strings will be converted to their values.
10451e837945SSteven Rostedt (VMware)
10461e837945SSteven Rostedt (VMware)	If something does not get converted properly, this option can be
10471e837945SSteven Rostedt (VMware)	used to show what enums/sizeof the kernel tried to convert.
10481e837945SSteven Rostedt (VMware)
10491e837945SSteven Rostedt (VMware)	This option is for debugging the conversions. A file is created
10501e837945SSteven Rostedt (VMware)	in the tracing directory called "eval_map" that will show the
10511e837945SSteven Rostedt (VMware)	names matched with their values and what trace event system they
10521e837945SSteven Rostedt (VMware)	belong too.
10531e837945SSteven Rostedt (VMware)
10541e837945SSteven Rostedt (VMware)	Normally, the mapping of the strings to values will be freed after
10551e837945SSteven Rostedt (VMware)	boot up or module load. With this option, they will not be freed, as
10561e837945SSteven Rostedt (VMware)	they are needed for the "eval_map" file. Enabling this option will
10571e837945SSteven Rostedt (VMware)	increase the memory footprint of the running kernel.
10581e837945SSteven Rostedt (VMware)
10591e837945SSteven Rostedt (VMware)	If unsure, say N.
10601e837945SSteven Rostedt (VMware)
1061773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION
1062773c1670SSteven Rostedt (VMware)	bool "Record functions that recurse in function tracing"
1063773c1670SSteven Rostedt (VMware)	depends on FUNCTION_TRACER
1064773c1670SSteven Rostedt (VMware)	help
1065773c1670SSteven Rostedt (VMware)	  All callbacks that attach to the function tracing have some sort
1066773c1670SSteven Rostedt (VMware)	  of protection against recursion. Even though the protection exists,
1067773c1670SSteven Rostedt (VMware)	  it adds overhead. This option will create a file in the tracefs
1068773c1670SSteven Rostedt (VMware)	  file system called "recursed_functions" that will list the functions
1069773c1670SSteven Rostedt (VMware)	  that triggered a recursion.
1070773c1670SSteven Rostedt (VMware)
1071773c1670SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
1072773c1670SSteven Rostedt (VMware)
1073773c1670SSteven Rostedt (VMware)	  If unsure, say N
1074773c1670SSteven Rostedt (VMware)
1075773c1670SSteven Rostedt (VMware)config FTRACE_RECORD_RECURSION_SIZE
1076773c1670SSteven Rostedt (VMware)	int "Max number of recursed functions to record"
1077773c1670SSteven Rostedt (VMware)	default 128
1078773c1670SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
1079773c1670SSteven Rostedt (VMware)	help
1080773c1670SSteven Rostedt (VMware)	  This defines the limit of number of functions that can be
1081773c1670SSteven Rostedt (VMware)	  listed in the "recursed_functions" file, that lists all
1082773c1670SSteven Rostedt (VMware)	  the functions that caused a recursion to happen.
1083773c1670SSteven Rostedt (VMware)	  This file can be reset, but the limit can not change in
1084773c1670SSteven Rostedt (VMware)	  size at runtime.
1085773c1670SSteven Rostedt (VMware)
1086b0e28a4bSAndrii Nakryikoconfig FTRACE_VALIDATE_RCU_IS_WATCHING
1087b0e28a4bSAndrii Nakryiko	bool "Validate RCU is on during ftrace execution"
1088b0e28a4bSAndrii Nakryiko	depends on FUNCTION_TRACER
1089b0e28a4bSAndrii Nakryiko	depends on ARCH_WANTS_NO_INSTR
1090b0e28a4bSAndrii Nakryiko	help
1091b0e28a4bSAndrii Nakryiko	  All callbacks that attach to the function tracing have some sort of
1092b0e28a4bSAndrii Nakryiko	  protection against recursion. This option is only to verify that
1093b0e28a4bSAndrii Nakryiko	  ftrace (and other users of ftrace_test_recursion_trylock()) are not
1094b0e28a4bSAndrii Nakryiko	  called outside of RCU, as if they are, it can cause a race. But it
1095b0e28a4bSAndrii Nakryiko	  also has a noticeable overhead when enabled.
1096b0e28a4bSAndrii Nakryiko
1097b0e28a4bSAndrii Nakryiko	  If unsure, say N
1098b0e28a4bSAndrii Nakryiko
109928575c61SSteven Rostedt (VMware)config RING_BUFFER_RECORD_RECURSION
110028575c61SSteven Rostedt (VMware)	bool "Record functions that recurse in the ring buffer"
110128575c61SSteven Rostedt (VMware)	depends on FTRACE_RECORD_RECURSION
110228575c61SSteven Rostedt (VMware)	# default y, because it is coupled with FTRACE_RECORD_RECURSION
110328575c61SSteven Rostedt (VMware)	default y
110428575c61SSteven Rostedt (VMware)	help
110528575c61SSteven Rostedt (VMware)	  The ring buffer has its own internal recursion. Although when
1106ac28d0a0SRandy Dunlap	  recursion happens it won't cause harm because of the protection,
1107ac28d0a0SRandy Dunlap	  but it does cause unwanted overhead. Enabling this option will
110828575c61SSteven Rostedt (VMware)	  place where recursion was detected into the ftrace "recursed_functions"
110928575c61SSteven Rostedt (VMware)	  file.
111028575c61SSteven Rostedt (VMware)
111128575c61SSteven Rostedt (VMware)	  This will add more overhead to cases that have recursion.
111228575c61SSteven Rostedt (VMware)
11131e837945SSteven Rostedt (VMware)config GCOV_PROFILE_FTRACE
11141e837945SSteven Rostedt (VMware)	bool "Enable GCOV profiling on ftrace subsystem"
11151e837945SSteven Rostedt (VMware)	depends on GCOV_KERNEL
11161e837945SSteven Rostedt (VMware)	help
11171e837945SSteven Rostedt (VMware)	  Enable GCOV profiling on ftrace subsystem for checking
11181e837945SSteven Rostedt (VMware)	  which functions/lines are tested.
11191e837945SSteven Rostedt (VMware)
11201e837945SSteven Rostedt (VMware)	  If unsure, say N.
11211e837945SSteven Rostedt (VMware)
11221e837945SSteven Rostedt (VMware)	  Note that on a kernel compiled with this config, ftrace will
11231e837945SSteven Rostedt (VMware)	  run significantly slower.
11241e837945SSteven Rostedt (VMware)
11251e837945SSteven Rostedt (VMware)config FTRACE_SELFTEST
11261e837945SSteven Rostedt (VMware)	bool
11271e837945SSteven Rostedt (VMware)
11281e837945SSteven Rostedt (VMware)config FTRACE_STARTUP_TEST
11291e837945SSteven Rostedt (VMware)	bool "Perform a startup test on ftrace"
11301e837945SSteven Rostedt (VMware)	depends on GENERIC_TRACER
11311e837945SSteven Rostedt (VMware)	select FTRACE_SELFTEST
11321e837945SSteven Rostedt (VMware)	help
11331e837945SSteven Rostedt (VMware)	  This option performs a series of startup tests on ftrace. On bootup
11341e837945SSteven Rostedt (VMware)	  a series of tests are made to verify that the tracer is
11351e837945SSteven Rostedt (VMware)	  functioning properly. It will do tests on all the configured
11361e837945SSteven Rostedt (VMware)	  tracers of ftrace.
11371e837945SSteven Rostedt (VMware)
11381e837945SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
11391e837945SSteven Rostedt (VMware)	bool "Run selftest on trace events"
11401e837945SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
11411e837945SSteven Rostedt (VMware)	default y
11421e837945SSteven Rostedt (VMware)	help
11431e837945SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
11441e837945SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
11451e837945SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
11461e837945SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
11471e837945SSteven Rostedt (VMware)
11481e837945SSteven Rostedt (VMware)config EVENT_TRACE_TEST_SYSCALLS
11491e837945SSteven Rostedt (VMware)	bool "Run selftest on syscall events"
11501e837945SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
11511e837945SSteven Rostedt (VMware)	help
11521e837945SSteven Rostedt (VMware)	 This option will also enable testing every syscall event.
11531e837945SSteven Rostedt (VMware)	 It only enables the event and disables it and runs various loads
11541e837945SSteven Rostedt (VMware)	 with the event enabled. This adds a bit more time for kernel boot
11551e837945SSteven Rostedt (VMware)	 up since it runs this on every system call defined.
11561e837945SSteven Rostedt (VMware)
11571e837945SSteven Rostedt (VMware)	 TBD - enable a way to actually call the syscalls as we test their
11581e837945SSteven Rostedt (VMware)	       events
11591e837945SSteven Rostedt (VMware)
11608147dc78SSteven Rostedt (VMware)config FTRACE_SORT_STARTUP_TEST
11618147dc78SSteven Rostedt (VMware)       bool "Verify compile time sorting of ftrace functions"
11628147dc78SSteven Rostedt (VMware)       depends on DYNAMIC_FTRACE
11636b9b6413SSteven Rostedt (Google)       depends on BUILDTIME_MCOUNT_SORT
11648147dc78SSteven Rostedt (VMware)       help
11658147dc78SSteven Rostedt (VMware)	 Sorting of the mcount_loc sections that is used to find the
11668147dc78SSteven Rostedt (VMware)	 where the ftrace knows where to patch functions for tracing
11678147dc78SSteven Rostedt (VMware)	 and other callbacks is done at compile time. But if the sort
11688147dc78SSteven Rostedt (VMware)	 is not done correctly, it will cause non-deterministic failures.
11698147dc78SSteven Rostedt (VMware)	 When this is set, the sorted sections will be verified that they
11708147dc78SSteven Rostedt (VMware)	 are in deed sorted and will warn if they are not.
11718147dc78SSteven Rostedt (VMware)
11728147dc78SSteven Rostedt (VMware)	 If unsure, say N
11738147dc78SSteven Rostedt (VMware)
11746c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
11756c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
11766c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
11776c43e554SSteven Rostedt (Red Hat)       help
11786c43e554SSteven Rostedt (Red Hat)	 Run a simple self test on the ring buffer on boot up. Late in the
11796c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
11806c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
11816c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
11826c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
11836c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
11846c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
11856c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
11866c43e554SSteven Rostedt (Red Hat)
11876c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
11886c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
11896c43e554SSteven Rostedt (Red Hat)
1190ac28d0a0SRandy Dunlap	 At the end of the test, statistics and more checks are done.
1191ac28d0a0SRandy Dunlap	 It will output the stats of each per cpu buffer: What
11926c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
11936c43e554SSteven Rostedt (Red Hat)	 other similar details.
11946c43e554SSteven Rostedt (Red Hat)
11956c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
11966c43e554SSteven Rostedt (Red Hat)
11975b7be9c7SSteven Rostedt (VMware)config RING_BUFFER_VALIDATE_TIME_DELTAS
11985b7be9c7SSteven Rostedt (VMware)	bool "Verify ring buffer time stamp deltas"
11995b7be9c7SSteven Rostedt (VMware)	depends on RING_BUFFER
12005b7be9c7SSteven Rostedt (VMware)	help
12015b7be9c7SSteven Rostedt (VMware)	  This will audit the time stamps on the ring buffer sub
12025b7be9c7SSteven Rostedt (VMware)	  buffer to make sure that all the time deltas for the
12035b7be9c7SSteven Rostedt (VMware)	  events on a sub buffer matches the current time stamp.
12045b7be9c7SSteven Rostedt (VMware)	  This audit is performed for every event that is not
12055b7be9c7SSteven Rostedt (VMware)	  interrupted, or interrupting another event. A check
12065b7be9c7SSteven Rostedt (VMware)	  is also made when traversing sub buffers to make sure
12075b7be9c7SSteven Rostedt (VMware)	  that all the deltas on the previous sub buffer do not
12085b7be9c7SSteven Rostedt (VMware)	  add up to be greater than the current time stamp.
12095b7be9c7SSteven Rostedt (VMware)
12105b7be9c7SSteven Rostedt (VMware)	  NOTE: This adds significant overhead to recording of events,
12115b7be9c7SSteven Rostedt (VMware)	  and should only be used to test the logic of the ring buffer.
12125b7be9c7SSteven Rostedt (VMware)	  Do not use it on production systems.
12135b7be9c7SSteven Rostedt (VMware)
12145b7be9c7SSteven Rostedt (VMware)	  Only say Y if you understand what this does, and you
12155b7be9c7SSteven Rostedt (VMware)	  still want it enabled. Otherwise say N
12165b7be9c7SSteven Rostedt (VMware)
121768413a36SMasami Hiramatsu (Google)config RING_BUFFER_PERSISTENT_INJECT
121868413a36SMasami Hiramatsu (Google)	bool "Enable persistent ring buffer error injection test"
121968413a36SMasami Hiramatsu (Google)	depends on RING_BUFFER
122068413a36SMasami Hiramatsu (Google)	help
122168413a36SMasami Hiramatsu (Google)	  This option will have the kernel check if the persistent ring
122268413a36SMasami Hiramatsu (Google)	  buffer is named "ptracingtest". and if so, it will corrupt some
122368413a36SMasami Hiramatsu (Google)	  of its pages on a kernel panic. This is used to test if the
122468413a36SMasami Hiramatsu (Google)	  persistent ring buffer can recover from some of its sub-buffers
122568413a36SMasami Hiramatsu (Google)	  being corrupted.
122668413a36SMasami Hiramatsu (Google)	  To use this, boot a kernel with a "ptracingtest" persistent
122768413a36SMasami Hiramatsu (Google)	  ring buffer, e.g.
122868413a36SMasami Hiramatsu (Google)
122968413a36SMasami Hiramatsu (Google)	   reserve_mem=20M:2M:trace trace_instance=ptracingtest@trace panic=1
123068413a36SMasami Hiramatsu (Google)
123168413a36SMasami Hiramatsu (Google)	  And after the 1st boot, run the following commands:
123268413a36SMasami Hiramatsu (Google)
123368413a36SMasami Hiramatsu (Google)	   cd /sys/kernel/tracing/instances/ptracingtest
123468413a36SMasami Hiramatsu (Google)	   echo 1 > events/enable
123568413a36SMasami Hiramatsu (Google)	   echo 1 > tracing_on
123668413a36SMasami Hiramatsu (Google)	   sleep 3
123768413a36SMasami Hiramatsu (Google)	   echo c > /proc/sysrq-trigger
123868413a36SMasami Hiramatsu (Google)
123968413a36SMasami Hiramatsu (Google)	  After the panic message, the kernel will reboot and will show
124068413a36SMasami Hiramatsu (Google)	  the test results in the console output.
124168413a36SMasami Hiramatsu (Google)
124268413a36SMasami Hiramatsu (Google)	  Note that events for the test ring buffer needs to be enabled
124368413a36SMasami Hiramatsu (Google)	  prior to crashing the kernel so that the ring buffer has content
124468413a36SMasami Hiramatsu (Google)	  that the test will corrupt.
124568413a36SMasami Hiramatsu (Google)	  As the test will corrupt events in the "ptracingtest" persistent
124668413a36SMasami Hiramatsu (Google)	  ring buffer, it should not be used for any other purpose other
124768413a36SMasami Hiramatsu (Google)	  than this test.
124868413a36SMasami Hiramatsu (Google)
124968413a36SMasami Hiramatsu (Google)	  If unsure, say N
125068413a36SMasami Hiramatsu (Google)
1251a48fc4f5SSteven Rostedt (VMware)config MMIOTRACE_TEST
1252a48fc4f5SSteven Rostedt (VMware)	tristate "Test module for mmiotrace"
1253a48fc4f5SSteven Rostedt (VMware)	depends on MMIOTRACE && m
1254a48fc4f5SSteven Rostedt (VMware)	help
1255a48fc4f5SSteven Rostedt (VMware)	  This is a dumb module for testing mmiotrace. It is very dangerous
1256a48fc4f5SSteven Rostedt (VMware)	  as it will write garbage to IO memory starting at a given address.
1257a48fc4f5SSteven Rostedt (VMware)	  However, it should be safe to use on e.g. unused portion of VRAM.
1258a48fc4f5SSteven Rostedt (VMware)
1259a48fc4f5SSteven Rostedt (VMware)	  Say N, unless you absolutely know what you are doing.
1260a48fc4f5SSteven Rostedt (VMware)
1261f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
1262a48fc4f5SSteven Rostedt (VMware)	tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
1263f96e8577SJoel Fernandes (Google)	depends on m
1264f96e8577SJoel Fernandes (Google)	help
1265f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
1266f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
1267f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
1268f96e8577SJoel Fernandes (Google)	  critical section.
1269f96e8577SJoel Fernandes (Google)
127079393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
127179393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
127279393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
1273f96e8577SJoel Fernandes (Google)
12744b9091e1SSong Chen	  What's more, if you want to attach the test on the cpu which the latency
12754b9091e1SSong Chen	  tracer is running on, specify cpu_affinity=cpu_num at the end of the
12764b9091e1SSong Chen	  command.
12774b9091e1SSong Chen
1278f96e8577SJoel Fernandes (Google)	  If unsure, say N
1279f96e8577SJoel Fernandes (Google)
12809fe41efaSTom Zanussiconfig SYNTH_EVENT_GEN_TEST
12819fe41efaSTom Zanussi	tristate "Test module for in-kernel synthetic event generation"
12823572bd56SMasami Hiramatsu (Google)	depends on SYNTH_EVENTS && m
12839fe41efaSTom Zanussi	help
12849fe41efaSTom Zanussi          This option creates a test module to check the base
12859fe41efaSTom Zanussi          functionality of in-kernel synthetic event definition and
12869fe41efaSTom Zanussi          generation.
12879fe41efaSTom Zanussi
12889fe41efaSTom Zanussi          To test, insert the module, and then check the trace buffer
12899fe41efaSTom Zanussi	  for the generated sample events.
12909fe41efaSTom Zanussi
12919fe41efaSTom Zanussi	  If unsure, say N.
12929fe41efaSTom Zanussi
129364836248STom Zanussiconfig KPROBE_EVENT_GEN_TEST
129464836248STom Zanussi	tristate "Test module for in-kernel kprobe event generation"
12953572bd56SMasami Hiramatsu (Google)	depends on KPROBE_EVENTS && m
129664836248STom Zanussi	help
129764836248STom Zanussi          This option creates a test module to check the base
129864836248STom Zanussi          functionality of in-kernel kprobe event definition.
129964836248STom Zanussi
130064836248STom Zanussi          To test, insert the module, and then check the trace buffer
130164836248STom Zanussi	  for the generated kprobe events.
130264836248STom Zanussi
130364836248STom Zanussi	  If unsure, say N.
130464836248STom Zanussi
13052d19bd79STom Zanussiconfig HIST_TRIGGERS_DEBUG
13062d19bd79STom Zanussi	bool "Hist trigger debug support"
13072d19bd79STom Zanussi	depends on HIST_TRIGGERS
13082d19bd79STom Zanussi	help
13092d19bd79STom Zanussi          Add "hist_debug" file for each event, which when read will
13102d19bd79STom Zanussi          dump out a bunch of internal details about the hist triggers
13112d19bd79STom Zanussi          defined on that event.
13122d19bd79STom Zanussi
13132d19bd79STom Zanussi          The hist_debug file serves a couple of purposes:
13142d19bd79STom Zanussi
13152d19bd79STom Zanussi            - Helps developers verify that nothing is broken.
13162d19bd79STom Zanussi
13172d19bd79STom Zanussi            - Provides educational information to support the details
13182d19bd79STom Zanussi              of the hist trigger internals as described by
13192d19bd79STom Zanussi              Documentation/trace/histogram-design.rst.
13202d19bd79STom Zanussi
13212d19bd79STom Zanussi          The hist_debug output only covers the data structures
13222d19bd79STom Zanussi          related to the histogram definitions themselves and doesn't
13232d19bd79STom Zanussi          display the internals of map buckets or variable values of
13242d19bd79STom Zanussi          running histograms.
13252d19bd79STom Zanussi
13262d19bd79STom Zanussi          If unsure, say N.
13272d19bd79STom Zanussi
1328102227b9SDaniel Bristot de Oliveirasource "kernel/trace/rv/Kconfig"
1329102227b9SDaniel Bristot de Oliveira
133096e43537SVincent Donnefortconfig TRACE_REMOTE
133196e43537SVincent Donnefort	bool
133296e43537SVincent Donnefort
133334e5b958SVincent Donnefortconfig SIMPLE_RING_BUFFER
133434e5b958SVincent Donnefort	bool
133534e5b958SVincent Donnefort
1336ea908a2bSVincent Donnefortconfig TRACE_REMOTE_TEST
1337ea908a2bSVincent Donnefort	tristate "Test module for remote tracing"
1338ea908a2bSVincent Donnefort	select TRACE_REMOTE
1339ea908a2bSVincent Donnefort	select SIMPLE_RING_BUFFER
1340ea908a2bSVincent Donnefort	help
1341ea908a2bSVincent Donnefort	  This trace remote includes a ring-buffer writer implementation using
1342ea908a2bSVincent Donnefort	  "simple_ring_buffer". This is solely intending for testing.
1343ea908a2bSVincent Donnefort
13444ed9f071SSteven Rostedtendif # FTRACE
1345