Kconfig.debug 68 KB

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