Kconfig.debug 68 KB

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