Kconfig.debug 66 KB

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