Kconfig.debug 69 KB

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