Kconfig.debug 58 KB

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