Kconfig 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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_FTRACE_NMI_ENTER
  10. bool
  11. help
  12. See Documentation/trace/ftrace-design.txt
  13. config HAVE_FUNCTION_TRACER
  14. bool
  15. help
  16. See Documentation/trace/ftrace-design.txt
  17. config HAVE_FUNCTION_GRAPH_TRACER
  18. bool
  19. help
  20. See Documentation/trace/ftrace-design.txt
  21. config HAVE_FUNCTION_GRAPH_FP_TEST
  22. bool
  23. help
  24. See Documentation/trace/ftrace-design.txt
  25. config HAVE_FUNCTION_TRACE_MCOUNT_TEST
  26. bool
  27. help
  28. See Documentation/trace/ftrace-design.txt
  29. config HAVE_DYNAMIC_FTRACE
  30. bool
  31. help
  32. See Documentation/trace/ftrace-design.txt
  33. config HAVE_FTRACE_MCOUNT_RECORD
  34. bool
  35. help
  36. See Documentation/trace/ftrace-design.txt
  37. config HAVE_SYSCALL_TRACEPOINTS
  38. bool
  39. help
  40. See Documentation/trace/ftrace-design.txt
  41. config HAVE_FENTRY
  42. bool
  43. help
  44. Arch supports the gcc options -pg with -mfentry
  45. config HAVE_C_RECORDMCOUNT
  46. bool
  47. help
  48. C version of recordmcount available?
  49. config TRACER_MAX_TRACE
  50. bool
  51. config RING_BUFFER
  52. bool
  53. config FTRACE_NMI_ENTER
  54. bool
  55. depends on HAVE_FTRACE_NMI_ENTER
  56. default y
  57. config EVENT_TRACING
  58. select CONTEXT_SWITCH_TRACER
  59. bool
  60. config EVENT_POWER_TRACING_DEPRECATED
  61. depends on EVENT_TRACING
  62. bool "Deprecated power event trace API, to be removed"
  63. default y
  64. help
  65. Provides old power event types:
  66. C-state/idle accounting events:
  67. power:power_start
  68. power:power_end
  69. and old cpufreq accounting event:
  70. power:power_frequency
  71. This is for userspace compatibility
  72. and will vanish after 5 kernel iterations,
  73. namely 3.1.
  74. config CONTEXT_SWITCH_TRACER
  75. bool
  76. config RING_BUFFER_ALLOW_SWAP
  77. bool
  78. help
  79. Allow the use of ring_buffer_swap_cpu.
  80. Adds a very slight overhead to tracing when enabled.
  81. # All tracer options should select GENERIC_TRACER. For those options that are
  82. # enabled by all tracers (context switch and event tracer) they select TRACING.
  83. # 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
  85. # GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
  86. # hiding of the automatic options.
  87. config TRACING
  88. bool
  89. select DEBUG_FS
  90. select RING_BUFFER
  91. select STACKTRACE if STACKTRACE_SUPPORT
  92. select TRACEPOINTS
  93. select NOP_TRACER
  94. select BINARY_PRINTF
  95. select EVENT_TRACING
  96. config GENERIC_TRACER
  97. bool
  98. select TRACING
  99. #
  100. # Minimum requirements an architecture has to meet for us to
  101. # be able to offer generic tracing facilities:
  102. #
  103. config TRACING_SUPPORT
  104. bool
  105. # PPC32 has no irqflags tracing support, but it can use most of the
  106. # tracers anyway, they were tested to build and work. Note that new
  107. # exceptions to this list aren't welcomed, better implement the
  108. # irqflags tracing for your architecture.
  109. depends on TRACE_IRQFLAGS_SUPPORT || PPC32
  110. depends on STACKTRACE_SUPPORT
  111. default y
  112. if TRACING_SUPPORT
  113. menuconfig FTRACE
  114. bool "Tracers"
  115. default y if DEBUG_KERNEL
  116. help
  117. Enable the kernel tracing infrastructure.
  118. if FTRACE
  119. config FUNCTION_TRACER
  120. bool "Kernel Function Tracer"
  121. depends on HAVE_FUNCTION_TRACER
  122. select KALLSYMS
  123. select GENERIC_TRACER
  124. select CONTEXT_SWITCH_TRACER
  125. help
  126. Enable the kernel to trace every kernel function. This is done
  127. by using a compiler feature to insert a small, 5-byte No-Operation
  128. instruction at the beginning of every kernel function, which NOP
  129. sequence is then dynamically patched into a tracer call when
  130. tracing is enabled by the administrator. If it's runtime disabled
  131. (the bootup default), then the overhead of the instructions is very
  132. small and not measurable even in micro-benchmarks.
  133. config FUNCTION_GRAPH_TRACER
  134. bool "Kernel Function Graph Tracer"
  135. depends on HAVE_FUNCTION_GRAPH_TRACER
  136. depends on FUNCTION_TRACER
  137. depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
  138. default y
  139. help
  140. Enable the kernel to trace a function at both its return
  141. and its entry.
  142. Its first purpose is to trace the duration of functions and
  143. draw a call graph for each thread with some information like
  144. the return value. This is done by setting the current return
  145. address on the current task structure into a stack of calls.
  146. config IRQSOFF_TRACER
  147. bool "Interrupts-off Latency Tracer"
  148. default n
  149. depends on TRACE_IRQFLAGS_SUPPORT
  150. depends on !ARCH_USES_GETTIMEOFFSET
  151. select TRACE_IRQFLAGS
  152. select GENERIC_TRACER
  153. select TRACER_MAX_TRACE
  154. select RING_BUFFER_ALLOW_SWAP
  155. help
  156. This option measures the time spent in irqs-off critical
  157. sections, with microsecond accuracy.
  158. The default measurement method is a maximum search, which is
  159. disabled by default and can be runtime (re-)started
  160. via:
  161. echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
  162. (Note that kernel size and overhead increase with this option
  163. enabled. This option and the preempt-off timing option can be
  164. used together or separately.)
  165. config PREEMPT_TRACER
  166. bool "Preemption-off Latency Tracer"
  167. default n
  168. depends on !ARCH_USES_GETTIMEOFFSET
  169. depends on PREEMPT
  170. select GENERIC_TRACER
  171. select TRACER_MAX_TRACE
  172. select RING_BUFFER_ALLOW_SWAP
  173. help
  174. This option measures the time spent in preemption-off critical
  175. sections, with microsecond accuracy.
  176. The default measurement method is a maximum search, which is
  177. disabled by default and can be runtime (re-)started
  178. via:
  179. echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
  180. (Note that kernel size and overhead increase with this option
  181. enabled. This option and the irqs-off timing option can be
  182. used together or separately.)
  183. config SCHED_TRACER
  184. bool "Scheduling Latency Tracer"
  185. select GENERIC_TRACER
  186. select CONTEXT_SWITCH_TRACER
  187. select TRACER_MAX_TRACE
  188. help
  189. This tracer tracks the latency of the highest priority task
  190. to be scheduled in, starting from the point it has woken up.
  191. config ENABLE_DEFAULT_TRACERS
  192. bool "Trace process context switches and events"
  193. depends on !GENERIC_TRACER
  194. select TRACING
  195. help
  196. This tracer hooks to various trace points in the kernel,
  197. allowing the user to pick and choose which trace point they
  198. want to trace. It also includes the sched_switch tracer plugin.
  199. config FTRACE_SYSCALLS
  200. bool "Trace syscalls"
  201. depends on HAVE_SYSCALL_TRACEPOINTS
  202. select GENERIC_TRACER
  203. select KALLSYMS
  204. help
  205. Basic tracer to catch the syscall entry and exit events.
  206. config TRACE_BRANCH_PROFILING
  207. bool
  208. select GENERIC_TRACER
  209. choice
  210. prompt "Branch Profiling"
  211. default BRANCH_PROFILE_NONE
  212. help
  213. The branch profiling is a software profiler. It will add hooks
  214. into the C conditionals to test which path a branch takes.
  215. The likely/unlikely profiler only looks at the conditions that
  216. are annotated with a likely or unlikely macro.
  217. The "all branch" profiler will profile every if-statement in the
  218. kernel. This profiler will also enable the likely/unlikely
  219. profiler.
  220. Either of the above profilers adds a bit of overhead to the system.
  221. If unsure, choose "No branch profiling".
  222. config BRANCH_PROFILE_NONE
  223. bool "No branch profiling"
  224. help
  225. No branch profiling. Branch profiling adds a bit of overhead.
  226. Only enable it if you want to analyse the branching behavior.
  227. Otherwise keep it disabled.
  228. config PROFILE_ANNOTATED_BRANCHES
  229. bool "Trace likely/unlikely profiler"
  230. select TRACE_BRANCH_PROFILING
  231. help
  232. This tracer profiles all likely and unlikely macros
  233. in the kernel. It will display the results in:
  234. /sys/kernel/debug/tracing/trace_stat/branch_annotated
  235. Note: this will add a significant overhead; only turn this
  236. on if you need to profile the system's use of these macros.
  237. config PROFILE_ALL_BRANCHES
  238. bool "Profile all if conditionals"
  239. select TRACE_BRANCH_PROFILING
  240. help
  241. This tracer profiles all branch conditions. Every if ()
  242. taken in the kernel is recorded whether it hit or miss.
  243. The results will be displayed in:
  244. /sys/kernel/debug/tracing/trace_stat/branch_all
  245. This option also enables the likely/unlikely profiler.
  246. This configuration, when enabled, will impose a great overhead
  247. on the system. This should only be enabled when the system
  248. is to be analyzed in much detail.
  249. endchoice
  250. config TRACING_BRANCHES
  251. bool
  252. help
  253. Selected by tracers that will trace the likely and unlikely
  254. conditions. This prevents the tracers themselves from being
  255. profiled. Profiling the tracing infrastructure can only happen
  256. when the likelys and unlikelys are not being traced.
  257. config BRANCH_TRACER
  258. bool "Trace likely/unlikely instances"
  259. depends on TRACE_BRANCH_PROFILING
  260. select TRACING_BRANCHES
  261. help
  262. This traces the events of likely and unlikely condition
  263. calls in the kernel. The difference between this and the
  264. "Trace likely/unlikely profiler" is that this is not a
  265. histogram of the callers, but actually places the calling
  266. events into a running trace buffer to see when and where the
  267. events happened, as well as their results.
  268. Say N if unsure.
  269. config STACK_TRACER
  270. bool "Trace max stack"
  271. depends on HAVE_FUNCTION_TRACER
  272. select FUNCTION_TRACER
  273. select STACKTRACE
  274. select KALLSYMS
  275. help
  276. This special tracer records the maximum stack footprint of the
  277. kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
  278. This tracer works by hooking into every function call that the
  279. kernel executes, and keeping a maximum stack depth value and
  280. stack-trace saved. If this is configured with DYNAMIC_FTRACE
  281. then it will not have any overhead while the stack tracer
  282. is disabled.
  283. To enable the stack tracer on bootup, pass in 'stacktrace'
  284. on the kernel command line.
  285. The stack tracer can also be enabled or disabled via the
  286. sysctl kernel.stack_tracer_enabled
  287. Say N if unsure.
  288. config BLK_DEV_IO_TRACE
  289. bool "Support for tracing block IO actions"
  290. depends on SYSFS
  291. depends on BLOCK
  292. select RELAY
  293. select DEBUG_FS
  294. select TRACEPOINTS
  295. select GENERIC_TRACER
  296. select STACKTRACE
  297. help
  298. Say Y here if you want to be able to trace the block layer actions
  299. on a given queue. Tracing allows you to see any traffic happening
  300. on a block device queue. For more information (and the userspace
  301. support tools needed), fetch the blktrace tools from:
  302. git://git.kernel.dk/blktrace.git
  303. Tracing also is possible using the ftrace interface, e.g.:
  304. echo 1 > /sys/block/sda/sda1/trace/enable
  305. echo blk > /sys/kernel/debug/tracing/current_tracer
  306. cat /sys/kernel/debug/tracing/trace_pipe
  307. If unsure, say N.
  308. config KPROBE_EVENT
  309. depends on KPROBES
  310. depends on HAVE_REGS_AND_STACK_ACCESS_API
  311. bool "Enable kprobes-based dynamic events"
  312. select TRACING
  313. select PROBE_EVENTS
  314. default y
  315. help
  316. This allows the user to add tracing events (similar to tracepoints)
  317. on the fly via the ftrace interface. See
  318. Documentation/trace/kprobetrace.txt for more details.
  319. Those events can be inserted wherever kprobes can probe, and record
  320. various register and memory values.
  321. This option is also required by perf-probe subcommand of perf tools.
  322. If you want to use perf tools, this option is strongly recommended.
  323. config UPROBE_EVENT
  324. bool "Enable uprobes-based dynamic events"
  325. depends on ARCH_SUPPORTS_UPROBES
  326. depends on MMU
  327. select UPROBES
  328. select PROBE_EVENTS
  329. select TRACING
  330. default n
  331. help
  332. This allows the user to add tracing events on top of userspace
  333. dynamic events (similar to tracepoints) on the fly via the trace
  334. events interface. Those events can be inserted wherever uprobes
  335. can probe, and record various registers.
  336. This option is required if you plan to use perf-probe subcommand
  337. of perf tools on user space applications.
  338. config PROBE_EVENTS
  339. def_bool n
  340. config DYNAMIC_FTRACE
  341. bool "enable/disable ftrace tracepoints dynamically"
  342. depends on FUNCTION_TRACER
  343. depends on HAVE_DYNAMIC_FTRACE
  344. default y
  345. help
  346. This option will modify all the calls to ftrace dynamically
  347. (will patch them out of the binary image and replace them
  348. with a No-Op instruction) as they are called. A table is
  349. created to dynamically enable them again.
  350. This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
  351. otherwise has native performance as long as no tracing is active.
  352. The changes to the code are done by a kernel thread that
  353. wakes up once a second and checks to see if any ftrace calls
  354. were made. If so, it runs stop_machine (stops all CPUS)
  355. and modifies the code to jump over the call to ftrace.
  356. config FUNCTION_PROFILER
  357. bool "Kernel function profiler"
  358. depends on FUNCTION_TRACER
  359. default n
  360. help
  361. This option enables the kernel function profiler. A file is created
  362. in debugfs called function_profile_enabled which defaults to zero.
  363. When a 1 is echoed into this file profiling begins, and when a
  364. zero is entered, profiling stops. A "functions" file is created in
  365. the trace_stats directory; this file shows the list of functions that
  366. have been hit and their counters.
  367. If in doubt, say N.
  368. config FTRACE_MCOUNT_RECORD
  369. def_bool y
  370. depends on DYNAMIC_FTRACE
  371. depends on HAVE_FTRACE_MCOUNT_RECORD
  372. config FTRACE_SELFTEST
  373. bool
  374. config FTRACE_STARTUP_TEST
  375. bool "Perform a startup test on ftrace"
  376. depends on GENERIC_TRACER
  377. select FTRACE_SELFTEST
  378. help
  379. This option performs a series of startup tests on ftrace. On bootup
  380. a series of tests are made to verify that the tracer is
  381. functioning properly. It will do tests on all the configured
  382. tracers of ftrace.
  383. config EVENT_TRACE_TEST_SYSCALLS
  384. bool "Run selftest on syscall events"
  385. depends on FTRACE_STARTUP_TEST
  386. help
  387. This option will also enable testing every syscall event.
  388. It only enables the event and disables it and runs various loads
  389. with the event enabled. This adds a bit more time for kernel boot
  390. up since it runs this on every system call defined.
  391. TBD - enable a way to actually call the syscalls as we test their
  392. events
  393. config MMIOTRACE
  394. bool "Memory mapped IO tracing"
  395. depends on HAVE_MMIOTRACE_SUPPORT && PCI
  396. select GENERIC_TRACER
  397. help
  398. Mmiotrace traces Memory Mapped I/O access and is meant for
  399. debugging and reverse engineering. It is called from the ioremap
  400. implementation and works via page faults. Tracing is disabled by
  401. default and can be enabled at run-time.
  402. See Documentation/trace/mmiotrace.txt.
  403. If you are not helping to develop drivers, say N.
  404. config MMIOTRACE_TEST
  405. tristate "Test module for mmiotrace"
  406. depends on MMIOTRACE && m
  407. help
  408. This is a dumb module for testing mmiotrace. It is very dangerous
  409. as it will write garbage to IO memory starting at a given address.
  410. However, it should be safe to use on e.g. unused portion of VRAM.
  411. Say N, unless you absolutely know what you are doing.
  412. config RING_BUFFER_BENCHMARK
  413. tristate "Ring buffer benchmark stress tester"
  414. depends on RING_BUFFER
  415. help
  416. This option creates a test to stress the ring buffer and benchmark it.
  417. It creates its own ring buffer such that it will not interfere with
  418. any other users of the ring buffer (such as ftrace). It then creates
  419. a producer and consumer that will run for 10 seconds and sleep for
  420. 10 seconds. Each interval it will print out the number of events
  421. it recorded and give a rough estimate of how long each iteration took.
  422. It does not disable interrupts or raise its priority, so it may be
  423. affected by processes that are running.
  424. If unsure, say N.
  425. endif # FTRACE
  426. endif # TRACING_SUPPORT