Kconfig.debug 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. config PRINTK_TIME
  2. bool "Show timing information on printks"
  3. depends on PRINTK
  4. help
  5. Selecting this option causes timing information to be
  6. included in printk output. This allows you to measure
  7. the interval between kernel operations, including bootup
  8. operations. This is useful for identifying long delays
  9. in kernel startup.
  10. config ENABLE_MUST_CHECK
  11. bool "Enable __must_check logic"
  12. default y
  13. help
  14. Enable the __must_check logic in the kernel build. Disable this to
  15. suppress the "warning: ignoring return value of 'foo', declared with
  16. attribute warn_unused_result" messages.
  17. config MAGIC_SYSRQ
  18. bool "Magic SysRq key"
  19. depends on !UML
  20. help
  21. If you say Y here, you will have some control over the system even
  22. if the system crashes for example during kernel debugging (e.g., you
  23. will be able to flush the buffer cache to disk, reboot the system
  24. immediately or dump some status information). This is accomplished
  25. by pressing various keys while holding SysRq (Alt+PrintScreen). It
  26. also works on a serial console (on PC hardware at least), if you
  27. send a BREAK and then within 5 seconds a command keypress. The
  28. keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
  29. unless you really know what this hack does.
  30. config UNUSED_SYMBOLS
  31. bool "Enable unused/obsolete exported symbols"
  32. default y if X86
  33. help
  34. Unused but exported symbols make the kernel needlessly bigger. For
  35. that reason most of these unused exports will soon be removed. This
  36. option is provided temporarily to provide a transition period in case
  37. some external kernel module needs one of these symbols anyway. If you
  38. encounter such a case in your module, consider if you are actually
  39. using the right API. (rationale: since nobody in the kernel is using
  40. this in a module, there is a pretty good chance it's actually the
  41. wrong interface to use). If you really need the symbol, please send a
  42. mail to the linux kernel mailing list mentioning the symbol and why
  43. you really need it, and what the merge plan to the mainline kernel for
  44. your module is.
  45. config DEBUG_FS
  46. bool "Debug Filesystem"
  47. depends on SYSFS
  48. help
  49. debugfs is a virtual file system that kernel developers use to put
  50. debugging files into. Enable this option to be able to read and
  51. write to these files.
  52. If unsure, say N.
  53. config HEADERS_CHECK
  54. bool "Run 'make headers_check' when building vmlinux"
  55. depends on !UML
  56. help
  57. This option will extract the user-visible kernel headers whenever
  58. building the kernel, and will run basic sanity checks on them to
  59. ensure that exported files do not attempt to include files which
  60. were not exported, etc.
  61. If you're making modifications to header files which are
  62. relevant for userspace, say 'Y', and check the headers
  63. exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
  64. your build tree), to make sure they're suitable.
  65. config DEBUG_KERNEL
  66. bool "Kernel debugging"
  67. help
  68. Say Y here if you are developing drivers or trying to debug and
  69. identify kernel problems.
  70. config DEBUG_SHIRQ
  71. bool "Debug shared IRQ handlers"
  72. depends on DEBUG_KERNEL && GENERIC_HARDIRQS
  73. help
  74. Enable this to generate a spurious interrupt as soon as a shared
  75. interrupt handler is registered, and just before one is deregistered.
  76. Drivers ought to be able to handle interrupts coming in at those
  77. points; some don't and need to be caught.
  78. config DETECT_SOFTLOCKUP
  79. bool "Detect Soft Lockups"
  80. depends on DEBUG_KERNEL && !S390
  81. default y
  82. help
  83. Say Y here to enable the kernel to detect "soft lockups",
  84. which are bugs that cause the kernel to loop in kernel
  85. mode for more than 10 seconds, without giving other tasks a
  86. chance to run.
  87. When a soft-lockup is detected, the kernel will print the
  88. current stack trace (which you should report), but the
  89. system will stay locked up. This feature has negligible
  90. overhead.
  91. (Note that "hard lockups" are separate type of bugs that
  92. can be detected via the NMI-watchdog, on platforms that
  93. support it.)
  94. config SCHED_DEBUG
  95. bool "Collect scheduler debugging info"
  96. depends on DEBUG_KERNEL && PROC_FS
  97. default y
  98. help
  99. If you say Y here, the /proc/sched_debug file will be provided
  100. that can help debug the scheduler. The runtime overhead of this
  101. option is minimal.
  102. config SCHEDSTATS
  103. bool "Collect scheduler statistics"
  104. depends on DEBUG_KERNEL && PROC_FS
  105. help
  106. If you say Y here, additional code will be inserted into the
  107. scheduler and related routines to collect statistics about
  108. scheduler behavior and provide them in /proc/schedstat. These
  109. stats may be useful for both tuning and debugging the scheduler
  110. If you aren't debugging the scheduler or trying to tune a specific
  111. application, you can say N to avoid the very slight overhead
  112. this adds.
  113. config TIMER_STATS
  114. bool "Collect kernel timers statistics"
  115. depends on DEBUG_KERNEL && PROC_FS
  116. help
  117. If you say Y here, additional code will be inserted into the
  118. timer routines to collect statistics about kernel timers being
  119. reprogrammed. The statistics can be read from /proc/timer_stats.
  120. The statistics collection is started by writing 1 to /proc/timer_stats,
  121. writing 0 stops it. This feature is useful to collect information
  122. about timer usage patterns in kernel and userspace. This feature
  123. is lightweight if enabled in the kernel config but not activated
  124. (it defaults to deactivated on bootup and will only be activated
  125. if some application like powertop activates it explicitly).
  126. config DEBUG_SLAB
  127. bool "Debug slab memory allocations"
  128. depends on DEBUG_KERNEL && SLAB
  129. help
  130. Say Y here to have the kernel do limited verification on memory
  131. allocation as well as poisoning memory on free to catch use of freed
  132. memory. This can make kmalloc/kfree-intensive workloads much slower.
  133. config DEBUG_SLAB_LEAK
  134. bool "Memory leak debugging"
  135. depends on DEBUG_SLAB
  136. config SLUB_DEBUG_ON
  137. bool "SLUB debugging on by default"
  138. depends on SLUB && SLUB_DEBUG
  139. default n
  140. help
  141. Boot with debugging on by default. SLUB boots by default with
  142. the runtime debug capabilities switched off. Enabling this is
  143. equivalent to specifying the "slub_debug" parameter on boot.
  144. There is no support for more fine grained debug control like
  145. possible with slub_debug=xxx. SLUB debugging may be switched
  146. off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
  147. "slub_debug=-".
  148. config DEBUG_PREEMPT
  149. bool "Debug preemptible kernel"
  150. depends on DEBUG_KERNEL && PREEMPT && (TRACE_IRQFLAGS_SUPPORT || PPC64)
  151. default y
  152. help
  153. If you say Y here then the kernel will use a debug variant of the
  154. commonly used smp_processor_id() function and will print warnings
  155. if kernel code uses it in a preemption-unsafe way. Also, the kernel
  156. will detect preemption count underflows.
  157. config DEBUG_RT_MUTEXES
  158. bool "RT Mutex debugging, deadlock detection"
  159. depends on DEBUG_KERNEL && RT_MUTEXES
  160. help
  161. This allows rt mutex semantics violations and rt mutex related
  162. deadlocks (lockups) to be detected and reported automatically.
  163. config DEBUG_PI_LIST
  164. bool
  165. default y
  166. depends on DEBUG_RT_MUTEXES
  167. config RT_MUTEX_TESTER
  168. bool "Built-in scriptable tester for rt-mutexes"
  169. depends on DEBUG_KERNEL && RT_MUTEXES
  170. help
  171. This option enables a rt-mutex tester.
  172. config DEBUG_SPINLOCK
  173. bool "Spinlock and rw-lock debugging: basic checks"
  174. depends on DEBUG_KERNEL
  175. help
  176. Say Y here and build SMP to catch missing spinlock initialization
  177. and certain other kinds of spinlock errors commonly made. This is
  178. best used in conjunction with the NMI watchdog so that spinlock
  179. deadlocks are also debuggable.
  180. config DEBUG_MUTEXES
  181. bool "Mutex debugging: basic checks"
  182. depends on DEBUG_KERNEL
  183. help
  184. This feature allows mutex semantics violations to be detected and
  185. reported.
  186. config DEBUG_SEMAPHORE
  187. bool "Semaphore debugging"
  188. depends on DEBUG_KERNEL
  189. depends on ALPHA || FRV
  190. default n
  191. help
  192. If you say Y here then semaphore processing will issue lots of
  193. verbose debugging messages. If you suspect a semaphore problem or a
  194. kernel hacker asks for this option then say Y. Otherwise say N.
  195. config DEBUG_LOCK_ALLOC
  196. bool "Lock debugging: detect incorrect freeing of live locks"
  197. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  198. select DEBUG_SPINLOCK
  199. select DEBUG_MUTEXES
  200. select LOCKDEP
  201. help
  202. This feature will check whether any held lock (spinlock, rwlock,
  203. mutex or rwsem) is incorrectly freed by the kernel, via any of the
  204. memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
  205. vfree(), etc.), whether a live lock is incorrectly reinitialized via
  206. spin_lock_init()/mutex_init()/etc., or whether there is any lock
  207. held during task exit.
  208. config PROVE_LOCKING
  209. bool "Lock debugging: prove locking correctness"
  210. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  211. select LOCKDEP
  212. select DEBUG_SPINLOCK
  213. select DEBUG_MUTEXES
  214. select DEBUG_LOCK_ALLOC
  215. default n
  216. help
  217. This feature enables the kernel to prove that all locking
  218. that occurs in the kernel runtime is mathematically
  219. correct: that under no circumstance could an arbitrary (and
  220. not yet triggered) combination of observed locking
  221. sequences (on an arbitrary number of CPUs, running an
  222. arbitrary number of tasks and interrupt contexts) cause a
  223. deadlock.
  224. In short, this feature enables the kernel to report locking
  225. related deadlocks before they actually occur.
  226. The proof does not depend on how hard and complex a
  227. deadlock scenario would be to trigger: how many
  228. participant CPUs, tasks and irq-contexts would be needed
  229. for it to trigger. The proof also does not depend on
  230. timing: if a race and a resulting deadlock is possible
  231. theoretically (no matter how unlikely the race scenario
  232. is), it will be proven so and will immediately be
  233. reported by the kernel (once the event is observed that
  234. makes the deadlock theoretically possible).
  235. If a deadlock is impossible (i.e. the locking rules, as
  236. observed by the kernel, are mathematically correct), the
  237. kernel reports nothing.
  238. NOTE: this feature can also be enabled for rwlocks, mutexes
  239. and rwsems - in which case all dependencies between these
  240. different locking variants are observed and mapped too, and
  241. the proof of observed correctness is also maintained for an
  242. arbitrary combination of these separate locking variants.
  243. For more details, see Documentation/lockdep-design.txt.
  244. config LOCKDEP
  245. bool
  246. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  247. select STACKTRACE
  248. select FRAME_POINTER if !X86 && !MIPS
  249. select KALLSYMS
  250. select KALLSYMS_ALL
  251. config LOCK_STAT
  252. bool "Lock usage statistics"
  253. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  254. select LOCKDEP
  255. select DEBUG_SPINLOCK
  256. select DEBUG_MUTEXES
  257. select DEBUG_LOCK_ALLOC
  258. default n
  259. help
  260. This feature enables tracking lock contention points
  261. For more details, see Documentation/lockstat.txt
  262. config DEBUG_LOCKDEP
  263. bool "Lock dependency engine debugging"
  264. depends on DEBUG_KERNEL && LOCKDEP
  265. help
  266. If you say Y here, the lock dependency engine will do
  267. additional runtime checks to debug itself, at the price
  268. of more runtime overhead.
  269. config TRACE_IRQFLAGS
  270. depends on DEBUG_KERNEL
  271. bool
  272. default y
  273. depends on TRACE_IRQFLAGS_SUPPORT
  274. depends on PROVE_LOCKING
  275. config DEBUG_SPINLOCK_SLEEP
  276. bool "Spinlock debugging: sleep-inside-spinlock checking"
  277. depends on DEBUG_KERNEL
  278. help
  279. If you say Y here, various routines which may sleep will become very
  280. noisy if they are called with a spinlock held.
  281. config DEBUG_LOCKING_API_SELFTESTS
  282. bool "Locking API boot-time self-tests"
  283. depends on DEBUG_KERNEL
  284. help
  285. Say Y here if you want the kernel to run a short self-test during
  286. bootup. The self-test checks whether common types of locking bugs
  287. are detected by debugging mechanisms or not. (if you disable
  288. lock debugging then those bugs wont be detected of course.)
  289. The following locking APIs are covered: spinlocks, rwlocks,
  290. mutexes and rwsems.
  291. config STACKTRACE
  292. bool
  293. depends on DEBUG_KERNEL
  294. depends on STACKTRACE_SUPPORT
  295. config DEBUG_KOBJECT
  296. bool "kobject debugging"
  297. depends on DEBUG_KERNEL
  298. help
  299. If you say Y here, some extra kobject debugging messages will be sent
  300. to the syslog.
  301. config DEBUG_HIGHMEM
  302. bool "Highmem debugging"
  303. depends on DEBUG_KERNEL && HIGHMEM
  304. help
  305. This options enables addition error checking for high memory systems.
  306. Disable for production systems.
  307. config DEBUG_BUGVERBOSE
  308. bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED
  309. depends on BUG
  310. depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || FRV || SUPERH || GENERIC_BUG || BFIN
  311. default !EMBEDDED
  312. help
  313. Say Y here to make BUG() panics output the file name and line number
  314. of the BUG call as well as the EIP and oops trace. This aids
  315. debugging but costs about 70-100K of memory.
  316. config DEBUG_INFO
  317. bool "Compile the kernel with debug info"
  318. depends on DEBUG_KERNEL
  319. help
  320. If you say Y here the resulting kernel image will include
  321. debugging info resulting in a larger kernel image.
  322. This adds debug symbols to the kernel and modules (gcc -g), and
  323. is needed if you intend to use kernel crashdump or binary object
  324. tools like crash, kgdb, LKCD, gdb, etc on the kernel.
  325. Say Y here only if you plan to debug the kernel.
  326. If unsure, say N.
  327. config DEBUG_VM
  328. bool "Debug VM"
  329. depends on DEBUG_KERNEL
  330. help
  331. Enable this to turn on extended checks in the virtual-memory system
  332. that may impact performance.
  333. If unsure, say N.
  334. config DEBUG_LIST
  335. bool "Debug linked list manipulation"
  336. depends on DEBUG_KERNEL
  337. help
  338. Enable this to turn on extended checks in the linked-list
  339. walking routines.
  340. If unsure, say N.
  341. config FRAME_POINTER
  342. bool "Compile the kernel with frame pointers"
  343. depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || AVR32 || SUPERH || BFIN)
  344. default y if DEBUG_INFO && UML
  345. help
  346. If you say Y here the resulting kernel image will be slightly larger
  347. and slower, but it might give very useful debugging information on
  348. some architectures or if you use external debuggers.
  349. If you don't debug the kernel, you can say N.
  350. config FORCED_INLINING
  351. bool "Force gcc to inline functions marked 'inline'"
  352. depends on DEBUG_KERNEL
  353. default y
  354. help
  355. This option determines if the kernel forces gcc to inline the functions
  356. developers have marked 'inline'. Doing so takes away freedom from gcc to
  357. do what it thinks is best, which is desirable for the gcc 3.x series of
  358. compilers. The gcc 4.x series have a rewritten inlining algorithm and
  359. disabling this option will generate a smaller kernel there. Hopefully
  360. this algorithm is so good that allowing gcc4 to make the decision can
  361. become the default in the future, until then this option is there to
  362. test gcc for this.
  363. config RCU_TORTURE_TEST
  364. tristate "torture tests for RCU"
  365. depends on DEBUG_KERNEL
  366. depends on m
  367. default n
  368. help
  369. This option provides a kernel module that runs torture tests
  370. on the RCU infrastructure. The kernel module may be built
  371. after the fact on the running kernel to be tested, if desired.
  372. Say M if you want the RCU torture tests to build as a module.
  373. Say N if you are unsure.
  374. config LKDTM
  375. tristate "Linux Kernel Dump Test Tool Module"
  376. depends on DEBUG_KERNEL
  377. depends on KPROBES
  378. default n
  379. help
  380. This module enables testing of the different dumping mechanisms by
  381. inducing system failures at predefined crash points.
  382. If you don't need it: say N
  383. Choose M here to compile this code as a module. The module will be
  384. called lkdtm.
  385. Documentation on how to use the module can be found in
  386. drivers/misc/lkdtm.c
  387. config FAULT_INJECTION
  388. bool "Fault-injection framework"
  389. depends on DEBUG_KERNEL
  390. help
  391. Provide fault-injection framework.
  392. For more details, see Documentation/fault-injection/.
  393. config FAILSLAB
  394. bool "Fault-injection capability for kmalloc"
  395. depends on FAULT_INJECTION
  396. help
  397. Provide fault-injection capability for kmalloc.
  398. config FAIL_PAGE_ALLOC
  399. bool "Fault-injection capabilitiy for alloc_pages()"
  400. depends on FAULT_INJECTION
  401. help
  402. Provide fault-injection capability for alloc_pages().
  403. config FAIL_MAKE_REQUEST
  404. bool "Fault-injection capability for disk IO"
  405. depends on FAULT_INJECTION
  406. help
  407. Provide fault-injection capability for disk IO.
  408. config FAULT_INJECTION_DEBUG_FS
  409. bool "Debugfs entries for fault-injection capabilities"
  410. depends on FAULT_INJECTION && SYSFS && DEBUG_FS
  411. help
  412. Enable configuration of fault-injection capabilities via debugfs.
  413. config FAULT_INJECTION_STACKTRACE_FILTER
  414. bool "stacktrace filter for fault-injection capabilities"
  415. depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
  416. depends on !X86_64
  417. select STACKTRACE
  418. select FRAME_POINTER
  419. help
  420. Provide stacktrace filter for fault-injection capabilities