trace: consolidate unlikely and likely profiler
[safe/jmp/linux-2.6] / kernel / trace / Kconfig
1 #
2 # Architectures that offer an FUNCTION_TRACER implementation should
3 #  select HAVE_FUNCTION_TRACER:
4 #
5
6 config NOP_TRACER
7         bool
8
9 config HAVE_FUNCTION_TRACER
10         bool
11
12 config HAVE_FUNCTION_RET_TRACER
13         bool
14
15 config HAVE_FUNCTION_TRACE_MCOUNT_TEST
16         bool
17         help
18          This gets selected when the arch tests the function_trace_stop
19          variable at the mcount call site. Otherwise, this variable
20          is tested by the called function.
21
22 config HAVE_DYNAMIC_FTRACE
23         bool
24
25 config HAVE_FTRACE_MCOUNT_RECORD
26         bool
27
28 config TRACER_MAX_TRACE
29         bool
30
31 config RING_BUFFER
32         bool
33
34 config TRACING
35         bool
36         select DEBUG_FS
37         select RING_BUFFER
38         select STACKTRACE if STACKTRACE_SUPPORT
39         select TRACEPOINTS
40         select NOP_TRACER
41
42 menu "Tracers"
43
44 config FUNCTION_TRACER
45         bool "Kernel Function Tracer"
46         depends on HAVE_FUNCTION_TRACER
47         depends on DEBUG_KERNEL
48         select FRAME_POINTER
49         select TRACING
50         select CONTEXT_SWITCH_TRACER
51         help
52           Enable the kernel to trace every kernel function. This is done
53           by using a compiler feature to insert a small, 5-byte No-Operation
54           instruction to the beginning of every kernel function, which NOP
55           sequence is then dynamically patched into a tracer call when
56           tracing is enabled by the administrator. If it's runtime disabled
57           (the bootup default), then the overhead of the instructions is very
58           small and not measurable even in micro-benchmarks.
59
60 config FUNCTION_RET_TRACER
61         bool "Kernel Function return Tracer"
62         depends on HAVE_FUNCTION_RET_TRACER
63         depends on FUNCTION_TRACER
64         help
65           Enable the kernel to trace a function at its return.
66           It's first purpose is to trace the duration of functions.
67           This is done by setting the current return address on the thread
68           info structure of the current task.
69
70 config IRQSOFF_TRACER
71         bool "Interrupts-off Latency Tracer"
72         default n
73         depends on TRACE_IRQFLAGS_SUPPORT
74         depends on GENERIC_TIME
75         depends on DEBUG_KERNEL
76         select TRACE_IRQFLAGS
77         select TRACING
78         select TRACER_MAX_TRACE
79         help
80           This option measures the time spent in irqs-off critical
81           sections, with microsecond accuracy.
82
83           The default measurement method is a maximum search, which is
84           disabled by default and can be runtime (re-)started
85           via:
86
87               echo 0 > /debugfs/tracing/tracing_max_latency
88
89           (Note that kernel size and overhead increases with this option
90           enabled. This option and the preempt-off timing option can be
91           used together or separately.)
92
93 config PREEMPT_TRACER
94         bool "Preemption-off Latency Tracer"
95         default n
96         depends on GENERIC_TIME
97         depends on PREEMPT
98         depends on DEBUG_KERNEL
99         select TRACING
100         select TRACER_MAX_TRACE
101         help
102           This option measures the time spent in preemption off critical
103           sections, with microsecond accuracy.
104
105           The default measurement method is a maximum search, which is
106           disabled by default and can be runtime (re-)started
107           via:
108
109               echo 0 > /debugfs/tracing/tracing_max_latency
110
111           (Note that kernel size and overhead increases with this option
112           enabled. This option and the irqs-off timing option can be
113           used together or separately.)
114
115 config SYSPROF_TRACER
116         bool "Sysprof Tracer"
117         depends on X86
118         select TRACING
119         help
120           This tracer provides the trace needed by the 'Sysprof' userspace
121           tool.
122
123 config SCHED_TRACER
124         bool "Scheduling Latency Tracer"
125         depends on DEBUG_KERNEL
126         select TRACING
127         select CONTEXT_SWITCH_TRACER
128         select TRACER_MAX_TRACE
129         help
130           This tracer tracks the latency of the highest priority task
131           to be scheduled in, starting from the point it has woken up.
132
133 config CONTEXT_SWITCH_TRACER
134         bool "Trace process context switches"
135         depends on DEBUG_KERNEL
136         select TRACING
137         select MARKERS
138         help
139           This tracer gets called from the context switch and records
140           all switching of tasks.
141
142 config BOOT_TRACER
143         bool "Trace boot initcalls"
144         depends on DEBUG_KERNEL
145         select TRACING
146         select CONTEXT_SWITCH_TRACER
147         help
148           This tracer helps developers to optimize boot times: it records
149           the timings of the initcalls and traces key events and the identity
150           of tasks that can cause boot delays, such as context-switches.
151
152           Its aim is to be parsed by the /scripts/bootgraph.pl tool to
153           produce pretty graphics about boot inefficiencies, giving a visual
154           representation of the delays during initcalls - but the raw
155           /debug/tracing/trace text output is readable too.
156
157           ( Note that tracing self tests can't be enabled if this tracer is
158             selected, because the self-tests are an initcall as well and that
159             would invalidate the boot trace. )
160
161 config TRACE_BRANCH_PROFILING
162         bool "Trace likely/unlikely profiler"
163         depends on DEBUG_KERNEL
164         select TRACING
165         help
166           This tracer profiles all the the likely and unlikely macros
167           in the kernel. It will display the results in:
168
169           /debugfs/tracing/profile_annotated_branch
170
171           Note: this will add a significant overhead, only turn this
172           on if you need to profile the system's use of these macros.
173
174           Say N if unsure.
175
176 config TRACING_BRANCHES
177         bool
178         help
179           Selected by tracers that will trace the likely and unlikely
180           conditions. This prevents the tracers themselves from being
181           profiled. Profiling the tracing infrastructure can only happen
182           when the likelys and unlikelys are not being traced.
183
184 config BRANCH_TRACER
185         bool "Trace likely/unlikely instances"
186         depends on TRACE_BRANCH_PROFILING
187         select TRACING_BRANCHES
188         help
189           This traces the events of likely and unlikely condition
190           calls in the kernel.  The difference between this and the
191           "Trace likely/unlikely profiler" is that this is not a
192           histogram of the callers, but actually places the calling
193           events into a running trace buffer to see when and where the
194           events happened, as well as their results.
195
196           Say N if unsure.
197
198 config STACK_TRACER
199         bool "Trace max stack"
200         depends on HAVE_FUNCTION_TRACER
201         depends on DEBUG_KERNEL
202         select FUNCTION_TRACER
203         select STACKTRACE
204         help
205           This special tracer records the maximum stack footprint of the
206           kernel and displays it in debugfs/tracing/stack_trace.
207
208           This tracer works by hooking into every function call that the
209           kernel executes, and keeping a maximum stack depth value and
210           stack-trace saved. Because this logic has to execute in every
211           kernel function, all the time, this option can slow down the
212           kernel measurably and is generally intended for kernel
213           developers only.
214
215           Say N if unsure.
216
217 config DYNAMIC_FTRACE
218         bool "enable/disable ftrace tracepoints dynamically"
219         depends on FUNCTION_TRACER
220         depends on HAVE_DYNAMIC_FTRACE
221         depends on DEBUG_KERNEL
222         default y
223         help
224          This option will modify all the calls to ftrace dynamically
225          (will patch them out of the binary image and replaces them
226          with a No-Op instruction) as they are called. A table is
227          created to dynamically enable them again.
228
229          This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise
230          has native performance as long as no tracing is active.
231
232          The changes to the code are done by a kernel thread that
233          wakes up once a second and checks to see if any ftrace calls
234          were made. If so, it runs stop_machine (stops all CPUS)
235          and modifies the code to jump over the call to ftrace.
236
237 config FTRACE_MCOUNT_RECORD
238         def_bool y
239         depends on DYNAMIC_FTRACE
240         depends on HAVE_FTRACE_MCOUNT_RECORD
241
242 config FTRACE_SELFTEST
243         bool
244
245 config FTRACE_STARTUP_TEST
246         bool "Perform a startup test on ftrace"
247         depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER
248         select FTRACE_SELFTEST
249         help
250           This option performs a series of startup tests on ftrace. On bootup
251           a series of tests are made to verify that the tracer is
252           functioning properly. It will do tests on all the configured
253           tracers of ftrace.
254
255 endmenu