Kconfig 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Architectures that offer an FUNCTION_TRACER implementation should
  4. # select HAVE_FUNCTION_TRACER:
  5. #
  6. config USER_STACKTRACE_SUPPORT
  7. bool
  8. config NOP_TRACER
  9. bool
  10. config HAVE_FUNCTION_TRACER
  11. bool
  12. help
  13. See Documentation/trace/ftrace-design.rst
  14. config HAVE_FUNCTION_GRAPH_TRACER
  15. bool
  16. help
  17. See Documentation/trace/ftrace-design.rst
  18. config HAVE_DYNAMIC_FTRACE
  19. bool
  20. help
  21. See Documentation/trace/ftrace-design.rst
  22. config HAVE_DYNAMIC_FTRACE_WITH_REGS
  23. bool
  24. config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
  25. bool
  26. config HAVE_FTRACE_MCOUNT_RECORD
  27. bool
  28. help
  29. See Documentation/trace/ftrace-design.rst
  30. config HAVE_SYSCALL_TRACEPOINTS
  31. bool
  32. help
  33. See Documentation/trace/ftrace-design.rst
  34. config HAVE_FENTRY
  35. bool
  36. help
  37. Arch supports the gcc options -pg with -mfentry
  38. config HAVE_NOP_MCOUNT
  39. bool
  40. help
  41. Arch supports the gcc options -pg with -mrecord-mcount and -nop-mcount
  42. config HAVE_OBJTOOL_MCOUNT
  43. bool
  44. help
  45. Arch supports objtool --mcount
  46. config HAVE_C_RECORDMCOUNT
  47. bool
  48. help
  49. C version of recordmcount available?
  50. config TRACER_MAX_TRACE
  51. bool
  52. config TRACE_CLOCK
  53. bool
  54. config RING_BUFFER
  55. bool
  56. select TRACE_CLOCK
  57. select IRQ_WORK
  58. config EVENT_TRACING
  59. select CONTEXT_SWITCH_TRACER
  60. select GLOB
  61. bool
  62. config CONTEXT_SWITCH_TRACER
  63. bool
  64. config RING_BUFFER_ALLOW_SWAP
  65. bool
  66. help
  67. Allow the use of ring_buffer_swap_cpu.
  68. Adds a very slight overhead to tracing when enabled.
  69. config TRACE_MMIO_ACCESS
  70. bool "Register read/write tracing"
  71. depends on TRACING
  72. depends on ARM64
  73. help
  74. Create tracepoints for IO read/write operations. These trace events
  75. can be used for logging all MMIO read/write operations.
  76. config PREEMPTIRQ_TRACEPOINTS
  77. bool
  78. depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
  79. select TRACING
  80. default y
  81. help
  82. Create preempt/irq toggle tracepoints if needed, so that other parts
  83. of the kernel can use them to generate or add hooks to them.
  84. menuconfig TRACEFS_DISABLE_AUTOMOUNT
  85. bool "Do not autmount tracefs in the debugfs filesystem"
  86. help
  87. Provides an option to not automount tracefs in /sys/kernel/debug/tracing.
  88. # All tracer options should select GENERIC_TRACER. For those options that are
  89. # enabled by all tracers (context switch and event tracer) they select TRACING.
  90. # This allows those options to appear when no other tracer is selected. But the
  91. # options do not appear when something else selects it. We need the two options
  92. # GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the
  93. # hiding of the automatic options.
  94. config TRACING
  95. bool
  96. select RING_BUFFER
  97. select STACKTRACE if STACKTRACE_SUPPORT
  98. select TRACEPOINTS
  99. select NOP_TRACER
  100. select BINARY_PRINTF
  101. select EVENT_TRACING
  102. select TRACE_CLOCK
  103. config GENERIC_TRACER
  104. bool
  105. select TRACING
  106. #
  107. # Minimum requirements an architecture has to meet for us to
  108. # be able to offer generic tracing facilities:
  109. #
  110. config TRACING_SUPPORT
  111. bool
  112. depends on TRACE_IRQFLAGS_SUPPORT
  113. depends on STACKTRACE_SUPPORT
  114. default y
  115. if TRACING_SUPPORT
  116. menuconfig FTRACE
  117. bool "Tracers"
  118. default y if DEBUG_KERNEL
  119. help
  120. Enable the kernel tracing infrastructure.
  121. if FTRACE
  122. config BOOTTIME_TRACING
  123. bool "Boot-time Tracing support"
  124. depends on TRACING
  125. select BOOT_CONFIG
  126. help
  127. Enable developer to setup ftrace subsystem via supplemental
  128. kernel cmdline at boot time for debugging (tracing) driver
  129. initialization and boot process.
  130. config FUNCTION_TRACER
  131. bool "Kernel Function Tracer"
  132. depends on HAVE_FUNCTION_TRACER
  133. select KALLSYMS
  134. select GENERIC_TRACER
  135. select CONTEXT_SWITCH_TRACER
  136. select GLOB
  137. select TASKS_RCU if PREEMPTION
  138. select TASKS_RUDE_RCU
  139. help
  140. Enable the kernel to trace every kernel function. This is done
  141. by using a compiler feature to insert a small, 5-byte No-Operation
  142. instruction at the beginning of every kernel function, which NOP
  143. sequence is then dynamically patched into a tracer call when
  144. tracing is enabled by the administrator. If it's runtime disabled
  145. (the bootup default), then the overhead of the instructions is very
  146. small and not measurable even in micro-benchmarks.
  147. config FUNCTION_GRAPH_TRACER
  148. bool "Kernel Function Graph Tracer"
  149. depends on HAVE_FUNCTION_GRAPH_TRACER
  150. depends on FUNCTION_TRACER
  151. depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
  152. default y
  153. help
  154. Enable the kernel to trace a function at both its return
  155. and its entry.
  156. Its first purpose is to trace the duration of functions and
  157. draw a call graph for each thread with some information like
  158. the return value. This is done by setting the current return
  159. address on the current task structure into a stack of calls.
  160. config DYNAMIC_FTRACE
  161. bool "enable/disable function tracing dynamically"
  162. depends on FUNCTION_TRACER
  163. depends on HAVE_DYNAMIC_FTRACE
  164. default y
  165. help
  166. This option will modify all the calls to function tracing
  167. dynamically (will patch them out of the binary image and
  168. replace them with a No-Op instruction) on boot up. During
  169. compile time, a table is made of all the locations that ftrace
  170. can function trace, and this table is linked into the kernel
  171. image. When this is enabled, functions can be individually
  172. enabled, and the functions not enabled will not affect
  173. performance of the system.
  174. See the files in /sys/kernel/debug/tracing:
  175. available_filter_functions
  176. set_ftrace_filter
  177. set_ftrace_notrace
  178. This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but
  179. otherwise has native performance as long as no tracing is active.
  180. config DYNAMIC_FTRACE_WITH_REGS
  181. def_bool y
  182. depends on DYNAMIC_FTRACE
  183. depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
  184. config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
  185. def_bool y
  186. depends on DYNAMIC_FTRACE_WITH_REGS
  187. depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
  188. config FUNCTION_PROFILER
  189. bool "Kernel function profiler"
  190. depends on FUNCTION_TRACER
  191. default n
  192. help
  193. This option enables the kernel function profiler. A file is created
  194. in debugfs called function_profile_enabled which defaults to zero.
  195. When a 1 is echoed into this file profiling begins, and when a
  196. zero is entered, profiling stops. A "functions" file is created in
  197. the trace_stat directory; this file shows the list of functions that
  198. have been hit and their counters.
  199. If in doubt, say N.
  200. config STACK_TRACER
  201. bool "Trace max stack"
  202. depends on HAVE_FUNCTION_TRACER
  203. select FUNCTION_TRACER
  204. select STACKTRACE
  205. select KALLSYMS
  206. help
  207. This special tracer records the maximum stack footprint of the
  208. kernel and displays it in /sys/kernel/debug/tracing/stack_trace.
  209. This tracer works by hooking into every function call that the
  210. kernel executes, and keeping a maximum stack depth value and
  211. stack-trace saved. If this is configured with DYNAMIC_FTRACE
  212. then it will not have any overhead while the stack tracer
  213. is disabled.
  214. To enable the stack tracer on bootup, pass in 'stacktrace'
  215. on the kernel command line.
  216. The stack tracer can also be enabled or disabled via the
  217. sysctl kernel.stack_tracer_enabled
  218. Say N if unsure.
  219. config TRACE_PREEMPT_TOGGLE
  220. bool
  221. help
  222. Enables hooks which will be called when preemption is first disabled,
  223. and last enabled.
  224. config IRQSOFF_TRACER
  225. bool "Interrupts-off Latency Tracer"
  226. default n
  227. depends on TRACE_IRQFLAGS_SUPPORT
  228. depends on !ARCH_USES_GETTIMEOFFSET
  229. select TRACE_IRQFLAGS
  230. select GENERIC_TRACER
  231. select TRACER_MAX_TRACE
  232. select RING_BUFFER_ALLOW_SWAP
  233. select TRACER_SNAPSHOT
  234. select TRACER_SNAPSHOT_PER_CPU_SWAP
  235. help
  236. This option measures the time spent in irqs-off critical
  237. sections, with microsecond accuracy.
  238. The default measurement method is a maximum search, which is
  239. disabled by default and can be runtime (re-)started
  240. via:
  241. echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
  242. (Note that kernel size and overhead increase with this option
  243. enabled. This option and the preempt-off timing option can be
  244. used together or separately.)
  245. config PREEMPT_TRACER
  246. bool "Preemption-off Latency Tracer"
  247. default n
  248. depends on !ARCH_USES_GETTIMEOFFSET
  249. depends on PREEMPTION
  250. select GENERIC_TRACER
  251. select TRACER_MAX_TRACE
  252. select RING_BUFFER_ALLOW_SWAP
  253. select TRACER_SNAPSHOT
  254. select TRACER_SNAPSHOT_PER_CPU_SWAP
  255. select TRACE_PREEMPT_TOGGLE
  256. help
  257. This option measures the time spent in preemption-off critical
  258. sections, with microsecond accuracy.
  259. The default measurement method is a maximum search, which is
  260. disabled by default and can be runtime (re-)started
  261. via:
  262. echo 0 > /sys/kernel/debug/tracing/tracing_max_latency
  263. (Note that kernel size and overhead increase with this option
  264. enabled. This option and the irqs-off timing option can be
  265. used together or separately.)
  266. config SCHED_TRACER
  267. bool "Scheduling Latency Tracer"
  268. select GENERIC_TRACER
  269. select CONTEXT_SWITCH_TRACER
  270. select TRACER_MAX_TRACE
  271. select TRACER_SNAPSHOT
  272. help
  273. This tracer tracks the latency of the highest priority task
  274. to be scheduled in, starting from the point it has woken up.
  275. config HWLAT_TRACER
  276. bool "Tracer to detect hardware latencies (like SMIs)"
  277. select GENERIC_TRACER
  278. help
  279. This tracer, when enabled will create one or more kernel threads,
  280. depending on what the cpumask file is set to, which each thread
  281. spinning in a loop looking for interruptions caused by
  282. something other than the kernel. For example, if a
  283. System Management Interrupt (SMI) takes a noticeable amount of
  284. time, this tracer will detect it. This is useful for testing
  285. if a system is reliable for Real Time tasks.
  286. Some files are created in the tracing directory when this
  287. is enabled:
  288. hwlat_detector/width - time in usecs for how long to spin for
  289. hwlat_detector/window - time in usecs between the start of each
  290. iteration
  291. A kernel thread is created that will spin with interrupts disabled
  292. for "width" microseconds in every "window" cycle. It will not spin
  293. for "window - width" microseconds, where the system can
  294. continue to operate.
  295. The output will appear in the trace and trace_pipe files.
  296. When the tracer is not running, it has no affect on the system,
  297. but when it is running, it can cause the system to be
  298. periodically non responsive. Do not run this tracer on a
  299. production system.
  300. To enable this tracer, echo in "hwlat" into the current_tracer
  301. file. Every time a latency is greater than tracing_thresh, it will
  302. be recorded into the ring buffer.
  303. config MMIOTRACE
  304. bool "Memory mapped IO tracing"
  305. depends on HAVE_MMIOTRACE_SUPPORT && PCI
  306. select GENERIC_TRACER
  307. help
  308. Mmiotrace traces Memory Mapped I/O access and is meant for
  309. debugging and reverse engineering. It is called from the ioremap
  310. implementation and works via page faults. Tracing is disabled by
  311. default and can be enabled at run-time.
  312. See Documentation/trace/mmiotrace.rst.
  313. If you are not helping to develop drivers, say N.
  314. config ENABLE_DEFAULT_TRACERS
  315. bool "Trace process context switches and events"
  316. depends on !GENERIC_TRACER
  317. select TRACING
  318. help
  319. This tracer hooks to various trace points in the kernel,
  320. allowing the user to pick and choose which trace point they
  321. want to trace. It also includes the sched_switch tracer plugin.
  322. config FTRACE_SYSCALLS
  323. bool "Trace syscalls"
  324. depends on HAVE_SYSCALL_TRACEPOINTS
  325. select GENERIC_TRACER
  326. select KALLSYMS
  327. help
  328. Basic tracer to catch the syscall entry and exit events.
  329. config TRACER_SNAPSHOT
  330. bool "Create a snapshot trace buffer"
  331. select TRACER_MAX_TRACE
  332. help
  333. Allow tracing users to take snapshot of the current buffer using the
  334. ftrace interface, e.g.:
  335. echo 1 > /sys/kernel/debug/tracing/snapshot
  336. cat snapshot
  337. config TRACER_SNAPSHOT_PER_CPU_SWAP
  338. bool "Allow snapshot to swap per CPU"
  339. depends on TRACER_SNAPSHOT
  340. select RING_BUFFER_ALLOW_SWAP
  341. help
  342. Allow doing a snapshot of a single CPU buffer instead of a
  343. full swap (all buffers). If this is set, then the following is
  344. allowed:
  345. echo 1 > /sys/kernel/debug/tracing/per_cpu/cpu2/snapshot
  346. After which, only the tracing buffer for CPU 2 was swapped with
  347. the main tracing buffer, and the other CPU buffers remain the same.
  348. When this is enabled, this adds a little more overhead to the
  349. trace recording, as it needs to add some checks to synchronize
  350. recording with swaps. But this does not affect the performance
  351. of the overall system. This is enabled by default when the preempt
  352. or irq latency tracers are enabled, as those need to swap as well
  353. and already adds the overhead (plus a lot more).
  354. config TRACE_BRANCH_PROFILING
  355. bool
  356. select GENERIC_TRACER
  357. choice
  358. prompt "Branch Profiling"
  359. default BRANCH_PROFILE_NONE
  360. help
  361. The branch profiling is a software profiler. It will add hooks
  362. into the C conditionals to test which path a branch takes.
  363. The likely/unlikely profiler only looks at the conditions that
  364. are annotated with a likely or unlikely macro.
  365. The "all branch" profiler will profile every if-statement in the
  366. kernel. This profiler will also enable the likely/unlikely
  367. profiler.
  368. Either of the above profilers adds a bit of overhead to the system.
  369. If unsure, choose "No branch profiling".
  370. config BRANCH_PROFILE_NONE
  371. bool "No branch profiling"
  372. help
  373. No branch profiling. Branch profiling adds a bit of overhead.
  374. Only enable it if you want to analyse the branching behavior.
  375. Otherwise keep it disabled.
  376. config PROFILE_ANNOTATED_BRANCHES
  377. bool "Trace likely/unlikely profiler"
  378. select TRACE_BRANCH_PROFILING
  379. help
  380. This tracer profiles all likely and unlikely macros
  381. in the kernel. It will display the results in:
  382. /sys/kernel/debug/tracing/trace_stat/branch_annotated
  383. Note: this will add a significant overhead; only turn this
  384. on if you need to profile the system's use of these macros.
  385. config PROFILE_ALL_BRANCHES
  386. bool "Profile all if conditionals" if !FORTIFY_SOURCE
  387. select TRACE_BRANCH_PROFILING
  388. help
  389. This tracer profiles all branch conditions. Every if ()
  390. taken in the kernel is recorded whether it hit or miss.
  391. The results will be displayed in:
  392. /sys/kernel/debug/tracing/trace_stat/branch_all
  393. This option also enables the likely/unlikely profiler.
  394. This configuration, when enabled, will impose a great overhead
  395. on the system. This should only be enabled when the system
  396. is to be analyzed in much detail.
  397. endchoice
  398. config TRACING_BRANCHES
  399. bool
  400. help
  401. Selected by tracers that will trace the likely and unlikely
  402. conditions. This prevents the tracers themselves from being
  403. profiled. Profiling the tracing infrastructure can only happen
  404. when the likelys and unlikelys are not being traced.
  405. config BRANCH_TRACER
  406. bool "Trace likely/unlikely instances"
  407. depends on TRACE_BRANCH_PROFILING
  408. select TRACING_BRANCHES
  409. help
  410. This traces the events of likely and unlikely condition
  411. calls in the kernel. The difference between this and the
  412. "Trace likely/unlikely profiler" is that this is not a
  413. histogram of the callers, but actually places the calling
  414. events into a running trace buffer to see when and where the
  415. events happened, as well as their results.
  416. Say N if unsure.
  417. config BLK_DEV_IO_TRACE
  418. bool "Support for tracing block IO actions"
  419. depends on SYSFS
  420. depends on BLOCK
  421. select RELAY
  422. select DEBUG_FS
  423. select TRACEPOINTS
  424. select GENERIC_TRACER
  425. select STACKTRACE
  426. help
  427. Say Y here if you want to be able to trace the block layer actions
  428. on a given queue. Tracing allows you to see any traffic happening
  429. on a block device queue. For more information (and the userspace
  430. support tools needed), fetch the blktrace tools from:
  431. git://git.kernel.dk/blktrace.git
  432. Tracing also is possible using the ftrace interface, e.g.:
  433. echo 1 > /sys/block/sda/sda1/trace/enable
  434. echo blk > /sys/kernel/debug/tracing/current_tracer
  435. cat /sys/kernel/debug/tracing/trace_pipe
  436. If unsure, say N.
  437. config KPROBE_EVENTS
  438. depends on KPROBES
  439. depends on HAVE_REGS_AND_STACK_ACCESS_API
  440. bool "Enable kprobes-based dynamic events"
  441. select TRACING
  442. select PROBE_EVENTS
  443. select DYNAMIC_EVENTS
  444. default y
  445. help
  446. This allows the user to add tracing events (similar to tracepoints)
  447. on the fly via the ftrace interface. See
  448. Documentation/trace/kprobetrace.rst for more details.
  449. Those events can be inserted wherever kprobes can probe, and record
  450. various register and memory values.
  451. This option is also required by perf-probe subcommand of perf tools.
  452. If you want to use perf tools, this option is strongly recommended.
  453. config KPROBE_EVENTS_ON_NOTRACE
  454. bool "Do NOT protect notrace function from kprobe events"
  455. depends on KPROBE_EVENTS
  456. depends on DYNAMIC_FTRACE
  457. default n
  458. help
  459. This is only for the developers who want to debug ftrace itself
  460. using kprobe events.
  461. If kprobes can use ftrace instead of breakpoint, ftrace related
  462. functions are protected from kprobe-events to prevent an infinit
  463. recursion or any unexpected execution path which leads to a kernel
  464. crash.
  465. This option disables such protection and allows you to put kprobe
  466. events on ftrace functions for debugging ftrace by itself.
  467. Note that this might let you shoot yourself in the foot.
  468. If unsure, say N.
  469. config UPROBE_EVENTS
  470. bool "Enable uprobes-based dynamic events"
  471. depends on ARCH_SUPPORTS_UPROBES
  472. depends on MMU
  473. depends on PERF_EVENTS
  474. select UPROBES
  475. select PROBE_EVENTS
  476. select DYNAMIC_EVENTS
  477. select TRACING
  478. default y
  479. help
  480. This allows the user to add tracing events on top of userspace
  481. dynamic events (similar to tracepoints) on the fly via the trace
  482. events interface. Those events can be inserted wherever uprobes
  483. can probe, and record various registers.
  484. This option is required if you plan to use perf-probe subcommand
  485. of perf tools on user space applications.
  486. config BPF_EVENTS
  487. depends on BPF_SYSCALL
  488. depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
  489. bool
  490. default y
  491. help
  492. This allows the user to attach BPF programs to kprobe, uprobe, and
  493. tracepoint events.
  494. config DYNAMIC_EVENTS
  495. def_bool n
  496. config PROBE_EVENTS
  497. def_bool n
  498. config BPF_KPROBE_OVERRIDE
  499. bool "Enable BPF programs to override a kprobed function"
  500. depends on BPF_EVENTS
  501. depends on FUNCTION_ERROR_INJECTION
  502. default n
  503. help
  504. Allows BPF to override the execution of a probed function and
  505. set a different return value. This is used for error injection.
  506. config FTRACE_MCOUNT_RECORD
  507. def_bool y
  508. depends on DYNAMIC_FTRACE
  509. depends on HAVE_FTRACE_MCOUNT_RECORD
  510. config FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
  511. bool
  512. depends on FTRACE_MCOUNT_RECORD
  513. config FTRACE_MCOUNT_USE_CC
  514. def_bool y
  515. depends on $(cc-option,-mrecord-mcount)
  516. depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
  517. depends on FTRACE_MCOUNT_RECORD
  518. config FTRACE_MCOUNT_USE_OBJTOOL
  519. def_bool y
  520. depends on HAVE_OBJTOOL_MCOUNT
  521. depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
  522. depends on !FTRACE_MCOUNT_USE_CC
  523. depends on FTRACE_MCOUNT_RECORD
  524. config FTRACE_MCOUNT_USE_RECORDMCOUNT
  525. def_bool y
  526. depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
  527. depends on !FTRACE_MCOUNT_USE_CC
  528. depends on !FTRACE_MCOUNT_USE_OBJTOOL
  529. depends on FTRACE_MCOUNT_RECORD
  530. config TRACING_MAP
  531. bool
  532. depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
  533. help
  534. tracing_map is a special-purpose lock-free map for tracing,
  535. separated out as a stand-alone facility in order to allow it
  536. to be shared between multiple tracers. It isn't meant to be
  537. generally used outside of that context, and is normally
  538. selected by tracers that use it.
  539. config SYNTH_EVENTS
  540. bool "Synthetic trace events"
  541. select TRACING
  542. select DYNAMIC_EVENTS
  543. default n
  544. help
  545. Synthetic events are user-defined trace events that can be
  546. used to combine data from other trace events or in fact any
  547. data source. Synthetic events can be generated indirectly
  548. via the trace() action of histogram triggers or directly
  549. by way of an in-kernel API.
  550. See Documentation/trace/events.rst or
  551. Documentation/trace/histogram.rst for details and examples.
  552. If in doubt, say N.
  553. config HIST_TRIGGERS
  554. bool "Histogram triggers"
  555. depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
  556. select TRACING_MAP
  557. select TRACING
  558. select DYNAMIC_EVENTS
  559. select SYNTH_EVENTS
  560. default n
  561. help
  562. Hist triggers allow one or more arbitrary trace event fields
  563. to be aggregated into hash tables and dumped to stdout by
  564. reading a debugfs/tracefs file. They're useful for
  565. gathering quick and dirty (though precise) summaries of
  566. event activity as an initial guide for further investigation
  567. using more advanced tools.
  568. Inter-event tracing of quantities such as latencies is also
  569. supported using hist triggers under this option.
  570. See Documentation/trace/histogram.rst.
  571. If in doubt, say N.
  572. config TRACE_EVENT_INJECT
  573. bool "Trace event injection"
  574. depends on TRACING
  575. help
  576. Allow user-space to inject a specific trace event into the ring
  577. buffer. This is mainly used for testing purpose.
  578. If unsure, say N.
  579. config TRACEPOINT_BENCHMARK
  580. bool "Add tracepoint that benchmarks tracepoints"
  581. help
  582. This option creates the tracepoint "benchmark:benchmark_event".
  583. When the tracepoint is enabled, it kicks off a kernel thread that
  584. goes into an infinite loop (calling cond_sched() to let other tasks
  585. run), and calls the tracepoint. Each iteration will record the time
  586. it took to write to the tracepoint and the next iteration that
  587. data will be passed to the tracepoint itself. That is, the tracepoint
  588. will report the time it took to do the previous tracepoint.
  589. The string written to the tracepoint is a static string of 128 bytes
  590. to keep the time the same. The initial string is simply a write of
  591. "START". The second string records the cold cache time of the first
  592. write which is not added to the rest of the calculations.
  593. As it is a tight loop, it benchmarks as hot cache. That's fine because
  594. we care most about hot paths that are probably in cache already.
  595. An example of the output:
  596. START
  597. first=3672 [COLD CACHED]
  598. last=632 first=3672 max=632 min=632 avg=316 std=446 std^2=199712
  599. last=278 first=3672 max=632 min=278 avg=303 std=316 std^2=100337
  600. last=277 first=3672 max=632 min=277 avg=296 std=258 std^2=67064
  601. last=273 first=3672 max=632 min=273 avg=292 std=224 std^2=50411
  602. last=273 first=3672 max=632 min=273 avg=288 std=200 std^2=40389
  603. last=281 first=3672 max=632 min=273 avg=287 std=183 std^2=33666
  604. config RING_BUFFER_BENCHMARK
  605. tristate "Ring buffer benchmark stress tester"
  606. depends on RING_BUFFER
  607. help
  608. This option creates a test to stress the ring buffer and benchmark it.
  609. It creates its own ring buffer such that it will not interfere with
  610. any other users of the ring buffer (such as ftrace). It then creates
  611. a producer and consumer that will run for 10 seconds and sleep for
  612. 10 seconds. Each interval it will print out the number of events
  613. it recorded and give a rough estimate of how long each iteration took.
  614. It does not disable interrupts or raise its priority, so it may be
  615. affected by processes that are running.
  616. If unsure, say N.
  617. config TRACE_EVAL_MAP_FILE
  618. bool "Show eval mappings for trace events"
  619. depends on TRACING
  620. help
  621. The "print fmt" of the trace events will show the enum/sizeof names
  622. instead of their values. This can cause problems for user space tools
  623. that use this string to parse the raw data as user space does not know
  624. how to convert the string to its value.
  625. To fix this, there's a special macro in the kernel that can be used
  626. to convert an enum/sizeof into its value. If this macro is used, then
  627. the print fmt strings will be converted to their values.
  628. If something does not get converted properly, this option can be
  629. used to show what enums/sizeof the kernel tried to convert.
  630. This option is for debugging the conversions. A file is created
  631. in the tracing directory called "eval_map" that will show the
  632. names matched with their values and what trace event system they
  633. belong too.
  634. Normally, the mapping of the strings to values will be freed after
  635. boot up or module load. With this option, they will not be freed, as
  636. they are needed for the "eval_map" file. Enabling this option will
  637. increase the memory footprint of the running kernel.
  638. If unsure, say N.
  639. config GCOV_PROFILE_FTRACE
  640. bool "Enable GCOV profiling on ftrace subsystem"
  641. depends on GCOV_KERNEL
  642. help
  643. Enable GCOV profiling on ftrace subsystem for checking
  644. which functions/lines are tested.
  645. If unsure, say N.
  646. Note that on a kernel compiled with this config, ftrace will
  647. run significantly slower.
  648. config FTRACE_SELFTEST
  649. bool
  650. config FTRACE_STARTUP_TEST
  651. bool "Perform a startup test on ftrace"
  652. depends on GENERIC_TRACER
  653. select FTRACE_SELFTEST
  654. help
  655. This option performs a series of startup tests on ftrace. On bootup
  656. a series of tests are made to verify that the tracer is
  657. functioning properly. It will do tests on all the configured
  658. tracers of ftrace.
  659. config EVENT_TRACE_STARTUP_TEST
  660. bool "Run selftest on trace events"
  661. depends on FTRACE_STARTUP_TEST
  662. default y
  663. help
  664. This option performs a test on all trace events in the system.
  665. It basically just enables each event and runs some code that
  666. will trigger events (not necessarily the event it enables)
  667. This may take some time run as there are a lot of events.
  668. config EVENT_TRACE_TEST_SYSCALLS
  669. bool "Run selftest on syscall events"
  670. depends on EVENT_TRACE_STARTUP_TEST
  671. help
  672. This option will also enable testing every syscall event.
  673. It only enables the event and disables it and runs various loads
  674. with the event enabled. This adds a bit more time for kernel boot
  675. up since it runs this on every system call defined.
  676. TBD - enable a way to actually call the syscalls as we test their
  677. events
  678. config RING_BUFFER_STARTUP_TEST
  679. bool "Ring buffer startup self test"
  680. depends on RING_BUFFER
  681. help
  682. Run a simple self test on the ring buffer on boot up. Late in the
  683. kernel boot sequence, the test will start that kicks off
  684. a thread per cpu. Each thread will write various size events
  685. into the ring buffer. Another thread is created to send IPIs
  686. to each of the threads, where the IPI handler will also write
  687. to the ring buffer, to test/stress the nesting ability.
  688. If any anomalies are discovered, a warning will be displayed
  689. and all ring buffers will be disabled.
  690. The test runs for 10 seconds. This will slow your boot time
  691. by at least 10 more seconds.
  692. At the end of the test, statics and more checks are done.
  693. It will output the stats of each per cpu buffer. What
  694. was written, the sizes, what was read, what was lost, and
  695. other similar details.
  696. If unsure, say N
  697. config MMIOTRACE_TEST
  698. tristate "Test module for mmiotrace"
  699. depends on MMIOTRACE && m
  700. help
  701. This is a dumb module for testing mmiotrace. It is very dangerous
  702. as it will write garbage to IO memory starting at a given address.
  703. However, it should be safe to use on e.g. unused portion of VRAM.
  704. Say N, unless you absolutely know what you are doing.
  705. config PREEMPTIRQ_DELAY_TEST
  706. tristate "Test module to create a preempt / IRQ disable delay thread to test latency tracers"
  707. depends on m
  708. help
  709. Select this option to build a test module that can help test latency
  710. tracers by executing a preempt or irq disable section with a user
  711. configurable delay. The module busy waits for the duration of the
  712. critical section.
  713. For example, the following invocation generates a burst of three
  714. irq-disabled critical sections for 500us:
  715. modprobe preemptirq_delay_test test_mode=irq delay=500 burst_size=3
  716. If unsure, say N
  717. config SYNTH_EVENT_GEN_TEST
  718. tristate "Test module for in-kernel synthetic event generation"
  719. depends on SYNTH_EVENTS
  720. help
  721. This option creates a test module to check the base
  722. functionality of in-kernel synthetic event definition and
  723. generation.
  724. To test, insert the module, and then check the trace buffer
  725. for the generated sample events.
  726. If unsure, say N.
  727. config KPROBE_EVENT_GEN_TEST
  728. tristate "Test module for in-kernel kprobe event generation"
  729. depends on KPROBE_EVENTS
  730. help
  731. This option creates a test module to check the base
  732. functionality of in-kernel kprobe event definition.
  733. To test, insert the module, and then check the trace buffer
  734. for the generated kprobe events.
  735. If unsure, say N.
  736. config HIST_TRIGGERS_DEBUG
  737. bool "Hist trigger debug support"
  738. depends on HIST_TRIGGERS
  739. help
  740. Add "hist_debug" file for each event, which when read will
  741. dump out a bunch of internal details about the hist triggers
  742. defined on that event.
  743. The hist_debug file serves a couple of purposes:
  744. - Helps developers verify that nothing is broken.
  745. - Provides educational information to support the details
  746. of the hist trigger internals as described by
  747. Documentation/trace/histogram-design.rst.
  748. The hist_debug output only covers the data structures
  749. related to the histogram definitions themselves and doesn't
  750. display the internals of map buckets or variable values of
  751. running histograms.
  752. If unsure, say N.
  753. endif # FTRACE
  754. endif # TRACING_SUPPORT