Kconfig.debug 69 KB

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