Kconfig.debug 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948
  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
  655. config SOFTLOCKUP_DETECTOR
  656. bool "Detect Soft Lockups"
  657. depends on DEBUG_KERNEL && !S390
  658. select LOCKUP_DETECTOR
  659. help
  660. Say Y here to enable the kernel to act as a watchdog to detect
  661. soft lockups.
  662. Softlockups are bugs that cause the kernel to loop in kernel
  663. mode for more than 20 seconds, without giving other tasks a
  664. chance to run. The current stack trace is displayed upon
  665. detection and the system will stay locked up.
  666. config HARDLOCKUP_DETECTOR_PERF
  667. bool
  668. select SOFTLOCKUP_DETECTOR
  669. #
  670. # arch/ can define HAVE_HARDLOCKUP_DETECTOR_ARCH to provide their own hard
  671. # lockup detector rather than the perf based detector.
  672. #
  673. config HARDLOCKUP_DETECTOR
  674. bool "Detect Hard Lockups"
  675. depends on DEBUG_KERNEL && !S390
  676. depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_ARCH
  677. select LOCKUP_DETECTOR
  678. select HARDLOCKUP_DETECTOR_PERF if HAVE_HARDLOCKUP_DETECTOR_PERF
  679. select HARDLOCKUP_DETECTOR_ARCH if HAVE_HARDLOCKUP_DETECTOR_ARCH
  680. help
  681. Say Y here to enable the kernel to act as a watchdog to detect
  682. hard lockups.
  683. Hardlockups are bugs that cause the CPU to loop in kernel mode
  684. for more than 10 seconds, without letting other interrupts have a
  685. chance to run. The current stack trace is displayed upon detection
  686. and the system will stay locked up.
  687. config BOOTPARAM_HARDLOCKUP_PANIC
  688. bool "Panic (Reboot) On Hard Lockups"
  689. depends on HARDLOCKUP_DETECTOR
  690. help
  691. Say Y here to enable the kernel to panic on "hard lockups",
  692. which are bugs that cause the kernel to loop in kernel
  693. mode with interrupts disabled for more than 10 seconds (configurable
  694. using the watchdog_thresh sysctl).
  695. Say N if unsure.
  696. config BOOTPARAM_HARDLOCKUP_PANIC_VALUE
  697. int
  698. depends on HARDLOCKUP_DETECTOR
  699. range 0 1
  700. default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
  701. default 1 if BOOTPARAM_HARDLOCKUP_PANIC
  702. config BOOTPARAM_SOFTLOCKUP_PANIC
  703. bool "Panic (Reboot) On Soft Lockups"
  704. depends on SOFTLOCKUP_DETECTOR
  705. help
  706. Say Y here to enable the kernel to panic on "soft lockups",
  707. which are bugs that cause the kernel to loop in kernel
  708. mode for more than 20 seconds (configurable using the watchdog_thresh
  709. sysctl), without giving other tasks a chance to run.
  710. The panic can be used in combination with panic_timeout,
  711. to cause the system to reboot automatically after a
  712. lockup has been detected. This feature is useful for
  713. high-availability systems that have uptime guarantees and
  714. where a lockup must be resolved ASAP.
  715. Say N if unsure.
  716. config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
  717. int
  718. depends on SOFTLOCKUP_DETECTOR
  719. range 0 1
  720. default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
  721. default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
  722. config DETECT_HUNG_TASK
  723. bool "Detect Hung Tasks"
  724. depends on DEBUG_KERNEL
  725. default SOFTLOCKUP_DETECTOR
  726. help
  727. Say Y here to enable the kernel to detect "hung tasks",
  728. which are bugs that cause the task to be stuck in
  729. uninterruptible "D" state indefinitely.
  730. When a hung task is detected, the kernel will print the
  731. current stack trace (which you should report), but the
  732. task will stay in uninterruptible state. If lockdep is
  733. enabled then all held locks will also be reported. This
  734. feature has negligible overhead.
  735. config DEFAULT_HUNG_TASK_TIMEOUT
  736. int "Default timeout for hung task detection (in seconds)"
  737. depends on DETECT_HUNG_TASK
  738. default 120
  739. help
  740. This option controls the default timeout (in seconds) used
  741. to determine when a task has become non-responsive and should
  742. be considered hung.
  743. It can be adjusted at runtime via the kernel.hung_task_timeout_secs
  744. sysctl or by writing a value to
  745. /proc/sys/kernel/hung_task_timeout_secs.
  746. A timeout of 0 disables the check. The default is two minutes.
  747. Keeping the default should be fine in most cases.
  748. config BOOTPARAM_HUNG_TASK_PANIC
  749. bool "Panic (Reboot) On Hung Tasks"
  750. depends on DETECT_HUNG_TASK
  751. help
  752. Say Y here to enable the kernel to panic on "hung tasks",
  753. which are bugs that cause the kernel to leave a task stuck
  754. in uninterruptible "D" state.
  755. The panic can be used in combination with panic_timeout,
  756. to cause the system to reboot automatically after a
  757. hung task has been detected. This feature is useful for
  758. high-availability systems that have uptime guarantees and
  759. where a hung tasks must be resolved ASAP.
  760. Say N if unsure.
  761. config BOOTPARAM_HUNG_TASK_PANIC_VALUE
  762. int
  763. depends on DETECT_HUNG_TASK
  764. range 0 1
  765. default 0 if !BOOTPARAM_HUNG_TASK_PANIC
  766. default 1 if BOOTPARAM_HUNG_TASK_PANIC
  767. config WQ_WATCHDOG
  768. bool "Detect Workqueue Stalls"
  769. depends on DEBUG_KERNEL
  770. help
  771. Say Y here to enable stall detection on workqueues. If a
  772. worker pool doesn't make forward progress on a pending work
  773. item for over a given amount of time, 30s by default, a
  774. warning message is printed along with dump of workqueue
  775. state. This can be configured through kernel parameter
  776. "workqueue.watchdog_thresh" and its sysfs counterpart.
  777. endmenu # "Debug lockups and hangs"
  778. config PANIC_ON_OOPS
  779. bool "Panic on Oops"
  780. help
  781. Say Y here to enable the kernel to panic when it oopses. This
  782. has the same effect as setting oops=panic on the kernel command
  783. line.
  784. This feature is useful to ensure that the kernel does not do
  785. anything erroneous after an oops which could result in data
  786. corruption or other issues.
  787. Say N if unsure.
  788. config PANIC_ON_OOPS_VALUE
  789. int
  790. range 0 1
  791. default 0 if !PANIC_ON_OOPS
  792. default 1 if PANIC_ON_OOPS
  793. config PANIC_TIMEOUT
  794. int "panic timeout"
  795. default 0
  796. help
  797. Set the timeout value (in seconds) until a reboot occurs when the
  798. the kernel panics. If n = 0, then we wait forever. A timeout
  799. value n > 0 will wait n seconds before rebooting, while a timeout
  800. value n < 0 will reboot immediately.
  801. config SCHED_DEBUG
  802. bool "Collect scheduler debugging info"
  803. depends on DEBUG_KERNEL && PROC_FS
  804. default y
  805. help
  806. If you say Y here, the /proc/sched_debug file will be provided
  807. that can help debug the scheduler. The runtime overhead of this
  808. option is minimal.
  809. config SCHED_INFO
  810. bool
  811. default n
  812. config SCHEDSTATS
  813. bool "Collect scheduler statistics"
  814. depends on DEBUG_KERNEL && PROC_FS
  815. select SCHED_INFO
  816. help
  817. If you say Y here, additional code will be inserted into the
  818. scheduler and related routines to collect statistics about
  819. scheduler behavior and provide them in /proc/schedstat. These
  820. stats may be useful for both tuning and debugging the scheduler
  821. If you aren't debugging the scheduler or trying to tune a specific
  822. application, you can say N to avoid the very slight overhead
  823. this adds.
  824. config SCHED_STACK_END_CHECK
  825. bool "Detect stack corruption on calls to schedule()"
  826. depends on DEBUG_KERNEL
  827. default n
  828. help
  829. This option checks for a stack overrun on calls to schedule().
  830. If the stack end location is found to be over written always panic as
  831. the content of the corrupted region can no longer be trusted.
  832. This is to ensure no erroneous behaviour occurs which could result in
  833. data corruption or a sporadic crash at a later stage once the region
  834. is examined. The runtime overhead introduced is minimal.
  835. config DEBUG_TIMEKEEPING
  836. bool "Enable extra timekeeping sanity checking"
  837. help
  838. This option will enable additional timekeeping sanity checks
  839. which may be helpful when diagnosing issues where timekeeping
  840. problems are suspected.
  841. This may include checks in the timekeeping hotpaths, so this
  842. option may have a (very small) performance impact to some
  843. workloads.
  844. If unsure, say N.
  845. config DEBUG_PREEMPT
  846. bool "Debug preemptible kernel"
  847. depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
  848. default y
  849. help
  850. If you say Y here then the kernel will use a debug variant of the
  851. commonly used smp_processor_id() function and will print warnings
  852. if kernel code uses it in a preemption-unsafe way. Also, the kernel
  853. will detect preemption count underflows.
  854. menu "Lock Debugging (spinlocks, mutexes, etc...)"
  855. config DEBUG_RT_MUTEXES
  856. bool "RT Mutex debugging, deadlock detection"
  857. depends on DEBUG_KERNEL && RT_MUTEXES
  858. help
  859. This allows rt mutex semantics violations and rt mutex related
  860. deadlocks (lockups) to be detected and reported automatically.
  861. config DEBUG_SPINLOCK
  862. bool "Spinlock and rw-lock debugging: basic checks"
  863. depends on DEBUG_KERNEL
  864. select UNINLINE_SPIN_UNLOCK
  865. help
  866. Say Y here and build SMP to catch missing spinlock initialization
  867. and certain other kinds of spinlock errors commonly made. This is
  868. best used in conjunction with the NMI watchdog so that spinlock
  869. deadlocks are also debuggable.
  870. config DEBUG_MUTEXES
  871. bool "Mutex debugging: basic checks"
  872. depends on DEBUG_KERNEL
  873. help
  874. This feature allows mutex semantics violations to be detected and
  875. reported.
  876. config DEBUG_WW_MUTEX_SLOWPATH
  877. bool "Wait/wound mutex debugging: Slowpath testing"
  878. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  879. select DEBUG_LOCK_ALLOC
  880. select DEBUG_SPINLOCK
  881. select DEBUG_MUTEXES
  882. help
  883. This feature enables slowpath testing for w/w mutex users by
  884. injecting additional -EDEADLK wound/backoff cases. Together with
  885. the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
  886. will test all possible w/w mutex interface abuse with the
  887. exception of simply not acquiring all the required locks.
  888. Note that this feature can introduce significant overhead, so
  889. it really should not be enabled in a production or distro kernel,
  890. even a debug kernel. If you are a driver writer, enable it. If
  891. you are a distro, do not.
  892. config DEBUG_LOCK_ALLOC
  893. bool "Lock debugging: detect incorrect freeing of live locks"
  894. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  895. select DEBUG_SPINLOCK
  896. select DEBUG_MUTEXES
  897. select DEBUG_RT_MUTEXES if RT_MUTEXES
  898. select LOCKDEP
  899. help
  900. This feature will check whether any held lock (spinlock, rwlock,
  901. mutex or rwsem) is incorrectly freed by the kernel, via any of the
  902. memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
  903. vfree(), etc.), whether a live lock is incorrectly reinitialized via
  904. spin_lock_init()/mutex_init()/etc., or whether there is any lock
  905. held during task exit.
  906. config PROVE_LOCKING
  907. bool "Lock debugging: prove locking correctness"
  908. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  909. select LOCKDEP
  910. select DEBUG_SPINLOCK
  911. select DEBUG_MUTEXES
  912. select DEBUG_RT_MUTEXES if RT_MUTEXES
  913. select DEBUG_LOCK_ALLOC
  914. select TRACE_IRQFLAGS
  915. default n
  916. help
  917. This feature enables the kernel to prove that all locking
  918. that occurs in the kernel runtime is mathematically
  919. correct: that under no circumstance could an arbitrary (and
  920. not yet triggered) combination of observed locking
  921. sequences (on an arbitrary number of CPUs, running an
  922. arbitrary number of tasks and interrupt contexts) cause a
  923. deadlock.
  924. In short, this feature enables the kernel to report locking
  925. related deadlocks before they actually occur.
  926. The proof does not depend on how hard and complex a
  927. deadlock scenario would be to trigger: how many
  928. participant CPUs, tasks and irq-contexts would be needed
  929. for it to trigger. The proof also does not depend on
  930. timing: if a race and a resulting deadlock is possible
  931. theoretically (no matter how unlikely the race scenario
  932. is), it will be proven so and will immediately be
  933. reported by the kernel (once the event is observed that
  934. makes the deadlock theoretically possible).
  935. If a deadlock is impossible (i.e. the locking rules, as
  936. observed by the kernel, are mathematically correct), the
  937. kernel reports nothing.
  938. NOTE: this feature can also be enabled for rwlocks, mutexes
  939. and rwsems - in which case all dependencies between these
  940. different locking variants are observed and mapped too, and
  941. the proof of observed correctness is also maintained for an
  942. arbitrary combination of these separate locking variants.
  943. For more details, see Documentation/locking/lockdep-design.txt.
  944. config LOCKDEP
  945. bool
  946. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  947. select STACKTRACE
  948. select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE
  949. select KALLSYMS
  950. select KALLSYMS_ALL
  951. config LOCKDEP_SMALL
  952. bool
  953. config LOCK_STAT
  954. bool "Lock usage statistics"
  955. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  956. select LOCKDEP
  957. select DEBUG_SPINLOCK
  958. select DEBUG_MUTEXES
  959. select DEBUG_RT_MUTEXES if RT_MUTEXES
  960. select DEBUG_LOCK_ALLOC
  961. default n
  962. help
  963. This feature enables tracking lock contention points
  964. For more details, see Documentation/locking/lockstat.txt
  965. This also enables lock events required by "perf lock",
  966. subcommand of perf.
  967. If you want to use "perf lock", you also need to turn on
  968. CONFIG_EVENT_TRACING.
  969. CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
  970. (CONFIG_LOCKDEP defines "acquire" and "release" events.)
  971. config DEBUG_LOCKDEP
  972. bool "Lock dependency engine debugging"
  973. depends on DEBUG_KERNEL && LOCKDEP
  974. help
  975. If you say Y here, the lock dependency engine will do
  976. additional runtime checks to debug itself, at the price
  977. of more runtime overhead.
  978. config DEBUG_ATOMIC_SLEEP
  979. bool "Sleep inside atomic section checking"
  980. select PREEMPT_COUNT
  981. depends on DEBUG_KERNEL
  982. help
  983. If you say Y here, various routines which may sleep will become very
  984. noisy if they are called inside atomic sections: when a spinlock is
  985. held, inside an rcu read side critical section, inside preempt disabled
  986. sections, inside an interrupt, etc...
  987. config DEBUG_LOCKING_API_SELFTESTS
  988. bool "Locking API boot-time self-tests"
  989. depends on DEBUG_KERNEL
  990. help
  991. Say Y here if you want the kernel to run a short self-test during
  992. bootup. The self-test checks whether common types of locking bugs
  993. are detected by debugging mechanisms or not. (if you disable
  994. lock debugging then those bugs wont be detected of course.)
  995. The following locking APIs are covered: spinlocks, rwlocks,
  996. mutexes and rwsems.
  997. config LOCK_TORTURE_TEST
  998. tristate "torture tests for locking"
  999. depends on DEBUG_KERNEL
  1000. select TORTURE_TEST
  1001. default n
  1002. help
  1003. This option provides a kernel module that runs torture tests
  1004. on kernel locking primitives. The kernel module may be built
  1005. after the fact on the running kernel to be tested, if desired.
  1006. Say Y here if you want kernel locking-primitive torture tests
  1007. to be built into the kernel.
  1008. Say M if you want these torture tests to build as a module.
  1009. Say N if you are unsure.
  1010. config WW_MUTEX_SELFTEST
  1011. tristate "Wait/wound mutex selftests"
  1012. help
  1013. This option provides a kernel module that runs tests on the
  1014. on the struct ww_mutex locking API.
  1015. It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction
  1016. with this test harness.
  1017. Say M if you want these self tests to build as a module.
  1018. Say N if you are unsure.
  1019. endmenu # lock debugging
  1020. config TRACE_IRQFLAGS
  1021. bool
  1022. help
  1023. Enables hooks to interrupt enabling and disabling for
  1024. either tracing or lock debugging.
  1025. config STACKTRACE
  1026. bool "Stack backtrace support"
  1027. depends on STACKTRACE_SUPPORT
  1028. help
  1029. This option causes the kernel to create a /proc/pid/stack for
  1030. every process, showing its current stack trace.
  1031. It is also used by various kernel debugging features that require
  1032. stack trace generation.
  1033. config WARN_ALL_UNSEEDED_RANDOM
  1034. bool "Warn for all uses of unseeded randomness"
  1035. default n
  1036. help
  1037. Some parts of the kernel contain bugs relating to their use of
  1038. cryptographically secure random numbers before it's actually possible
  1039. to generate those numbers securely. This setting ensures that these
  1040. flaws don't go unnoticed, by enabling a message, should this ever
  1041. occur. This will allow people with obscure setups to know when things
  1042. are going wrong, so that they might contact developers about fixing
  1043. it.
  1044. Unfortunately, on some models of some architectures getting
  1045. a fully seeded CRNG is extremely difficult, and so this can
  1046. result in dmesg getting spammed for a surprisingly long
  1047. time. This is really bad from a security perspective, and
  1048. so architecture maintainers really need to do what they can
  1049. to get the CRNG seeded sooner after the system is booted.
  1050. However, since users can not do anything actionble to
  1051. address this, by default the kernel will issue only a single
  1052. warning for the first use of unseeded randomness.
  1053. Say Y here if you want to receive warnings for all uses of
  1054. unseeded randomness. This will be of use primarily for
  1055. those developers interersted in improving the security of
  1056. Linux kernels running on their architecture (or
  1057. subarchitecture).
  1058. config DEBUG_KOBJECT
  1059. bool "kobject debugging"
  1060. depends on DEBUG_KERNEL
  1061. help
  1062. If you say Y here, some extra kobject debugging messages will be sent
  1063. to the syslog.
  1064. config DEBUG_KOBJECT_RELEASE
  1065. bool "kobject release debugging"
  1066. depends on DEBUG_OBJECTS_TIMERS
  1067. help
  1068. kobjects are reference counted objects. This means that their
  1069. last reference count put is not predictable, and the kobject can
  1070. live on past the point at which a driver decides to drop it's
  1071. initial reference to the kobject gained on allocation. An
  1072. example of this would be a struct device which has just been
  1073. unregistered.
  1074. However, some buggy drivers assume that after such an operation,
  1075. the memory backing the kobject can be immediately freed. This
  1076. goes completely against the principles of a refcounted object.
  1077. If you say Y here, the kernel will delay the release of kobjects
  1078. on the last reference count to improve the visibility of this
  1079. kind of kobject release bug.
  1080. config HAVE_DEBUG_BUGVERBOSE
  1081. bool
  1082. config DEBUG_BUGVERBOSE
  1083. bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
  1084. depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
  1085. default y
  1086. help
  1087. Say Y here to make BUG() panics output the file name and line number
  1088. of the BUG call as well as the EIP and oops trace. This aids
  1089. debugging but costs about 70-100K of memory.
  1090. config DEBUG_LIST
  1091. bool "Debug linked list manipulation"
  1092. depends on DEBUG_KERNEL || BUG_ON_DATA_CORRUPTION
  1093. help
  1094. Enable this to turn on extended checks in the linked-list
  1095. walking routines.
  1096. If unsure, say N.
  1097. config DEBUG_PI_LIST
  1098. bool "Debug priority linked list manipulation"
  1099. depends on DEBUG_KERNEL
  1100. help
  1101. Enable this to turn on extended checks in the priority-ordered
  1102. linked-list (plist) walking routines. This checks the entire
  1103. list multiple times during each manipulation.
  1104. If unsure, say N.
  1105. config DEBUG_SG
  1106. bool "Debug SG table operations"
  1107. depends on DEBUG_KERNEL
  1108. help
  1109. Enable this to turn on checks on scatter-gather tables. This can
  1110. help find problems with drivers that do not properly initialize
  1111. their sg tables.
  1112. If unsure, say N.
  1113. config DEBUG_NOTIFIERS
  1114. bool "Debug notifier call chains"
  1115. depends on DEBUG_KERNEL
  1116. help
  1117. Enable this to turn on sanity checking for notifier call chains.
  1118. This is most useful for kernel developers to make sure that
  1119. modules properly unregister themselves from notifier chains.
  1120. This is a relatively cheap check but if you care about maximum
  1121. performance, say N.
  1122. config DEBUG_CREDENTIALS
  1123. bool "Debug credential management"
  1124. depends on DEBUG_KERNEL
  1125. help
  1126. Enable this to turn on some debug checking for credential
  1127. management. The additional code keeps track of the number of
  1128. pointers from task_structs to any given cred struct, and checks to
  1129. see that this number never exceeds the usage count of the cred
  1130. struct.
  1131. Furthermore, if SELinux is enabled, this also checks that the
  1132. security pointer in the cred struct is never seen to be invalid.
  1133. If unsure, say N.
  1134. source "kernel/rcu/Kconfig.debug"
  1135. config DEBUG_WQ_FORCE_RR_CPU
  1136. bool "Force round-robin CPU selection for unbound work items"
  1137. depends on DEBUG_KERNEL
  1138. default n
  1139. help
  1140. Workqueue used to implicitly guarantee that work items queued
  1141. without explicit CPU specified are put on the local CPU. This
  1142. guarantee is no longer true and while local CPU is still
  1143. preferred work items may be put on foreign CPUs. Kernel
  1144. parameter "workqueue.debug_force_rr_cpu" is added to force
  1145. round-robin CPU selection to flush out usages which depend on the
  1146. now broken guarantee. This config option enables the debug
  1147. feature by default. When enabled, memory and cache locality will
  1148. be impacted.
  1149. config DEBUG_BLOCK_EXT_DEVT
  1150. bool "Force extended block device numbers and spread them"
  1151. depends on DEBUG_KERNEL
  1152. depends on BLOCK
  1153. default n
  1154. help
  1155. BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
  1156. SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
  1157. YOU ARE DOING. Distros, please enable this and fix whatever
  1158. is broken.
  1159. Conventionally, block device numbers are allocated from
  1160. predetermined contiguous area. However, extended block area
  1161. may introduce non-contiguous block device numbers. This
  1162. option forces most block device numbers to be allocated from
  1163. the extended space and spreads them to discover kernel or
  1164. userland code paths which assume predetermined contiguous
  1165. device number allocation.
  1166. Note that turning on this debug option shuffles all the
  1167. device numbers for all IDE and SCSI devices including libata
  1168. ones, so root partition specified using device number
  1169. directly (via rdev or root=MAJ:MIN) won't work anymore.
  1170. Textual device names (root=/dev/sdXn) will continue to work.
  1171. Say N if you are unsure.
  1172. config CPU_HOTPLUG_STATE_CONTROL
  1173. bool "Enable CPU hotplug state control"
  1174. depends on DEBUG_KERNEL
  1175. depends on HOTPLUG_CPU
  1176. default n
  1177. help
  1178. Allows to write steps between "offline" and "online" to the CPUs
  1179. sysfs target file so states can be stepped granular. This is a debug
  1180. option for now as the hotplug machinery cannot be stopped and
  1181. restarted at arbitrary points yet.
  1182. Say N if your are unsure.
  1183. config NOTIFIER_ERROR_INJECTION
  1184. tristate "Notifier error injection"
  1185. depends on DEBUG_KERNEL
  1186. select DEBUG_FS
  1187. help
  1188. This option provides the ability to inject artificial errors to
  1189. specified notifier chain callbacks. It is useful to test the error
  1190. handling of notifier call chain failures.
  1191. Say N if unsure.
  1192. config PM_NOTIFIER_ERROR_INJECT
  1193. tristate "PM notifier error injection module"
  1194. depends on PM && NOTIFIER_ERROR_INJECTION
  1195. default m if PM_DEBUG
  1196. help
  1197. This option provides the ability to inject artificial errors to
  1198. PM notifier chain callbacks. It is controlled through debugfs
  1199. interface /sys/kernel/debug/notifier-error-inject/pm
  1200. If the notifier call chain should be failed with some events
  1201. notified, write the error code to "actions/<notifier event>/error".
  1202. Example: Inject PM suspend error (-12 = -ENOMEM)
  1203. # cd /sys/kernel/debug/notifier-error-inject/pm/
  1204. # echo -12 > actions/PM_SUSPEND_PREPARE/error
  1205. # echo mem > /sys/power/state
  1206. bash: echo: write error: Cannot allocate memory
  1207. To compile this code as a module, choose M here: the module will
  1208. be called pm-notifier-error-inject.
  1209. If unsure, say N.
  1210. config OF_RECONFIG_NOTIFIER_ERROR_INJECT
  1211. tristate "OF reconfig notifier error injection module"
  1212. depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
  1213. help
  1214. This option provides the ability to inject artificial errors to
  1215. OF reconfig notifier chain callbacks. It is controlled
  1216. through debugfs interface under
  1217. /sys/kernel/debug/notifier-error-inject/OF-reconfig/
  1218. If the notifier call chain should be failed with some events
  1219. notified, write the error code to "actions/<notifier event>/error".
  1220. To compile this code as a module, choose M here: the module will
  1221. be called of-reconfig-notifier-error-inject.
  1222. If unsure, say N.
  1223. config NETDEV_NOTIFIER_ERROR_INJECT
  1224. tristate "Netdev notifier error injection module"
  1225. depends on NET && NOTIFIER_ERROR_INJECTION
  1226. help
  1227. This option provides the ability to inject artificial errors to
  1228. netdevice notifier chain callbacks. It is controlled through debugfs
  1229. interface /sys/kernel/debug/notifier-error-inject/netdev
  1230. If the notifier call chain should be failed with some events
  1231. notified, write the error code to "actions/<notifier event>/error".
  1232. Example: Inject netdevice mtu change error (-22 = -EINVAL)
  1233. # cd /sys/kernel/debug/notifier-error-inject/netdev
  1234. # echo -22 > actions/NETDEV_CHANGEMTU/error
  1235. # ip link set eth0 mtu 1024
  1236. RTNETLINK answers: Invalid argument
  1237. To compile this code as a module, choose M here: the module will
  1238. be called netdev-notifier-error-inject.
  1239. If unsure, say N.
  1240. config FAULT_INJECTION
  1241. bool "Fault-injection framework"
  1242. depends on DEBUG_KERNEL
  1243. help
  1244. Provide fault-injection framework.
  1245. For more details, see Documentation/fault-injection/.
  1246. config FAILSLAB
  1247. bool "Fault-injection capability for kmalloc"
  1248. depends on FAULT_INJECTION
  1249. depends on SLAB || SLUB
  1250. help
  1251. Provide fault-injection capability for kmalloc.
  1252. config FAIL_PAGE_ALLOC
  1253. bool "Fault-injection capabilitiy for alloc_pages()"
  1254. depends on FAULT_INJECTION
  1255. help
  1256. Provide fault-injection capability for alloc_pages().
  1257. config FAIL_MAKE_REQUEST
  1258. bool "Fault-injection capability for disk IO"
  1259. depends on FAULT_INJECTION && BLOCK
  1260. help
  1261. Provide fault-injection capability for disk IO.
  1262. config FAIL_IO_TIMEOUT
  1263. bool "Fault-injection capability for faking disk interrupts"
  1264. depends on FAULT_INJECTION && BLOCK
  1265. help
  1266. Provide fault-injection capability on end IO handling. This
  1267. will make the block layer "forget" an interrupt as configured,
  1268. thus exercising the error handling.
  1269. Only works with drivers that use the generic timeout handling,
  1270. for others it wont do anything.
  1271. config FAIL_MMC_REQUEST
  1272. bool "Fault-injection capability for MMC IO"
  1273. depends on FAULT_INJECTION_DEBUG_FS && MMC
  1274. help
  1275. Provide fault-injection capability for MMC IO.
  1276. This will make the mmc core return data errors. This is
  1277. useful to test the error handling in the mmc block device
  1278. and to test how the mmc host driver handles retries from
  1279. the block device.
  1280. config FAIL_FUTEX
  1281. bool "Fault-injection capability for futexes"
  1282. select DEBUG_FS
  1283. depends on FAULT_INJECTION && FUTEX
  1284. help
  1285. Provide fault-injection capability for futexes.
  1286. config FAULT_INJECTION_DEBUG_FS
  1287. bool "Debugfs entries for fault-injection capabilities"
  1288. depends on FAULT_INJECTION && SYSFS && DEBUG_FS
  1289. help
  1290. Enable configuration of fault-injection capabilities via debugfs.
  1291. config FAULT_INJECTION_STACKTRACE_FILTER
  1292. bool "stacktrace filter for fault-injection capabilities"
  1293. depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
  1294. depends on !X86_64
  1295. select STACKTRACE
  1296. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE
  1297. help
  1298. Provide stacktrace filter for fault-injection capabilities
  1299. config LATENCYTOP
  1300. bool "Latency measuring infrastructure"
  1301. depends on DEBUG_KERNEL
  1302. depends on STACKTRACE_SUPPORT
  1303. depends on PROC_FS
  1304. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
  1305. select KALLSYMS
  1306. select KALLSYMS_ALL
  1307. select STACKTRACE
  1308. select SCHEDSTATS
  1309. select SCHED_DEBUG
  1310. help
  1311. Enable this option if you want to use the LatencyTOP tool
  1312. to find out which userspace is blocking on what kernel operations.
  1313. source kernel/trace/Kconfig
  1314. menu "Runtime Testing"
  1315. config LKDTM
  1316. tristate "Linux Kernel Dump Test Tool Module"
  1317. depends on DEBUG_FS
  1318. depends on BLOCK
  1319. default n
  1320. help
  1321. This module enables testing of the different dumping mechanisms by
  1322. inducing system failures at predefined crash points.
  1323. If you don't need it: say N
  1324. Choose M here to compile this code as a module. The module will be
  1325. called lkdtm.
  1326. Documentation on how to use the module can be found in
  1327. Documentation/fault-injection/provoke-crashes.txt
  1328. config TEST_LIST_SORT
  1329. tristate "Linked list sorting test"
  1330. depends on DEBUG_KERNEL || m
  1331. help
  1332. Enable this to turn on 'list_sort()' function test. This test is
  1333. executed only once during system boot (so affects only boot time),
  1334. or at module load time.
  1335. If unsure, say N.
  1336. config TEST_SORT
  1337. tristate "Array-based sort test"
  1338. depends on DEBUG_KERNEL || m
  1339. help
  1340. This option enables the self-test function of 'sort()' at boot,
  1341. or at module load time.
  1342. If unsure, say N.
  1343. config KPROBES_SANITY_TEST
  1344. bool "Kprobes sanity tests"
  1345. depends on DEBUG_KERNEL
  1346. depends on KPROBES
  1347. default n
  1348. help
  1349. This option provides for testing basic kprobes functionality on
  1350. boot. A sample kprobe, jprobe and kretprobe are inserted and
  1351. verified for functionality.
  1352. Say N if you are unsure.
  1353. config BACKTRACE_SELF_TEST
  1354. tristate "Self test for the backtrace code"
  1355. depends on DEBUG_KERNEL
  1356. default n
  1357. help
  1358. This option provides a kernel module that can be used to test
  1359. the kernel stack backtrace code. This option is not useful
  1360. for distributions or general kernels, but only for kernel
  1361. developers working on architecture code.
  1362. Note that if you want to also test saved backtraces, you will
  1363. have to enable STACKTRACE as well.
  1364. Say N if you are unsure.
  1365. config RBTREE_TEST
  1366. tristate "Red-Black tree test"
  1367. depends on DEBUG_KERNEL
  1368. help
  1369. A benchmark measuring the performance of the rbtree library.
  1370. Also includes rbtree invariant checks.
  1371. config INTERVAL_TREE_TEST
  1372. tristate "Interval tree test"
  1373. depends on DEBUG_KERNEL
  1374. select INTERVAL_TREE
  1375. help
  1376. A benchmark measuring the performance of the interval tree library
  1377. config PERCPU_TEST
  1378. tristate "Per cpu operations test"
  1379. depends on m && DEBUG_KERNEL
  1380. help
  1381. Enable this option to build test module which validates per-cpu
  1382. operations.
  1383. If unsure, say N.
  1384. config ATOMIC64_SELFTEST
  1385. tristate "Perform an atomic64_t self-test"
  1386. help
  1387. Enable this option to test the atomic64_t functions at boot or
  1388. at module load time.
  1389. If unsure, say N.
  1390. config ASYNC_RAID6_TEST
  1391. tristate "Self test for hardware accelerated raid6 recovery"
  1392. depends on ASYNC_RAID6_RECOV
  1393. select ASYNC_MEMCPY
  1394. ---help---
  1395. This is a one-shot self test that permutes through the
  1396. recovery of all the possible two disk failure scenarios for a
  1397. N-disk array. Recovery is performed with the asynchronous
  1398. raid6 recovery routines, and will optionally use an offload
  1399. engine if one is available.
  1400. If unsure, say N.
  1401. config TEST_HEXDUMP
  1402. tristate "Test functions located in the hexdump module at runtime"
  1403. config TEST_STRING_HELPERS
  1404. tristate "Test functions located in the string_helpers module at runtime"
  1405. config TEST_KSTRTOX
  1406. tristate "Test kstrto*() family of functions at runtime"
  1407. config TEST_PRINTF
  1408. tristate "Test printf() family of functions at runtime"
  1409. config TEST_BITMAP
  1410. tristate "Test bitmap_*() family of functions at runtime"
  1411. default n
  1412. help
  1413. Enable this option to test the bitmap functions at boot.
  1414. If unsure, say N.
  1415. config TEST_UUID
  1416. tristate "Test functions located in the uuid module at runtime"
  1417. config TEST_RHASHTABLE
  1418. tristate "Perform selftest on resizable hash table"
  1419. default n
  1420. help
  1421. Enable this option to test the rhashtable functions at boot.
  1422. If unsure, say N.
  1423. config TEST_HASH
  1424. tristate "Perform selftest on hash functions"
  1425. default n
  1426. help
  1427. Enable this option to test the kernel's integer (<linux/hash.h>),
  1428. string (<linux/stringhash.h>), and siphash (<linux/siphash.h>)
  1429. hash functions on boot (or module load).
  1430. This is intended to help people writing architecture-specific
  1431. optimized versions. If unsure, say N.
  1432. config TEST_PARMAN
  1433. tristate "Perform selftest on priority array manager"
  1434. default n
  1435. depends on PARMAN
  1436. help
  1437. Enable this option to test priority array manager on boot
  1438. (or module load).
  1439. If unsure, say N.
  1440. endmenu # runtime tests
  1441. config PROVIDE_OHCI1394_DMA_INIT
  1442. bool "Remote debugging over FireWire early on boot"
  1443. depends on PCI && X86
  1444. help
  1445. If you want to debug problems which hang or crash the kernel early
  1446. on boot and the crashing machine has a FireWire port, you can use
  1447. this feature to remotely access the memory of the crashed machine
  1448. over FireWire. This employs remote DMA as part of the OHCI1394
  1449. specification which is now the standard for FireWire controllers.
  1450. With remote DMA, you can monitor the printk buffer remotely using
  1451. firescope and access all memory below 4GB using fireproxy from gdb.
  1452. Even controlling a kernel debugger is possible using remote DMA.
  1453. Usage:
  1454. If ohci1394_dma=early is used as boot parameter, it will initialize
  1455. all OHCI1394 controllers which are found in the PCI config space.
  1456. As all changes to the FireWire bus such as enabling and disabling
  1457. devices cause a bus reset and thereby disable remote DMA for all
  1458. devices, be sure to have the cable plugged and FireWire enabled on
  1459. the debugging host before booting the debug target for debugging.
  1460. This code (~1k) is freed after boot. By then, the firewire stack
  1461. in charge of the OHCI-1394 controllers should be used instead.
  1462. See Documentation/debugging-via-ohci1394.txt for more information.
  1463. config DMA_API_DEBUG
  1464. bool "Enable debugging of DMA-API usage"
  1465. depends on HAVE_DMA_API_DEBUG
  1466. help
  1467. Enable this option to debug the use of the DMA API by device drivers.
  1468. With this option you will be able to detect common bugs in device
  1469. drivers like double-freeing of DMA mappings or freeing mappings that
  1470. were never allocated.
  1471. This also attempts to catch cases where a page owned by DMA is
  1472. accessed by the cpu in a way that could cause data corruption. For
  1473. example, this enables cow_user_page() to check that the source page is
  1474. not undergoing DMA.
  1475. This option causes a performance degradation. Use only if you want to
  1476. debug device drivers and dma interactions.
  1477. If unsure, say N.
  1478. config TEST_LKM
  1479. tristate "Test module loading with 'hello world' module"
  1480. default n
  1481. depends on m
  1482. help
  1483. This builds the "test_module" module that emits "Hello, world"
  1484. on printk when loaded. It is designed to be used for basic
  1485. evaluation of the module loading subsystem (for example when
  1486. validating module verification). It lacks any extra dependencies,
  1487. and will not normally be loaded by the system unless explicitly
  1488. requested by name.
  1489. If unsure, say N.
  1490. config TEST_USER_COPY
  1491. tristate "Test user/kernel boundary protections"
  1492. default n
  1493. depends on m
  1494. help
  1495. This builds the "test_user_copy" module that runs sanity checks
  1496. on the copy_to/from_user infrastructure, making sure basic
  1497. user/kernel boundary testing is working. If it fails to load,
  1498. a regression has been detected in the user/kernel memory boundary
  1499. protections.
  1500. If unsure, say N.
  1501. config TEST_BPF
  1502. tristate "Test BPF filter functionality"
  1503. default n
  1504. depends on m && NET
  1505. help
  1506. This builds the "test_bpf" module that runs various test vectors
  1507. against the BPF interpreter or BPF JIT compiler depending on the
  1508. current setting. This is in particular useful for BPF JIT compiler
  1509. development, but also to run regression tests against changes in
  1510. the interpreter code. It also enables test stubs for eBPF maps and
  1511. verifier used by user space verifier testsuite.
  1512. If unsure, say N.
  1513. config TEST_FIRMWARE
  1514. tristate "Test firmware loading via userspace interface"
  1515. default n
  1516. depends on FW_LOADER
  1517. help
  1518. This builds the "test_firmware" module that creates a userspace
  1519. interface for testing firmware loading. This can be used to
  1520. control the triggering of firmware loading without needing an
  1521. actual firmware-using device. The contents can be rechecked by
  1522. userspace.
  1523. If unsure, say N.
  1524. config TEST_SYSCTL
  1525. tristate "sysctl test driver"
  1526. default n
  1527. depends on PROC_SYSCTL
  1528. help
  1529. This builds the "test_sysctl" module. This driver enables to test the
  1530. proc sysctl interfaces available to drivers safely without affecting
  1531. production knobs which might alter system functionality.
  1532. If unsure, say N.
  1533. config TEST_UDELAY
  1534. tristate "udelay test driver"
  1535. default n
  1536. help
  1537. This builds the "udelay_test" module that helps to make sure
  1538. that udelay() is working properly.
  1539. If unsure, say N.
  1540. config MEMTEST
  1541. bool "Memtest"
  1542. depends on HAVE_MEMBLOCK
  1543. ---help---
  1544. This option adds a kernel parameter 'memtest', which allows memtest
  1545. to be set.
  1546. memtest=0, mean disabled; -- default
  1547. memtest=1, mean do 1 test pattern;
  1548. ...
  1549. memtest=17, mean do 17 test patterns.
  1550. If you are unsure how to answer this question, answer N.
  1551. config TEST_STATIC_KEYS
  1552. tristate "Test static keys"
  1553. default n
  1554. depends on m
  1555. help
  1556. Test the static key interfaces.
  1557. If unsure, say N.
  1558. config BUG_ON_DATA_CORRUPTION
  1559. bool "Trigger a BUG when data corruption is detected"
  1560. select DEBUG_LIST
  1561. help
  1562. Select this option if the kernel should BUG when it encounters
  1563. data corruption in kernel memory structures when they get checked
  1564. for validity.
  1565. If unsure, say N.
  1566. config TEST_KMOD
  1567. tristate "kmod stress tester"
  1568. default n
  1569. depends on m
  1570. depends on BLOCK && (64BIT || LBDAF) # for XFS, BTRFS
  1571. depends on NETDEVICES && NET_CORE && INET # for TUN
  1572. select TEST_LKM
  1573. select XFS_FS
  1574. select TUN
  1575. select BTRFS_FS
  1576. help
  1577. Test the kernel's module loading mechanism: kmod. kmod implements
  1578. support to load modules using the Linux kernel's usermode helper.
  1579. This test provides a series of tests against kmod.
  1580. Although technically you can either build test_kmod as a module or
  1581. into the kernel we disallow building it into the kernel since
  1582. it stress tests request_module() and this will very likely cause
  1583. some issues by taking over precious threads available from other
  1584. module load requests, ultimately this could be fatal.
  1585. To run tests run:
  1586. tools/testing/selftests/kmod/kmod.sh --help
  1587. If unsure, say N.
  1588. source "samples/Kconfig"
  1589. source "lib/Kconfig.kgdb"
  1590. source "lib/Kconfig.ubsan"
  1591. config ARCH_HAS_DEVMEM_IS_ALLOWED
  1592. bool
  1593. config STRICT_DEVMEM
  1594. bool "Filter access to /dev/mem"
  1595. depends on MMU && DEVMEM
  1596. depends on ARCH_HAS_DEVMEM_IS_ALLOWED
  1597. default y if TILE || PPC
  1598. ---help---
  1599. If this option is disabled, you allow userspace (root) access to all
  1600. of memory, including kernel and userspace memory. Accidental
  1601. access to this is obviously disastrous, but specific access can
  1602. be used by people debugging the kernel. Note that with PAT support
  1603. enabled, even in this case there are restrictions on /dev/mem
  1604. use due to the cache aliasing requirements.
  1605. If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
  1606. file only allows userspace access to PCI space and the BIOS code and
  1607. data regions. This is sufficient for dosemu and X and all common
  1608. users of /dev/mem.
  1609. If in doubt, say Y.
  1610. config IO_STRICT_DEVMEM
  1611. bool "Filter I/O access to /dev/mem"
  1612. depends on STRICT_DEVMEM
  1613. ---help---
  1614. If this option is disabled, you allow userspace (root) access to all
  1615. io-memory regardless of whether a driver is actively using that
  1616. range. Accidental access to this is obviously disastrous, but
  1617. specific access can be used by people debugging kernel drivers.
  1618. If this option is switched on, the /dev/mem file only allows
  1619. userspace access to *idle* io-memory ranges (see /proc/iomem) This
  1620. may break traditional users of /dev/mem (dosemu, legacy X, etc...)
  1621. if the driver using a given range cannot be disabled.
  1622. If in doubt, say Y.