Kconfig 8.5 KB

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