Kconfig.debug 66 KB

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