Kconfig.debug 68 KB

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