Kconfig.debug 18 KB

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