xref: /linux/kernel/trace/Kconfig (revision b303c6df80c9f8f13785aa83a0471fca7e38b24d)
116444a8aSArnaldo Carvalho de Melo#
2606576ceSSteven Rostedt# Architectures that offer an FUNCTION_TRACER implementation should
3606576ceSSteven Rostedt#  select HAVE_FUNCTION_TRACER:
416444a8aSArnaldo Carvalho de Melo#
52a3a4f66SFrédéric Weisbecker
68d26487fSTörök Edwinconfig USER_STACKTRACE_SUPPORT
78d26487fSTörök Edwin	bool
88d26487fSTörök Edwin
92a3a4f66SFrédéric Weisbeckerconfig NOP_TRACER
102a3a4f66SFrédéric Weisbecker	bool
112a3a4f66SFrédéric Weisbecker
1278d904b4SSteven Rostedtconfig HAVE_FTRACE_NMI_ENTER
1378d904b4SSteven Rostedt	bool
14555f386cSMike Frysinger	help
155fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
1678d904b4SSteven Rostedt
17606576ceSSteven Rostedtconfig HAVE_FUNCTION_TRACER
1816444a8aSArnaldo Carvalho de Melo	bool
19555f386cSMike Frysinger	help
205fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
21bc0c38d1SSteven Rostedt
22fb52607aSFrederic Weisbeckerconfig HAVE_FUNCTION_GRAPH_TRACER
2315e6cb36SFrederic Weisbecker	bool
24555f386cSMike Frysinger	help
255fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
2615e6cb36SFrederic Weisbecker
27677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE
28677aa9f7SSteven Rostedt	bool
29555f386cSMike Frysinger	help
305fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
31677aa9f7SSteven Rostedt
3206aeaaeaSMasami Hiramatsuconfig HAVE_DYNAMIC_FTRACE_WITH_REGS
3306aeaaeaSMasami Hiramatsu	bool
3406aeaaeaSMasami Hiramatsu
358da3821bSSteven Rostedtconfig HAVE_FTRACE_MCOUNT_RECORD
368da3821bSSteven Rostedt	bool
37555f386cSMike Frysinger	help
385fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
398da3821bSSteven Rostedt
4066700001SJosh Stoneconfig HAVE_SYSCALL_TRACEPOINTS
41ee08c6ecSFrederic Weisbecker	bool
42555f386cSMike Frysinger	help
435fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/ftrace-design.rst
44ee08c6ecSFrederic Weisbecker
45a2546faeSSteven Rostedtconfig HAVE_FENTRY
46a2546faeSSteven Rostedt	bool
47a2546faeSSteven Rostedt	help
48a2546faeSSteven Rostedt	  Arch supports the gcc options -pg with -mfentry
49a2546faeSSteven Rostedt
502f4df001SVasily Gorbikconfig HAVE_NOP_MCOUNT
512f4df001SVasily Gorbik	bool
522f4df001SVasily Gorbik	help
532f4df001SVasily Gorbik	  Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
542f4df001SVasily Gorbik
55cf4db259SSteven Rostedtconfig HAVE_C_RECORDMCOUNT
5672441cb1SSteven Rostedt	bool
5772441cb1SSteven Rostedt	help
5872441cb1SSteven Rostedt	  C version of recordmcount available?
5972441cb1SSteven Rostedt
60352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE
61352ad25aSSteven Rostedt	bool
62352ad25aSSteven Rostedt
63ea632e9fSJosh Triplettconfig TRACE_CLOCK
64ea632e9fSJosh Triplett	bool
65ea632e9fSJosh Triplett
667a8e76a3SSteven Rostedtconfig RING_BUFFER
677a8e76a3SSteven Rostedt	bool
68ea632e9fSJosh Triplett	select TRACE_CLOCK
6922287688SSteven Rostedt (Red Hat)	select IRQ_WORK
707a8e76a3SSteven Rostedt
7178d904b4SSteven Rostedtconfig FTRACE_NMI_ENTER
7278d904b4SSteven Rostedt       bool
7378d904b4SSteven Rostedt       depends on HAVE_FTRACE_NMI_ENTER
7478d904b4SSteven Rostedt       default y
7578d904b4SSteven Rostedt
765f77a88bSTom Zanussiconfig EVENT_TRACING
77b11c53e1SZhaolei	select CONTEXT_SWITCH_TRACER
7860f1d5e3SMasami Hiramatsu        select GLOB
79b11c53e1SZhaolei	bool
80b11c53e1SZhaolei
81b11c53e1SZhaoleiconfig CONTEXT_SWITCH_TRACER
825f77a88bSTom Zanussi	bool
835f77a88bSTom Zanussi
8485bac32cSSteven Rostedtconfig RING_BUFFER_ALLOW_SWAP
8585bac32cSSteven Rostedt	bool
8685bac32cSSteven Rostedt	help
8785bac32cSSteven Rostedt	 Allow the use of ring_buffer_swap_cpu.
8885bac32cSSteven Rostedt	 Adds a very slight overhead to tracing when enabled.
8985bac32cSSteven Rostedt
90c3bc8fd6SJoel Fernandes (Google)config PREEMPTIRQ_TRACEPOINTS
91c3bc8fd6SJoel Fernandes (Google)	bool
92c3bc8fd6SJoel Fernandes (Google)	depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
93c3bc8fd6SJoel Fernandes (Google)	select TRACING
94c3bc8fd6SJoel Fernandes (Google)	default y
95c3bc8fd6SJoel Fernandes (Google)	help
96c3bc8fd6SJoel Fernandes (Google)	  Create preempt/irq toggle tracepoints if needed, so that other parts
97c3bc8fd6SJoel Fernandes (Google)	  of the kernel can use them to generate or add hooks to them.
98c3bc8fd6SJoel Fernandes (Google)
995e0a0939SSteven Rostedt# All tracer options should select GENERIC_TRACER. For those options that are
1005e0a0939SSteven Rostedt# enabled by all tracers (context switch and event tracer) they select TRACING.
1015e0a0939SSteven Rostedt# This allows those options to appear when no other tracer is selected. But the
1025e0a0939SSteven Rostedt# options do not appear when something else selects it. We need the two options
1035e0a0939SSteven Rostedt# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
10440892367SRandy Dunlap# hiding of the automatic options.
1055e0a0939SSteven Rostedt
106bc0c38d1SSteven Rostedtconfig TRACING
107bc0c38d1SSteven Rostedt	bool
108bc0c38d1SSteven Rostedt	select DEBUG_FS
1097a8e76a3SSteven Rostedt	select RING_BUFFER
110c2c80529SAl Viro	select STACKTRACE if STACKTRACE_SUPPORT
1115f87f112SIngo Molnar	select TRACEPOINTS
112f3384b28SSteven Rostedt	select NOP_TRACER
113769b0441SFrederic Weisbecker	select BINARY_PRINTF
1145f77a88bSTom Zanussi	select EVENT_TRACING
115ea632e9fSJosh Triplett	select TRACE_CLOCK
116bc0c38d1SSteven Rostedt
1175e0a0939SSteven Rostedtconfig GENERIC_TRACER
1185e0a0939SSteven Rostedt	bool
1195e0a0939SSteven Rostedt	select TRACING
1205e0a0939SSteven Rostedt
12140ada30fSIngo Molnar#
12240ada30fSIngo Molnar# Minimum requirements an architecture has to meet for us to
12340ada30fSIngo Molnar# be able to offer generic tracing facilities:
12440ada30fSIngo Molnar#
12540ada30fSIngo Molnarconfig TRACING_SUPPORT
12640ada30fSIngo Molnar	bool
1270ea5ee03SMichael Ellerman	depends on TRACE_IRQFLAGS_SUPPORT
12840ada30fSIngo Molnar	depends on STACKTRACE_SUPPORT
129422d3c7aSKOSAKI Motohiro	default y
13040ada30fSIngo Molnar
13140ada30fSIngo Molnarif TRACING_SUPPORT
13240ada30fSIngo Molnar
1334ed9f071SSteven Rostedtmenuconfig FTRACE
1344ed9f071SSteven Rostedt	bool "Tracers"
13565b77242SSteven Rostedt	default y if DEBUG_KERNEL
1364ed9f071SSteven Rostedt	help
1374ed9f071SSteven Rostedt	  Enable the kernel tracing infrastructure.
1384ed9f071SSteven Rostedt
1394ed9f071SSteven Rostedtif FTRACE
14017d80fd0SPeter Zijlstra
141606576ceSSteven Rostedtconfig FUNCTION_TRACER
1421b29b018SSteven Rostedt	bool "Kernel Function Tracer"
143606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
1444d7a077cSSteven Rostedt	select KALLSYMS
1455e0a0939SSteven Rostedt	select GENERIC_TRACER
14635e8e302SSteven Rostedt	select CONTEXT_SWITCH_TRACER
14760f1d5e3SMasami Hiramatsu	select GLOB
1480598e4f0SSteven Rostedt (VMware)	select TASKS_RCU if PREEMPT
1491b29b018SSteven Rostedt	help
1501b29b018SSteven Rostedt	  Enable the kernel to trace every kernel function. This is done
1511b29b018SSteven Rostedt	  by using a compiler feature to insert a small, 5-byte No-Operation
15240892367SRandy Dunlap	  instruction at the beginning of every kernel function, which NOP
1531b29b018SSteven Rostedt	  sequence is then dynamically patched into a tracer call when
1541b29b018SSteven Rostedt	  tracing is enabled by the administrator. If it's runtime disabled
1551b29b018SSteven Rostedt	  (the bootup default), then the overhead of the instructions is very
1561b29b018SSteven Rostedt	  small and not measurable even in micro-benchmarks.
15735e8e302SSteven Rostedt
158fb52607aSFrederic Weisbeckerconfig FUNCTION_GRAPH_TRACER
159fb52607aSFrederic Weisbecker	bool "Kernel Function Graph Tracer"
160fb52607aSFrederic Weisbecker	depends on HAVE_FUNCTION_GRAPH_TRACER
16115e6cb36SFrederic Weisbecker	depends on FUNCTION_TRACER
162eb4a0378SSteven Rostedt	depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
163764f3b95SIngo Molnar	default y
16415e6cb36SFrederic Weisbecker	help
165fb52607aSFrederic Weisbecker	  Enable the kernel to trace a function at both its return
166fb52607aSFrederic Weisbecker	  and its entry.
167692105b8SMatt LaPlante	  Its first purpose is to trace the duration of functions and
168692105b8SMatt LaPlante	  draw a call graph for each thread with some information like
169692105b8SMatt LaPlante	  the return value. This is done by setting the current return
170692105b8SMatt LaPlante	  address on the current task structure into a stack of calls.
17115e6cb36SFrederic Weisbecker
172c3bc8fd6SJoel Fernandes (Google)config TRACE_PREEMPT_TOGGLE
173c3bc8fd6SJoel Fernandes (Google)	bool
174c3bc8fd6SJoel Fernandes (Google)	help
175c3bc8fd6SJoel Fernandes (Google)	  Enables hooks which will be called when preemption is first disabled,
176c3bc8fd6SJoel Fernandes (Google)	  and last enabled.
177bac429f0SSteven Rostedt
178d5915816SJoel Fernandesconfig PREEMPTIRQ_EVENTS
179d5915816SJoel Fernandes	bool "Enable trace events for preempt and irq disable/enable"
180d5915816SJoel Fernandes	select TRACE_IRQFLAGS
181c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE if PREEMPT
182c3bc8fd6SJoel Fernandes (Google)	select GENERIC_TRACER
183d5915816SJoel Fernandes	default n
184d5915816SJoel Fernandes	help
185d5915816SJoel Fernandes	  Enable tracing of disable and enable events for preemption and irqs.
186d5915816SJoel Fernandes
18781d68a96SSteven Rostedtconfig IRQSOFF_TRACER
18881d68a96SSteven Rostedt	bool "Interrupts-off Latency Tracer"
18981d68a96SSteven Rostedt	default n
19081d68a96SSteven Rostedt	depends on TRACE_IRQFLAGS_SUPPORT
191592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
19281d68a96SSteven Rostedt	select TRACE_IRQFLAGS
1935e0a0939SSteven Rostedt	select GENERIC_TRACER
19481d68a96SSteven Rostedt	select TRACER_MAX_TRACE
19585bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
19622cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
1970b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
19881d68a96SSteven Rostedt	help
19981d68a96SSteven Rostedt	  This option measures the time spent in irqs-off critical
20081d68a96SSteven Rostedt	  sections, with microsecond accuracy.
20181d68a96SSteven Rostedt
20281d68a96SSteven Rostedt	  The default measurement method is a maximum search, which is
20381d68a96SSteven Rostedt	  disabled by default and can be runtime (re-)started
20481d68a96SSteven Rostedt	  via:
20581d68a96SSteven Rostedt
206156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
20781d68a96SSteven Rostedt
20840892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2096cd8a4bbSSteven Rostedt	  enabled. This option and the preempt-off timing option can be
2106cd8a4bbSSteven Rostedt	  used together or separately.)
2116cd8a4bbSSteven Rostedt
2126cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER
2136cd8a4bbSSteven Rostedt	bool "Preemption-off Latency Tracer"
2146cd8a4bbSSteven Rostedt	default n
215592913ecSJohn Stultz	depends on !ARCH_USES_GETTIMEOFFSET
2166cd8a4bbSSteven Rostedt	depends on PREEMPT
2175e0a0939SSteven Rostedt	select GENERIC_TRACER
2186cd8a4bbSSteven Rostedt	select TRACER_MAX_TRACE
21985bac32cSSteven Rostedt	select RING_BUFFER_ALLOW_SWAP
22022cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
2210b85ffc2SSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT_PER_CPU_SWAP
222c3bc8fd6SJoel Fernandes (Google)	select TRACE_PREEMPT_TOGGLE
2236cd8a4bbSSteven Rostedt	help
22440892367SRandy Dunlap	  This option measures the time spent in preemption-off critical
2256cd8a4bbSSteven Rostedt	  sections, with microsecond accuracy.
2266cd8a4bbSSteven Rostedt
2276cd8a4bbSSteven Rostedt	  The default measurement method is a maximum search, which is
2286cd8a4bbSSteven Rostedt	  disabled by default and can be runtime (re-)started
2296cd8a4bbSSteven Rostedt	  via:
2306cd8a4bbSSteven Rostedt
231156f5a78SGeunSik Lim	      echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
2326cd8a4bbSSteven Rostedt
23340892367SRandy Dunlap	  (Note that kernel size and overhead increase with this option
2346cd8a4bbSSteven Rostedt	  enabled. This option and the irqs-off timing option can be
2356cd8a4bbSSteven Rostedt	  used together or separately.)
2366cd8a4bbSSteven Rostedt
237352ad25aSSteven Rostedtconfig SCHED_TRACER
238352ad25aSSteven Rostedt	bool "Scheduling Latency Tracer"
2395e0a0939SSteven Rostedt	select GENERIC_TRACER
240352ad25aSSteven Rostedt	select CONTEXT_SWITCH_TRACER
241352ad25aSSteven Rostedt	select TRACER_MAX_TRACE
24222cffc2bSSteven Rostedt (Red Hat)	select TRACER_SNAPSHOT
243352ad25aSSteven Rostedt	help
244352ad25aSSteven Rostedt	  This tracer tracks the latency of the highest priority task
245352ad25aSSteven Rostedt	  to be scheduled in, starting from the point it has woken up.
246352ad25aSSteven Rostedt
247e7c15cd8SSteven Rostedt (Red Hat)config HWLAT_TRACER
248e7c15cd8SSteven Rostedt (Red Hat)	bool "Tracer to detect hardware latencies (like SMIs)"
249e7c15cd8SSteven Rostedt (Red Hat)	select GENERIC_TRACER
250e7c15cd8SSteven Rostedt (Red Hat)	help
251e7c15cd8SSteven Rostedt (Red Hat)	 This tracer, when enabled will create one or more kernel threads,
252c5c1ea75SJesper Dangaard Brouer	 depending on what the cpumask file is set to, which each thread
253e7c15cd8SSteven Rostedt (Red Hat)	 spinning in a loop looking for interruptions caused by
254e7c15cd8SSteven Rostedt (Red Hat)	 something other than the kernel. For example, if a
255e7c15cd8SSteven Rostedt (Red Hat)	 System Management Interrupt (SMI) takes a noticeable amount of
256e7c15cd8SSteven Rostedt (Red Hat)	 time, this tracer will detect it. This is useful for testing
257e7c15cd8SSteven Rostedt (Red Hat)	 if a system is reliable for Real Time tasks.
258e7c15cd8SSteven Rostedt (Red Hat)
259e7c15cd8SSteven Rostedt (Red Hat)	 Some files are created in the tracing directory when this
260e7c15cd8SSteven Rostedt (Red Hat)	 is enabled:
261e7c15cd8SSteven Rostedt (Red Hat)
262e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/width   - time in usecs for how long to spin for
263e7c15cd8SSteven Rostedt (Red Hat)	   hwlat_detector/window  - time in usecs between the start of each
264e7c15cd8SSteven Rostedt (Red Hat)				     iteration
265e7c15cd8SSteven Rostedt (Red Hat)
266e7c15cd8SSteven Rostedt (Red Hat)	 A kernel thread is created that will spin with interrupts disabled
267c5c1ea75SJesper Dangaard Brouer	 for "width" microseconds in every "window" cycle. It will not spin
268e7c15cd8SSteven Rostedt (Red Hat)	 for "window - width" microseconds, where the system can
269e7c15cd8SSteven Rostedt (Red Hat)	 continue to operate.
270e7c15cd8SSteven Rostedt (Red Hat)
271e7c15cd8SSteven Rostedt (Red Hat)	 The output will appear in the trace and trace_pipe files.
272e7c15cd8SSteven Rostedt (Red Hat)
273e7c15cd8SSteven Rostedt (Red Hat)	 When the tracer is not running, it has no affect on the system,
274e7c15cd8SSteven Rostedt (Red Hat)	 but when it is running, it can cause the system to be
275e7c15cd8SSteven Rostedt (Red Hat)	 periodically non responsive. Do not run this tracer on a
276e7c15cd8SSteven Rostedt (Red Hat)	 production system.
277e7c15cd8SSteven Rostedt (Red Hat)
278e7c15cd8SSteven Rostedt (Red Hat)	 To enable this tracer, echo in "hwlat" into the current_tracer
279e7c15cd8SSteven Rostedt (Red Hat)	 file. Every time a latency is greater than tracing_thresh, it will
280e7c15cd8SSteven Rostedt (Red Hat)	 be recorded into the ring buffer.
281e7c15cd8SSteven Rostedt (Red Hat)
282897f17a6SSteven Rostedtconfig ENABLE_DEFAULT_TRACERS
283897f17a6SSteven Rostedt	bool "Trace process context switches and events"
2845e0a0939SSteven Rostedt	depends on !GENERIC_TRACER
285b77e38aaSSteven Rostedt	select TRACING
286b77e38aaSSteven Rostedt	help
28740892367SRandy Dunlap	  This tracer hooks to various trace points in the kernel,
288b77e38aaSSteven Rostedt	  allowing the user to pick and choose which trace point they
289897f17a6SSteven Rostedt	  want to trace. It also includes the sched_switch tracer plugin.
290a7abe97fSSteven Rostedt
291ee08c6ecSFrederic Weisbeckerconfig FTRACE_SYSCALLS
292ee08c6ecSFrederic Weisbecker	bool "Trace syscalls"
29366700001SJosh Stone	depends on HAVE_SYSCALL_TRACEPOINTS
2945e0a0939SSteven Rostedt	select GENERIC_TRACER
2950ea1c415SFrederic Weisbecker	select KALLSYMS
296ee08c6ecSFrederic Weisbecker	help
297ee08c6ecSFrederic Weisbecker	  Basic tracer to catch the syscall entry and exit events.
298ee08c6ecSFrederic Weisbecker
299debdd57fSHiraku Toyookaconfig TRACER_SNAPSHOT
300debdd57fSHiraku Toyooka	bool "Create a snapshot trace buffer"
301debdd57fSHiraku Toyooka	select TRACER_MAX_TRACE
302debdd57fSHiraku Toyooka	help
303debdd57fSHiraku Toyooka	  Allow tracing users to take snapshot of the current buffer using the
304debdd57fSHiraku Toyooka	  ftrace interface, e.g.:
305debdd57fSHiraku Toyooka
306debdd57fSHiraku Toyooka	      echo 1 > /sys/kernel/debug/tracing/snapshot
307debdd57fSHiraku Toyooka	      cat snapshot
308debdd57fSHiraku Toyooka
3090b85ffc2SSteven Rostedt (Red Hat)config TRACER_SNAPSHOT_PER_CPU_SWAP
3100b85ffc2SSteven Rostedt (Red Hat)        bool "Allow snapshot to swap per CPU"
3110b85ffc2SSteven Rostedt (Red Hat)	depends on TRACER_SNAPSHOT
3120b85ffc2SSteven Rostedt (Red Hat)	select RING_BUFFER_ALLOW_SWAP
3130b85ffc2SSteven Rostedt (Red Hat)	help
3140b85ffc2SSteven Rostedt (Red Hat)	  Allow doing a snapshot of a single CPU buffer instead of a
3150b85ffc2SSteven Rostedt (Red Hat)	  full swap (all buffers). If this is set, then the following is
3160b85ffc2SSteven Rostedt (Red Hat)	  allowed:
3170b85ffc2SSteven Rostedt (Red Hat)
3180b85ffc2SSteven Rostedt (Red Hat)	      echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
3190b85ffc2SSteven Rostedt (Red Hat)
3200b85ffc2SSteven Rostedt (Red Hat)	  After which, only the tracing buffer for CPU 2 was swapped with
3210b85ffc2SSteven Rostedt (Red Hat)	  the main tracing buffer, and the other CPU buffers remain the same.
3220b85ffc2SSteven Rostedt (Red Hat)
3230b85ffc2SSteven Rostedt (Red Hat)	  When this is enabled, this adds a little more overhead to the
3240b85ffc2SSteven Rostedt (Red Hat)	  trace recording, as it needs to add some checks to synchronize
3250b85ffc2SSteven Rostedt (Red Hat)	  recording with swaps. But this does not affect the performance
3260b85ffc2SSteven Rostedt (Red Hat)	  of the overall system. This is enabled by default when the preempt
3270b85ffc2SSteven Rostedt (Red Hat)	  or irq latency tracers are enabled, as those need to swap as well
3280b85ffc2SSteven Rostedt (Red Hat)	  and already adds the overhead (plus a lot more).
3290b85ffc2SSteven Rostedt (Red Hat)
3302ed84eebSSteven Rostedtconfig TRACE_BRANCH_PROFILING
3319ae5b879SSteven Rostedt	bool
3325e0a0939SSteven Rostedt	select GENERIC_TRACER
3339ae5b879SSteven Rostedt
3349ae5b879SSteven Rostedtchoice
3359ae5b879SSteven Rostedt	prompt "Branch Profiling"
3369ae5b879SSteven Rostedt	default BRANCH_PROFILE_NONE
3379ae5b879SSteven Rostedt	help
3389ae5b879SSteven Rostedt	 The branch profiling is a software profiler. It will add hooks
3399ae5b879SSteven Rostedt	 into the C conditionals to test which path a branch takes.
3409ae5b879SSteven Rostedt
3419ae5b879SSteven Rostedt	 The likely/unlikely profiler only looks at the conditions that
3429ae5b879SSteven Rostedt	 are annotated with a likely or unlikely macro.
3439ae5b879SSteven Rostedt
34440892367SRandy Dunlap	 The "all branch" profiler will profile every if-statement in the
3459ae5b879SSteven Rostedt	 kernel. This profiler will also enable the likely/unlikely
34640892367SRandy Dunlap	 profiler.
3479ae5b879SSteven Rostedt
34840892367SRandy Dunlap	 Either of the above profilers adds a bit of overhead to the system.
34940892367SRandy Dunlap	 If unsure, choose "No branch profiling".
3509ae5b879SSteven Rostedt
3519ae5b879SSteven Rostedtconfig BRANCH_PROFILE_NONE
3529ae5b879SSteven Rostedt	bool "No branch profiling"
3539ae5b879SSteven Rostedt	help
3549ae5b879SSteven Rostedt	  No branch profiling. Branch profiling adds a bit of overhead.
3559ae5b879SSteven Rostedt	  Only enable it if you want to analyse the branching behavior.
3569ae5b879SSteven Rostedt	  Otherwise keep it disabled.
3579ae5b879SSteven Rostedt
3589ae5b879SSteven Rostedtconfig PROFILE_ANNOTATED_BRANCHES
3599ae5b879SSteven Rostedt	bool "Trace likely/unlikely profiler"
3609ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
3611f0d69a9SSteven Rostedt	help
36259bf8964SMasanari Iida	  This tracer profiles all likely and unlikely macros
3631f0d69a9SSteven Rostedt	  in the kernel. It will display the results in:
3641f0d69a9SSteven Rostedt
36513e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_annotated
3661f0d69a9SSteven Rostedt
36740892367SRandy Dunlap	  Note: this will add a significant overhead; only turn this
3681f0d69a9SSteven Rostedt	  on if you need to profile the system's use of these macros.
3691f0d69a9SSteven Rostedt
3702bcd521aSSteven Rostedtconfig PROFILE_ALL_BRANCHES
37168e76e03SRandy Dunlap	bool "Profile all if conditionals" if !FORTIFY_SOURCE
3729ae5b879SSteven Rostedt	select TRACE_BRANCH_PROFILING
373*b303c6dfSMasahiro Yamada	imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED  # avoid false positives
3742bcd521aSSteven Rostedt	help
3752bcd521aSSteven Rostedt	  This tracer profiles all branch conditions. Every if ()
3762bcd521aSSteven Rostedt	  taken in the kernel is recorded whether it hit or miss.
3772bcd521aSSteven Rostedt	  The results will be displayed in:
3782bcd521aSSteven Rostedt
37913e5befaSDavid Rientjes	  /sys/kernel/debug/tracing/trace_stat/branch_all
3802bcd521aSSteven Rostedt
3819ae5b879SSteven Rostedt	  This option also enables the likely/unlikely profiler.
3829ae5b879SSteven Rostedt
3832bcd521aSSteven Rostedt	  This configuration, when enabled, will impose a great overhead
3842bcd521aSSteven Rostedt	  on the system. This should only be enabled when the system
38540892367SRandy Dunlap	  is to be analyzed in much detail.
3869ae5b879SSteven Rostedtendchoice
3872bcd521aSSteven Rostedt
3882ed84eebSSteven Rostedtconfig TRACING_BRANCHES
38952f232cbSSteven Rostedt	bool
39052f232cbSSteven Rostedt	help
39152f232cbSSteven Rostedt	  Selected by tracers that will trace the likely and unlikely
39252f232cbSSteven Rostedt	  conditions. This prevents the tracers themselves from being
39352f232cbSSteven Rostedt	  profiled. Profiling the tracing infrastructure can only happen
39452f232cbSSteven Rostedt	  when the likelys and unlikelys are not being traced.
39552f232cbSSteven Rostedt
3962ed84eebSSteven Rostedtconfig BRANCH_TRACER
39752f232cbSSteven Rostedt	bool "Trace likely/unlikely instances"
3982ed84eebSSteven Rostedt	depends on TRACE_BRANCH_PROFILING
3992ed84eebSSteven Rostedt	select TRACING_BRANCHES
40052f232cbSSteven Rostedt	help
40152f232cbSSteven Rostedt	  This traces the events of likely and unlikely condition
40252f232cbSSteven Rostedt	  calls in the kernel.  The difference between this and the
40352f232cbSSteven Rostedt	  "Trace likely/unlikely profiler" is that this is not a
40452f232cbSSteven Rostedt	  histogram of the callers, but actually places the calling
40552f232cbSSteven Rostedt	  events into a running trace buffer to see when and where the
40652f232cbSSteven Rostedt	  events happened, as well as their results.
40752f232cbSSteven Rostedt
40852f232cbSSteven Rostedt	  Say N if unsure.
40952f232cbSSteven Rostedt
410e5a81b62SSteven Rostedtconfig STACK_TRACER
411e5a81b62SSteven Rostedt	bool "Trace max stack"
412606576ceSSteven Rostedt	depends on HAVE_FUNCTION_TRACER
413606576ceSSteven Rostedt	select FUNCTION_TRACER
414e5a81b62SSteven Rostedt	select STACKTRACE
4154d7a077cSSteven Rostedt	select KALLSYMS
416e5a81b62SSteven Rostedt	help
4174519d9e5SIngo Molnar	  This special tracer records the maximum stack footprint of the
418156f5a78SGeunSik Lim	  kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
4194519d9e5SIngo Molnar
4204519d9e5SIngo Molnar	  This tracer works by hooking into every function call that the
4214519d9e5SIngo Molnar	  kernel executes, and keeping a maximum stack depth value and
422f38f1d2aSSteven Rostedt	  stack-trace saved.  If this is configured with DYNAMIC_FTRACE
423f38f1d2aSSteven Rostedt	  then it will not have any overhead while the stack tracer
424f38f1d2aSSteven Rostedt	  is disabled.
425f38f1d2aSSteven Rostedt
426f38f1d2aSSteven Rostedt	  To enable the stack tracer on bootup, pass in 'stacktrace'
427f38f1d2aSSteven Rostedt	  on the kernel command line.
428f38f1d2aSSteven Rostedt
429f38f1d2aSSteven Rostedt	  The stack tracer can also be enabled or disabled via the
430f38f1d2aSSteven Rostedt	  sysctl kernel.stack_tracer_enabled
4314519d9e5SIngo Molnar
4324519d9e5SIngo Molnar	  Say N if unsure.
433e5a81b62SSteven Rostedt
4342db270a8SFrederic Weisbeckerconfig BLK_DEV_IO_TRACE
43540892367SRandy Dunlap	bool "Support for tracing block IO actions"
4362db270a8SFrederic Weisbecker	depends on SYSFS
4371dfba05dSIngo Molnar	depends on BLOCK
4382db270a8SFrederic Weisbecker	select RELAY
4392db270a8SFrederic Weisbecker	select DEBUG_FS
4402db270a8SFrederic Weisbecker	select TRACEPOINTS
4415e0a0939SSteven Rostedt	select GENERIC_TRACER
4422db270a8SFrederic Weisbecker	select STACKTRACE
4432db270a8SFrederic Weisbecker	help
4442db270a8SFrederic Weisbecker	  Say Y here if you want to be able to trace the block layer actions
4452db270a8SFrederic Weisbecker	  on a given queue. Tracing allows you to see any traffic happening
4462db270a8SFrederic Weisbecker	  on a block device queue. For more information (and the userspace
4472db270a8SFrederic Weisbecker	  support tools needed), fetch the blktrace tools from:
4482db270a8SFrederic Weisbecker
4492db270a8SFrederic Weisbecker	  git://git.kernel.dk/blktrace.git
4502db270a8SFrederic Weisbecker
4512db270a8SFrederic Weisbecker	  Tracing also is possible using the ftrace interface, e.g.:
4522db270a8SFrederic Weisbecker
4532db270a8SFrederic Weisbecker	    echo 1 > /sys/block/sda/sda1/trace/enable
4542db270a8SFrederic Weisbecker	    echo blk > /sys/kernel/debug/tracing/current_tracer
4552db270a8SFrederic Weisbecker	    cat /sys/kernel/debug/tracing/trace_pipe
4562db270a8SFrederic Weisbecker
4572db270a8SFrederic Weisbecker	  If unsure, say N.
45836994e58SFrederic Weisbecker
4596b0b7551SAnton Blanchardconfig KPROBE_EVENTS
460413d37d1SMasami Hiramatsu	depends on KPROBES
461f850c30cSHeiko Carstens	depends on HAVE_REGS_AND_STACK_ACCESS_API
46277b44d1bSMasami Hiramatsu	bool "Enable kprobes-based dynamic events"
463413d37d1SMasami Hiramatsu	select TRACING
4648ab83f56SSrikar Dronamraju	select PROBE_EVENTS
4656212dd29SMasami Hiramatsu	select DYNAMIC_EVENTS
46677b44d1bSMasami Hiramatsu	default y
467413d37d1SMasami Hiramatsu	help
46840892367SRandy Dunlap	  This allows the user to add tracing events (similar to tracepoints)
46940892367SRandy Dunlap	  on the fly via the ftrace interface. See
4705fb94e9cSMauro Carvalho Chehab	  Documentation/trace/kprobetrace.rst for more details.
47177b44d1bSMasami Hiramatsu
47277b44d1bSMasami Hiramatsu	  Those events can be inserted wherever kprobes can probe, and record
47377b44d1bSMasami Hiramatsu	  various register and memory values.
47477b44d1bSMasami Hiramatsu
47540892367SRandy Dunlap	  This option is also required by perf-probe subcommand of perf tools.
47640892367SRandy Dunlap	  If you want to use perf tools, this option is strongly recommended.
477413d37d1SMasami Hiramatsu
47845408c4fSMasami Hiramatsuconfig KPROBE_EVENTS_ON_NOTRACE
47945408c4fSMasami Hiramatsu	bool "Do NOT protect notrace function from kprobe events"
48045408c4fSMasami Hiramatsu	depends on KPROBE_EVENTS
48145408c4fSMasami Hiramatsu	depends on KPROBES_ON_FTRACE
48245408c4fSMasami Hiramatsu	default n
48345408c4fSMasami Hiramatsu	help
48445408c4fSMasami Hiramatsu	  This is only for the developers who want to debug ftrace itself
48545408c4fSMasami Hiramatsu	  using kprobe events.
48645408c4fSMasami Hiramatsu
48745408c4fSMasami Hiramatsu	  If kprobes can use ftrace instead of breakpoint, ftrace related
48845408c4fSMasami Hiramatsu	  functions are protected from kprobe-events to prevent an infinit
48945408c4fSMasami Hiramatsu	  recursion or any unexpected execution path which leads to a kernel
49045408c4fSMasami Hiramatsu	  crash.
49145408c4fSMasami Hiramatsu
49245408c4fSMasami Hiramatsu	  This option disables such protection and allows you to put kprobe
49345408c4fSMasami Hiramatsu	  events on ftrace functions for debugging ftrace by itself.
49445408c4fSMasami Hiramatsu	  Note that this might let you shoot yourself in the foot.
49545408c4fSMasami Hiramatsu
49645408c4fSMasami Hiramatsu	  If unsure, say N.
49745408c4fSMasami Hiramatsu
4986b0b7551SAnton Blanchardconfig UPROBE_EVENTS
499f3f096cfSSrikar Dronamraju	bool "Enable uprobes-based dynamic events"
500f3f096cfSSrikar Dronamraju	depends on ARCH_SUPPORTS_UPROBES
501f3f096cfSSrikar Dronamraju	depends on MMU
50209294e31SDavid A. Long	depends on PERF_EVENTS
503f3f096cfSSrikar Dronamraju	select UPROBES
504f3f096cfSSrikar Dronamraju	select PROBE_EVENTS
5050597c49cSMasami Hiramatsu	select DYNAMIC_EVENTS
506f3f096cfSSrikar Dronamraju	select TRACING
50761f35d75SArnaldo Carvalho de Melo	default y
508f3f096cfSSrikar Dronamraju	help
509f3f096cfSSrikar Dronamraju	  This allows the user to add tracing events on top of userspace
510f3f096cfSSrikar Dronamraju	  dynamic events (similar to tracepoints) on the fly via the trace
511f3f096cfSSrikar Dronamraju	  events interface. Those events can be inserted wherever uprobes
512f3f096cfSSrikar Dronamraju	  can probe, and record various registers.
513f3f096cfSSrikar Dronamraju	  This option is required if you plan to use perf-probe subcommand
514f3f096cfSSrikar Dronamraju	  of perf tools on user space applications.
515f3f096cfSSrikar Dronamraju
516e1abf2ccSIngo Molnarconfig BPF_EVENTS
517e1abf2ccSIngo Molnar	depends on BPF_SYSCALL
5186b0b7551SAnton Blanchard	depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
519e1abf2ccSIngo Molnar	bool
520e1abf2ccSIngo Molnar	default y
521e1abf2ccSIngo Molnar	help
522e1abf2ccSIngo Molnar	  This allows the user to attach BPF programs to kprobe events.
523e1abf2ccSIngo Molnar
5245448d44cSMasami Hiramatsuconfig DYNAMIC_EVENTS
5255448d44cSMasami Hiramatsu	def_bool n
5265448d44cSMasami Hiramatsu
5278ab83f56SSrikar Dronamrajuconfig PROBE_EVENTS
5288ab83f56SSrikar Dronamraju	def_bool n
5298ab83f56SSrikar Dronamraju
5303d083395SSteven Rostedtconfig DYNAMIC_FTRACE
531db05021dSSteven Rostedt	bool "enable/disable function tracing dynamically"
532606576ceSSteven Rostedt	depends on FUNCTION_TRACER
533677aa9f7SSteven Rostedt	depends on HAVE_DYNAMIC_FTRACE
5343d083395SSteven Rostedt	default y
5353d083395SSteven Rostedt	help
536db05021dSSteven Rostedt	  This option will modify all the calls to function tracing
537db05021dSSteven Rostedt	  dynamically (will patch them out of the binary image and
538db05021dSSteven Rostedt	  replace them with a No-Op instruction) on boot up. During
539db05021dSSteven Rostedt	  compile time, a table is made of all the locations that ftrace
540db05021dSSteven Rostedt	  can function trace, and this table is linked into the kernel
541db05021dSSteven Rostedt	  image. When this is enabled, functions can be individually
542db05021dSSteven Rostedt	  enabled, and the functions not enabled will not affect
543db05021dSSteven Rostedt	  performance of the system.
544db05021dSSteven Rostedt
545db05021dSSteven Rostedt	  See the files in /sys/kernel/debug/tracing:
546db05021dSSteven Rostedt	    available_filter_functions
547db05021dSSteven Rostedt	    set_ftrace_filter
548db05021dSSteven Rostedt	    set_ftrace_notrace
5493d083395SSteven Rostedt
55040892367SRandy Dunlap	  This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
55140892367SRandy Dunlap	  otherwise has native performance as long as no tracing is active.
5523d083395SSteven Rostedt
55306aeaaeaSMasami Hiramatsuconfig DYNAMIC_FTRACE_WITH_REGS
55406aeaaeaSMasami Hiramatsu	def_bool y
55506aeaaeaSMasami Hiramatsu	depends on DYNAMIC_FTRACE
55606aeaaeaSMasami Hiramatsu	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
55706aeaaeaSMasami Hiramatsu
558bac429f0SSteven Rostedtconfig FUNCTION_PROFILER
559bac429f0SSteven Rostedt	bool "Kernel function profiler"
560493762fcSSteven Rostedt	depends on FUNCTION_TRACER
561bac429f0SSteven Rostedt	default n
562bac429f0SSteven Rostedt	help
563493762fcSSteven Rostedt	  This option enables the kernel function profiler. A file is created
564493762fcSSteven Rostedt	  in debugfs called function_profile_enabled which defaults to zero.
565bac429f0SSteven Rostedt	  When a 1 is echoed into this file profiling begins, and when a
56640892367SRandy Dunlap	  zero is entered, profiling stops. A "functions" file is created in
5671fee4f77SMasami Hiramatsu	  the trace_stat directory; this file shows the list of functions that
568bac429f0SSteven Rostedt	  have been hit and their counters.
569bac429f0SSteven Rostedt
57040892367SRandy Dunlap	  If in doubt, say N.
571bac429f0SSteven Rostedt
5729802d865SJosef Bacikconfig BPF_KPROBE_OVERRIDE
5739802d865SJosef Bacik	bool "Enable BPF programs to override a kprobed function"
5749802d865SJosef Bacik	depends on BPF_EVENTS
575540adea3SMasami Hiramatsu	depends on FUNCTION_ERROR_INJECTION
5769802d865SJosef Bacik	default n
5779802d865SJosef Bacik	help
5789802d865SJosef Bacik	 Allows BPF to override the execution of a probed function and
5799802d865SJosef Bacik	 set a different return value.  This is used for error injection.
5809802d865SJosef Bacik
5818da3821bSSteven Rostedtconfig FTRACE_MCOUNT_RECORD
5828da3821bSSteven Rostedt	def_bool y
5838da3821bSSteven Rostedt	depends on DYNAMIC_FTRACE
5848da3821bSSteven Rostedt	depends on HAVE_FTRACE_MCOUNT_RECORD
5858da3821bSSteven Rostedt
58660a11774SSteven Rostedtconfig FTRACE_SELFTEST
58760a11774SSteven Rostedt	bool
58860a11774SSteven Rostedt
58960a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST
59060a11774SSteven Rostedt	bool "Perform a startup test on ftrace"
5915e0a0939SSteven Rostedt	depends on GENERIC_TRACER
59260a11774SSteven Rostedt	select FTRACE_SELFTEST
59360a11774SSteven Rostedt	help
59460a11774SSteven Rostedt	  This option performs a series of startup tests on ftrace. On bootup
59560a11774SSteven Rostedt	  a series of tests are made to verify that the tracer is
59660a11774SSteven Rostedt	  functioning properly. It will do tests on all the configured
59760a11774SSteven Rostedt	  tracers of ftrace.
59817d80fd0SPeter Zijlstra
5991f5a6b45SSteven Rostedtconfig EVENT_TRACE_TEST_SYSCALLS
6001f5a6b45SSteven Rostedt	bool "Run selftest on syscall events"
6011f5a6b45SSteven Rostedt	depends on FTRACE_STARTUP_TEST
6021f5a6b45SSteven Rostedt	help
6031f5a6b45SSteven Rostedt	 This option will also enable testing every syscall event.
6041f5a6b45SSteven Rostedt	 It only enables the event and disables it and runs various loads
6051f5a6b45SSteven Rostedt	 with the event enabled. This adds a bit more time for kernel boot
6061f5a6b45SSteven Rostedt	 up since it runs this on every system call defined.
6071f5a6b45SSteven Rostedt
6081f5a6b45SSteven Rostedt	 TBD - enable a way to actually call the syscalls as we test their
6091f5a6b45SSteven Rostedt	       events
6101f5a6b45SSteven Rostedt
611fe6f90e5SPekka Paalanenconfig MMIOTRACE
612fe6f90e5SPekka Paalanen	bool "Memory mapped IO tracing"
61340ada30fSIngo Molnar	depends on HAVE_MMIOTRACE_SUPPORT && PCI
6145e0a0939SSteven Rostedt	select GENERIC_TRACER
615fe6f90e5SPekka Paalanen	help
616fe6f90e5SPekka Paalanen	  Mmiotrace traces Memory Mapped I/O access and is meant for
617fe6f90e5SPekka Paalanen	  debugging and reverse engineering. It is called from the ioremap
618fe6f90e5SPekka Paalanen	  implementation and works via page faults. Tracing is disabled by
619fe6f90e5SPekka Paalanen	  default and can be enabled at run-time.
620fe6f90e5SPekka Paalanen
6215fb94e9cSMauro Carvalho Chehab	  See Documentation/trace/mmiotrace.rst.
622fe6f90e5SPekka Paalanen	  If you are not helping to develop drivers, say N.
623fe6f90e5SPekka Paalanen
62408d43a5fSTom Zanussiconfig TRACING_MAP
62508d43a5fSTom Zanussi	bool
62608d43a5fSTom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
62708d43a5fSTom Zanussi	help
62808d43a5fSTom Zanussi	  tracing_map is a special-purpose lock-free map for tracing,
62908d43a5fSTom Zanussi	  separated out as a stand-alone facility in order to allow it
63008d43a5fSTom Zanussi	  to be shared between multiple tracers.  It isn't meant to be
63108d43a5fSTom Zanussi	  generally used outside of that context, and is normally
63208d43a5fSTom Zanussi	  selected by tracers that use it.
63308d43a5fSTom Zanussi
6347ef224d1STom Zanussiconfig HIST_TRIGGERS
6357ef224d1STom Zanussi	bool "Histogram triggers"
6367ef224d1STom Zanussi	depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
6377ef224d1STom Zanussi	select TRACING_MAP
6387ad8fb61STom Zanussi	select TRACING
6397bbab38dSMasami Hiramatsu	select DYNAMIC_EVENTS
6407ef224d1STom Zanussi	default n
6417ef224d1STom Zanussi	help
6427ef224d1STom Zanussi	  Hist triggers allow one or more arbitrary trace event fields
6437ef224d1STom Zanussi	  to be aggregated into hash tables and dumped to stdout by
6447ef224d1STom Zanussi	  reading a debugfs/tracefs file.  They're useful for
6457ef224d1STom Zanussi	  gathering quick and dirty (though precise) summaries of
6467ef224d1STom Zanussi	  event activity as an initial guide for further investigation
6477ef224d1STom Zanussi	  using more advanced tools.
6487ef224d1STom Zanussi
64989e270c1STom Zanussi	  Inter-event tracing of quantities such as latencies is also
65089e270c1STom Zanussi	  supported using hist triggers under this option.
65189e270c1STom Zanussi
652ea272257SMauro Carvalho Chehab	  See Documentation/trace/histogram.rst.
6537ef224d1STom Zanussi	  If in doubt, say N.
6547ef224d1STom Zanussi
655fe6f90e5SPekka Paalanenconfig MMIOTRACE_TEST
656fe6f90e5SPekka Paalanen	tristate "Test module for mmiotrace"
657fe6f90e5SPekka Paalanen	depends on MMIOTRACE && m
658fe6f90e5SPekka Paalanen	help
659fe6f90e5SPekka Paalanen	  This is a dumb module for testing mmiotrace. It is very dangerous
660fe6f90e5SPekka Paalanen	  as it will write garbage to IO memory starting at a given address.
661fe6f90e5SPekka Paalanen	  However, it should be safe to use on e.g. unused portion of VRAM.
662fe6f90e5SPekka Paalanen
663fe6f90e5SPekka Paalanen	  Say N, unless you absolutely know what you are doing.
664fe6f90e5SPekka Paalanen
66581dc9f0eSSteven Rostedt (Red Hat)config TRACEPOINT_BENCHMARK
66681dc9f0eSSteven Rostedt (Red Hat)        bool "Add tracepoint that benchmarks tracepoints"
66781dc9f0eSSteven Rostedt (Red Hat)	help
66881dc9f0eSSteven Rostedt (Red Hat)	 This option creates the tracepoint "benchmark:benchmark_event".
66981dc9f0eSSteven Rostedt (Red Hat)	 When the tracepoint is enabled, it kicks off a kernel thread that
67081dc9f0eSSteven Rostedt (Red Hat)	 goes into an infinite loop (calling cond_sched() to let other tasks
67181dc9f0eSSteven Rostedt (Red Hat)	 run), and calls the tracepoint. Each iteration will record the time
67281dc9f0eSSteven Rostedt (Red Hat)	 it took to write to the tracepoint and the next iteration that
67381dc9f0eSSteven Rostedt (Red Hat)	 data will be passed to the tracepoint itself. That is, the tracepoint
67481dc9f0eSSteven Rostedt (Red Hat)	 will report the time it took to do the previous tracepoint.
67581dc9f0eSSteven Rostedt (Red Hat)	 The string written to the tracepoint is a static string of 128 bytes
67681dc9f0eSSteven Rostedt (Red Hat)	 to keep the time the same. The initial string is simply a write of
67781dc9f0eSSteven Rostedt (Red Hat)	 "START". The second string records the cold cache time of the first
67881dc9f0eSSteven Rostedt (Red Hat)	 write which is not added to the rest of the calculations.
67981dc9f0eSSteven Rostedt (Red Hat)
68081dc9f0eSSteven Rostedt (Red Hat)	 As it is a tight loop, it benchmarks as hot cache. That's fine because
68181dc9f0eSSteven Rostedt (Red Hat)	 we care most about hot paths that are probably in cache already.
68281dc9f0eSSteven Rostedt (Red Hat)
68381dc9f0eSSteven Rostedt (Red Hat)	 An example of the output:
68481dc9f0eSSteven Rostedt (Red Hat)
68581dc9f0eSSteven Rostedt (Red Hat)	      START
68681dc9f0eSSteven Rostedt (Red Hat)	      first=3672 [COLD CACHED]
68781dc9f0eSSteven Rostedt (Red Hat)	      last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
68881dc9f0eSSteven Rostedt (Red Hat)	      last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
68981dc9f0eSSteven Rostedt (Red Hat)	      last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
69081dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
69181dc9f0eSSteven Rostedt (Red Hat)	      last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
69281dc9f0eSSteven Rostedt (Red Hat)	      last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
69381dc9f0eSSteven Rostedt (Red Hat)
69481dc9f0eSSteven Rostedt (Red Hat)
6955092dbc9SSteven Rostedtconfig RING_BUFFER_BENCHMARK
6965092dbc9SSteven Rostedt	tristate "Ring buffer benchmark stress tester"
6975092dbc9SSteven Rostedt	depends on RING_BUFFER
6985092dbc9SSteven Rostedt	help
6995092dbc9SSteven Rostedt	  This option creates a test to stress the ring buffer and benchmark it.
70040892367SRandy Dunlap	  It creates its own ring buffer such that it will not interfere with
7015092dbc9SSteven Rostedt	  any other users of the ring buffer (such as ftrace). It then creates
7025092dbc9SSteven Rostedt	  a producer and consumer that will run for 10 seconds and sleep for
7035092dbc9SSteven Rostedt	  10 seconds. Each interval it will print out the number of events
7045092dbc9SSteven Rostedt	  it recorded and give a rough estimate of how long each iteration took.
7055092dbc9SSteven Rostedt
7065092dbc9SSteven Rostedt	  It does not disable interrupts or raise its priority, so it may be
7075092dbc9SSteven Rostedt	  affected by processes that are running.
7085092dbc9SSteven Rostedt
70940892367SRandy Dunlap	  If unsure, say N.
7105092dbc9SSteven Rostedt
7116c43e554SSteven Rostedt (Red Hat)config RING_BUFFER_STARTUP_TEST
7126c43e554SSteven Rostedt (Red Hat)       bool "Ring buffer startup self test"
7136c43e554SSteven Rostedt (Red Hat)       depends on RING_BUFFER
7146c43e554SSteven Rostedt (Red Hat)       help
7156c43e554SSteven Rostedt (Red Hat)         Run a simple self test on the ring buffer on boot up. Late in the
7166c43e554SSteven Rostedt (Red Hat)	 kernel boot sequence, the test will start that kicks off
7176c43e554SSteven Rostedt (Red Hat)	 a thread per cpu. Each thread will write various size events
7186c43e554SSteven Rostedt (Red Hat)	 into the ring buffer. Another thread is created to send IPIs
7196c43e554SSteven Rostedt (Red Hat)	 to each of the threads, where the IPI handler will also write
7206c43e554SSteven Rostedt (Red Hat)	 to the ring buffer, to test/stress the nesting ability.
7216c43e554SSteven Rostedt (Red Hat)	 If any anomalies are discovered, a warning will be displayed
7226c43e554SSteven Rostedt (Red Hat)	 and all ring buffers will be disabled.
7236c43e554SSteven Rostedt (Red Hat)
7246c43e554SSteven Rostedt (Red Hat)	 The test runs for 10 seconds. This will slow your boot time
7256c43e554SSteven Rostedt (Red Hat)	 by at least 10 more seconds.
7266c43e554SSteven Rostedt (Red Hat)
7276c43e554SSteven Rostedt (Red Hat)	 At the end of the test, statics and more checks are done.
7286c43e554SSteven Rostedt (Red Hat)	 It will output the stats of each per cpu buffer. What
7296c43e554SSteven Rostedt (Red Hat)	 was written, the sizes, what was read, what was lost, and
7306c43e554SSteven Rostedt (Red Hat)	 other similar details.
7316c43e554SSteven Rostedt (Red Hat)
7326c43e554SSteven Rostedt (Red Hat)	 If unsure, say N
7336c43e554SSteven Rostedt (Red Hat)
734f96e8577SJoel Fernandes (Google)config PREEMPTIRQ_DELAY_TEST
735f96e8577SJoel Fernandes (Google)	tristate "Preempt / IRQ disable delay thread to test latency tracers"
736f96e8577SJoel Fernandes (Google)	depends on m
737f96e8577SJoel Fernandes (Google)	help
738f96e8577SJoel Fernandes (Google)	  Select this option to build a test module that can help test latency
739f96e8577SJoel Fernandes (Google)	  tracers by executing a preempt or irq disable section with a user
740f96e8577SJoel Fernandes (Google)	  configurable delay. The module busy waits for the duration of the
741f96e8577SJoel Fernandes (Google)	  critical section.
742f96e8577SJoel Fernandes (Google)
743f96e8577SJoel Fernandes (Google)	  For example, the following invocation forces a one-time irq-disabled
744f96e8577SJoel Fernandes (Google)	  critical section for 500us:
745f96e8577SJoel Fernandes (Google)	  modprobe preemptirq_delay_test test_mode=irq delay=500000
746f96e8577SJoel Fernandes (Google)
747f96e8577SJoel Fernandes (Google)	  If unsure, say N
748f96e8577SJoel Fernandes (Google)
749681bec03SJeremy Lintonconfig TRACE_EVAL_MAP_FILE
750681bec03SJeremy Linton       bool "Show eval mappings for trace events"
7519828413dSSteven Rostedt (Red Hat)       depends on TRACING
7529828413dSSteven Rostedt (Red Hat)       help
753681bec03SJeremy Linton	The "print fmt" of the trace events will show the enum/sizeof names
754681bec03SJeremy Linton	instead	of their values. This can cause problems for user space tools
755681bec03SJeremy Linton	that use this string to parse the raw data as user space does not know
7569828413dSSteven Rostedt (Red Hat)	how to convert the string to its value.
7579828413dSSteven Rostedt (Red Hat)
7589828413dSSteven Rostedt (Red Hat)	To fix this, there's a special macro in the kernel that can be used
759681bec03SJeremy Linton	to convert an enum/sizeof into its value. If this macro is used, then
760681bec03SJeremy Linton	the print fmt strings will be converted to their values.
7619828413dSSteven Rostedt (Red Hat)
7629828413dSSteven Rostedt (Red Hat)	If something does not get converted properly, this option can be
763681bec03SJeremy Linton	used to show what enums/sizeof the kernel tried to convert.
7649828413dSSteven Rostedt (Red Hat)
765681bec03SJeremy Linton	This option is for debugging the conversions. A file is created
766681bec03SJeremy Linton	in the tracing directory called "eval_map" that will show the
7679828413dSSteven Rostedt (Red Hat)	names matched with their values and what trace event system they
7689828413dSSteven Rostedt (Red Hat)	belong too.
7699828413dSSteven Rostedt (Red Hat)
7709828413dSSteven Rostedt (Red Hat)	Normally, the mapping of the strings to values will be freed after
7719828413dSSteven Rostedt (Red Hat)	boot up or module load. With this option, they will not be freed, as
772681bec03SJeremy Linton	they are needed for the "eval_map" file. Enabling this option will
7739828413dSSteven Rostedt (Red Hat)	increase the memory footprint of the running kernel.
7749828413dSSteven Rostedt (Red Hat)
7759828413dSSteven Rostedt (Red Hat)	If unsure, say N
7769828413dSSteven Rostedt (Red Hat)
777ddd70280STal Shorerconfig TRACING_EVENTS_GPIO
778ddd70280STal Shorer	bool "Trace gpio events"
779ddd70280STal Shorer	depends on GPIOLIB
780ddd70280STal Shorer	default y
781ddd70280STal Shorer	help
782ddd70280STal Shorer	  Enable tracing events for gpio subsystem
783ddd70280STal Shorer
7846b7dca40SMasami Hiramatsuconfig GCOV_PROFILE_FTRACE
7856b7dca40SMasami Hiramatsu	bool "Enable GCOV profiling on ftrace subsystem"
7866b7dca40SMasami Hiramatsu	depends on GCOV_KERNEL
7876b7dca40SMasami Hiramatsu	help
7886b7dca40SMasami Hiramatsu	  Enable GCOV profiling on ftrace subsystem for checking
7896b7dca40SMasami Hiramatsu	  which functions/lines are tested.
7906b7dca40SMasami Hiramatsu
7916b7dca40SMasami Hiramatsu	  If unsure, say N.
7926b7dca40SMasami Hiramatsu
7936b7dca40SMasami Hiramatsu	  Note that on a kernel compiled with this config, ftrace will
7946b7dca40SMasami Hiramatsu	  run significantly slower.
7956b7dca40SMasami Hiramatsu
7964ed9f071SSteven Rostedtendif # FTRACE
79740ada30fSIngo Molnar
79840ada30fSIngo Molnarendif # TRACING_SUPPORT
79940ada30fSIngo Molnar
800