Kconfig.debug 68 KB

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