Kconfig.debug 68 KB

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