Kconfig.debug 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  1. menu "printk and dmesg options"
  2. config PRINTK_TIME
  3. bool "Show timing information on printks"
  4. depends on PRINTK
  5. help
  6. Selecting this option causes time stamps of the printk()
  7. messages to be added to the output of the syslog() system
  8. call and at the console.
  9. The timestamp is always recorded internally, and exported
  10. to /dev/kmsg. This flag just specifies if the timestamp should
  11. be included, not that the timestamp is recorded.
  12. The behavior is also controlled by the kernel command line
  13. parameter printk.time=1. See Documentation/kernel-parameters.txt
  14. config DEFAULT_MESSAGE_LOGLEVEL
  15. int "Default message log level (1-7)"
  16. range 1 7
  17. default "4"
  18. help
  19. Default log level for printk statements with no specified priority.
  20. This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
  21. that are auditing their logs closely may want to set it to a lower
  22. priority.
  23. config BOOT_PRINTK_DELAY
  24. bool "Delay each boot printk message by N milliseconds"
  25. depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
  26. help
  27. This build option allows you to read kernel boot messages
  28. by inserting a short delay after each one. The delay is
  29. specified in milliseconds on the kernel command line,
  30. using "boot_delay=N".
  31. It is likely that you would also need to use "lpj=M" to preset
  32. the "loops per jiffie" value.
  33. See a previous boot log for the "lpj" value to use for your
  34. system, and then set "lpj=M" before setting "boot_delay=N".
  35. NOTE: Using this option may adversely affect SMP systems.
  36. I.e., processors other than the first one may not boot up.
  37. BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
  38. what it believes to be lockup conditions.
  39. config DYNAMIC_DEBUG
  40. bool "Enable dynamic printk() support"
  41. default n
  42. depends on PRINTK
  43. depends on DEBUG_FS
  44. help
  45. Compiles debug level messages into the kernel, which would not
  46. otherwise be available at runtime. These messages can then be
  47. enabled/disabled based on various levels of scope - per source file,
  48. function, module, format string, and line number. This mechanism
  49. implicitly compiles in all pr_debug() and dev_dbg() calls, which
  50. enlarges the kernel text size by about 2%.
  51. If a source file is compiled with DEBUG flag set, any
  52. pr_debug() calls in it are enabled by default, but can be
  53. disabled at runtime as below. Note that DEBUG flag is
  54. turned on by many CONFIG_*DEBUG* options.
  55. Usage:
  56. Dynamic debugging is controlled via the 'dynamic_debug/control' file,
  57. which is contained in the 'debugfs' filesystem. Thus, the debugfs
  58. filesystem must first be mounted before making use of this feature.
  59. We refer the control file as: <debugfs>/dynamic_debug/control. This
  60. file contains a list of the debug statements that can be enabled. The
  61. format for each line of the file is:
  62. filename:lineno [module]function flags format
  63. filename : source file of the debug statement
  64. lineno : line number of the debug statement
  65. module : module that contains the debug statement
  66. function : function that contains the debug statement
  67. flags : '=p' means the line is turned 'on' for printing
  68. format : the format used for the debug statement
  69. From a live system:
  70. nullarbor:~ # cat <debugfs>/dynamic_debug/control
  71. # filename:lineno [module]function flags format
  72. fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
  73. fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
  74. fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
  75. Example usage:
  76. // enable the message at line 1603 of file svcsock.c
  77. nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
  78. <debugfs>/dynamic_debug/control
  79. // enable all the messages in file svcsock.c
  80. nullarbor:~ # echo -n 'file svcsock.c +p' >
  81. <debugfs>/dynamic_debug/control
  82. // enable all the messages in the NFS server module
  83. nullarbor:~ # echo -n 'module nfsd +p' >
  84. <debugfs>/dynamic_debug/control
  85. // enable all 12 messages in the function svc_process()
  86. nullarbor:~ # echo -n 'func svc_process +p' >
  87. <debugfs>/dynamic_debug/control
  88. // disable all 12 messages in the function svc_process()
  89. nullarbor:~ # echo -n 'func svc_process -p' >
  90. <debugfs>/dynamic_debug/control
  91. See Documentation/dynamic-debug-howto.txt for additional information.
  92. endmenu # "printk and dmesg options"
  93. menu "Compile-time checks and compiler options"
  94. config DEBUG_INFO
  95. bool "Compile the kernel with debug info"
  96. depends on DEBUG_KERNEL && !COMPILE_TEST
  97. help
  98. If you say Y here the resulting kernel image will include
  99. debugging info resulting in a larger kernel image.
  100. This adds debug symbols to the kernel and modules (gcc -g), and
  101. is needed if you intend to use kernel crashdump or binary object
  102. tools like crash, kgdb, LKCD, gdb, etc on the kernel.
  103. Say Y here only if you plan to debug the kernel.
  104. If unsure, say N.
  105. config DEBUG_INFO_REDUCED
  106. bool "Reduce debugging information"
  107. depends on DEBUG_INFO
  108. help
  109. If you say Y here gcc is instructed to generate less debugging
  110. information for structure types. This means that tools that
  111. need full debugging information (like kgdb or systemtap) won't
  112. be happy. But if you merely need debugging information to
  113. resolve line numbers there is no loss. Advantage is that
  114. build directory object sizes shrink dramatically over a full
  115. DEBUG_INFO build and compile times are reduced too.
  116. Only works with newer gcc versions.
  117. config ENABLE_WARN_DEPRECATED
  118. bool "Enable __deprecated logic"
  119. default y
  120. help
  121. Enable the __deprecated logic in the kernel build.
  122. Disable this to suppress the "warning: 'foo' is deprecated
  123. (declared at kernel/power/somefile.c:1234)" messages.
  124. config ENABLE_MUST_CHECK
  125. bool "Enable __must_check logic"
  126. default y
  127. help
  128. Enable the __must_check logic in the kernel build. Disable this to
  129. suppress the "warning: ignoring return value of 'foo', declared with
  130. attribute warn_unused_result" messages.
  131. config FRAME_WARN
  132. int "Warn for stack frames larger than (needs gcc 4.4)"
  133. range 0 8192
  134. default 1024 if !64BIT
  135. default 2048 if 64BIT
  136. help
  137. Tell gcc to warn at build time for stack frames larger than this.
  138. Setting this too low will cause a lot of warnings.
  139. Setting it to 0 disables the warning.
  140. Requires gcc 4.4
  141. config STRIP_ASM_SYMS
  142. bool "Strip assembler-generated symbols during link"
  143. default n
  144. help
  145. Strip internal assembler-generated symbols during a link (symbols
  146. that look like '.Lxxx') so they don't pollute the output of
  147. get_wchan() and suchlike.
  148. config READABLE_ASM
  149. bool "Generate readable assembler code"
  150. depends on DEBUG_KERNEL
  151. help
  152. Disable some compiler optimizations that tend to generate human unreadable
  153. assembler output. This may make the kernel slightly slower, but it helps
  154. to keep kernel developers who have to stare a lot at assembler listings
  155. sane.
  156. config UNUSED_SYMBOLS
  157. bool "Enable unused/obsolete exported symbols"
  158. default y if X86
  159. help
  160. Unused but exported symbols make the kernel needlessly bigger. For
  161. that reason most of these unused exports will soon be removed. This
  162. option is provided temporarily to provide a transition period in case
  163. some external kernel module needs one of these symbols anyway. If you
  164. encounter such a case in your module, consider if you are actually
  165. using the right API. (rationale: since nobody in the kernel is using
  166. this in a module, there is a pretty good chance it's actually the
  167. wrong interface to use). If you really need the symbol, please send a
  168. mail to the linux kernel mailing list mentioning the symbol and why
  169. you really need it, and what the merge plan to the mainline kernel for
  170. your module is.
  171. config DEBUG_FS
  172. bool "Debug Filesystem"
  173. help
  174. debugfs is a virtual file system that kernel developers use to put
  175. debugging files into. Enable this option to be able to read and
  176. write to these files.
  177. For detailed documentation on the debugfs API, see
  178. Documentation/DocBook/filesystems.
  179. If unsure, say N.
  180. config HEADERS_CHECK
  181. bool "Run 'make headers_check' when building vmlinux"
  182. depends on !UML
  183. help
  184. This option will extract the user-visible kernel headers whenever
  185. building the kernel, and will run basic sanity checks on them to
  186. ensure that exported files do not attempt to include files which
  187. were not exported, etc.
  188. If you're making modifications to header files which are
  189. relevant for userspace, say 'Y', and check the headers
  190. exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
  191. your build tree), to make sure they're suitable.
  192. config DEBUG_SECTION_MISMATCH
  193. bool "Enable full Section mismatch analysis"
  194. help
  195. The section mismatch analysis checks if there are illegal
  196. references from one section to another section.
  197. During linktime or runtime, some sections are dropped;
  198. any use of code/data previously in these sections would
  199. most likely result in an oops.
  200. In the code, functions and variables are annotated with
  201. __init,, etc. (see the full list in include/linux/init.h),
  202. which results in the code/data being placed in specific sections.
  203. The section mismatch analysis is always performed after a full
  204. kernel build, and enabling this option causes the following
  205. additional steps to occur:
  206. - Add the option -fno-inline-functions-called-once to gcc commands.
  207. When inlining a function annotated with __init in a non-init
  208. function, we would lose the section information and thus
  209. the analysis would not catch the illegal reference.
  210. This option tells gcc to inline less (but it does result in
  211. a larger kernel).
  212. - Run the section mismatch analysis for each module/built-in.o file.
  213. When we run the section mismatch analysis on vmlinux.o, we
  214. lose valueble information about where the mismatch was
  215. introduced.
  216. Running the analysis for each module/built-in.o file
  217. tells where the mismatch happens much closer to the
  218. source. The drawback is that the same mismatch is
  219. reported at least twice.
  220. - Enable verbose reporting from modpost in order to help resolve
  221. the section mismatches that are reported.
  222. #
  223. # Select this config option from the architecture Kconfig, if it
  224. # is preferred to always offer frame pointers as a config
  225. # option on the architecture (regardless of KERNEL_DEBUG):
  226. #
  227. config ARCH_WANT_FRAME_POINTERS
  228. bool
  229. help
  230. config FRAME_POINTER
  231. bool "Compile the kernel with frame pointers"
  232. depends on DEBUG_KERNEL && \
  233. (CRIS || M68K || FRV || UML || \
  234. AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
  235. ARCH_WANT_FRAME_POINTERS
  236. default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
  237. help
  238. If you say Y here the resulting kernel image will be slightly
  239. larger and slower, but it gives very useful debugging information
  240. in case of kernel bugs. (precise oopses/stacktraces/warnings)
  241. config DEBUG_FORCE_WEAK_PER_CPU
  242. bool "Force weak per-cpu definitions"
  243. depends on DEBUG_KERNEL
  244. help
  245. s390 and alpha require percpu variables in modules to be
  246. defined weak to work around addressing range issue which
  247. puts the following two restrictions on percpu variable
  248. definitions.
  249. 1. percpu symbols must be unique whether static or not
  250. 2. percpu variables can't be defined inside a function
  251. To ensure that generic code follows the above rules, this
  252. option forces all percpu variables to be defined as weak.
  253. endmenu # "Compiler options"
  254. config MAGIC_SYSRQ
  255. bool "Magic SysRq key"
  256. depends on !UML
  257. help
  258. If you say Y here, you will have some control over the system even
  259. if the system crashes for example during kernel debugging (e.g., you
  260. will be able to flush the buffer cache to disk, reboot the system
  261. immediately or dump some status information). This is accomplished
  262. by pressing various keys while holding SysRq (Alt+PrintScreen). It
  263. also works on a serial console (on PC hardware at least), if you
  264. send a BREAK and then within 5 seconds a command keypress. The
  265. keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
  266. unless you really know what this hack does.
  267. config MAGIC_SYSRQ_DEFAULT_ENABLE
  268. hex "Enable magic SysRq key functions by default"
  269. depends on MAGIC_SYSRQ
  270. default 0x1
  271. help
  272. Specifies which SysRq key functions are enabled by default.
  273. This may be set to 1 or 0 to enable or disable them all, or
  274. to a bitmask as described in Documentation/sysrq.txt.
  275. config DEBUG_KERNEL
  276. bool "Kernel debugging"
  277. help
  278. Say Y here if you are developing drivers or trying to debug and
  279. identify kernel problems.
  280. menu "Memory Debugging"
  281. source mm/Kconfig.debug
  282. config DEBUG_OBJECTS
  283. bool "Debug object operations"
  284. depends on DEBUG_KERNEL
  285. help
  286. If you say Y here, additional code will be inserted into the
  287. kernel to track the life time of various objects and validate
  288. the operations on those objects.
  289. config DEBUG_OBJECTS_SELFTEST
  290. bool "Debug objects selftest"
  291. depends on DEBUG_OBJECTS
  292. help
  293. This enables the selftest of the object debug code.
  294. config DEBUG_OBJECTS_FREE
  295. bool "Debug objects in freed memory"
  296. depends on DEBUG_OBJECTS
  297. help
  298. This enables checks whether a k/v free operation frees an area
  299. which contains an object which has not been deactivated
  300. properly. This can make kmalloc/kfree-intensive workloads
  301. much slower.
  302. config DEBUG_OBJECTS_TIMERS
  303. bool "Debug timer objects"
  304. depends on DEBUG_OBJECTS
  305. help
  306. If you say Y here, additional code will be inserted into the
  307. timer routines to track the life time of timer objects and
  308. validate the timer operations.
  309. config DEBUG_OBJECTS_WORK
  310. bool "Debug work objects"
  311. depends on DEBUG_OBJECTS
  312. help
  313. If you say Y here, additional code will be inserted into the
  314. work queue routines to track the life time of work objects and
  315. validate the work operations.
  316. config DEBUG_OBJECTS_RCU_HEAD
  317. bool "Debug RCU callbacks objects"
  318. depends on DEBUG_OBJECTS
  319. help
  320. Enable this to turn on debugging of RCU list heads (call_rcu() usage).
  321. config DEBUG_OBJECTS_PERCPU_COUNTER
  322. bool "Debug percpu counter objects"
  323. depends on DEBUG_OBJECTS
  324. help
  325. If you say Y here, additional code will be inserted into the
  326. percpu counter routines to track the life time of percpu counter
  327. objects and validate the percpu counter operations.
  328. config DEBUG_OBJECTS_ENABLE_DEFAULT
  329. int "debug_objects bootup default value (0-1)"
  330. range 0 1
  331. default "1"
  332. depends on DEBUG_OBJECTS
  333. help
  334. Debug objects boot parameter default value
  335. config DEBUG_SLAB
  336. bool "Debug slab memory allocations"
  337. depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
  338. help
  339. Say Y here to have the kernel do limited verification on memory
  340. allocation as well as poisoning memory on free to catch use of freed
  341. memory. This can make kmalloc/kfree-intensive workloads much slower.
  342. config DEBUG_SLAB_LEAK
  343. bool "Memory leak debugging"
  344. depends on DEBUG_SLAB
  345. config SLUB_DEBUG_ON
  346. bool "SLUB debugging on by default"
  347. depends on SLUB && SLUB_DEBUG && !KMEMCHECK
  348. default n
  349. help
  350. Boot with debugging on by default. SLUB boots by default with
  351. the runtime debug capabilities switched off. Enabling this is
  352. equivalent to specifying the "slub_debug" parameter on boot.
  353. There is no support for more fine grained debug control like
  354. possible with slub_debug=xxx. SLUB debugging may be switched
  355. off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
  356. "slub_debug=-".
  357. config SLUB_STATS
  358. default n
  359. bool "Enable SLUB performance statistics"
  360. depends on SLUB && SYSFS
  361. help
  362. SLUB statistics are useful to debug SLUBs allocation behavior in
  363. order find ways to optimize the allocator. This should never be
  364. enabled for production use since keeping statistics slows down
  365. the allocator by a few percentage points. The slabinfo command
  366. supports the determination of the most active slabs to figure
  367. out which slabs are relevant to a particular load.
  368. Try running: slabinfo -DA
  369. config HAVE_DEBUG_KMEMLEAK
  370. bool
  371. config DEBUG_KMEMLEAK
  372. bool "Kernel memory leak detector"
  373. depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
  374. select DEBUG_FS
  375. select STACKTRACE if STACKTRACE_SUPPORT
  376. select KALLSYMS
  377. select CRC32
  378. help
  379. Say Y here if you want to enable the memory leak
  380. detector. The memory allocation/freeing is traced in a way
  381. similar to the Boehm's conservative garbage collector, the
  382. difference being that the orphan objects are not freed but
  383. only shown in /sys/kernel/debug/kmemleak. Enabling this
  384. feature will introduce an overhead to memory
  385. allocations. See Documentation/kmemleak.txt for more
  386. details.
  387. Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
  388. of finding leaks due to the slab objects poisoning.
  389. In order to access the kmemleak file, debugfs needs to be
  390. mounted (usually at /sys/kernel/debug).
  391. config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
  392. int "Maximum kmemleak early log entries"
  393. depends on DEBUG_KMEMLEAK
  394. range 200 40000
  395. default 400
  396. help
  397. Kmemleak must track all the memory allocations to avoid
  398. reporting false positives. Since memory may be allocated or
  399. freed before kmemleak is initialised, an early log buffer is
  400. used to store these actions. If kmemleak reports "early log
  401. buffer exceeded", please increase this value.
  402. config DEBUG_KMEMLEAK_TEST
  403. tristate "Simple test for the kernel memory leak detector"
  404. depends on DEBUG_KMEMLEAK && m
  405. help
  406. This option enables a module that explicitly leaks memory.
  407. If unsure, say N.
  408. config DEBUG_KMEMLEAK_DEFAULT_OFF
  409. bool "Default kmemleak to off"
  410. depends on DEBUG_KMEMLEAK
  411. help
  412. Say Y here to disable kmemleak by default. It can then be enabled
  413. on the command line via kmemleak=on.
  414. config DEBUG_STACK_USAGE
  415. bool "Stack utilization instrumentation"
  416. depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
  417. help
  418. Enables the display of the minimum amount of free stack which each
  419. task has ever had available in the sysrq-T and sysrq-P debug output.
  420. This option will slow down process creation somewhat.
  421. config DEBUG_VM
  422. bool "Debug VM"
  423. depends on DEBUG_KERNEL
  424. help
  425. Enable this to turn on extended checks in the virtual-memory system
  426. that may impact performance.
  427. If unsure, say N.
  428. config DEBUG_VM_RB
  429. bool "Debug VM red-black trees"
  430. depends on DEBUG_VM
  431. help
  432. Enable VM red-black tree debugging information and extra validations.
  433. If unsure, say N.
  434. config DEBUG_VIRTUAL
  435. bool "Debug VM translations"
  436. depends on DEBUG_KERNEL && X86
  437. help
  438. Enable some costly sanity checks in virtual to page code. This can
  439. catch mistakes with virt_to_page() and friends.
  440. If unsure, say N.
  441. config DEBUG_NOMMU_REGIONS
  442. bool "Debug the global anon/private NOMMU mapping region tree"
  443. depends on DEBUG_KERNEL && !MMU
  444. help
  445. This option causes the global tree of anonymous and private mapping
  446. regions to be regularly checked for invalid topology.
  447. config DEBUG_MEMORY_INIT
  448. bool "Debug memory initialisation" if EXPERT
  449. default !EXPERT
  450. help
  451. Enable this for additional checks during memory initialisation.
  452. The sanity checks verify aspects of the VM such as the memory model
  453. and other information provided by the architecture. Verbose
  454. information will be printed at KERN_DEBUG loglevel depending
  455. on the mminit_loglevel= command-line option.
  456. If unsure, say Y
  457. config MEMORY_NOTIFIER_ERROR_INJECT
  458. tristate "Memory hotplug notifier error injection module"
  459. depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
  460. help
  461. This option provides the ability to inject artificial errors to
  462. memory hotplug notifier chain callbacks. It is controlled through
  463. debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
  464. If the notifier call chain should be failed with some events
  465. notified, write the error code to "actions/<notifier event>/error".
  466. Example: Inject memory hotplug offline error (-12 == -ENOMEM)
  467. # cd /sys/kernel/debug/notifier-error-inject/memory
  468. # echo -12 > actions/MEM_GOING_OFFLINE/error
  469. # echo offline > /sys/devices/system/memory/memoryXXX/state
  470. bash: echo: write error: Cannot allocate memory
  471. To compile this code as a module, choose M here: the module will
  472. be called memory-notifier-error-inject.
  473. If unsure, say N.
  474. config DEBUG_PER_CPU_MAPS
  475. bool "Debug access to per_cpu maps"
  476. depends on DEBUG_KERNEL
  477. depends on SMP
  478. help
  479. Say Y to verify that the per_cpu map being accessed has
  480. been set up. This adds a fair amount of code to kernel memory
  481. and decreases performance.
  482. Say N if unsure.
  483. config DEBUG_HIGHMEM
  484. bool "Highmem debugging"
  485. depends on DEBUG_KERNEL && HIGHMEM
  486. help
  487. This options enables addition error checking for high memory systems.
  488. Disable for production systems.
  489. config HAVE_DEBUG_STACKOVERFLOW
  490. bool
  491. config DEBUG_STACKOVERFLOW
  492. bool "Check for stack overflows"
  493. depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
  494. ---help---
  495. Say Y here if you want to check for overflows of kernel, IRQ
  496. and exception stacks (if your archicture uses them). This
  497. option will show detailed messages if free stack space drops
  498. below a certain limit.
  499. These kinds of bugs usually occur when call-chains in the
  500. kernel get too deep, especially when interrupts are
  501. involved.
  502. Use this in cases where you see apparently random memory
  503. corruption, especially if it appears in 'struct thread_info'
  504. If in doubt, say "N".
  505. source "lib/Kconfig.kmemcheck"
  506. endmenu # "Memory Debugging"
  507. config DEBUG_SHIRQ
  508. bool "Debug shared IRQ handlers"
  509. depends on DEBUG_KERNEL
  510. help
  511. Enable this to generate a spurious interrupt as soon as a shared
  512. interrupt handler is registered, and just before one is deregistered.
  513. Drivers ought to be able to handle interrupts coming in at those
  514. points; some don't and need to be caught.
  515. menu "Debug Lockups and Hangs"
  516. config LOCKUP_DETECTOR
  517. bool "Detect Hard and Soft Lockups"
  518. depends on DEBUG_KERNEL && !S390
  519. help
  520. Say Y here to enable the kernel to act as a watchdog to detect
  521. hard and soft lockups.
  522. Softlockups are bugs that cause the kernel to loop in kernel
  523. mode for more than 20 seconds, without giving other tasks a
  524. chance to run. The current stack trace is displayed upon
  525. detection and the system will stay locked up.
  526. Hardlockups are bugs that cause the CPU to loop in kernel mode
  527. for more than 10 seconds, without letting other interrupts have a
  528. chance to run. The current stack trace is displayed upon detection
  529. and the system will stay locked up.
  530. The overhead should be minimal. A periodic hrtimer runs to
  531. generate interrupts and kick the watchdog task every 4 seconds.
  532. An NMI is generated every 10 seconds or so to check for hardlockups.
  533. The frequency of hrtimer and NMI events and the soft and hard lockup
  534. thresholds can be controlled through the sysctl watchdog_thresh.
  535. config HARDLOCKUP_DETECTOR
  536. def_bool y
  537. depends on LOCKUP_DETECTOR && !HAVE_NMI_WATCHDOG
  538. depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
  539. config BOOTPARAM_HARDLOCKUP_PANIC
  540. bool "Panic (Reboot) On Hard Lockups"
  541. depends on HARDLOCKUP_DETECTOR
  542. help
  543. Say Y here to enable the kernel to panic on "hard lockups",
  544. which are bugs that cause the kernel to loop in kernel
  545. mode with interrupts disabled for more than 10 seconds (configurable
  546. using the watchdog_thresh sysctl).
  547. Say N if unsure.
  548. config BOOTPARAM_HARDLOCKUP_PANIC_VALUE
  549. int
  550. depends on HARDLOCKUP_DETECTOR
  551. range 0 1
  552. default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
  553. default 1 if BOOTPARAM_HARDLOCKUP_PANIC
  554. config BOOTPARAM_SOFTLOCKUP_PANIC
  555. bool "Panic (Reboot) On Soft Lockups"
  556. depends on LOCKUP_DETECTOR
  557. help
  558. Say Y here to enable the kernel to panic on "soft lockups",
  559. which are bugs that cause the kernel to loop in kernel
  560. mode for more than 20 seconds (configurable using the watchdog_thresh
  561. sysctl), without giving other tasks a chance to run.
  562. The panic can be used in combination with panic_timeout,
  563. to cause the system to reboot automatically after a
  564. lockup has been detected. This feature is useful for
  565. high-availability systems that have uptime guarantees and
  566. where a lockup must be resolved ASAP.
  567. Say N if unsure.
  568. config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
  569. int
  570. depends on LOCKUP_DETECTOR
  571. range 0 1
  572. default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
  573. default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
  574. config DETECT_HUNG_TASK
  575. bool "Detect Hung Tasks"
  576. depends on DEBUG_KERNEL
  577. default LOCKUP_DETECTOR
  578. help
  579. Say Y here to enable the kernel to detect "hung tasks",
  580. which are bugs that cause the task to be stuck in
  581. uninterruptible "D" state indefinitiley.
  582. When a hung task is detected, the kernel will print the
  583. current stack trace (which you should report), but the
  584. task will stay in uninterruptible state. If lockdep is
  585. enabled then all held locks will also be reported. This
  586. feature has negligible overhead.
  587. config DEFAULT_HUNG_TASK_TIMEOUT
  588. int "Default timeout for hung task detection (in seconds)"
  589. depends on DETECT_HUNG_TASK
  590. default 120
  591. help
  592. This option controls the default timeout (in seconds) used
  593. to determine when a task has become non-responsive and should
  594. be considered hung.
  595. It can be adjusted at runtime via the kernel.hung_task_timeout_secs
  596. sysctl or by writing a value to
  597. /proc/sys/kernel/hung_task_timeout_secs.
  598. A timeout of 0 disables the check. The default is two minutes.
  599. Keeping the default should be fine in most cases.
  600. config BOOTPARAM_HUNG_TASK_PANIC
  601. bool "Panic (Reboot) On Hung Tasks"
  602. depends on DETECT_HUNG_TASK
  603. help
  604. Say Y here to enable the kernel to panic on "hung tasks",
  605. which are bugs that cause the kernel to leave a task stuck
  606. in uninterruptible "D" state.
  607. The panic can be used in combination with panic_timeout,
  608. to cause the system to reboot automatically after a
  609. hung task has been detected. This feature is useful for
  610. high-availability systems that have uptime guarantees and
  611. where a hung tasks must be resolved ASAP.
  612. Say N if unsure.
  613. config BOOTPARAM_HUNG_TASK_PANIC_VALUE
  614. int
  615. depends on DETECT_HUNG_TASK
  616. range 0 1
  617. default 0 if !BOOTPARAM_HUNG_TASK_PANIC
  618. default 1 if BOOTPARAM_HUNG_TASK_PANIC
  619. endmenu # "Debug lockups and hangs"
  620. config PANIC_ON_OOPS
  621. bool "Panic on Oops"
  622. help
  623. Say Y here to enable the kernel to panic when it oopses. This
  624. has the same effect as setting oops=panic on the kernel command
  625. line.
  626. This feature is useful to ensure that the kernel does not do
  627. anything erroneous after an oops which could result in data
  628. corruption or other issues.
  629. Say N if unsure.
  630. config PANIC_ON_OOPS_VALUE
  631. int
  632. range 0 1
  633. default 0 if !PANIC_ON_OOPS
  634. default 1 if PANIC_ON_OOPS
  635. config PANIC_TIMEOUT
  636. int "panic timeout"
  637. default 0
  638. help
  639. Set the timeout value (in seconds) until a reboot occurs when the
  640. the kernel panics. If n = 0, then we wait forever. A timeout
  641. value n > 0 will wait n seconds before rebooting, while a timeout
  642. value n < 0 will reboot immediately.
  643. config SCHED_DEBUG
  644. bool "Collect scheduler debugging info"
  645. depends on DEBUG_KERNEL && PROC_FS
  646. default y
  647. help
  648. If you say Y here, the /proc/sched_debug file will be provided
  649. that can help debug the scheduler. The runtime overhead of this
  650. option is minimal.
  651. config SCHEDSTATS
  652. bool "Collect scheduler statistics"
  653. depends on DEBUG_KERNEL && PROC_FS
  654. help
  655. If you say Y here, additional code will be inserted into the
  656. scheduler and related routines to collect statistics about
  657. scheduler behavior and provide them in /proc/schedstat. These
  658. stats may be useful for both tuning and debugging the scheduler
  659. If you aren't debugging the scheduler or trying to tune a specific
  660. application, you can say N to avoid the very slight overhead
  661. this adds.
  662. config TIMER_STATS
  663. bool "Collect kernel timers statistics"
  664. depends on DEBUG_KERNEL && PROC_FS
  665. help
  666. If you say Y here, additional code will be inserted into the
  667. timer routines to collect statistics about kernel timers being
  668. reprogrammed. The statistics can be read from /proc/timer_stats.
  669. The statistics collection is started by writing 1 to /proc/timer_stats,
  670. writing 0 stops it. This feature is useful to collect information
  671. about timer usage patterns in kernel and userspace. This feature
  672. is lightweight if enabled in the kernel config but not activated
  673. (it defaults to deactivated on bootup and will only be activated
  674. if some application like powertop activates it explicitly).
  675. config DEBUG_PREEMPT
  676. bool "Debug preemptible kernel"
  677. depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
  678. default y
  679. help
  680. If you say Y here then the kernel will use a debug variant of the
  681. commonly used smp_processor_id() function and will print warnings
  682. if kernel code uses it in a preemption-unsafe way. Also, the kernel
  683. will detect preemption count underflows.
  684. menu "Lock Debugging (spinlocks, mutexes, etc...)"
  685. config DEBUG_RT_MUTEXES
  686. bool "RT Mutex debugging, deadlock detection"
  687. depends on DEBUG_KERNEL && RT_MUTEXES
  688. help
  689. This allows rt mutex semantics violations and rt mutex related
  690. deadlocks (lockups) to be detected and reported automatically.
  691. config DEBUG_PI_LIST
  692. bool
  693. default y
  694. depends on DEBUG_RT_MUTEXES
  695. config RT_MUTEX_TESTER
  696. bool "Built-in scriptable tester for rt-mutexes"
  697. depends on DEBUG_KERNEL && RT_MUTEXES
  698. help
  699. This option enables a rt-mutex tester.
  700. config DEBUG_SPINLOCK
  701. bool "Spinlock and rw-lock debugging: basic checks"
  702. depends on DEBUG_KERNEL
  703. select UNINLINE_SPIN_UNLOCK
  704. help
  705. Say Y here and build SMP to catch missing spinlock initialization
  706. and certain other kinds of spinlock errors commonly made. This is
  707. best used in conjunction with the NMI watchdog so that spinlock
  708. deadlocks are also debuggable.
  709. config DEBUG_MUTEXES
  710. bool "Mutex debugging: basic checks"
  711. depends on DEBUG_KERNEL
  712. help
  713. This feature allows mutex semantics violations to be detected and
  714. reported.
  715. config DEBUG_WW_MUTEX_SLOWPATH
  716. bool "Wait/wound mutex debugging: Slowpath testing"
  717. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  718. select DEBUG_LOCK_ALLOC
  719. select DEBUG_SPINLOCK
  720. select DEBUG_MUTEXES
  721. help
  722. This feature enables slowpath testing for w/w mutex users by
  723. injecting additional -EDEADLK wound/backoff cases. Together with
  724. the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
  725. will test all possible w/w mutex interface abuse with the
  726. exception of simply not acquiring all the required locks.
  727. config DEBUG_LOCK_ALLOC
  728. bool "Lock debugging: detect incorrect freeing of live locks"
  729. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  730. select DEBUG_SPINLOCK
  731. select DEBUG_MUTEXES
  732. select LOCKDEP
  733. help
  734. This feature will check whether any held lock (spinlock, rwlock,
  735. mutex or rwsem) is incorrectly freed by the kernel, via any of the
  736. memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
  737. vfree(), etc.), whether a live lock is incorrectly reinitialized via
  738. spin_lock_init()/mutex_init()/etc., or whether there is any lock
  739. held during task exit.
  740. config PROVE_LOCKING
  741. bool "Lock debugging: prove locking correctness"
  742. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  743. select LOCKDEP
  744. select DEBUG_SPINLOCK
  745. select DEBUG_MUTEXES
  746. select DEBUG_LOCK_ALLOC
  747. select TRACE_IRQFLAGS
  748. default n
  749. help
  750. This feature enables the kernel to prove that all locking
  751. that occurs in the kernel runtime is mathematically
  752. correct: that under no circumstance could an arbitrary (and
  753. not yet triggered) combination of observed locking
  754. sequences (on an arbitrary number of CPUs, running an
  755. arbitrary number of tasks and interrupt contexts) cause a
  756. deadlock.
  757. In short, this feature enables the kernel to report locking
  758. related deadlocks before they actually occur.
  759. The proof does not depend on how hard and complex a
  760. deadlock scenario would be to trigger: how many
  761. participant CPUs, tasks and irq-contexts would be needed
  762. for it to trigger. The proof also does not depend on
  763. timing: if a race and a resulting deadlock is possible
  764. theoretically (no matter how unlikely the race scenario
  765. is), it will be proven so and will immediately be
  766. reported by the kernel (once the event is observed that
  767. makes the deadlock theoretically possible).
  768. If a deadlock is impossible (i.e. the locking rules, as
  769. observed by the kernel, are mathematically correct), the
  770. kernel reports nothing.
  771. NOTE: this feature can also be enabled for rwlocks, mutexes
  772. and rwsems - in which case all dependencies between these
  773. different locking variants are observed and mapped too, and
  774. the proof of observed correctness is also maintained for an
  775. arbitrary combination of these separate locking variants.
  776. For more details, see Documentation/lockdep-design.txt.
  777. config LOCKDEP
  778. bool
  779. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  780. select STACKTRACE
  781. select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC
  782. select KALLSYMS
  783. select KALLSYMS_ALL
  784. config LOCK_STAT
  785. bool "Lock usage statistics"
  786. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  787. select LOCKDEP
  788. select DEBUG_SPINLOCK
  789. select DEBUG_MUTEXES
  790. select DEBUG_LOCK_ALLOC
  791. default n
  792. help
  793. This feature enables tracking lock contention points
  794. For more details, see Documentation/lockstat.txt
  795. This also enables lock events required by "perf lock",
  796. subcommand of perf.
  797. If you want to use "perf lock", you also need to turn on
  798. CONFIG_EVENT_TRACING.
  799. CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
  800. (CONFIG_LOCKDEP defines "acquire" and "release" events.)
  801. config DEBUG_LOCKDEP
  802. bool "Lock dependency engine debugging"
  803. depends on DEBUG_KERNEL && LOCKDEP
  804. help
  805. If you say Y here, the lock dependency engine will do
  806. additional runtime checks to debug itself, at the price
  807. of more runtime overhead.
  808. config DEBUG_ATOMIC_SLEEP
  809. bool "Sleep inside atomic section checking"
  810. select PREEMPT_COUNT
  811. depends on DEBUG_KERNEL
  812. help
  813. If you say Y here, various routines which may sleep will become very
  814. noisy if they are called inside atomic sections: when a spinlock is
  815. held, inside an rcu read side critical section, inside preempt disabled
  816. sections, inside an interrupt, etc...
  817. config DEBUG_LOCKING_API_SELFTESTS
  818. bool "Locking API boot-time self-tests"
  819. depends on DEBUG_KERNEL
  820. help
  821. Say Y here if you want the kernel to run a short self-test during
  822. bootup. The self-test checks whether common types of locking bugs
  823. are detected by debugging mechanisms or not. (if you disable
  824. lock debugging then those bugs wont be detected of course.)
  825. The following locking APIs are covered: spinlocks, rwlocks,
  826. mutexes and rwsems.
  827. config LOCK_TORTURE_TEST
  828. tristate "torture tests for locking"
  829. depends on DEBUG_KERNEL
  830. select TORTURE_TEST
  831. default n
  832. help
  833. This option provides a kernel module that runs torture tests
  834. on kernel locking primitives. The kernel module may be built
  835. after the fact on the running kernel to be tested, if desired.
  836. Say Y here if you want kernel locking-primitive torture tests
  837. to be built into the kernel.
  838. Say M if you want these torture tests to build as a module.
  839. Say N if you are unsure.
  840. endmenu # lock debugging
  841. config TRACE_IRQFLAGS
  842. bool
  843. help
  844. Enables hooks to interrupt enabling and disabling for
  845. either tracing or lock debugging.
  846. config STACKTRACE
  847. bool
  848. depends on STACKTRACE_SUPPORT
  849. config DEBUG_KOBJECT
  850. bool "kobject debugging"
  851. depends on DEBUG_KERNEL
  852. help
  853. If you say Y here, some extra kobject debugging messages will be sent
  854. to the syslog.
  855. config DEBUG_KOBJECT_RELEASE
  856. bool "kobject release debugging"
  857. depends on DEBUG_OBJECTS_TIMERS
  858. help
  859. kobjects are reference counted objects. This means that their
  860. last reference count put is not predictable, and the kobject can
  861. live on past the point at which a driver decides to drop it's
  862. initial reference to the kobject gained on allocation. An
  863. example of this would be a struct device which has just been
  864. unregistered.
  865. However, some buggy drivers assume that after such an operation,
  866. the memory backing the kobject can be immediately freed. This
  867. goes completely against the principles of a refcounted object.
  868. If you say Y here, the kernel will delay the release of kobjects
  869. on the last reference count to improve the visibility of this
  870. kind of kobject release bug.
  871. config HAVE_DEBUG_BUGVERBOSE
  872. bool
  873. config DEBUG_BUGVERBOSE
  874. bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
  875. depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
  876. default y
  877. help
  878. Say Y here to make BUG() panics output the file name and line number
  879. of the BUG call as well as the EIP and oops trace. This aids
  880. debugging but costs about 70-100K of memory.
  881. config DEBUG_LIST
  882. bool "Debug linked list manipulation"
  883. depends on DEBUG_KERNEL
  884. help
  885. Enable this to turn on extended checks in the linked-list
  886. walking routines.
  887. If unsure, say N.
  888. config DEBUG_SG
  889. bool "Debug SG table operations"
  890. depends on DEBUG_KERNEL
  891. help
  892. Enable this to turn on checks on scatter-gather tables. This can
  893. help find problems with drivers that do not properly initialize
  894. their sg tables.
  895. If unsure, say N.
  896. config DEBUG_NOTIFIERS
  897. bool "Debug notifier call chains"
  898. depends on DEBUG_KERNEL
  899. help
  900. Enable this to turn on sanity checking for notifier call chains.
  901. This is most useful for kernel developers to make sure that
  902. modules properly unregister themselves from notifier chains.
  903. This is a relatively cheap check but if you care about maximum
  904. performance, say N.
  905. config DEBUG_CREDENTIALS
  906. bool "Debug credential management"
  907. depends on DEBUG_KERNEL
  908. help
  909. Enable this to turn on some debug checking for credential
  910. management. The additional code keeps track of the number of
  911. pointers from task_structs to any given cred struct, and checks to
  912. see that this number never exceeds the usage count of the cred
  913. struct.
  914. Furthermore, if SELinux is enabled, this also checks that the
  915. security pointer in the cred struct is never seen to be invalid.
  916. If unsure, say N.
  917. menu "RCU Debugging"
  918. config PROVE_RCU
  919. bool "RCU debugging: prove RCU correctness"
  920. depends on PROVE_LOCKING
  921. default n
  922. help
  923. This feature enables lockdep extensions that check for correct
  924. use of RCU APIs. This is currently under development. Say Y
  925. if you want to debug RCU usage or help work on the PROVE_RCU
  926. feature.
  927. Say N if you are unsure.
  928. config PROVE_RCU_REPEATEDLY
  929. bool "RCU debugging: don't disable PROVE_RCU on first splat"
  930. depends on PROVE_RCU
  931. default n
  932. help
  933. By itself, PROVE_RCU will disable checking upon issuing the
  934. first warning (or "splat"). This feature prevents such
  935. disabling, allowing multiple RCU-lockdep warnings to be printed
  936. on a single reboot.
  937. Say Y to allow multiple RCU-lockdep warnings per boot.
  938. Say N if you are unsure.
  939. config PROVE_RCU_DELAY
  940. bool "RCU debugging: preemptible RCU race provocation"
  941. depends on DEBUG_KERNEL && PREEMPT_RCU
  942. default n
  943. help
  944. There is a class of races that involve an unlikely preemption
  945. of __rcu_read_unlock() just after ->rcu_read_lock_nesting has
  946. been set to INT_MIN. This feature inserts a delay at that
  947. point to increase the probability of these races.
  948. Say Y to increase probability of preemption of __rcu_read_unlock().
  949. Say N if you are unsure.
  950. config SPARSE_RCU_POINTER
  951. bool "RCU debugging: sparse-based checks for pointer usage"
  952. default n
  953. help
  954. This feature enables the __rcu sparse annotation for
  955. RCU-protected pointers. This annotation will cause sparse
  956. to flag any non-RCU used of annotated pointers. This can be
  957. helpful when debugging RCU usage. Please note that this feature
  958. is not intended to enforce code cleanliness; it is instead merely
  959. a debugging aid.
  960. Say Y to make sparse flag questionable use of RCU-protected pointers
  961. Say N if you are unsure.
  962. config TORTURE_TEST
  963. tristate
  964. default n
  965. config RCU_TORTURE_TEST
  966. tristate "torture tests for RCU"
  967. depends on DEBUG_KERNEL
  968. select TORTURE_TEST
  969. default n
  970. help
  971. This option provides a kernel module that runs torture tests
  972. on the RCU infrastructure. The kernel module may be built
  973. after the fact on the running kernel to be tested, if desired.
  974. Say Y here if you want RCU torture tests to be built into
  975. the kernel.
  976. Say M if you want the RCU torture tests to build as a module.
  977. Say N if you are unsure.
  978. config RCU_TORTURE_TEST_RUNNABLE
  979. bool "torture tests for RCU runnable by default"
  980. depends on RCU_TORTURE_TEST = y
  981. default n
  982. help
  983. This option provides a way to build the RCU torture tests
  984. directly into the kernel without them starting up at boot
  985. time. You can use /proc/sys/kernel/rcutorture_runnable
  986. to manually override this setting. This /proc file is
  987. available only when the RCU torture tests have been built
  988. into the kernel.
  989. Say Y here if you want the RCU torture tests to start during
  990. boot (you probably don't).
  991. Say N here if you want the RCU torture tests to start only
  992. after being manually enabled via /proc.
  993. config RCU_CPU_STALL_TIMEOUT
  994. int "RCU CPU stall timeout in seconds"
  995. depends on RCU_STALL_COMMON
  996. range 3 300
  997. default 21
  998. help
  999. If a given RCU grace period extends more than the specified
  1000. number of seconds, a CPU stall warning is printed. If the
  1001. RCU grace period persists, additional CPU stall warnings are
  1002. printed at more widely spaced intervals.
  1003. config RCU_CPU_STALL_VERBOSE
  1004. bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
  1005. depends on TREE_PREEMPT_RCU
  1006. default y
  1007. help
  1008. This option causes RCU to printk detailed per-task information
  1009. for any tasks that are stalling the current RCU grace period.
  1010. Say N if you are unsure.
  1011. Say Y if you want to enable such checks.
  1012. config RCU_CPU_STALL_INFO
  1013. bool "Print additional diagnostics on RCU CPU stall"
  1014. depends on (TREE_RCU || TREE_PREEMPT_RCU) && DEBUG_KERNEL
  1015. default n
  1016. help
  1017. For each stalled CPU that is aware of the current RCU grace
  1018. period, print out additional per-CPU diagnostic information
  1019. regarding scheduling-clock ticks, idle state, and,
  1020. for RCU_FAST_NO_HZ kernels, idle-entry state.
  1021. Say N if you are unsure.
  1022. Say Y if you want to enable such diagnostics.
  1023. config RCU_TRACE
  1024. bool "Enable tracing for RCU"
  1025. depends on DEBUG_KERNEL
  1026. select TRACE_CLOCK
  1027. help
  1028. This option provides tracing in RCU which presents stats
  1029. in debugfs for debugging RCU implementation.
  1030. Say Y here if you want to enable RCU tracing
  1031. Say N if you are unsure.
  1032. endmenu # "RCU Debugging"
  1033. config DEBUG_BLOCK_EXT_DEVT
  1034. bool "Force extended block device numbers and spread them"
  1035. depends on DEBUG_KERNEL
  1036. depends on BLOCK
  1037. default n
  1038. help
  1039. BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
  1040. SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
  1041. YOU ARE DOING. Distros, please enable this and fix whatever
  1042. is broken.
  1043. Conventionally, block device numbers are allocated from
  1044. predetermined contiguous area. However, extended block area
  1045. may introduce non-contiguous block device numbers. This
  1046. option forces most block device numbers to be allocated from
  1047. the extended space and spreads them to discover kernel or
  1048. userland code paths which assume predetermined contiguous
  1049. device number allocation.
  1050. Note that turning on this debug option shuffles all the
  1051. device numbers for all IDE and SCSI devices including libata
  1052. ones, so root partition specified using device number
  1053. directly (via rdev or root=MAJ:MIN) won't work anymore.
  1054. Textual device names (root=/dev/sdXn) will continue to work.
  1055. Say N if you are unsure.
  1056. config NOTIFIER_ERROR_INJECTION
  1057. tristate "Notifier error injection"
  1058. depends on DEBUG_KERNEL
  1059. select DEBUG_FS
  1060. help
  1061. This option provides the ability to inject artificial errors to
  1062. specified notifier chain callbacks. It is useful to test the error
  1063. handling of notifier call chain failures.
  1064. Say N if unsure.
  1065. config CPU_NOTIFIER_ERROR_INJECT
  1066. tristate "CPU notifier error injection module"
  1067. depends on HOTPLUG_CPU && NOTIFIER_ERROR_INJECTION
  1068. help
  1069. This option provides a kernel module that can be used to test
  1070. the error handling of the cpu notifiers by injecting artificial
  1071. errors to CPU notifier chain callbacks. It is controlled through
  1072. debugfs interface under /sys/kernel/debug/notifier-error-inject/cpu
  1073. If the notifier call chain should be failed with some events
  1074. notified, write the error code to "actions/<notifier event>/error".
  1075. Example: Inject CPU offline error (-1 == -EPERM)
  1076. # cd /sys/kernel/debug/notifier-error-inject/cpu
  1077. # echo -1 > actions/CPU_DOWN_PREPARE/error
  1078. # echo 0 > /sys/devices/system/cpu/cpu1/online
  1079. bash: echo: write error: Operation not permitted
  1080. To compile this code as a module, choose M here: the module will
  1081. be called cpu-notifier-error-inject.
  1082. If unsure, say N.
  1083. config PM_NOTIFIER_ERROR_INJECT
  1084. tristate "PM notifier error injection module"
  1085. depends on PM && NOTIFIER_ERROR_INJECTION
  1086. default m if PM_DEBUG
  1087. help
  1088. This option provides the ability to inject artificial errors to
  1089. PM notifier chain callbacks. It is controlled through debugfs
  1090. interface /sys/kernel/debug/notifier-error-inject/pm
  1091. If the notifier call chain should be failed with some events
  1092. notified, write the error code to "actions/<notifier event>/error".
  1093. Example: Inject PM suspend error (-12 = -ENOMEM)
  1094. # cd /sys/kernel/debug/notifier-error-inject/pm/
  1095. # echo -12 > actions/PM_SUSPEND_PREPARE/error
  1096. # echo mem > /sys/power/state
  1097. bash: echo: write error: Cannot allocate memory
  1098. To compile this code as a module, choose M here: the module will
  1099. be called pm-notifier-error-inject.
  1100. If unsure, say N.
  1101. config OF_RECONFIG_NOTIFIER_ERROR_INJECT
  1102. tristate "OF reconfig notifier error injection module"
  1103. depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
  1104. help
  1105. This option provides the ability to inject artificial errors to
  1106. OF reconfig notifier chain callbacks. It is controlled
  1107. through debugfs interface under
  1108. /sys/kernel/debug/notifier-error-inject/OF-reconfig/
  1109. If the notifier call chain should be failed with some events
  1110. notified, write the error code to "actions/<notifier event>/error".
  1111. To compile this code as a module, choose M here: the module will
  1112. be called of-reconfig-notifier-error-inject.
  1113. If unsure, say N.
  1114. config FAULT_INJECTION
  1115. bool "Fault-injection framework"
  1116. depends on DEBUG_KERNEL
  1117. help
  1118. Provide fault-injection framework.
  1119. For more details, see Documentation/fault-injection/.
  1120. config FAILSLAB
  1121. bool "Fault-injection capability for kmalloc"
  1122. depends on FAULT_INJECTION
  1123. depends on SLAB || SLUB
  1124. help
  1125. Provide fault-injection capability for kmalloc.
  1126. config FAIL_PAGE_ALLOC
  1127. bool "Fault-injection capabilitiy for alloc_pages()"
  1128. depends on FAULT_INJECTION
  1129. help
  1130. Provide fault-injection capability for alloc_pages().
  1131. config FAIL_MAKE_REQUEST
  1132. bool "Fault-injection capability for disk IO"
  1133. depends on FAULT_INJECTION && BLOCK
  1134. help
  1135. Provide fault-injection capability for disk IO.
  1136. config FAIL_IO_TIMEOUT
  1137. bool "Fault-injection capability for faking disk interrupts"
  1138. depends on FAULT_INJECTION && BLOCK
  1139. help
  1140. Provide fault-injection capability on end IO handling. This
  1141. will make the block layer "forget" an interrupt as configured,
  1142. thus exercising the error handling.
  1143. Only works with drivers that use the generic timeout handling,
  1144. for others it wont do anything.
  1145. config FAIL_MMC_REQUEST
  1146. bool "Fault-injection capability for MMC IO"
  1147. select DEBUG_FS
  1148. depends on FAULT_INJECTION && MMC
  1149. help
  1150. Provide fault-injection capability for MMC IO.
  1151. This will make the mmc core return data errors. This is
  1152. useful to test the error handling in the mmc block device
  1153. and to test how the mmc host driver handles retries from
  1154. the block device.
  1155. config FAULT_INJECTION_DEBUG_FS
  1156. bool "Debugfs entries for fault-injection capabilities"
  1157. depends on FAULT_INJECTION && SYSFS && DEBUG_FS
  1158. help
  1159. Enable configuration of fault-injection capabilities via debugfs.
  1160. config FAULT_INJECTION_STACKTRACE_FILTER
  1161. bool "stacktrace filter for fault-injection capabilities"
  1162. depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
  1163. depends on !X86_64
  1164. select STACKTRACE
  1165. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
  1166. help
  1167. Provide stacktrace filter for fault-injection capabilities
  1168. config LATENCYTOP
  1169. bool "Latency measuring infrastructure"
  1170. depends on HAVE_LATENCYTOP_SUPPORT
  1171. depends on DEBUG_KERNEL
  1172. depends on STACKTRACE_SUPPORT
  1173. depends on PROC_FS
  1174. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
  1175. select KALLSYMS
  1176. select KALLSYMS_ALL
  1177. select STACKTRACE
  1178. select SCHEDSTATS
  1179. select SCHED_DEBUG
  1180. help
  1181. Enable this option if you want to use the LatencyTOP tool
  1182. to find out which userspace is blocking on what kernel operations.
  1183. config ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
  1184. bool
  1185. config DEBUG_STRICT_USER_COPY_CHECKS
  1186. bool "Strict user copy size checks"
  1187. depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
  1188. depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
  1189. help
  1190. Enabling this option turns a certain set of sanity checks for user
  1191. copy operations into compile time failures.
  1192. The copy_from_user() etc checks are there to help test if there
  1193. are sufficient security checks on the length argument of
  1194. the copy operation, by having gcc prove that the argument is
  1195. within bounds.
  1196. If unsure, say N.
  1197. source kernel/trace/Kconfig
  1198. menu "Runtime Testing"
  1199. config LKDTM
  1200. tristate "Linux Kernel Dump Test Tool Module"
  1201. depends on DEBUG_FS
  1202. depends on BLOCK
  1203. default n
  1204. help
  1205. This module enables testing of the different dumping mechanisms by
  1206. inducing system failures at predefined crash points.
  1207. If you don't need it: say N
  1208. Choose M here to compile this code as a module. The module will be
  1209. called lkdtm.
  1210. Documentation on how to use the module can be found in
  1211. Documentation/fault-injection/provoke-crashes.txt
  1212. config TEST_LIST_SORT
  1213. bool "Linked list sorting test"
  1214. depends on DEBUG_KERNEL
  1215. help
  1216. Enable this to turn on 'list_sort()' function test. This test is
  1217. executed only once during system boot, so affects only boot time.
  1218. If unsure, say N.
  1219. config KPROBES_SANITY_TEST
  1220. bool "Kprobes sanity tests"
  1221. depends on DEBUG_KERNEL
  1222. depends on KPROBES
  1223. default n
  1224. help
  1225. This option provides for testing basic kprobes functionality on
  1226. boot. A sample kprobe, jprobe and kretprobe are inserted and
  1227. verified for functionality.
  1228. Say N if you are unsure.
  1229. config BACKTRACE_SELF_TEST
  1230. tristate "Self test for the backtrace code"
  1231. depends on DEBUG_KERNEL
  1232. default n
  1233. help
  1234. This option provides a kernel module that can be used to test
  1235. the kernel stack backtrace code. This option is not useful
  1236. for distributions or general kernels, but only for kernel
  1237. developers working on architecture code.
  1238. Note that if you want to also test saved backtraces, you will
  1239. have to enable STACKTRACE as well.
  1240. Say N if you are unsure.
  1241. config RBTREE_TEST
  1242. tristate "Red-Black tree test"
  1243. depends on DEBUG_KERNEL
  1244. help
  1245. A benchmark measuring the performance of the rbtree library.
  1246. Also includes rbtree invariant checks.
  1247. config INTERVAL_TREE_TEST
  1248. tristate "Interval tree test"
  1249. depends on m && DEBUG_KERNEL
  1250. select INTERVAL_TREE
  1251. help
  1252. A benchmark measuring the performance of the interval tree library
  1253. config PERCPU_TEST
  1254. tristate "Per cpu operations test"
  1255. depends on m && DEBUG_KERNEL
  1256. help
  1257. Enable this option to build test module which validates per-cpu
  1258. operations.
  1259. If unsure, say N.
  1260. config ATOMIC64_SELFTEST
  1261. bool "Perform an atomic64_t self-test at boot"
  1262. help
  1263. Enable this option to test the atomic64_t functions at boot.
  1264. If unsure, say N.
  1265. config ASYNC_RAID6_TEST
  1266. tristate "Self test for hardware accelerated raid6 recovery"
  1267. depends on ASYNC_RAID6_RECOV
  1268. select ASYNC_MEMCPY
  1269. ---help---
  1270. This is a one-shot self test that permutes through the
  1271. recovery of all the possible two disk failure scenarios for a
  1272. N-disk array. Recovery is performed with the asynchronous
  1273. raid6 recovery routines, and will optionally use an offload
  1274. engine if one is available.
  1275. If unsure, say N.
  1276. config TEST_STRING_HELPERS
  1277. tristate "Test functions located in the string_helpers module at runtime"
  1278. config TEST_KSTRTOX
  1279. tristate "Test kstrto*() family of functions at runtime"
  1280. endmenu # runtime tests
  1281. config PROVIDE_OHCI1394_DMA_INIT
  1282. bool "Remote debugging over FireWire early on boot"
  1283. depends on PCI && X86
  1284. help
  1285. If you want to debug problems which hang or crash the kernel early
  1286. on boot and the crashing machine has a FireWire port, you can use
  1287. this feature to remotely access the memory of the crashed machine
  1288. over FireWire. This employs remote DMA as part of the OHCI1394
  1289. specification which is now the standard for FireWire controllers.
  1290. With remote DMA, you can monitor the printk buffer remotely using
  1291. firescope and access all memory below 4GB using fireproxy from gdb.
  1292. Even controlling a kernel debugger is possible using remote DMA.
  1293. Usage:
  1294. If ohci1394_dma=early is used as boot parameter, it will initialize
  1295. all OHCI1394 controllers which are found in the PCI config space.
  1296. As all changes to the FireWire bus such as enabling and disabling
  1297. devices cause a bus reset and thereby disable remote DMA for all
  1298. devices, be sure to have the cable plugged and FireWire enabled on
  1299. the debugging host before booting the debug target for debugging.
  1300. This code (~1k) is freed after boot. By then, the firewire stack
  1301. in charge of the OHCI-1394 controllers should be used instead.
  1302. See Documentation/debugging-via-ohci1394.txt for more information.
  1303. config BUILD_DOCSRC
  1304. bool "Build targets in Documentation/ tree"
  1305. depends on HEADERS_CHECK
  1306. help
  1307. This option attempts to build objects from the source files in the
  1308. kernel Documentation/ tree.
  1309. Say N if you are unsure.
  1310. config DMA_API_DEBUG
  1311. bool "Enable debugging of DMA-API usage"
  1312. depends on HAVE_DMA_API_DEBUG
  1313. help
  1314. Enable this option to debug the use of the DMA API by device drivers.
  1315. With this option you will be able to detect common bugs in device
  1316. drivers like double-freeing of DMA mappings or freeing mappings that
  1317. were never allocated.
  1318. This also attempts to catch cases where a page owned by DMA is
  1319. accessed by the cpu in a way that could cause data corruption. For
  1320. example, this enables cow_user_page() to check that the source page is
  1321. not undergoing DMA.
  1322. This option causes a performance degradation. Use only if you want to
  1323. debug device drivers and dma interactions.
  1324. If unsure, say N.
  1325. config TEST_MODULE
  1326. tristate "Test module loading with 'hello world' module"
  1327. default n
  1328. depends on m
  1329. help
  1330. This builds the "test_module" module that emits "Hello, world"
  1331. on printk when loaded. It is designed to be used for basic
  1332. evaluation of the module loading subsystem (for example when
  1333. validating module verification). It lacks any extra dependencies,
  1334. and will not normally be loaded by the system unless explicitly
  1335. requested by name.
  1336. If unsure, say N.
  1337. config TEST_USER_COPY
  1338. tristate "Test user/kernel boundary protections"
  1339. default n
  1340. depends on m
  1341. help
  1342. This builds the "test_user_copy" module that runs sanity checks
  1343. on the copy_to/from_user infrastructure, making sure basic
  1344. user/kernel boundary testing is working. If it fails to load,
  1345. a regression has been detected in the user/kernel memory boundary
  1346. protections.
  1347. If unsure, say N.
  1348. source "samples/Kconfig"
  1349. source "lib/Kconfig.kgdb"