aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/Kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/Kconfig')
-rw-r--r--kernel/trace/Kconfig144
1 files changed, 90 insertions, 54 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index b416512ad17f..60e2ce0181ee 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -12,39 +12,37 @@ config NOP_TRACER
12config HAVE_FTRACE_NMI_ENTER 12config HAVE_FTRACE_NMI_ENTER
13 bool 13 bool
14 help 14 help
15 See Documentation/trace/ftrace-implementation.txt 15 See Documentation/trace/ftrace-design.txt
16 16
17config HAVE_FUNCTION_TRACER 17config HAVE_FUNCTION_TRACER
18 bool 18 bool
19 help 19 help
20 See Documentation/trace/ftrace-implementation.txt 20 See Documentation/trace/ftrace-design.txt
21 21
22config HAVE_FUNCTION_GRAPH_TRACER 22config HAVE_FUNCTION_GRAPH_TRACER
23 bool 23 bool
24 help 24 help
25 See Documentation/trace/ftrace-implementation.txt 25 See Documentation/trace/ftrace-design.txt
26 26
27config HAVE_FUNCTION_GRAPH_FP_TEST 27config HAVE_FUNCTION_GRAPH_FP_TEST
28 bool 28 bool
29 help 29 help
30 An arch may pass in a unique value (frame pointer) to both the 30 See Documentation/trace/ftrace-design.txt
31 entering and exiting of a function. On exit, the value is compared
32 and if it does not match, then it will panic the kernel.
33 31
34config HAVE_FUNCTION_TRACE_MCOUNT_TEST 32config HAVE_FUNCTION_TRACE_MCOUNT_TEST
35 bool 33 bool
36 help 34 help
37 See Documentation/trace/ftrace-implementation.txt 35 See Documentation/trace/ftrace-design.txt
38 36
39config HAVE_DYNAMIC_FTRACE 37config HAVE_DYNAMIC_FTRACE
40 bool 38 bool
41 help 39 help
42 See Documentation/trace/ftrace-implementation.txt 40 See Documentation/trace/ftrace-design.txt
43 41
44config HAVE_FTRACE_MCOUNT_RECORD 42config HAVE_FTRACE_MCOUNT_RECORD
45 bool 43 bool
46 help 44 help
47 See Documentation/trace/ftrace-implementation.txt 45 See Documentation/trace/ftrace-design.txt
48 46
49config HAVE_HW_BRANCH_TRACER 47config HAVE_HW_BRANCH_TRACER
50 bool 48 bool
@@ -52,7 +50,7 @@ config HAVE_HW_BRANCH_TRACER
52config HAVE_SYSCALL_TRACEPOINTS 50config HAVE_SYSCALL_TRACEPOINTS
53 bool 51 bool
54 help 52 help
55 See Documentation/trace/ftrace-implementation.txt 53 See Documentation/trace/ftrace-design.txt
56 54
57config TRACER_MAX_TRACE 55config TRACER_MAX_TRACE
58 bool 56 bool
@@ -83,7 +81,7 @@ config RING_BUFFER_ALLOW_SWAP
83# This allows those options to appear when no other tracer is selected. But the 81# This allows those options to appear when no other tracer is selected. But the
84# options do not appear when something else selects it. We need the two options 82# options do not appear when something else selects it. We need the two options
85# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the 83# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
86# hidding of the automatic options. 84# hiding of the automatic options.
87 85
88config TRACING 86config TRACING
89 bool 87 bool
@@ -119,7 +117,7 @@ menuconfig FTRACE
119 bool "Tracers" 117 bool "Tracers"
120 default y if DEBUG_KERNEL 118 default y if DEBUG_KERNEL
121 help 119 help
122 Enable the kernel tracing infrastructure. 120 Enable the kernel tracing infrastructure.
123 121
124if FTRACE 122if FTRACE
125 123
@@ -133,7 +131,7 @@ config FUNCTION_TRACER
133 help 131 help
134 Enable the kernel to trace every kernel function. This is done 132 Enable the kernel to trace every kernel function. This is done
135 by using a compiler feature to insert a small, 5-byte No-Operation 133 by using a compiler feature to insert a small, 5-byte No-Operation
136 instruction to the beginning of every kernel function, which NOP 134 instruction at the beginning of every kernel function, which NOP
137 sequence is then dynamically patched into a tracer call when 135 sequence is then dynamically patched into a tracer call when
138 tracing is enabled by the administrator. If it's runtime disabled 136 tracing is enabled by the administrator. If it's runtime disabled
139 (the bootup default), then the overhead of the instructions is very 137 (the bootup default), then the overhead of the instructions is very
@@ -150,7 +148,7 @@ config FUNCTION_GRAPH_TRACER
150 and its entry. 148 and its entry.
151 Its first purpose is to trace the duration of functions and 149 Its first purpose is to trace the duration of functions and
152 draw a call graph for each thread with some information like 150 draw a call graph for each thread with some information like
153 the return value. This is done by setting the current return 151 the return value. This is done by setting the current return
154 address on the current task structure into a stack of calls. 152 address on the current task structure into a stack of calls.
155 153
156 154
@@ -173,7 +171,7 @@ config IRQSOFF_TRACER
173 171
174 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 172 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
175 173
176 (Note that kernel size and overhead increases with this option 174 (Note that kernel size and overhead increase with this option
177 enabled. This option and the preempt-off timing option can be 175 enabled. This option and the preempt-off timing option can be
178 used together or separately.) 176 used together or separately.)
179 177
@@ -186,7 +184,7 @@ config PREEMPT_TRACER
186 select TRACER_MAX_TRACE 184 select TRACER_MAX_TRACE
187 select RING_BUFFER_ALLOW_SWAP 185 select RING_BUFFER_ALLOW_SWAP
188 help 186 help
189 This option measures the time spent in preemption off critical 187 This option measures the time spent in preemption-off critical
190 sections, with microsecond accuracy. 188 sections, with microsecond accuracy.
191 189
192 The default measurement method is a maximum search, which is 190 The default measurement method is a maximum search, which is
@@ -195,7 +193,7 @@ config PREEMPT_TRACER
195 193
196 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency 194 echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
197 195
198 (Note that kernel size and overhead increases with this option 196 (Note that kernel size and overhead increase with this option
199 enabled. This option and the irqs-off timing option can be 197 enabled. This option and the irqs-off timing option can be
200 used together or separately.) 198 used together or separately.)
201 199
@@ -222,7 +220,7 @@ config ENABLE_DEFAULT_TRACERS
222 depends on !GENERIC_TRACER 220 depends on !GENERIC_TRACER
223 select TRACING 221 select TRACING
224 help 222 help
225 This tracer hooks to various trace points in the kernel 223 This tracer hooks to various trace points in the kernel,
226 allowing the user to pick and choose which trace point they 224 allowing the user to pick and choose which trace point they
227 want to trace. It also includes the sched_switch tracer plugin. 225 want to trace. It also includes the sched_switch tracer plugin.
228 226
@@ -265,19 +263,19 @@ choice
265 The likely/unlikely profiler only looks at the conditions that 263 The likely/unlikely profiler only looks at the conditions that
266 are annotated with a likely or unlikely macro. 264 are annotated with a likely or unlikely macro.
267 265
268 The "all branch" profiler will profile every if statement in the 266 The "all branch" profiler will profile every if-statement in the
269 kernel. This profiler will also enable the likely/unlikely 267 kernel. This profiler will also enable the likely/unlikely
270 profiler as well. 268 profiler.
271 269
272 Either of the above profilers add a bit of overhead to the system. 270 Either of the above profilers adds a bit of overhead to the system.
273 If unsure choose "No branch profiling". 271 If unsure, choose "No branch profiling".
274 272
275config BRANCH_PROFILE_NONE 273config BRANCH_PROFILE_NONE
276 bool "No branch profiling" 274 bool "No branch profiling"
277 help 275 help
278 No branch profiling. Branch profiling adds a bit of overhead. 276 No branch profiling. Branch profiling adds a bit of overhead.
279 Only enable it if you want to analyse the branching behavior. 277 Only enable it if you want to analyse the branching behavior.
280 Otherwise keep it disabled. 278 Otherwise keep it disabled.
281 279
282config PROFILE_ANNOTATED_BRANCHES 280config PROFILE_ANNOTATED_BRANCHES
283 bool "Trace likely/unlikely profiler" 281 bool "Trace likely/unlikely profiler"
@@ -288,7 +286,7 @@ config PROFILE_ANNOTATED_BRANCHES
288 286
289 /sys/kernel/debug/tracing/profile_annotated_branch 287 /sys/kernel/debug/tracing/profile_annotated_branch
290 288
291 Note: this will add a significant overhead, only turn this 289 Note: this will add a significant overhead; only turn this
292 on if you need to profile the system's use of these macros. 290 on if you need to profile the system's use of these macros.
293 291
294config PROFILE_ALL_BRANCHES 292config PROFILE_ALL_BRANCHES
@@ -305,7 +303,7 @@ config PROFILE_ALL_BRANCHES
305 303
306 This configuration, when enabled, will impose a great overhead 304 This configuration, when enabled, will impose a great overhead
307 on the system. This should only be enabled when the system 305 on the system. This should only be enabled when the system
308 is to be analyzed 306 is to be analyzed in much detail.
309endchoice 307endchoice
310 308
311config TRACING_BRANCHES 309config TRACING_BRANCHES
@@ -335,10 +333,31 @@ config POWER_TRACER
335 depends on X86 333 depends on X86
336 select GENERIC_TRACER 334 select GENERIC_TRACER
337 help 335 help
338 This tracer helps developers to analyze and optimize the kernels 336 This tracer helps developers to analyze and optimize the kernel's
339 power management decisions, specifically the C-state and P-state 337 power management decisions, specifically the C-state and P-state
340 behavior. 338 behavior.
341 339
340config KSYM_TRACER
341 bool "Trace read and write access on kernel memory locations"
342 depends on HAVE_HW_BREAKPOINT
343 select TRACING
344 help
345 This tracer helps find read and write operations on any given kernel
346 symbol i.e. /proc/kallsyms.
347
348config PROFILE_KSYM_TRACER
349 bool "Profile all kernel memory accesses on 'watched' variables"
350 depends on KSYM_TRACER
351 help
352 This tracer profiles kernel accesses on variables watched through the
353 ksym tracer ftrace plugin. Depending upon the hardware, all read
354 and write operations on kernel variables can be monitored for
355 accesses.
356
357 The results will be displayed in:
358 /debugfs/tracing/profile_ksym
359
360 Say N if unsure.
342 361
343config STACK_TRACER 362config STACK_TRACER
344 bool "Trace max stack" 363 bool "Trace max stack"
@@ -370,14 +389,14 @@ config HW_BRANCH_TRACER
370 select GENERIC_TRACER 389 select GENERIC_TRACER
371 help 390 help
372 This tracer records all branches on the system in a circular 391 This tracer records all branches on the system in a circular
373 buffer giving access to the last N branches for each cpu. 392 buffer, giving access to the last N branches for each cpu.
374 393
375config KMEMTRACE 394config KMEMTRACE
376 bool "Trace SLAB allocations" 395 bool "Trace SLAB allocations"
377 select GENERIC_TRACER 396 select GENERIC_TRACER
378 help 397 help
379 kmemtrace provides tracing for slab allocator functions, such as 398 kmemtrace provides tracing for slab allocator functions, such as
380 kmalloc, kfree, kmem_cache_alloc, kmem_cache_free etc.. Collected 399 kmalloc, kfree, kmem_cache_alloc, kmem_cache_free, etc. Collected
381 data is then fed to the userspace application in order to analyse 400 data is then fed to the userspace application in order to analyse
382 allocation hotspots, internal fragmentation and so on, making it 401 allocation hotspots, internal fragmentation and so on, making it
383 possible to see how well an allocator performs, as well as debug 402 possible to see how well an allocator performs, as well as debug
@@ -396,15 +415,15 @@ config WORKQUEUE_TRACER
396 bool "Trace workqueues" 415 bool "Trace workqueues"
397 select GENERIC_TRACER 416 select GENERIC_TRACER
398 help 417 help
399 The workqueue tracer provides some statistical informations 418 The workqueue tracer provides some statistical information
400 about each cpu workqueue thread such as the number of the 419 about each cpu workqueue thread such as the number of the
401 works inserted and executed since their creation. It can help 420 works inserted and executed since their creation. It can help
402 to evaluate the amount of work each of them have to perform. 421 to evaluate the amount of work each of them has to perform.
403 For example it can help a developer to decide whether he should 422 For example it can help a developer to decide whether he should
404 choose a per cpu workqueue instead of a singlethreaded one. 423 choose a per-cpu workqueue instead of a singlethreaded one.
405 424
406config BLK_DEV_IO_TRACE 425config BLK_DEV_IO_TRACE
407 bool "Support for tracing block io actions" 426 bool "Support for tracing block IO actions"
408 depends on SYSFS 427 depends on SYSFS
409 depends on BLOCK 428 depends on BLOCK
410 select RELAY 429 select RELAY
@@ -428,38 +447,55 @@ config BLK_DEV_IO_TRACE
428 447
429 If unsure, say N. 448 If unsure, say N.
430 449
450config KPROBE_EVENT
451 depends on KPROBES
452 depends on X86
453 bool "Enable kprobes-based dynamic events"
454 select TRACING
455 default y
456 help
457 This allows the user to add tracing events (similar to tracepoints)
458 on the fly via the ftrace interface. See
459 Documentation/trace/kprobetrace.txt for more details.
460
461 Those events can be inserted wherever kprobes can probe, and record
462 various register and memory values.
463
464 This option is also required by perf-probe subcommand of perf tools.
465 If you want to use perf tools, this option is strongly recommended.
466
431config DYNAMIC_FTRACE 467config DYNAMIC_FTRACE
432 bool "enable/disable ftrace tracepoints dynamically" 468 bool "enable/disable ftrace tracepoints dynamically"
433 depends on FUNCTION_TRACER 469 depends on FUNCTION_TRACER
434 depends on HAVE_DYNAMIC_FTRACE 470 depends on HAVE_DYNAMIC_FTRACE
435 default y 471 default y
436 help 472 help
437 This option will modify all the calls to ftrace dynamically 473 This option will modify all the calls to ftrace dynamically
438 (will patch them out of the binary image and replaces them 474 (will patch them out of the binary image and replace them
439 with a No-Op instruction) as they are called. A table is 475 with a No-Op instruction) as they are called. A table is
440 created to dynamically enable them again. 476 created to dynamically enable them again.
441 477
442 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise 478 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
443 has native performance as long as no tracing is active. 479 otherwise has native performance as long as no tracing is active.
444 480
445 The changes to the code are done by a kernel thread that 481 The changes to the code are done by a kernel thread that
446 wakes up once a second and checks to see if any ftrace calls 482 wakes up once a second and checks to see if any ftrace calls
447 were made. If so, it runs stop_machine (stops all CPUS) 483 were made. If so, it runs stop_machine (stops all CPUS)
448 and modifies the code to jump over the call to ftrace. 484 and modifies the code to jump over the call to ftrace.
449 485
450config FUNCTION_PROFILER 486config FUNCTION_PROFILER
451 bool "Kernel function profiler" 487 bool "Kernel function profiler"
452 depends on FUNCTION_TRACER 488 depends on FUNCTION_TRACER
453 default n 489 default n
454 help 490 help
455 This option enables the kernel function profiler. A file is created 491 This option enables the kernel function profiler. A file is created
456 in debugfs called function_profile_enabled which defaults to zero. 492 in debugfs called function_profile_enabled which defaults to zero.
457 When a 1 is echoed into this file profiling begins, and when a 493 When a 1 is echoed into this file profiling begins, and when a
458 zero is entered, profiling stops. A file in the trace_stats 494 zero is entered, profiling stops. A "functions" file is created in
459 directory called functions, that show the list of functions that 495 the trace_stats directory; this file shows the list of functions that
460 have been hit and their counters. 496 have been hit and their counters.
461 497
462 If in doubt, say N 498 If in doubt, say N.
463 499
464config FTRACE_MCOUNT_RECORD 500config FTRACE_MCOUNT_RECORD
465 def_bool y 501 def_bool y
@@ -518,8 +554,8 @@ config RING_BUFFER_BENCHMARK
518 tristate "Ring buffer benchmark stress tester" 554 tristate "Ring buffer benchmark stress tester"
519 depends on RING_BUFFER 555 depends on RING_BUFFER
520 help 556 help
521 This option creates a test to stress the ring buffer and bench mark it. 557 This option creates a test to stress the ring buffer and benchmark it.
522 It creates its own ring buffer such that it will not interfer with 558 It creates its own ring buffer such that it will not interfere with
523 any other users of the ring buffer (such as ftrace). It then creates 559 any other users of the ring buffer (such as ftrace). It then creates
524 a producer and consumer that will run for 10 seconds and sleep for 560 a producer and consumer that will run for 10 seconds and sleep for
525 10 seconds. Each interval it will print out the number of events 561 10 seconds. Each interval it will print out the number of events
@@ -528,7 +564,7 @@ config RING_BUFFER_BENCHMARK
528 It does not disable interrupts or raise its priority, so it may be 564 It does not disable interrupts or raise its priority, so it may be
529 affected by processes that are running. 565 affected by processes that are running.
530 566
531 If unsure, say N 567 If unsure, say N.
532 568
533endif # FTRACE 569endif # FTRACE
534 570