Kconfig.debug 68 KB

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