xref: /linux/kernel/trace/Kconfig (revision 793937236d1ee032d2ee5ccc27bdd280a04e766e)
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
1378d904b4SSteven Rostedtconfig HAVE_FTRACE_NMI_ENTER
1478d904b4SSteven Rostedt	bool
15555f386cSMike Frysinger	help
165fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
1778d904b4SSteven Rostedt
18606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
1916444a8aSArnaldo Carvalho de Melo	bool
20555f386cSMike Frysinger	help
215fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
22bc0c38d1SSteven Rostedt
23fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER
2415e6cb36SFrederic Weisbecker	bool
25555f386cSMike Frysinger	help
265fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
2715e6cb36SFrederic Weisbecker
28677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
29677aa9f7SSteven Rostedt	bool
30555f386cSMike Frysinger	help
315fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
32677aa9f7SSteven Rostedt
3306aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
3406aeaaeaSMasami Hiramatsu	bool
3506aeaaeaSMasami Hiramatsu
36763e34e7SSteven Rostedt (VMware)config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
37763e34e7SSteven Rostedt (VMware)	bool
38763e34e7SSteven Rostedt (VMware)
398da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
408da3821bSSteven Rostedt	bool
41555f386cSMike Frysinger	help
425fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
438da3821bSSteven Rostedt
4466700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
45ee08c6ecSFrederic Weisbecker	bool
46555f386cSMike Frysinger	help
475fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
48ee08c6ecSFrederic Weisbecker
49a2546faeSSteven Rostedtconfig HAVE_FENTRY
50a2546faeSSteven Rostedt	bool
51a2546faeSSteven Rostedt	help
52a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
53a2546faeSSteven Rostedt
542f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
552f4df001SVasily Gorbik	bool
562f4df001SVasily Gorbik	help
572f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
582f4df001SVasily Gorbik
59cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
6072441cb1SSteven Rostedt	bool
6172441cb1SSteven Rostedt	help
6272441cb1SSteven Rostedt	  C version of recordmcount available?
6372441cb1SSteven Rostedt
64352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
65352ad25aSSteven Rostedt	bool
66352ad25aSSteven Rostedt
67ea632e9fSJosh Triplettconfig TRACE_CLOCK
68ea632e9fSJosh Triplett	bool
69ea632e9fSJosh Triplett
707a8e76a3SSteven Rostedtconfig RING_BUFFER
717a8e76a3SSteven Rostedt	bool
72ea632e9fSJosh Triplett	select TRACE_CLOCK
7322287688SSteven Rostedt (Red Hat)	select IRQ_WORK
747a8e76a3SSteven Rostedt
7578d904b4SSteven Rostedtconfig FTRACE_NMI_ENTER
7678d904b4SSteven Rostedt       bool
7778d904b4SSteven Rostedt       depends on HAVE_FTRACE_NMI_ENTER
7878d904b4SSteven Rostedt       default y
7978d904b4SSteven Rostedt
805f77a88bSTom Zanussiconfig EVENT_TRACING
81b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
8260f1d5e3SMasami Hiramatsu        select GLOB
83b11c53e1SZhaolei	bool
84b11c53e1SZhaolei
85b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
865f77a88bSTom Zanussi	bool
875f77a88bSTom Zanussi
8885bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
8985bac32cSSteven Rostedt	bool
9085bac32cSSteven Rostedt	help
9185bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
9285bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
9385bac32cSSteven Rostedt
94c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
95c3bc8fd6SJoel Fernandes (Google)	bool
96c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
97c3bc8fd6SJoel Fernandes (Google)	select TRACING
98c3bc8fd6SJoel Fernandes (Google)	default y
99c3bc8fd6SJoel Fernandes (Google)	help
100c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
101c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
102c3bc8fd6SJoel Fernandes (Google)
1035e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1045e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1055e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1065e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1075e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
10840892367SRandy Dunlap# hiding of the automatic options.
1095e0a0939SSteven Rostedt
110bc0c38d1SSteven Rostedtconfig TRACING
111bc0c38d1SSteven Rostedt	bool
112bc0c38d1SSteven Rostedt	select DEBUG_FS
1137a8e76a3SSteven Rostedt	select RING_BUFFER
114c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1155f87f112SIngo Molnar	select TRACEPOINTS
116f3384b28SSteven Rostedt	select NOP_TRACER
117769b0441SFrederic Weisbecker	select BINARY_PRINTF
1185f77a88bSTom Zanussi	select EVENT_TRACING
119ea632e9fSJosh Triplett	select TRACE_CLOCK
120bc0c38d1SSteven Rostedt
1215e0a0939SSteven Rostedtconfig GENERIC_TRACER
1225e0a0939SSteven Rostedt	bool
1235e0a0939SSteven Rostedt	select TRACING
1245e0a0939SSteven Rostedt
12540ada30fSIngo Molnar#
12640ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
12740ada30fSIngo Molnar# be able to offer generic tracing facilities:
12840ada30fSIngo Molnar#
12940ada30fSIngo Molnarconfig TRACING_SUPPORT
13040ada30fSIngo Molnar	bool
1310ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
13240ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
133422d3c7aSKOSAKI Motohiro	default y
13440ada30fSIngo Molnar
13540ada30fSIngo Molnarif TRACING_SUPPORT
13640ada30fSIngo Molnar
1374ed9f071SSteven Rostedtmenuconfig FTRACE
1384ed9f071SSteven Rostedt	bool "Tracers"
13965b77242SSteven Rostedt	default y if DEBUG_KERNEL
1404ed9f071SSteven Rostedt	help
1414ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1424ed9f071SSteven Rostedt
1434ed9f071SSteven Rostedtif FTRACE
14417d80fd0SPeter Zijlstra
145606576ceSSteven Rostedtconfig FUNCTION_TRACER
1461b29b018SSteven Rostedt	bool "Kernel Function Tracer"
147606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1484d7a077cSSteven Rostedt	select KALLSYMS
1495e0a0939SSteven Rostedt	select GENERIC_TRACER
15035e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
15160f1d5e3SMasami Hiramatsu	select GLOB
15201b1d88bSThomas Gleixner	select TASKS_RCU if PREEMPTION
1531b29b018SSteven Rostedt	help
1541b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1551b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
15640892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
1571b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
1581b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
1591b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
1601b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
16135e8e302SSteven Rostedt
162fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
163fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
164fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
16515e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
166eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
167764f3b95SIngo Molnar	default y
16815e6cb36SFrederic Weisbecker	help
169fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
170fb52607aSFrederic Weisbecker	  and its entry.
171692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
172692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
173692105b8SMatt LaPlante	  the return value. This is done by setting the current return
174692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
17515e6cb36SFrederic Weisbecker
176c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
177c3bc8fd6SJoel Fernandes (Google)	bool
178c3bc8fd6SJoel Fernandes (Google)	help
179c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
180c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
181bac429f0SSteven Rostedt
182d5915816SJoel Fernandesconfig PREEMPTIRQ_EVENTS
183d5915816SJoel Fernandes	bool "Enable trace events for preempt and irq disable/enable"
184d5915816SJoel Fernandes	select TRACE_IRQFLAGS
18530c93704SThomas Gleixner	select TRACE_PREEMPT_TOGGLE if PREEMPTION
186c3bc8fd6SJoel Fernandes (Google)	select GENERIC_TRACER
187d5915816SJoel Fernandes	default n
188d5915816SJoel Fernandes	help
189d5915816SJoel Fernandes	  Enable tracing of disable and enable events for preemption and irqs.
190d5915816SJoel Fernandes
19181d68a96SSteven Rostedtconfig IRQSOFF_TRACER
19281d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
19381d68a96SSteven Rostedt	default n
19481d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
195592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
19681d68a96SSteven Rostedt	select TRACE_IRQFLAGS
1975e0a0939SSteven Rostedt	select GENERIC_TRACER
19881d68a96SSteven Rostedt	select TRACER_MAX_TRACE
19985bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
20022cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2010b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
20281d68a96SSteven Rostedt	help
20381d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
20481d68a96SSteven Rostedt	  sections, with microsecond accuracy.
20581d68a96SSteven Rostedt
20681d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
20781d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
20881d68a96SSteven Rostedt	  via:
20981d68a96SSteven Rostedt
210156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
21181d68a96SSteven Rostedt
21240892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2136cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
2146cd8a4bbSSteven Rostedt	  used together or separately.)
2156cd8a4bbSSteven Rostedt
2166cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
2176cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
2186cd8a4bbSSteven Rostedt	default n
219592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
22030c93704SThomas Gleixner	depends on PREEMPTION
2215e0a0939SSteven Rostedt	select GENERIC_TRACER
2226cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
22385bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
22422cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2250b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
226c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
2276cd8a4bbSSteven Rostedt	help
22840892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
2296cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
2306cd8a4bbSSteven Rostedt
2316cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
2326cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
2336cd8a4bbSSteven Rostedt	  via:
2346cd8a4bbSSteven Rostedt
235156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
2366cd8a4bbSSteven Rostedt
23740892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2386cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
2396cd8a4bbSSteven Rostedt	  used together or separately.)
2406cd8a4bbSSteven Rostedt
241352ad25aSSteven Rostedtconfig SCHED_TRACER
242352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
2435e0a0939SSteven Rostedt	select GENERIC_TRACER
244352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
245352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
24622cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
247352ad25aSSteven Rostedt	help
248352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
249352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
250352ad25aSSteven Rostedt
251e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
252e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
253e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
254e7c15cd8SSteven Rostedt (Red Hat)	help
255e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
256c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
257e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
258e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
259e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
260e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
261e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
262e7c15cd8SSteven Rostedt (Red Hat)
263e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
264e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
265e7c15cd8SSteven Rostedt (Red Hat)
266e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
267e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
268e7c15cd8SSteven Rostedt (Red Hat)				     iteration
269e7c15cd8SSteven Rostedt (Red Hat)
270e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
271c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
272e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
273e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
274e7c15cd8SSteven Rostedt (Red Hat)
275e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
276e7c15cd8SSteven Rostedt (Red Hat)
277e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
278e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
279e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
280e7c15cd8SSteven Rostedt (Red Hat)	 production system.
281e7c15cd8SSteven Rostedt (Red Hat)
282e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
283e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
284e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
285e7c15cd8SSteven Rostedt (Red Hat)
286897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
287897f17a6SSteven Rostedt	bool "Trace process context switches and events"
2885e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
289b77e38aaSSteven Rostedt	select TRACING
290b77e38aaSSteven Rostedt	help
29140892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
292b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
293897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
294a7abe97fSSteven Rostedt
295ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
296ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
29766700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
2985e0a0939SSteven Rostedt	select GENERIC_TRACER
2990ea1c415SFrederic Weisbecker	select KALLSYMS
300ee08c6ecSFrederic Weisbecker	help
301ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
302ee08c6ecSFrederic Weisbecker
303debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
304debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
305debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
306debdd57fSHiraku Toyooka	help
307debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
308debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
309debdd57fSHiraku Toyooka
310debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
311debdd57fSHiraku Toyooka	      cat snapshot
312debdd57fSHiraku Toyooka
3130b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
3140b85ffc2SSteven Rostedt (Red Hat)        bool "Allow snapshot to swap per CPU"
3150b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
3160b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
3170b85ffc2SSteven Rostedt (Red Hat)	help
3180b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
3190b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
3200b85ffc2SSteven Rostedt (Red Hat)	  allowed:
3210b85ffc2SSteven Rostedt (Red Hat)
3220b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
3230b85ffc2SSteven Rostedt (Red Hat)
3240b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
3250b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
3260b85ffc2SSteven Rostedt (Red Hat)
3270b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
3280b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
3290b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
3300b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
3310b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
3320b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
3330b85ffc2SSteven Rostedt (Red Hat)
3342ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
3359ae5b879SSteven Rostedt	bool
3365e0a0939SSteven Rostedt	select GENERIC_TRACER
3379ae5b879SSteven Rostedt
3389ae5b879SSteven Rostedtchoice
3399ae5b879SSteven Rostedt	prompt "Branch Profiling"
3409ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
3419ae5b879SSteven Rostedt	help
3429ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
3439ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
3449ae5b879SSteven Rostedt
3459ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
3469ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
3479ae5b879SSteven Rostedt
34840892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
3499ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
35040892367SRandy Dunlap	 profiler.
3519ae5b879SSteven Rostedt
35240892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
35340892367SRandy Dunlap	 If unsure, choose "No branch profiling".
3549ae5b879SSteven Rostedt
3559ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
3569ae5b879SSteven Rostedt	bool "No branch profiling"
3579ae5b879SSteven Rostedt	help
3589ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
3599ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
3609ae5b879SSteven Rostedt	  Otherwise keep it disabled.
3619ae5b879SSteven Rostedt
3629ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
3639ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
3649ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
3651f0d69a9SSteven Rostedt	help
36659bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
3671f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
3681f0d69a9SSteven Rostedt
36913e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
3701f0d69a9SSteven Rostedt
37140892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
3721f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
3731f0d69a9SSteven Rostedt
3742bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
37568e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
3769ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
377b303c6dfSMasahiro Yamada	imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED  # avoid false positives
3782bcd521aSSteven Rostedt	help
3792bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
3802bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
3812bcd521aSSteven Rostedt	  The results will be displayed in:
3822bcd521aSSteven Rostedt
38313e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
3842bcd521aSSteven Rostedt
3859ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
3869ae5b879SSteven Rostedt
3872bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
3882bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
38940892367SRandy Dunlap	  is to be analyzed in much detail.
3909ae5b879SSteven Rostedtendchoice
3912bcd521aSSteven Rostedt
3922ed84eebSSteven Rostedtconfig TRACING_BRANCHES
39352f232cbSSteven Rostedt	bool
39452f232cbSSteven Rostedt	help
39552f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
39652f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
39752f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
39852f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
39952f232cbSSteven Rostedt
4002ed84eebSSteven Rostedtconfig BRANCH_TRACER
40152f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
4022ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
4032ed84eebSSteven Rostedt	select TRACING_BRANCHES
40452f232cbSSteven Rostedt	help
40552f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
40652f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
40752f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
40852f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
40952f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
41052f232cbSSteven Rostedt	  events happened, as well as their results.
41152f232cbSSteven Rostedt
41252f232cbSSteven Rostedt	  Say N if unsure.
41352f232cbSSteven Rostedt
414e5a81b62SSteven Rostedtconfig STACK_TRACER
415e5a81b62SSteven Rostedt	bool "Trace max stack"
416606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
417606576ceSSteven Rostedt	select FUNCTION_TRACER
418e5a81b62SSteven Rostedt	select STACKTRACE
4194d7a077cSSteven Rostedt	select KALLSYMS
420e5a81b62SSteven Rostedt	help
4214519d9e5SIngo Molnar	  This special tracer records the maximum stack footprint of the
422156f5a78SGeunSik Lim	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
4234519d9e5SIngo Molnar
4244519d9e5SIngo Molnar	  This tracer works by hooking into every function call that the
4254519d9e5SIngo Molnar	  kernel executes, and keeping a maximum stack depth value and
426f38f1d2aSSteven Rostedt	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
427f38f1d2aSSteven Rostedt	  then it will not have any overhead while the stack tracer
428f38f1d2aSSteven Rostedt	  is disabled.
429f38f1d2aSSteven Rostedt
430f38f1d2aSSteven Rostedt	  To enable the stack tracer on bootup, pass in 'stacktrace'
431f38f1d2aSSteven Rostedt	  on the kernel command line.
432f38f1d2aSSteven Rostedt
433f38f1d2aSSteven Rostedt	  The stack tracer can also be enabled or disabled via the
434f38f1d2aSSteven Rostedt	  sysctl kernel.stack_tracer_enabled
4354519d9e5SIngo Molnar
4364519d9e5SIngo Molnar	  Say N if unsure.
437e5a81b62SSteven Rostedt
4382db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
43940892367SRandy Dunlap	bool "Support for tracing block IO actions"
4402db270a8SFrederic Weisbecker	depends on SYSFS
4411dfba05dSIngo Molnar	depends on BLOCK
4422db270a8SFrederic Weisbecker	select RELAY
4432db270a8SFrederic Weisbecker	select DEBUG_FS
4442db270a8SFrederic Weisbecker	select TRACEPOINTS
4455e0a0939SSteven Rostedt	select GENERIC_TRACER
4462db270a8SFrederic Weisbecker	select STACKTRACE
4472db270a8SFrederic Weisbecker	help
4482db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
4492db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
4502db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
4512db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
4522db270a8SFrederic Weisbecker
4532db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
4542db270a8SFrederic Weisbecker
4552db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
4562db270a8SFrederic Weisbecker
4572db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
4582db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
4592db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
4602db270a8SFrederic Weisbecker
4612db270a8SFrederic Weisbecker	  If unsure, say N.
46236994e58SFrederic Weisbecker
4636b0b7551SAnton Blanchardconfig KPROBE_EVENTS
464413d37d1SMasami Hiramatsu	depends on KPROBES
465f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
46677b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
467413d37d1SMasami Hiramatsu	select TRACING
4688ab83f56SSrikar Dronamraju	select PROBE_EVENTS
4696212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
47077b44d1bSMasami Hiramatsu	default y
471413d37d1SMasami Hiramatsu	help
47240892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
47340892367SRandy Dunlap	  on the fly via the ftrace interface. See
4745fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
47577b44d1bSMasami Hiramatsu
47677b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
47777b44d1bSMasami Hiramatsu	  various register and memory values.
47877b44d1bSMasami Hiramatsu
47940892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
48040892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
481413d37d1SMasami Hiramatsu
48245408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
48345408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
48445408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
48545408c4fSMasami Hiramatsu	depends on KPROBES_ON_FTRACE
48645408c4fSMasami Hiramatsu	default n
48745408c4fSMasami Hiramatsu	help
48845408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
48945408c4fSMasami Hiramatsu	  using kprobe events.
49045408c4fSMasami Hiramatsu
49145408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
49245408c4fSMasami Hiramatsu	  functions are protected from kprobe-events to prevent an infinit
49345408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
49445408c4fSMasami Hiramatsu	  crash.
49545408c4fSMasami Hiramatsu
49645408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
49745408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
49845408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
49945408c4fSMasami Hiramatsu
50045408c4fSMasami Hiramatsu	  If unsure, say N.
50145408c4fSMasami Hiramatsu
5026b0b7551SAnton Blanchardconfig UPROBE_EVENTS
503f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
504f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
505f3f096cfSSrikar Dronamraju	depends on MMU
50609294e31SDavid A. Long	depends on PERF_EVENTS
507f3f096cfSSrikar Dronamraju	select UPROBES
508f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
5090597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
510f3f096cfSSrikar Dronamraju	select TRACING
51161f35d75SArnaldo Carvalho de Melo	default y
512f3f096cfSSrikar Dronamraju	help
513f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
514f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
515f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
516f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
517f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
518f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
519f3f096cfSSrikar Dronamraju
520e1abf2ccSIngo Molnarconfig BPF_EVENTS
521e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
5226b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
523e1abf2ccSIngo Molnar	bool
524e1abf2ccSIngo Molnar	default y
525e1abf2ccSIngo Molnar	help
5265cbd22c1SPeter Wu	  This allows the user to attach BPF programs to kprobe, uprobe, and
5275cbd22c1SPeter Wu	  tracepoint events.
528e1abf2ccSIngo Molnar
5295448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
5305448d44cSMasami Hiramatsu	def_bool n
5315448d44cSMasami Hiramatsu
5328ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
5338ab83f56SSrikar Dronamraju	def_bool n
5348ab83f56SSrikar Dronamraju
5353d083395SSteven Rostedtconfig DYNAMIC_FTRACE
536db05021dSSteven Rostedt	bool "enable/disable function tracing dynamically"
537606576ceSSteven Rostedt	depends on FUNCTION_TRACER
538677aa9f7SSteven Rostedt	depends on HAVE_DYNAMIC_FTRACE
5393d083395SSteven Rostedt	default y
5403d083395SSteven Rostedt	help
541db05021dSSteven Rostedt	  This option will modify all the calls to function tracing
542db05021dSSteven Rostedt	  dynamically (will patch them out of the binary image and
543db05021dSSteven Rostedt	  replace them with a No-Op instruction) on boot up. During
544db05021dSSteven Rostedt	  compile time, a table is made of all the locations that ftrace
545db05021dSSteven Rostedt	  can function trace, and this table is linked into the kernel
546db05021dSSteven Rostedt	  image. When this is enabled, functions can be individually
547db05021dSSteven Rostedt	  enabled, and the functions not enabled will not affect
548db05021dSSteven Rostedt	  performance of the system.
549db05021dSSteven Rostedt
550db05021dSSteven Rostedt	  See the files in /sys/kernel/debug/tracing:
551db05021dSSteven Rostedt	    available_filter_functions
552db05021dSSteven Rostedt	    set_ftrace_filter
553db05021dSSteven Rostedt	    set_ftrace_notrace
5543d083395SSteven Rostedt
55540892367SRandy Dunlap	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
55640892367SRandy Dunlap	  otherwise has native performance as long as no tracing is active.
5573d083395SSteven Rostedt
55806aeaaeaSMasami Hiramatsuconfig DYNAMIC_FTRACE_WITH_REGS
55906aeaaeaSMasami Hiramatsu	def_bool y
56006aeaaeaSMasami Hiramatsu	depends on DYNAMIC_FTRACE
56106aeaaeaSMasami Hiramatsu	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
56206aeaaeaSMasami Hiramatsu
563763e34e7SSteven Rostedt (VMware)config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
564763e34e7SSteven Rostedt (VMware)	def_bool y
565763e34e7SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE
566763e34e7SSteven Rostedt (VMware)	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
567763e34e7SSteven Rostedt (VMware)
568bac429f0SSteven Rostedtconfig FUNCTION_PROFILER
569bac429f0SSteven Rostedt	bool "Kernel function profiler"
570493762fcSSteven Rostedt	depends on FUNCTION_TRACER
571bac429f0SSteven Rostedt	default n
572bac429f0SSteven Rostedt	help
573493762fcSSteven Rostedt	  This option enables the kernel function profiler. A file is created
574493762fcSSteven Rostedt	  in debugfs called function_profile_enabled which defaults to zero.
575bac429f0SSteven Rostedt	  When a 1 is echoed into this file profiling begins, and when a
57640892367SRandy Dunlap	  zero is entered, profiling stops. A "functions" file is created in
5771fee4f77SMasami Hiramatsu	  the trace_stat directory; this file shows the list of functions that
578bac429f0SSteven Rostedt	  have been hit and their counters.
579bac429f0SSteven Rostedt
58040892367SRandy Dunlap	  If in doubt, say N.
581bac429f0SSteven Rostedt
5829802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
5839802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
5849802d865SJosef Bacik	depends on BPF_EVENTS
585540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
5869802d865SJosef Bacik	default n
5879802d865SJosef Bacik	help
5889802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
5899802d865SJosef Bacik	 set a different return value.  This is used for error injection.
5909802d865SJosef Bacik
5918da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
5928da3821bSSteven Rostedt	def_bool y
5938da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
5948da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
5958da3821bSSteven Rostedt
59660a11774SSteven Rostedtconfig FTRACE_SELFTEST
59760a11774SSteven Rostedt	bool
59860a11774SSteven Rostedt
59960a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST
60060a11774SSteven Rostedt	bool "Perform a startup test on ftrace"
6015e0a0939SSteven Rostedt	depends on GENERIC_TRACER
60260a11774SSteven Rostedt	select FTRACE_SELFTEST
60360a11774SSteven Rostedt	help
60460a11774SSteven Rostedt	  This option performs a series of startup tests on ftrace. On bootup
60560a11774SSteven Rostedt	  a series of tests are made to verify that the tracer is
60660a11774SSteven Rostedt	  functioning properly. It will do tests on all the configured
60760a11774SSteven Rostedt	  tracers of ftrace.
60817d80fd0SPeter Zijlstra
609b3015fe4SSteven Rostedt (VMware)config EVENT_TRACE_STARTUP_TEST
610b3015fe4SSteven Rostedt (VMware)	bool "Run selftest on trace events"
611b3015fe4SSteven Rostedt (VMware)	depends on FTRACE_STARTUP_TEST
612b3015fe4SSteven Rostedt (VMware)	default y
613b3015fe4SSteven Rostedt (VMware)	help
614b3015fe4SSteven Rostedt (VMware)	  This option performs a test on all trace events in the system.
615b3015fe4SSteven Rostedt (VMware)	  It basically just enables each event and runs some code that
616b3015fe4SSteven Rostedt (VMware)	  will trigger events (not necessarily the event it enables)
617b3015fe4SSteven Rostedt (VMware)	  This may take some time run as there are a lot of events.
618b3015fe4SSteven Rostedt (VMware)
6191f5a6b45SSteven Rostedtconfig EVENT_TRACE_TEST_SYSCALLS
6201f5a6b45SSteven Rostedt	bool "Run selftest on syscall events"
621b3015fe4SSteven Rostedt (VMware)	depends on EVENT_TRACE_STARTUP_TEST
6221f5a6b45SSteven Rostedt	help
6231f5a6b45SSteven Rostedt	 This option will also enable testing every syscall event.
6241f5a6b45SSteven Rostedt	 It only enables the event and disables it and runs various loads
6251f5a6b45SSteven Rostedt	 with the event enabled. This adds a bit more time for kernel boot
6261f5a6b45SSteven Rostedt	 up since it runs this on every system call defined.
6271f5a6b45SSteven Rostedt
6281f5a6b45SSteven Rostedt	 TBD - enable a way to actually call the syscalls as we test their
6291f5a6b45SSteven Rostedt	       events
6301f5a6b45SSteven Rostedt
631fe6f90e5SPekka Paalanenconfig MMIOTRACE
632fe6f90e5SPekka Paalanen	bool "Memory mapped IO tracing"
63340ada30fSIngo Molnar	depends on HAVE_MMIOTRACE_SUPPORT && PCI
6345e0a0939SSteven Rostedt	select GENERIC_TRACER
635fe6f90e5SPekka Paalanen	help
636fe6f90e5SPekka Paalanen	  Mmiotrace traces Memory Mapped I/O access and is meant for
637fe6f90e5SPekka Paalanen	  debugging and reverse engineering. It is called from the ioremap
638fe6f90e5SPekka Paalanen	  implementation and works via page faults. Tracing is disabled by
639fe6f90e5SPekka Paalanen	  default and can be enabled at run-time.
640fe6f90e5SPekka Paalanen
6415fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/mmiotrace.rst.
642fe6f90e5SPekka Paalanen	  If you are not helping to develop drivers, say N.
643fe6f90e5SPekka Paalanen
64408d43a5fSTom Zanussiconfig TRACING_MAP
64508d43a5fSTom Zanussi	bool
64608d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
64708d43a5fSTom Zanussi	help
64808d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
64908d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
65008d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
65108d43a5fSTom Zanussi	  generally used outside of that context, and is normally
65208d43a5fSTom Zanussi	  selected by tracers that use it.
65308d43a5fSTom Zanussi
6547ef224d1STom Zanussiconfig HIST_TRIGGERS
6557ef224d1STom Zanussi	bool "Histogram triggers"
6567ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
6577ef224d1STom Zanussi	select TRACING_MAP
6587ad8fb61STom Zanussi	select TRACING
6597bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
6607ef224d1STom Zanussi	default n
6617ef224d1STom Zanussi	help
6627ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
6637ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
6647ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
6657ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
6667ef224d1STom Zanussi	  event activity as an initial guide for further investigation
6677ef224d1STom Zanussi	  using more advanced tools.
6687ef224d1STom Zanussi
66989e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
67089e270c1STom Zanussi	  supported using hist triggers under this option.
67189e270c1STom Zanussi
672ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
6737ef224d1STom Zanussi	  If in doubt, say N.
6747ef224d1STom Zanussi
675fe6f90e5SPekka Paalanenconfig MMIOTRACE_TEST
676fe6f90e5SPekka Paalanen	tristate "Test module for mmiotrace"
677fe6f90e5SPekka Paalanen	depends on MMIOTRACE && m
678fe6f90e5SPekka Paalanen	help
679fe6f90e5SPekka Paalanen	  This is a dumb module for testing mmiotrace. It is very dangerous
680fe6f90e5SPekka Paalanen	  as it will write garbage to IO memory starting at a given address.
681fe6f90e5SPekka Paalanen	  However, it should be safe to use on e.g. unused portion of VRAM.
682fe6f90e5SPekka Paalanen
683fe6f90e5SPekka Paalanen	  Say N, unless you absolutely know what you are doing.
684fe6f90e5SPekka Paalanen
68581dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
68681dc9f0eSSteven Rostedt (Red Hat)        bool "Add tracepoint that benchmarks tracepoints"
68781dc9f0eSSteven Rostedt (Red Hat)	help
68881dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
68981dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
69081dc9f0eSSteven Rostedt (Red Hat)	 goes into an infinite loop (calling cond_sched() to let other tasks
69181dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
69281dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
69381dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
69481dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
69581dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
69681dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
69781dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
69881dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
69981dc9f0eSSteven Rostedt (Red Hat)
70081dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
70181dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
70281dc9f0eSSteven Rostedt (Red Hat)
70381dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
70481dc9f0eSSteven Rostedt (Red Hat)
70581dc9f0eSSteven Rostedt (Red Hat)	      START
70681dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
70781dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
70881dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
70981dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
71081dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
71181dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
71281dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
71381dc9f0eSSteven Rostedt (Red Hat)
71481dc9f0eSSteven Rostedt (Red Hat)
7155092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
7165092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
7175092dbc9SSteven Rostedt	depends on RING_BUFFER
7185092dbc9SSteven Rostedt	help
7195092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
72040892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
7215092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
7225092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
7235092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
7245092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
7255092dbc9SSteven Rostedt
7265092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
7275092dbc9SSteven Rostedt	  affected by processes that are running.
7285092dbc9SSteven Rostedt
72940892367SRandy Dunlap	  If unsure, say N.
7305092dbc9SSteven Rostedt
7316c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
7326c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
7336c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
7346c43e554SSteven Rostedt (Red Hat)       help
7356c43e554SSteven Rostedt (Red Hat)         Run a simple self test on the ring buffer on boot up. Late in the
7366c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
7376c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
7386c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
7396c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
7406c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
7416c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
7426c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
7436c43e554SSteven Rostedt (Red Hat)
7446c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
7456c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
7466c43e554SSteven Rostedt (Red Hat)
7476c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
7486c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
7496c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
7506c43e554SSteven Rostedt (Red Hat)	 other similar details.
7516c43e554SSteven Rostedt (Red Hat)
7526c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
7536c43e554SSteven Rostedt (Red Hat)
754f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
755f96e8577SJoel Fernandes (Google)	tristate "Preempt / IRQ disable delay thread to test latency tracers"
756f96e8577SJoel Fernandes (Google)	depends on m
757f96e8577SJoel Fernandes (Google)	help
758f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
759f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
760f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
761f96e8577SJoel Fernandes (Google)	  critical section.
762f96e8577SJoel Fernandes (Google)
763*79393723SViktor Rosendahl (BMW)	  For example, the following invocation generates a burst of three
764*79393723SViktor Rosendahl (BMW)	  irq-disabled critical sections for 500us:
765*79393723SViktor Rosendahl (BMW)	  modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
766f96e8577SJoel Fernandes (Google)
767f96e8577SJoel Fernandes (Google)	  If unsure, say N
768f96e8577SJoel Fernandes (Google)
769681bec03SJeremy Lintonconfig TRACE_EVAL_MAP_FILE
770681bec03SJeremy Linton       bool "Show eval mappings for trace events"
7719828413dSSteven Rostedt (Red Hat)       depends on TRACING
7729828413dSSteven Rostedt (Red Hat)       help
773681bec03SJeremy Linton	The "print fmt" of the trace events will show the enum/sizeof names
774681bec03SJeremy Linton	instead	of their values. This can cause problems for user space tools
775681bec03SJeremy Linton	that use this string to parse the raw data as user space does not know
7769828413dSSteven Rostedt (Red Hat)	how to convert the string to its value.
7779828413dSSteven Rostedt (Red Hat)
7789828413dSSteven Rostedt (Red Hat)	To fix this, there's a special macro in the kernel that can be used
779681bec03SJeremy Linton	to convert an enum/sizeof into its value. If this macro is used, then
780681bec03SJeremy Linton	the print fmt strings will be converted to their values.
7819828413dSSteven Rostedt (Red Hat)
7829828413dSSteven Rostedt (Red Hat)	If something does not get converted properly, this option can be
783681bec03SJeremy Linton	used to show what enums/sizeof the kernel tried to convert.
7849828413dSSteven Rostedt (Red Hat)
785681bec03SJeremy Linton	This option is for debugging the conversions. A file is created
786681bec03SJeremy Linton	in the tracing directory called "eval_map" that will show the
7879828413dSSteven Rostedt (Red Hat)	names matched with their values and what trace event system they
7889828413dSSteven Rostedt (Red Hat)	belong too.
7899828413dSSteven Rostedt (Red Hat)
7909828413dSSteven Rostedt (Red Hat)	Normally, the mapping of the strings to values will be freed after
7919828413dSSteven Rostedt (Red Hat)	boot up or module load. With this option, they will not be freed, as
792681bec03SJeremy Linton	they are needed for the "eval_map" file. Enabling this option will
7939828413dSSteven Rostedt (Red Hat)	increase the memory footprint of the running kernel.
7949828413dSSteven Rostedt (Red Hat)
7959828413dSSteven Rostedt (Red Hat)	If unsure, say N
7969828413dSSteven Rostedt (Red Hat)
7976b7dca40SMasami Hiramatsuconfig GCOV_PROFILE_FTRACE
7986b7dca40SMasami Hiramatsu	bool "Enable GCOV profiling on ftrace subsystem"
7996b7dca40SMasami Hiramatsu	depends on GCOV_KERNEL
8006b7dca40SMasami Hiramatsu	help
8016b7dca40SMasami Hiramatsu	  Enable GCOV profiling on ftrace subsystem for checking
8026b7dca40SMasami Hiramatsu	  which functions/lines are tested.
8036b7dca40SMasami Hiramatsu
8046b7dca40SMasami Hiramatsu	  If unsure, say N.
8056b7dca40SMasami Hiramatsu
8066b7dca40SMasami Hiramatsu	  Note that on a kernel compiled with this config, ftrace will
8076b7dca40SMasami Hiramatsu	  run significantly slower.
8086b7dca40SMasami Hiramatsu
8094ed9f071SSteven Rostedtendif # FTRACE
81040ada30fSIngo Molnar
81140ada30fSIngo Molnarendif # TRACING_SUPPORT
81240ada30fSIngo Molnar
813