Kconfig.debug 73 KB

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