Commit | Line | Data |
---|---|---|
ec8f24b7 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
16444a8a | 2 | # |
606576ce SR |
3 | # Architectures that offer an FUNCTION_TRACER implementation should |
4 | # select HAVE_FUNCTION_TRACER: | |
16444a8a | 5 | # |
2a3a4f66 | 6 | |
8d26487f TE |
7 | config USER_STACKTRACE_SUPPORT |
8 | bool | |
9 | ||
2a3a4f66 FW |
10 | config NOP_TRACER |
11 | bool | |
12 | ||
54ecbe6f MH |
13 | config HAVE_RETHOOK |
14 | bool | |
15 | ||
16 | config RETHOOK | |
17 | bool | |
18 | depends on HAVE_RETHOOK | |
19 | help | |
20 | Enable generic return hooking feature. This is an internal | |
21 | API, which will be used by other function-entry hooking | |
22 | features like fprobe and kprobes. | |
23 | ||
606576ce | 24 | config HAVE_FUNCTION_TRACER |
16444a8a | 25 | bool |
555f386c | 26 | help |
5fb94e9c | 27 | See Documentation/trace/ftrace-design.rst |
bc0c38d1 | 28 | |
fb52607a | 29 | config HAVE_FUNCTION_GRAPH_TRACER |
15e6cb36 | 30 | bool |
555f386c | 31 | help |
5fb94e9c | 32 | See Documentation/trace/ftrace-design.rst |
15e6cb36 | 33 | |
a3ed4157 | 34 | config HAVE_FUNCTION_GRAPH_FREGS |
a1be9ccc DP |
35 | bool |
36 | ||
a762e926 MHG |
37 | config HAVE_FTRACE_GRAPH_FUNC |
38 | bool | |
39 | help | |
40 | True if ftrace_graph_func() is defined. | |
41 | ||
677aa9f7 SR |
42 | config HAVE_DYNAMIC_FTRACE |
43 | bool | |
555f386c | 44 | help |
5fb94e9c | 45 | See Documentation/trace/ftrace-design.rst |
677aa9f7 | 46 | |
06aeaaea MH |
47 | config HAVE_DYNAMIC_FTRACE_WITH_REGS |
48 | bool | |
49 | ||
763e34e7 SRV |
50 | config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS |
51 | bool | |
52 | ||
cbad0fb2 MR |
53 | config HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS |
54 | bool | |
55 | ||
02a474ca SRV |
56 | config HAVE_DYNAMIC_FTRACE_WITH_ARGS |
57 | bool | |
58 | help | |
59 | If this is set, then arguments and stack can be found from | |
94d095ff | 60 | the ftrace_regs passed into the function callback regs parameter |
02a474ca | 61 | by default, even without setting the REGS flag in the ftrace_ops. |
94d095ff MR |
62 | This allows for use of ftrace_regs_get_argument() and |
63 | ftrace_regs_get_stack_pointer(). | |
02a474ca | 64 | |
762abbc0 MHG |
65 | config HAVE_FTRACE_REGS_HAVING_PT_REGS |
66 | bool | |
67 | help | |
68 | If this is set, ftrace_regs has pt_regs, thus it can convert to | |
69 | pt_regs without allocating memory. | |
70 | ||
9440155c PZI |
71 | config HAVE_DYNAMIC_FTRACE_NO_PATCHABLE |
72 | bool | |
73 | help | |
74 | If the architecture generates __patchable_function_entries sections | |
75 | but does not want them included in the ftrace locations. | |
76 | ||
8da3821b SR |
77 | config HAVE_FTRACE_MCOUNT_RECORD |
78 | bool | |
555f386c | 79 | help |
5fb94e9c | 80 | See Documentation/trace/ftrace-design.rst |
8da3821b | 81 | |
66700001 | 82 | config HAVE_SYSCALL_TRACEPOINTS |
ee08c6ec | 83 | bool |
555f386c | 84 | help |
5fb94e9c | 85 | See Documentation/trace/ftrace-design.rst |
ee08c6ec | 86 | |
a2546fae SR |
87 | config HAVE_FENTRY |
88 | bool | |
89 | help | |
90 | Arch supports the gcc options -pg with -mfentry | |
91 | ||
2f4df001 VG |
92 | config HAVE_NOP_MCOUNT |
93 | bool | |
94 | help | |
95 | Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount | |
96 | ||
22c8542d ST |
97 | config HAVE_OBJTOOL_MCOUNT |
98 | bool | |
99 | help | |
100 | Arch supports objtool --mcount | |
101 | ||
280981d6 SV |
102 | config HAVE_OBJTOOL_NOP_MCOUNT |
103 | bool | |
104 | help | |
105 | Arch supports the objtool options --mcount with --mnop. | |
106 | An architecture can select this if it wants to enable nop'ing | |
107 | of ftrace locations. | |
108 | ||
cf4db259 | 109 | config HAVE_C_RECORDMCOUNT |
72441cb1 SR |
110 | bool |
111 | help | |
112 | C version of recordmcount available? | |
113 | ||
4ed308c4 SRG |
114 | config HAVE_BUILDTIME_MCOUNT_SORT |
115 | bool | |
116 | help | |
117 | An architecture selects this if it sorts the mcount_loc section | |
118 | at build time. | |
119 | ||
6b9b6413 SRG |
120 | config BUILDTIME_MCOUNT_SORT |
121 | bool | |
122 | default y | |
4ed308c4 | 123 | depends on HAVE_BUILDTIME_MCOUNT_SORT && DYNAMIC_FTRACE |
6b9b6413 SRG |
124 | help |
125 | Sort the mcount_loc section at build time. | |
126 | ||
352ad25a SR |
127 | config TRACER_MAX_TRACE |
128 | bool | |
129 | ||
ea632e9f JT |
130 | config TRACE_CLOCK |
131 | bool | |
132 | ||
7a8e76a3 SR |
133 | config RING_BUFFER |
134 | bool | |
ea632e9f | 135 | select TRACE_CLOCK |
22287688 | 136 | select IRQ_WORK |
7a8e76a3 | 137 | |
5f77a88b | 138 | config EVENT_TRACING |
b11c53e1 | 139 | select CONTEXT_SWITCH_TRACER |
fc809bc5 | 140 | select GLOB |
b11c53e1 Z |
141 | bool |
142 | ||
143 | config CONTEXT_SWITCH_TRACER | |
5f77a88b TZ |
144 | bool |
145 | ||
85bac32c SR |
146 | config RING_BUFFER_ALLOW_SWAP |
147 | bool | |
148 | help | |
149 | Allow the use of ring_buffer_swap_cpu. | |
150 | Adds a very slight overhead to tracing when enabled. | |
151 | ||
c3bc8fd6 JFG |
152 | config PREEMPTIRQ_TRACEPOINTS |
153 | bool | |
154 | depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS | |
155 | select TRACING | |
156 | default y | |
157 | help | |
158 | Create preempt/irq toggle tracepoints if needed, so that other parts | |
159 | of the kernel can use them to generate or add hooks to them. | |
160 | ||
5e0a0939 SR |
161 | # All tracer options should select GENERIC_TRACER. For those options that are |
162 | # enabled by all tracers (context switch and event tracer) they select TRACING. | |
163 | # This allows those options to appear when no other tracer is selected. But the | |
164 | # options do not appear when something else selects it. We need the two options | |
165 | # GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the | |
40892367 | 166 | # hiding of the automatic options. |
5e0a0939 | 167 | |
bc0c38d1 SR |
168 | config TRACING |
169 | bool | |
7a8e76a3 | 170 | select RING_BUFFER |
c2c80529 | 171 | select STACKTRACE if STACKTRACE_SUPPORT |
5f87f112 | 172 | select TRACEPOINTS |
f3384b28 | 173 | select NOP_TRACER |
769b0441 | 174 | select BINARY_PRINTF |
5f77a88b | 175 | select EVENT_TRACING |
ea632e9f | 176 | select TRACE_CLOCK |
02b3c5fc | 177 | select NEED_TASKS_RCU |
bc0c38d1 | 178 | |
5e0a0939 SR |
179 | config GENERIC_TRACER |
180 | bool | |
181 | select TRACING | |
182 | ||
40ada30f IM |
183 | # |
184 | # Minimum requirements an architecture has to meet for us to | |
185 | # be able to offer generic tracing facilities: | |
186 | # | |
187 | config TRACING_SUPPORT | |
188 | bool | |
0ea5ee03 | 189 | depends on TRACE_IRQFLAGS_SUPPORT |
40ada30f | 190 | depends on STACKTRACE_SUPPORT |
422d3c7a | 191 | default y |
40ada30f | 192 | |
4ed9f071 SR |
193 | menuconfig FTRACE |
194 | bool "Tracers" | |
de32951b | 195 | depends on TRACING_SUPPORT |
65b77242 | 196 | default y if DEBUG_KERNEL |
4ed9f071 | 197 | help |
40892367 | 198 | Enable the kernel tracing infrastructure. |
4ed9f071 SR |
199 | |
200 | if FTRACE | |
17d80fd0 | 201 | |
1e837945 SRV |
202 | config BOOTTIME_TRACING |
203 | bool "Boot-time Tracing support" | |
d8a953dd MH |
204 | depends on TRACING |
205 | select BOOT_CONFIG | |
1e837945 SRV |
206 | help |
207 | Enable developer to setup ftrace subsystem via supplemental | |
208 | kernel cmdline at boot time for debugging (tracing) driver | |
209 | initialization and boot process. | |
210 | ||
606576ce | 211 | config FUNCTION_TRACER |
1b29b018 | 212 | bool "Kernel Function Tracer" |
606576ce | 213 | depends on HAVE_FUNCTION_TRACER |
4d7a077c | 214 | select KALLSYMS |
5e0a0939 | 215 | select GENERIC_TRACER |
35e8e302 | 216 | select CONTEXT_SWITCH_TRACER |
0598e4f0 | 217 | select GLOB |
02b3c5fc | 218 | select NEED_TASKS_RCU |
e5a971d7 | 219 | select TASKS_RUDE_RCU |
1b29b018 SR |
220 | help |
221 | Enable the kernel to trace every kernel function. This is done | |
222 | by using a compiler feature to insert a small, 5-byte No-Operation | |
40892367 | 223 | instruction at the beginning of every kernel function, which NOP |
1b29b018 SR |
224 | sequence is then dynamically patched into a tracer call when |
225 | tracing is enabled by the administrator. If it's runtime disabled | |
226 | (the bootup default), then the overhead of the instructions is very | |
0a6d7d45 SRG |
227 | small and not measurable even in micro-benchmarks (at least on |
228 | x86, but may have impact on other architectures). | |
35e8e302 | 229 | |
fb52607a FW |
230 | config FUNCTION_GRAPH_TRACER |
231 | bool "Kernel Function Graph Tracer" | |
232 | depends on HAVE_FUNCTION_GRAPH_TRACER | |
15e6cb36 | 233 | depends on FUNCTION_TRACER |
eb4a0378 | 234 | depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE |
764f3b95 | 235 | default y |
15e6cb36 | 236 | help |
fb52607a FW |
237 | Enable the kernel to trace a function at both its return |
238 | and its entry. | |
692105b8 ML |
239 | Its first purpose is to trace the duration of functions and |
240 | draw a call graph for each thread with some information like | |
40892367 | 241 | the return value. This is done by setting the current return |
692105b8 | 242 | address on the current task structure into a stack of calls. |
15e6cb36 | 243 | |
a1be9ccc DP |
244 | config FUNCTION_GRAPH_RETVAL |
245 | bool "Kernel Function Graph Return Value" | |
a3ed4157 | 246 | depends on HAVE_FUNCTION_GRAPH_FREGS |
a1be9ccc DP |
247 | depends on FUNCTION_GRAPH_TRACER |
248 | default n | |
249 | help | |
250 | Support recording and printing the function return value when | |
251 | using function graph tracer. It can be helpful to locate functions | |
252 | that return errors. This feature is off by default, and you can | |
253 | enable it via the trace option funcgraph-retval. | |
254 | See Documentation/trace/ftrace.rst | |
255 | ||
21e92806 DP |
256 | config FUNCTION_GRAPH_RETADDR |
257 | bool "Kernel Function Graph Return Address" | |
258 | depends on FUNCTION_GRAPH_TRACER | |
259 | default n | |
260 | help | |
261 | Support recording and printing the function return address when | |
262 | using function graph tracer. It can be helpful to locate code line that | |
263 | the function is called. This feature is off by default, and you can | |
264 | enable it via the trace option funcgraph-retaddr. | |
265 | ||
533c20b0 SS |
266 | config FUNCTION_TRACE_ARGS |
267 | bool | |
b81ff11c | 268 | depends on PROBE_EVENTS_BTF_ARGS |
533c20b0 | 269 | default y |
ff5c9c57 SS |
270 | help |
271 | If supported with function argument access API and BTF, then | |
272 | the function tracer and function graph tracer will support printing | |
273 | of function arguments. This feature is off by default, and can be | |
274 | enabled via the trace option func-args (for the function tracer) and | |
275 | funcgraph-args (for the function graph tracer) | |
533c20b0 | 276 | |
61778cd7 SRV |
277 | config DYNAMIC_FTRACE |
278 | bool "enable/disable function tracing dynamically" | |
279 | depends on FUNCTION_TRACER | |
280 | depends on HAVE_DYNAMIC_FTRACE | |
281 | default y | |
282 | help | |
283 | This option will modify all the calls to function tracing | |
284 | dynamically (will patch them out of the binary image and | |
285 | replace them with a No-Op instruction) on boot up. During | |
286 | compile time, a table is made of all the locations that ftrace | |
287 | can function trace, and this table is linked into the kernel | |
288 | image. When this is enabled, functions can be individually | |
289 | enabled, and the functions not enabled will not affect | |
290 | performance of the system. | |
291 | ||
2455f0e1 | 292 | See the files in /sys/kernel/tracing: |
61778cd7 SRV |
293 | available_filter_functions |
294 | set_ftrace_filter | |
295 | set_ftrace_notrace | |
296 | ||
297 | This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but | |
298 | otherwise has native performance as long as no tracing is active. | |
299 | ||
300 | config DYNAMIC_FTRACE_WITH_REGS | |
301 | def_bool y | |
302 | depends on DYNAMIC_FTRACE | |
303 | depends on HAVE_DYNAMIC_FTRACE_WITH_REGS | |
304 | ||
305 | config DYNAMIC_FTRACE_WITH_DIRECT_CALLS | |
306 | def_bool y | |
60c89718 | 307 | depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS |
61778cd7 SRV |
308 | depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS |
309 | ||
cbad0fb2 MR |
310 | config DYNAMIC_FTRACE_WITH_CALL_OPS |
311 | def_bool y | |
312 | depends on HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS | |
313 | ||
12f9951d LB |
314 | config DYNAMIC_FTRACE_WITH_ARGS |
315 | def_bool y | |
316 | depends on DYNAMIC_FTRACE | |
317 | depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS | |
318 | ||
cad9931f MH |
319 | config FPROBE |
320 | bool "Kernel Function Probe (fprobe)" | |
4346ba16 MHG |
321 | depends on HAVE_FUNCTION_GRAPH_FREGS && HAVE_FTRACE_GRAPH_FUNC |
322 | depends on DYNAMIC_FTRACE_WITH_ARGS | |
323 | select FUNCTION_GRAPH_TRACER | |
cad9931f MH |
324 | default n |
325 | help | |
5b0ab789 MH |
326 | This option enables kernel function probe (fprobe) based on ftrace. |
327 | The fprobe is similar to kprobes, but probes only for kernel function | |
328 | entries and exits. This also can probe multiple functions by one | |
329 | fprobe. | |
cad9931f MH |
330 | |
331 | If unsure, say N. | |
332 | ||
61778cd7 SRV |
333 | config FUNCTION_PROFILER |
334 | bool "Kernel function profiler" | |
335 | depends on FUNCTION_TRACER | |
336 | default n | |
337 | help | |
338 | This option enables the kernel function profiler. A file is created | |
339 | in debugfs called function_profile_enabled which defaults to zero. | |
340 | When a 1 is echoed into this file profiling begins, and when a | |
341 | zero is entered, profiling stops. A "functions" file is created in | |
342 | the trace_stat directory; this file shows the list of functions that | |
343 | have been hit and their counters. | |
344 | ||
345 | If in doubt, say N. | |
346 | ||
347 | config STACK_TRACER | |
348 | bool "Trace max stack" | |
349 | depends on HAVE_FUNCTION_TRACER | |
350 | select FUNCTION_TRACER | |
351 | select STACKTRACE | |
352 | select KALLSYMS | |
353 | help | |
354 | This special tracer records the maximum stack footprint of the | |
2455f0e1 | 355 | kernel and displays it in /sys/kernel/tracing/stack_trace. |
61778cd7 SRV |
356 | |
357 | This tracer works by hooking into every function call that the | |
358 | kernel executes, and keeping a maximum stack depth value and | |
359 | stack-trace saved. If this is configured with DYNAMIC_FTRACE | |
360 | then it will not have any overhead while the stack tracer | |
361 | is disabled. | |
362 | ||
363 | To enable the stack tracer on bootup, pass in 'stacktrace' | |
364 | on the kernel command line. | |
365 | ||
366 | The stack tracer can also be enabled or disabled via the | |
367 | sysctl kernel.stack_tracer_enabled | |
368 | ||
369 | Say N if unsure. | |
370 | ||
c3bc8fd6 JFG |
371 | config TRACE_PREEMPT_TOGGLE |
372 | bool | |
373 | help | |
374 | Enables hooks which will be called when preemption is first disabled, | |
375 | and last enabled. | |
bac429f0 | 376 | |
81d68a96 SR |
377 | config IRQSOFF_TRACER |
378 | bool "Interrupts-off Latency Tracer" | |
379 | default n | |
380 | depends on TRACE_IRQFLAGS_SUPPORT | |
81d68a96 | 381 | select TRACE_IRQFLAGS |
5e0a0939 | 382 | select GENERIC_TRACER |
81d68a96 | 383 | select TRACER_MAX_TRACE |
85bac32c | 384 | select RING_BUFFER_ALLOW_SWAP |
22cffc2b | 385 | select TRACER_SNAPSHOT |
0b85ffc2 | 386 | select TRACER_SNAPSHOT_PER_CPU_SWAP |
81d68a96 SR |
387 | help |
388 | This option measures the time spent in irqs-off critical | |
389 | sections, with microsecond accuracy. | |
390 | ||
391 | The default measurement method is a maximum search, which is | |
392 | disabled by default and can be runtime (re-)started | |
393 | via: | |
394 | ||
2455f0e1 | 395 | echo 0 > /sys/kernel/tracing/tracing_max_latency |
81d68a96 | 396 | |
40892367 | 397 | (Note that kernel size and overhead increase with this option |
6cd8a4bb SR |
398 | enabled. This option and the preempt-off timing option can be |
399 | used together or separately.) | |
400 | ||
401 | config PREEMPT_TRACER | |
402 | bool "Preemption-off Latency Tracer" | |
403 | default n | |
30c93704 | 404 | depends on PREEMPTION |
5e0a0939 | 405 | select GENERIC_TRACER |
6cd8a4bb | 406 | select TRACER_MAX_TRACE |
85bac32c | 407 | select RING_BUFFER_ALLOW_SWAP |
22cffc2b | 408 | select TRACER_SNAPSHOT |
0b85ffc2 | 409 | select TRACER_SNAPSHOT_PER_CPU_SWAP |
c3bc8fd6 | 410 | select TRACE_PREEMPT_TOGGLE |
6cd8a4bb | 411 | help |
40892367 | 412 | This option measures the time spent in preemption-off critical |
6cd8a4bb SR |
413 | sections, with microsecond accuracy. |
414 | ||
415 | The default measurement method is a maximum search, which is | |
416 | disabled by default and can be runtime (re-)started | |
417 | via: | |
418 | ||
2455f0e1 | 419 | echo 0 > /sys/kernel/tracing/tracing_max_latency |
6cd8a4bb | 420 | |
40892367 | 421 | (Note that kernel size and overhead increase with this option |
6cd8a4bb SR |
422 | enabled. This option and the irqs-off timing option can be |
423 | used together or separately.) | |
424 | ||
352ad25a SR |
425 | config SCHED_TRACER |
426 | bool "Scheduling Latency Tracer" | |
5e0a0939 | 427 | select GENERIC_TRACER |
352ad25a SR |
428 | select CONTEXT_SWITCH_TRACER |
429 | select TRACER_MAX_TRACE | |
22cffc2b | 430 | select TRACER_SNAPSHOT |
352ad25a SR |
431 | help |
432 | This tracer tracks the latency of the highest priority task | |
433 | to be scheduled in, starting from the point it has woken up. | |
434 | ||
e7c15cd8 SRRH |
435 | config HWLAT_TRACER |
436 | bool "Tracer to detect hardware latencies (like SMIs)" | |
437 | select GENERIC_TRACER | |
e25e43a4 | 438 | select TRACER_MAX_TRACE |
e7c15cd8 SRRH |
439 | help |
440 | This tracer, when enabled will create one or more kernel threads, | |
c5c1ea75 | 441 | depending on what the cpumask file is set to, which each thread |
e7c15cd8 SRRH |
442 | spinning in a loop looking for interruptions caused by |
443 | something other than the kernel. For example, if a | |
444 | System Management Interrupt (SMI) takes a noticeable amount of | |
445 | time, this tracer will detect it. This is useful for testing | |
446 | if a system is reliable for Real Time tasks. | |
447 | ||
448 | Some files are created in the tracing directory when this | |
449 | is enabled: | |
450 | ||
451 | hwlat_detector/width - time in usecs for how long to spin for | |
452 | hwlat_detector/window - time in usecs between the start of each | |
453 | iteration | |
454 | ||
455 | A kernel thread is created that will spin with interrupts disabled | |
c5c1ea75 | 456 | for "width" microseconds in every "window" cycle. It will not spin |
e7c15cd8 SRRH |
457 | for "window - width" microseconds, where the system can |
458 | continue to operate. | |
459 | ||
460 | The output will appear in the trace and trace_pipe files. | |
461 | ||
462 | When the tracer is not running, it has no affect on the system, | |
463 | but when it is running, it can cause the system to be | |
464 | periodically non responsive. Do not run this tracer on a | |
465 | production system. | |
466 | ||
467 | To enable this tracer, echo in "hwlat" into the current_tracer | |
468 | file. Every time a latency is greater than tracing_thresh, it will | |
469 | be recorded into the ring buffer. | |
470 | ||
bce29ac9 DBO |
471 | config OSNOISE_TRACER |
472 | bool "OS Noise tracer" | |
473 | select GENERIC_TRACER | |
e25e43a4 | 474 | select TRACER_MAX_TRACE |
bce29ac9 DBO |
475 | help |
476 | In the context of high-performance computing (HPC), the Operating | |
477 | System Noise (osnoise) refers to the interference experienced by an | |
478 | application due to activities inside the operating system. In the | |
479 | context of Linux, NMIs, IRQs, SoftIRQs, and any other system thread | |
480 | can cause noise to the system. Moreover, hardware-related jobs can | |
481 | also cause noise, for example, via SMIs. | |
482 | ||
483 | The osnoise tracer leverages the hwlat_detector by running a similar | |
484 | loop with preemption, SoftIRQs and IRQs enabled, thus allowing all | |
485 | the sources of osnoise during its execution. The osnoise tracer takes | |
486 | note of the entry and exit point of any source of interferences, | |
487 | increasing a per-cpu interference counter. It saves an interference | |
488 | counter for each source of interference. The interference counter for | |
489 | NMI, IRQs, SoftIRQs, and threads is increased anytime the tool | |
490 | observes these interferences' entry events. When a noise happens | |
491 | without any interference from the operating system level, the | |
492 | hardware noise counter increases, pointing to a hardware-related | |
493 | noise. In this way, osnoise can account for any source of | |
494 | interference. At the end of the period, the osnoise tracer prints | |
495 | the sum of all noise, the max single noise, the percentage of CPU | |
496 | available for the thread, and the counters for the noise sources. | |
497 | ||
498 | In addition to the tracer, a set of tracepoints were added to | |
499 | facilitate the identification of the osnoise source. | |
500 | ||
501 | The output will appear in the trace and trace_pipe files. | |
502 | ||
503 | To enable this tracer, echo in "osnoise" into the current_tracer | |
504 | file. | |
505 | ||
a955d7ea DBO |
506 | config TIMERLAT_TRACER |
507 | bool "Timerlat tracer" | |
508 | select OSNOISE_TRACER | |
509 | select GENERIC_TRACER | |
510 | help | |
511 | The timerlat tracer aims to help the preemptive kernel developers | |
512 | to find sources of wakeup latencies of real-time threads. | |
513 | ||
514 | The tracer creates a per-cpu kernel thread with real-time priority. | |
515 | The tracer thread sets a periodic timer to wakeup itself, and goes | |
516 | to sleep waiting for the timer to fire. At the wakeup, the thread | |
517 | then computes a wakeup latency value as the difference between | |
518 | the current time and the absolute time that the timer was set | |
519 | to expire. | |
520 | ||
521 | The tracer prints two lines at every activation. The first is the | |
522 | timer latency observed at the hardirq context before the | |
523 | activation of the thread. The second is the timer latency observed | |
524 | by the thread, which is the same level that cyclictest reports. The | |
525 | ACTIVATION ID field serves to relate the irq execution to its | |
526 | respective thread execution. | |
527 | ||
528 | The tracer is build on top of osnoise tracer, and the osnoise: | |
529 | events can be used to trace the source of interference from NMI, | |
530 | IRQs and other threads. It also enables the capture of the | |
531 | stacktrace at the IRQ context, which helps to identify the code | |
532 | path that can cause thread delay. | |
533 | ||
21b3ce30 SRV |
534 | config MMIOTRACE |
535 | bool "Memory mapped IO tracing" | |
536 | depends on HAVE_MMIOTRACE_SUPPORT && PCI | |
537 | select GENERIC_TRACER | |
538 | help | |
539 | Mmiotrace traces Memory Mapped I/O access and is meant for | |
540 | debugging and reverse engineering. It is called from the ioremap | |
541 | implementation and works via page faults. Tracing is disabled by | |
542 | default and can be enabled at run-time. | |
543 | ||
544 | See Documentation/trace/mmiotrace.rst. | |
545 | If you are not helping to develop drivers, say N. | |
546 | ||
897f17a6 SR |
547 | config ENABLE_DEFAULT_TRACERS |
548 | bool "Trace process context switches and events" | |
5e0a0939 | 549 | depends on !GENERIC_TRACER |
b77e38aa SR |
550 | select TRACING |
551 | help | |
40892367 | 552 | This tracer hooks to various trace points in the kernel, |
b77e38aa | 553 | allowing the user to pick and choose which trace point they |
897f17a6 | 554 | want to trace. It also includes the sched_switch tracer plugin. |
a7abe97f | 555 | |
ee08c6ec FW |
556 | config FTRACE_SYSCALLS |
557 | bool "Trace syscalls" | |
66700001 | 558 | depends on HAVE_SYSCALL_TRACEPOINTS |
5e0a0939 | 559 | select GENERIC_TRACER |
0ea1c415 | 560 | select KALLSYMS |
ee08c6ec FW |
561 | help |
562 | Basic tracer to catch the syscall entry and exit events. | |
563 | ||
debdd57f HT |
564 | config TRACER_SNAPSHOT |
565 | bool "Create a snapshot trace buffer" | |
566 | select TRACER_MAX_TRACE | |
567 | help | |
568 | Allow tracing users to take snapshot of the current buffer using the | |
569 | ftrace interface, e.g.: | |
570 | ||
2455f0e1 | 571 | echo 1 > /sys/kernel/tracing/snapshot |
debdd57f HT |
572 | cat snapshot |
573 | ||
0b85ffc2 | 574 | config TRACER_SNAPSHOT_PER_CPU_SWAP |
fc809bc5 | 575 | bool "Allow snapshot to swap per CPU" |
0b85ffc2 SRRH |
576 | depends on TRACER_SNAPSHOT |
577 | select RING_BUFFER_ALLOW_SWAP | |
578 | help | |
579 | Allow doing a snapshot of a single CPU buffer instead of a | |
580 | full swap (all buffers). If this is set, then the following is | |
581 | allowed: | |
582 | ||
2455f0e1 | 583 | echo 1 > /sys/kernel/tracing/per_cpu/cpu2/snapshot |
0b85ffc2 SRRH |
584 | |
585 | After which, only the tracing buffer for CPU 2 was swapped with | |
586 | the main tracing buffer, and the other CPU buffers remain the same. | |
587 | ||
588 | When this is enabled, this adds a little more overhead to the | |
589 | trace recording, as it needs to add some checks to synchronize | |
590 | recording with swaps. But this does not affect the performance | |
591 | of the overall system. This is enabled by default when the preempt | |
592 | or irq latency tracers are enabled, as those need to swap as well | |
593 | and already adds the overhead (plus a lot more). | |
594 | ||
2ed84eeb | 595 | config TRACE_BRANCH_PROFILING |
9ae5b879 | 596 | bool |
5e0a0939 | 597 | select GENERIC_TRACER |
9ae5b879 SR |
598 | |
599 | choice | |
600 | prompt "Branch Profiling" | |
601 | default BRANCH_PROFILE_NONE | |
602 | help | |
603 | The branch profiling is a software profiler. It will add hooks | |
604 | into the C conditionals to test which path a branch takes. | |
605 | ||
606 | The likely/unlikely profiler only looks at the conditions that | |
607 | are annotated with a likely or unlikely macro. | |
608 | ||
40892367 | 609 | The "all branch" profiler will profile every if-statement in the |
9ae5b879 | 610 | kernel. This profiler will also enable the likely/unlikely |
40892367 | 611 | profiler. |
9ae5b879 | 612 | |
40892367 RD |
613 | Either of the above profilers adds a bit of overhead to the system. |
614 | If unsure, choose "No branch profiling". | |
9ae5b879 SR |
615 | |
616 | config BRANCH_PROFILE_NONE | |
617 | bool "No branch profiling" | |
618 | help | |
40892367 RD |
619 | No branch profiling. Branch profiling adds a bit of overhead. |
620 | Only enable it if you want to analyse the branching behavior. | |
621 | Otherwise keep it disabled. | |
9ae5b879 SR |
622 | |
623 | config PROFILE_ANNOTATED_BRANCHES | |
624 | bool "Trace likely/unlikely profiler" | |
625 | select TRACE_BRANCH_PROFILING | |
1f0d69a9 | 626 | help |
59bf8964 | 627 | This tracer profiles all likely and unlikely macros |
1f0d69a9 SR |
628 | in the kernel. It will display the results in: |
629 | ||
2455f0e1 | 630 | /sys/kernel/tracing/trace_stat/branch_annotated |
1f0d69a9 | 631 | |
40892367 | 632 | Note: this will add a significant overhead; only turn this |
1f0d69a9 SR |
633 | on if you need to profile the system's use of these macros. |
634 | ||
2bcd521a | 635 | config PROFILE_ALL_BRANCHES |
68e76e03 | 636 | bool "Profile all if conditionals" if !FORTIFY_SOURCE |
9ae5b879 | 637 | select TRACE_BRANCH_PROFILING |
2bcd521a SR |
638 | help |
639 | This tracer profiles all branch conditions. Every if () | |
640 | taken in the kernel is recorded whether it hit or miss. | |
641 | The results will be displayed in: | |
642 | ||
2455f0e1 | 643 | /sys/kernel/tracing/trace_stat/branch_all |
2bcd521a | 644 | |
9ae5b879 SR |
645 | This option also enables the likely/unlikely profiler. |
646 | ||
2bcd521a SR |
647 | This configuration, when enabled, will impose a great overhead |
648 | on the system. This should only be enabled when the system | |
40892367 | 649 | is to be analyzed in much detail. |
9ae5b879 | 650 | endchoice |
2bcd521a | 651 | |
2ed84eeb | 652 | config TRACING_BRANCHES |
52f232cb SR |
653 | bool |
654 | help | |
655 | Selected by tracers that will trace the likely and unlikely | |
656 | conditions. This prevents the tracers themselves from being | |
657 | profiled. Profiling the tracing infrastructure can only happen | |
658 | when the likelys and unlikelys are not being traced. | |
659 | ||
2ed84eeb | 660 | config BRANCH_TRACER |
52f232cb | 661 | bool "Trace likely/unlikely instances" |
2ed84eeb SR |
662 | depends on TRACE_BRANCH_PROFILING |
663 | select TRACING_BRANCHES | |
52f232cb SR |
664 | help |
665 | This traces the events of likely and unlikely condition | |
666 | calls in the kernel. The difference between this and the | |
667 | "Trace likely/unlikely profiler" is that this is not a | |
668 | histogram of the callers, but actually places the calling | |
669 | events into a running trace buffer to see when and where the | |
670 | events happened, as well as their results. | |
671 | ||
672 | Say N if unsure. | |
673 | ||
2db270a8 | 674 | config BLK_DEV_IO_TRACE |
40892367 | 675 | bool "Support for tracing block IO actions" |
2db270a8 | 676 | depends on SYSFS |
1dfba05d | 677 | depends on BLOCK |
2db270a8 FW |
678 | select RELAY |
679 | select DEBUG_FS | |
680 | select TRACEPOINTS | |
5e0a0939 | 681 | select GENERIC_TRACER |
2db270a8 FW |
682 | select STACKTRACE |
683 | help | |
684 | Say Y here if you want to be able to trace the block layer actions | |
685 | on a given queue. Tracing allows you to see any traffic happening | |
686 | on a block device queue. For more information (and the userspace | |
687 | support tools needed), fetch the blktrace tools from: | |
688 | ||
689 | git://git.kernel.dk/blktrace.git | |
690 | ||
691 | Tracing also is possible using the ftrace interface, e.g.: | |
692 | ||
693 | echo 1 > /sys/block/sda/sda1/trace/enable | |
2455f0e1 RZ |
694 | echo blk > /sys/kernel/tracing/current_tracer |
695 | cat /sys/kernel/tracing/trace_pipe | |
2db270a8 FW |
696 | |
697 | If unsure, say N. | |
36994e58 | 698 | |
334e5519 MHG |
699 | config FPROBE_EVENTS |
700 | depends on FPROBE | |
701 | depends on HAVE_REGS_AND_STACK_ACCESS_API | |
702 | bool "Enable fprobe-based dynamic events" | |
703 | select TRACING | |
704 | select PROBE_EVENTS | |
705 | select DYNAMIC_EVENTS | |
706 | default y | |
707 | help | |
708 | This allows user to add tracing events on the function entry and | |
709 | exit via ftrace interface. The syntax is same as the kprobe events | |
710 | and the kprobe events on function entry and exit will be | |
711 | transparently converted to this fprobe events. | |
712 | ||
b576e097 MHG |
713 | config PROBE_EVENTS_BTF_ARGS |
714 | depends on HAVE_FUNCTION_ARG_ACCESS_API | |
715 | depends on FPROBE_EVENTS || KPROBE_EVENTS | |
716 | depends on DEBUG_INFO_BTF && BPF_SYSCALL | |
717 | bool "Support BTF function arguments for probe events" | |
718 | default y | |
719 | help | |
720 | The user can specify the arguments of the probe event using the names | |
721 | of the arguments of the probed function, when the probe location is a | |
722 | kernel function entry or a tracepoint. | |
723 | This is available only if BTF (BPF Type Format) support is enabled. | |
724 | ||
6b0b7551 | 725 | config KPROBE_EVENTS |
413d37d1 | 726 | depends on KPROBES |
f850c30c | 727 | depends on HAVE_REGS_AND_STACK_ACCESS_API |
77b44d1b | 728 | bool "Enable kprobes-based dynamic events" |
413d37d1 | 729 | select TRACING |
8ab83f56 | 730 | select PROBE_EVENTS |
6212dd29 | 731 | select DYNAMIC_EVENTS |
77b44d1b | 732 | default y |
413d37d1 | 733 | help |
40892367 RD |
734 | This allows the user to add tracing events (similar to tracepoints) |
735 | on the fly via the ftrace interface. See | |
5fb94e9c | 736 | Documentation/trace/kprobetrace.rst for more details. |
77b44d1b MH |
737 | |
738 | Those events can be inserted wherever kprobes can probe, and record | |
739 | various register and memory values. | |
740 | ||
40892367 RD |
741 | This option is also required by perf-probe subcommand of perf tools. |
742 | If you want to use perf tools, this option is strongly recommended. | |
413d37d1 | 743 | |
45408c4f MH |
744 | config KPROBE_EVENTS_ON_NOTRACE |
745 | bool "Do NOT protect notrace function from kprobe events" | |
746 | depends on KPROBE_EVENTS | |
7bb83f6f | 747 | depends on DYNAMIC_FTRACE |
45408c4f MH |
748 | default n |
749 | help | |
750 | This is only for the developers who want to debug ftrace itself | |
751 | using kprobe events. | |
752 | ||
753 | If kprobes can use ftrace instead of breakpoint, ftrace related | |
28cc65a1 | 754 | functions are protected from kprobe-events to prevent an infinite |
45408c4f MH |
755 | recursion or any unexpected execution path which leads to a kernel |
756 | crash. | |
757 | ||
758 | This option disables such protection and allows you to put kprobe | |
759 | events on ftrace functions for debugging ftrace by itself. | |
760 | Note that this might let you shoot yourself in the foot. | |
761 | ||
762 | If unsure, say N. | |
763 | ||
6b0b7551 | 764 | config UPROBE_EVENTS |
f3f096cf SD |
765 | bool "Enable uprobes-based dynamic events" |
766 | depends on ARCH_SUPPORTS_UPROBES | |
767 | depends on MMU | |
09294e31 | 768 | depends on PERF_EVENTS |
f3f096cf SD |
769 | select UPROBES |
770 | select PROBE_EVENTS | |
0597c49c | 771 | select DYNAMIC_EVENTS |
f3f096cf | 772 | select TRACING |
61f35d75 | 773 | default y |
f3f096cf SD |
774 | help |
775 | This allows the user to add tracing events on top of userspace | |
776 | dynamic events (similar to tracepoints) on the fly via the trace | |
777 | events interface. Those events can be inserted wherever uprobes | |
778 | can probe, and record various registers. | |
779 | This option is required if you plan to use perf-probe subcommand | |
780 | of perf tools on user space applications. | |
781 | ||
e1abf2cc IM |
782 | config BPF_EVENTS |
783 | depends on BPF_SYSCALL | |
6b0b7551 | 784 | depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS |
e1abf2cc IM |
785 | bool |
786 | default y | |
787 | help | |
5cbd22c1 PW |
788 | This allows the user to attach BPF programs to kprobe, uprobe, and |
789 | tracepoint events. | |
e1abf2cc | 790 | |
5448d44c MH |
791 | config DYNAMIC_EVENTS |
792 | def_bool n | |
793 | ||
8ab83f56 SD |
794 | config PROBE_EVENTS |
795 | def_bool n | |
796 | ||
9802d865 JB |
797 | config BPF_KPROBE_OVERRIDE |
798 | bool "Enable BPF programs to override a kprobed function" | |
799 | depends on BPF_EVENTS | |
540adea3 | 800 | depends on FUNCTION_ERROR_INJECTION |
9802d865 JB |
801 | default n |
802 | help | |
803 | Allows BPF to override the execution of a probed function and | |
804 | set a different return value. This is used for error injection. | |
805 | ||
8da3821b SR |
806 | config FTRACE_MCOUNT_RECORD |
807 | def_bool y | |
808 | depends on DYNAMIC_FTRACE | |
809 | depends on HAVE_FTRACE_MCOUNT_RECORD | |
810 | ||
3b15cdc1 ST |
811 | config FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY |
812 | bool | |
813 | depends on FTRACE_MCOUNT_RECORD | |
814 | ||
815 | config FTRACE_MCOUNT_USE_CC | |
816 | def_bool y | |
817 | depends on $(cc-option,-mrecord-mcount) | |
818 | depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY | |
819 | depends on FTRACE_MCOUNT_RECORD | |
820 | ||
22c8542d ST |
821 | config FTRACE_MCOUNT_USE_OBJTOOL |
822 | def_bool y | |
823 | depends on HAVE_OBJTOOL_MCOUNT | |
824 | depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY | |
825 | depends on !FTRACE_MCOUNT_USE_CC | |
826 | depends on FTRACE_MCOUNT_RECORD | |
03f16cd0 | 827 | select OBJTOOL |
22c8542d | 828 | |
3b15cdc1 ST |
829 | config FTRACE_MCOUNT_USE_RECORDMCOUNT |
830 | def_bool y | |
831 | depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY | |
832 | depends on !FTRACE_MCOUNT_USE_CC | |
22c8542d | 833 | depends on !FTRACE_MCOUNT_USE_OBJTOOL |
3b15cdc1 ST |
834 | depends on FTRACE_MCOUNT_RECORD |
835 | ||
08d43a5f TZ |
836 | config TRACING_MAP |
837 | bool | |
838 | depends on ARCH_HAVE_NMI_SAFE_CMPXCHG | |
08d43a5f TZ |
839 | help |
840 | tracing_map is a special-purpose lock-free map for tracing, | |
841 | separated out as a stand-alone facility in order to allow it | |
842 | to be shared between multiple tracers. It isn't meant to be | |
843 | generally used outside of that context, and is normally | |
844 | selected by tracers that use it. | |
845 | ||
726721a5 TZ |
846 | config SYNTH_EVENTS |
847 | bool "Synthetic trace events" | |
848 | select TRACING | |
849 | select DYNAMIC_EVENTS | |
850 | default n | |
851 | help | |
852 | Synthetic events are user-defined trace events that can be | |
853 | used to combine data from other trace events or in fact any | |
854 | data source. Synthetic events can be generated indirectly | |
855 | via the trace() action of histogram triggers or directly | |
856 | by way of an in-kernel API. | |
857 | ||
858 | See Documentation/trace/events.rst or | |
859 | Documentation/trace/histogram.rst for details and examples. | |
860 | ||
861 | If in doubt, say N. | |
862 | ||
7f5a08c7 BB |
863 | config USER_EVENTS |
864 | bool "User trace events" | |
865 | select TRACING | |
866 | select DYNAMIC_EVENTS | |
867 | help | |
868 | User trace events are user-defined trace events that | |
869 | can be used like an existing kernel trace event. User trace | |
870 | events are generated by writing to a tracefs file. User | |
871 | processes can determine if their tracing events should be | |
72357590 BB |
872 | generated by registering a value and bit with the kernel |
873 | that reflects when it is enabled or not. | |
7f5a08c7 | 874 | |
72357590 | 875 | See Documentation/trace/user_events.rst. |
7f5a08c7 BB |
876 | If in doubt, say N. |
877 | ||
7ef224d1 TZ |
878 | config HIST_TRIGGERS |
879 | bool "Histogram triggers" | |
880 | depends on ARCH_HAVE_NMI_SAFE_CMPXCHG | |
881 | select TRACING_MAP | |
7ad8fb61 | 882 | select TRACING |
7bbab38d | 883 | select DYNAMIC_EVENTS |
726721a5 | 884 | select SYNTH_EVENTS |
7ef224d1 TZ |
885 | default n |
886 | help | |
887 | Hist triggers allow one or more arbitrary trace event fields | |
888 | to be aggregated into hash tables and dumped to stdout by | |
889 | reading a debugfs/tracefs file. They're useful for | |
890 | gathering quick and dirty (though precise) summaries of | |
891 | event activity as an initial guide for further investigation | |
892 | using more advanced tools. | |
893 | ||
89e270c1 TZ |
894 | Inter-event tracing of quantities such as latencies is also |
895 | supported using hist triggers under this option. | |
896 | ||
ea272257 | 897 | See Documentation/trace/histogram.rst. |
7ef224d1 TZ |
898 | If in doubt, say N. |
899 | ||
6c3edaf9 CW |
900 | config TRACE_EVENT_INJECT |
901 | bool "Trace event injection" | |
902 | depends on TRACING | |
903 | help | |
904 | Allow user-space to inject a specific trace event into the ring | |
905 | buffer. This is mainly used for testing purpose. | |
906 | ||
907 | If unsure, say N. | |
908 | ||
81dc9f0e | 909 | config TRACEPOINT_BENCHMARK |
fc809bc5 | 910 | bool "Add tracepoint that benchmarks tracepoints" |
81dc9f0e SRRH |
911 | help |
912 | This option creates the tracepoint "benchmark:benchmark_event". | |
913 | When the tracepoint is enabled, it kicks off a kernel thread that | |
69268094 | 914 | goes into an infinite loop (calling cond_resched() to let other tasks |
81dc9f0e SRRH |
915 | run), and calls the tracepoint. Each iteration will record the time |
916 | it took to write to the tracepoint and the next iteration that | |
917 | data will be passed to the tracepoint itself. That is, the tracepoint | |
918 | will report the time it took to do the previous tracepoint. | |
919 | The string written to the tracepoint is a static string of 128 bytes | |
920 | to keep the time the same. The initial string is simply a write of | |
921 | "START". The second string records the cold cache time of the first | |
922 | write which is not added to the rest of the calculations. | |
923 | ||
924 | As it is a tight loop, it benchmarks as hot cache. That's fine because | |
925 | we care most about hot paths that are probably in cache already. | |
926 | ||
927 | An example of the output: | |
928 | ||
929 | START | |
930 | first=3672 [COLD CACHED] | |
931 | last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712 | |
932 | last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337 | |
933 | last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064 | |
934 | last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411 | |
935 | last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389 | |
936 | last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666 | |
937 | ||
938 | ||
5092dbc9 SR |
939 | config RING_BUFFER_BENCHMARK |
940 | tristate "Ring buffer benchmark stress tester" | |
941 | depends on RING_BUFFER | |
942 | help | |
40892367 RD |
943 | This option creates a test to stress the ring buffer and benchmark it. |
944 | It creates its own ring buffer such that it will not interfere with | |
5092dbc9 SR |
945 | any other users of the ring buffer (such as ftrace). It then creates |
946 | a producer and consumer that will run for 10 seconds and sleep for | |
947 | 10 seconds. Each interval it will print out the number of events | |
948 | it recorded and give a rough estimate of how long each iteration took. | |
949 | ||
950 | It does not disable interrupts or raise its priority, so it may be | |
951 | affected by processes that are running. | |
952 | ||
40892367 | 953 | If unsure, say N. |
5092dbc9 | 954 | |
1e837945 SRV |
955 | config TRACE_EVAL_MAP_FILE |
956 | bool "Show eval mappings for trace events" | |
957 | depends on TRACING | |
958 | help | |
959 | The "print fmt" of the trace events will show the enum/sizeof names | |
960 | instead of their values. This can cause problems for user space tools | |
961 | that use this string to parse the raw data as user space does not know | |
962 | how to convert the string to its value. | |
963 | ||
964 | To fix this, there's a special macro in the kernel that can be used | |
965 | to convert an enum/sizeof into its value. If this macro is used, then | |
966 | the print fmt strings will be converted to their values. | |
967 | ||
968 | If something does not get converted properly, this option can be | |
969 | used to show what enums/sizeof the kernel tried to convert. | |
970 | ||
971 | This option is for debugging the conversions. A file is created | |
972 | in the tracing directory called "eval_map" that will show the | |
973 | names matched with their values and what trace event system they | |
974 | belong too. | |
975 | ||
976 | Normally, the mapping of the strings to values will be freed after | |
977 | boot up or module load. With this option, they will not be freed, as | |
978 | they are needed for the "eval_map" file. Enabling this option will | |
979 | increase the memory footprint of the running kernel. | |
980 | ||
981 | If unsure, say N. | |
982 | ||
773c1670 SRV |
983 | config FTRACE_RECORD_RECURSION |
984 | bool "Record functions that recurse in function tracing" | |
985 | depends on FUNCTION_TRACER | |
986 | help | |
987 | All callbacks that attach to the function tracing have some sort | |
988 | of protection against recursion. Even though the protection exists, | |
989 | it adds overhead. This option will create a file in the tracefs | |
990 | file system called "recursed_functions" that will list the functions | |
991 | that triggered a recursion. | |
992 | ||
993 | This will add more overhead to cases that have recursion. | |
994 | ||
995 | If unsure, say N | |
996 | ||
997 | config FTRACE_RECORD_RECURSION_SIZE | |
998 | int "Max number of recursed functions to record" | |
d96c3600 | 999 | default 128 |
773c1670 SRV |
1000 | depends on FTRACE_RECORD_RECURSION |
1001 | help | |
1002 | This defines the limit of number of functions that can be | |
1003 | listed in the "recursed_functions" file, that lists all | |
1004 | the functions that caused a recursion to happen. | |
1005 | This file can be reset, but the limit can not change in | |
1006 | size at runtime. | |
1007 | ||
b0e28a4b AN |
1008 | config FTRACE_VALIDATE_RCU_IS_WATCHING |
1009 | bool "Validate RCU is on during ftrace execution" | |
1010 | depends on FUNCTION_TRACER | |
1011 | depends on ARCH_WANTS_NO_INSTR | |
1012 | help | |
1013 | All callbacks that attach to the function tracing have some sort of | |
1014 | protection against recursion. This option is only to verify that | |
1015 | ftrace (and other users of ftrace_test_recursion_trylock()) are not | |
1016 | called outside of RCU, as if they are, it can cause a race. But it | |
1017 | also has a noticeable overhead when enabled. | |
1018 | ||
1019 | If unsure, say N | |
1020 | ||
28575c61 SRV |
1021 | config RING_BUFFER_RECORD_RECURSION |
1022 | bool "Record functions that recurse in the ring buffer" | |
1023 | depends on FTRACE_RECORD_RECURSION | |
1024 | # default y, because it is coupled with FTRACE_RECORD_RECURSION | |
1025 | default y | |
1026 | help | |
1027 | The ring buffer has its own internal recursion. Although when | |
ac28d0a0 RD |
1028 | recursion happens it won't cause harm because of the protection, |
1029 | but it does cause unwanted overhead. Enabling this option will | |
28575c61 SRV |
1030 | place where recursion was detected into the ftrace "recursed_functions" |
1031 | file. | |
1032 | ||
1033 | This will add more overhead to cases that have recursion. | |
1034 | ||
1e837945 SRV |
1035 | config GCOV_PROFILE_FTRACE |
1036 | bool "Enable GCOV profiling on ftrace subsystem" | |
1037 | depends on GCOV_KERNEL | |
1038 | help | |
1039 | Enable GCOV profiling on ftrace subsystem for checking | |
1040 | which functions/lines are tested. | |
1041 | ||
1042 | If unsure, say N. | |
1043 | ||
1044 | Note that on a kernel compiled with this config, ftrace will | |
1045 | run significantly slower. | |
1046 | ||
1047 | config FTRACE_SELFTEST | |
1048 | bool | |
1049 | ||
1050 | config FTRACE_STARTUP_TEST | |
1051 | bool "Perform a startup test on ftrace" | |
1052 | depends on GENERIC_TRACER | |
1053 | select FTRACE_SELFTEST | |
1054 | help | |
1055 | This option performs a series of startup tests on ftrace. On bootup | |
1056 | a series of tests are made to verify that the tracer is | |
1057 | functioning properly. It will do tests on all the configured | |
1058 | tracers of ftrace. | |
1059 | ||
1060 | config EVENT_TRACE_STARTUP_TEST | |
1061 | bool "Run selftest on trace events" | |
1062 | depends on FTRACE_STARTUP_TEST | |
1063 | default y | |
1064 | help | |
1065 | This option performs a test on all trace events in the system. | |
1066 | It basically just enables each event and runs some code that | |
1067 | will trigger events (not necessarily the event it enables) | |
1068 | This may take some time run as there are a lot of events. | |
1069 | ||
1070 | config EVENT_TRACE_TEST_SYSCALLS | |
1071 | bool "Run selftest on syscall events" | |
1072 | depends on EVENT_TRACE_STARTUP_TEST | |
1073 | help | |
1074 | This option will also enable testing every syscall event. | |
1075 | It only enables the event and disables it and runs various loads | |
1076 | with the event enabled. This adds a bit more time for kernel boot | |
1077 | up since it runs this on every system call defined. | |
1078 | ||
1079 | TBD - enable a way to actually call the syscalls as we test their | |
1080 | events | |
1081 | ||
8147dc78 SRV |
1082 | config FTRACE_SORT_STARTUP_TEST |
1083 | bool "Verify compile time sorting of ftrace functions" | |
1084 | depends on DYNAMIC_FTRACE | |
6b9b6413 | 1085 | depends on BUILDTIME_MCOUNT_SORT |
8147dc78 SRV |
1086 | help |
1087 | Sorting of the mcount_loc sections that is used to find the | |
1088 | where the ftrace knows where to patch functions for tracing | |
1089 | and other callbacks is done at compile time. But if the sort | |
1090 | is not done correctly, it will cause non-deterministic failures. | |
1091 | When this is set, the sorted sections will be verified that they | |
1092 | are in deed sorted and will warn if they are not. | |
1093 | ||
1094 | If unsure, say N | |
1095 | ||
6c43e554 SRRH |
1096 | config RING_BUFFER_STARTUP_TEST |
1097 | bool "Ring buffer startup self test" | |
1098 | depends on RING_BUFFER | |
1099 | help | |
fc809bc5 | 1100 | Run a simple self test on the ring buffer on boot up. Late in the |
6c43e554 SRRH |
1101 | kernel boot sequence, the test will start that kicks off |
1102 | a thread per cpu. Each thread will write various size events | |
1103 | into the ring buffer. Another thread is created to send IPIs | |
1104 | to each of the threads, where the IPI handler will also write | |
1105 | to the ring buffer, to test/stress the nesting ability. | |
1106 | If any anomalies are discovered, a warning will be displayed | |
1107 | and all ring buffers will be disabled. | |
1108 | ||
1109 | The test runs for 10 seconds. This will slow your boot time | |
1110 | by at least 10 more seconds. | |
1111 | ||
ac28d0a0 RD |
1112 | At the end of the test, statistics and more checks are done. |
1113 | It will output the stats of each per cpu buffer: What | |
6c43e554 SRRH |
1114 | was written, the sizes, what was read, what was lost, and |
1115 | other similar details. | |
1116 | ||
1117 | If unsure, say N | |
1118 | ||
5b7be9c7 SRV |
1119 | config RING_BUFFER_VALIDATE_TIME_DELTAS |
1120 | bool "Verify ring buffer time stamp deltas" | |
1121 | depends on RING_BUFFER | |
1122 | help | |
1123 | This will audit the time stamps on the ring buffer sub | |
1124 | buffer to make sure that all the time deltas for the | |
1125 | events on a sub buffer matches the current time stamp. | |
1126 | This audit is performed for every event that is not | |
1127 | interrupted, or interrupting another event. A check | |
1128 | is also made when traversing sub buffers to make sure | |
1129 | that all the deltas on the previous sub buffer do not | |
1130 | add up to be greater than the current time stamp. | |
1131 | ||
1132 | NOTE: This adds significant overhead to recording of events, | |
1133 | and should only be used to test the logic of the ring buffer. | |
1134 | Do not use it on production systems. | |
1135 | ||
1136 | Only say Y if you understand what this does, and you | |
1137 | still want it enabled. Otherwise say N | |
1138 | ||
a48fc4f5 SRV |
1139 | config MMIOTRACE_TEST |
1140 | tristate "Test module for mmiotrace" | |
1141 | depends on MMIOTRACE && m | |
1142 | help | |
1143 | This is a dumb module for testing mmiotrace. It is very dangerous | |
1144 | as it will write garbage to IO memory starting at a given address. | |
1145 | However, it should be safe to use on e.g. unused portion of VRAM. | |
1146 | ||
1147 | Say N, unless you absolutely know what you are doing. | |
1148 | ||
f96e8577 | 1149 | config PREEMPTIRQ_DELAY_TEST |
a48fc4f5 | 1150 | tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers" |
f96e8577 JFG |
1151 | depends on m |
1152 | help | |
1153 | Select this option to build a test module that can help test latency | |
1154 | tracers by executing a preempt or irq disable section with a user | |
1155 | configurable delay. The module busy waits for the duration of the | |
1156 | critical section. | |
1157 | ||
79393723 VRB |
1158 | For example, the following invocation generates a burst of three |
1159 | irq-disabled critical sections for 500us: | |
1160 | modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3 | |
f96e8577 | 1161 | |
4b9091e1 SC |
1162 | What's more, if you want to attach the test on the cpu which the latency |
1163 | tracer is running on, specify cpu_affinity=cpu_num at the end of the | |
1164 | command. | |
1165 | ||
f96e8577 JFG |
1166 | If unsure, say N |
1167 | ||
9fe41efa TZ |
1168 | config SYNTH_EVENT_GEN_TEST |
1169 | tristate "Test module for in-kernel synthetic event generation" | |
3572bd56 | 1170 | depends on SYNTH_EVENTS && m |
9fe41efa TZ |
1171 | help |
1172 | This option creates a test module to check the base | |
1173 | functionality of in-kernel synthetic event definition and | |
1174 | generation. | |
1175 | ||
1176 | To test, insert the module, and then check the trace buffer | |
1177 | for the generated sample events. | |
1178 | ||
1179 | If unsure, say N. | |
1180 | ||
64836248 TZ |
1181 | config KPROBE_EVENT_GEN_TEST |
1182 | tristate "Test module for in-kernel kprobe event generation" | |
3572bd56 | 1183 | depends on KPROBE_EVENTS && m |
64836248 TZ |
1184 | help |
1185 | This option creates a test module to check the base | |
1186 | functionality of in-kernel kprobe event definition. | |
1187 | ||
1188 | To test, insert the module, and then check the trace buffer | |
1189 | for the generated kprobe events. | |
1190 | ||
1191 | If unsure, say N. | |
1192 | ||
2d19bd79 TZ |
1193 | config HIST_TRIGGERS_DEBUG |
1194 | bool "Hist trigger debug support" | |
1195 | depends on HIST_TRIGGERS | |
1196 | help | |
1197 | Add "hist_debug" file for each event, which when read will | |
1198 | dump out a bunch of internal details about the hist triggers | |
1199 | defined on that event. | |
1200 | ||
1201 | The hist_debug file serves a couple of purposes: | |
1202 | ||
1203 | - Helps developers verify that nothing is broken. | |
1204 | ||
1205 | - Provides educational information to support the details | |
1206 | of the hist trigger internals as described by | |
1207 | Documentation/trace/histogram-design.rst. | |
1208 | ||
1209 | The hist_debug output only covers the data structures | |
1210 | related to the histogram definitions themselves and doesn't | |
1211 | display the internals of map buckets or variable values of | |
1212 | running histograms. | |
1213 | ||
1214 | If unsure, say N. | |
1215 | ||
102227b9 DBO |
1216 | source "kernel/trace/rv/Kconfig" |
1217 | ||
4ed9f071 | 1218 | endif # FTRACE |