Kconfig.debug 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  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 DEFAULT_MESSAGE_LOGLEVEL
  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
  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 ENABLE_WARN_DEPRECATED
  118. bool "Enable __deprecated logic"
  119. default y
  120. help
  121. Enable the __deprecated logic in the kernel build.
  122. Disable this to suppress the "warning: 'foo' is deprecated
  123. (declared at kernel/power/somefile.c:1234)" messages.
  124. config ENABLE_MUST_CHECK
  125. bool "Enable __must_check logic"
  126. default y
  127. help
  128. Enable the __must_check logic in the kernel build. Disable this to
  129. suppress the "warning: ignoring return value of 'foo', declared with
  130. attribute warn_unused_result" messages.
  131. config FRAME_WARN
  132. int "Warn for stack frames larger than (needs gcc 4.4)"
  133. range 0 8192
  134. default 1024 if !64BIT
  135. default 2048 if 64BIT
  136. help
  137. Tell gcc to warn at build time for stack frames larger than this.
  138. Setting this too low will cause a lot of warnings.
  139. Setting it to 0 disables the warning.
  140. Requires gcc 4.4
  141. config STRIP_ASM_SYMS
  142. bool "Strip assembler-generated symbols during link"
  143. default n
  144. help
  145. Strip internal assembler-generated symbols during a link (symbols
  146. that look like '.Lxxx') so they don't pollute the output of
  147. get_wchan() and suchlike.
  148. config READABLE_ASM
  149. bool "Generate readable assembler code"
  150. depends on DEBUG_KERNEL
  151. help
  152. Disable some compiler optimizations that tend to generate human unreadable
  153. assembler output. This may make the kernel slightly slower, but it helps
  154. to keep kernel developers who have to stare a lot at assembler listings
  155. sane.
  156. config UNUSED_SYMBOLS
  157. bool "Enable unused/obsolete exported symbols"
  158. default y if X86
  159. help
  160. Unused but exported symbols make the kernel needlessly bigger. For
  161. that reason most of these unused exports will soon be removed. This
  162. option is provided temporarily to provide a transition period in case
  163. some external kernel module needs one of these symbols anyway. If you
  164. encounter such a case in your module, consider if you are actually
  165. using the right API. (rationale: since nobody in the kernel is using
  166. this in a module, there is a pretty good chance it's actually the
  167. wrong interface to use). If you really need the symbol, please send a
  168. mail to the linux kernel mailing list mentioning the symbol and why
  169. you really need it, and what the merge plan to the mainline kernel for
  170. your module is.
  171. config DEBUG_FS
  172. bool "Debug Filesystem"
  173. help
  174. debugfs is a virtual file system that kernel developers use to put
  175. debugging files into. Enable this option to be able to read and
  176. write to these files.
  177. For detailed documentation on the debugfs API, see
  178. Documentation/DocBook/filesystems.
  179. If unsure, say N.
  180. config HEADERS_CHECK
  181. bool "Run 'make headers_check' when building vmlinux"
  182. depends on !UML
  183. help
  184. This option will extract the user-visible kernel headers whenever
  185. building the kernel, and will run basic sanity checks on them to
  186. ensure that exported files do not attempt to include files which
  187. were not exported, etc.
  188. If you're making modifications to header files which are
  189. relevant for userspace, say 'Y', and check the headers
  190. exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
  191. your build tree), to make sure they're suitable.
  192. config DEBUG_SECTION_MISMATCH
  193. bool "Enable full Section mismatch analysis"
  194. help
  195. The section mismatch analysis checks if there are illegal
  196. references from one section to another section.
  197. During linktime or runtime, some sections are dropped;
  198. any use of code/data previously in these sections would
  199. most likely result in an oops.
  200. In the code, functions and variables are annotated with
  201. __init,, etc. (see the full list in include/linux/init.h),
  202. which results in the code/data being placed in specific sections.
  203. The section mismatch analysis is always performed after a full
  204. kernel build, and enabling this option causes the following
  205. additional steps to occur:
  206. - Add the option -fno-inline-functions-called-once to gcc commands.
  207. When inlining a function annotated with __init in a non-init
  208. function, we would lose the section information and thus
  209. the analysis would not catch the illegal reference.
  210. This option tells gcc to inline less (but it does result in
  211. a larger kernel).
  212. - Run the section mismatch analysis for each module/built-in.o file.
  213. When we run the section mismatch analysis on vmlinux.o, we
  214. lose valueble information about where the mismatch was
  215. introduced.
  216. Running the analysis for each module/built-in.o file
  217. tells where the mismatch happens much closer to the
  218. source. The drawback is that the same mismatch is
  219. reported at least twice.
  220. - Enable verbose reporting from modpost in order to help resolve
  221. the section mismatches that are reported.
  222. #
  223. # Select this config option from the architecture Kconfig, if it
  224. # is preferred to always offer frame pointers as a config
  225. # option on the architecture (regardless of KERNEL_DEBUG):
  226. #
  227. config ARCH_WANT_FRAME_POINTERS
  228. bool
  229. help
  230. config FRAME_POINTER
  231. bool "Compile the kernel with frame pointers"
  232. depends on DEBUG_KERNEL && \
  233. (CRIS || M68K || FRV || UML || \
  234. AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
  235. ARCH_WANT_FRAME_POINTERS
  236. default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
  237. help
  238. If you say Y here the resulting kernel image will be slightly
  239. larger and slower, but it gives very useful debugging information
  240. in case of kernel bugs. (precise oopses/stacktraces/warnings)
  241. config DEBUG_FORCE_WEAK_PER_CPU
  242. bool "Force weak per-cpu definitions"
  243. depends on DEBUG_KERNEL
  244. help
  245. s390 and alpha require percpu variables in modules to be
  246. defined weak to work around addressing range issue which
  247. puts the following two restrictions on percpu variable
  248. definitions.
  249. 1. percpu symbols must be unique whether static or not
  250. 2. percpu variables can't be defined inside a function
  251. To ensure that generic code follows the above rules, this
  252. option forces all percpu variables to be defined as weak.
  253. endmenu # "Compiler options"
  254. config MAGIC_SYSRQ
  255. bool "Magic SysRq key"
  256. depends on !UML
  257. help
  258. If you say Y here, you will have some control over the system even
  259. if the system crashes for example during kernel debugging (e.g., you
  260. will be able to flush the buffer cache to disk, reboot the system
  261. immediately or dump some status information). This is accomplished
  262. by pressing various keys while holding SysRq (Alt+PrintScreen). It
  263. also works on a serial console (on PC hardware at least), if you
  264. send a BREAK and then within 5 seconds a command keypress. The
  265. keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
  266. unless you really know what this hack does.
  267. config DEBUG_KERNEL
  268. bool "Kernel debugging"
  269. help
  270. Say Y here if you are developing drivers or trying to debug and
  271. identify kernel problems.
  272. menu "Memory Debugging"
  273. source mm/Kconfig.debug
  274. config DEBUG_OBJECTS
  275. bool "Debug object operations"
  276. depends on DEBUG_KERNEL
  277. help
  278. If you say Y here, additional code will be inserted into the
  279. kernel to track the life time of various objects and validate
  280. the operations on those objects.
  281. config DEBUG_OBJECTS_SELFTEST
  282. bool "Debug objects selftest"
  283. depends on DEBUG_OBJECTS
  284. help
  285. This enables the selftest of the object debug code.
  286. config DEBUG_OBJECTS_FREE
  287. bool "Debug objects in freed memory"
  288. depends on DEBUG_OBJECTS
  289. help
  290. This enables checks whether a k/v free operation frees an area
  291. which contains an object which has not been deactivated
  292. properly. This can make kmalloc/kfree-intensive workloads
  293. much slower.
  294. config DEBUG_OBJECTS_TIMERS
  295. bool "Debug timer objects"
  296. depends on DEBUG_OBJECTS
  297. help
  298. If you say Y here, additional code will be inserted into the
  299. timer routines to track the life time of timer objects and
  300. validate the timer operations.
  301. config DEBUG_OBJECTS_WORK
  302. bool "Debug work objects"
  303. depends on DEBUG_OBJECTS
  304. help
  305. If you say Y here, additional code will be inserted into the
  306. work queue routines to track the life time of work objects and
  307. validate the work operations.
  308. config DEBUG_OBJECTS_RCU_HEAD
  309. bool "Debug RCU callbacks objects"
  310. depends on DEBUG_OBJECTS
  311. help
  312. Enable this to turn on debugging of RCU list heads (call_rcu() usage).
  313. config DEBUG_OBJECTS_PERCPU_COUNTER
  314. bool "Debug percpu counter objects"
  315. depends on DEBUG_OBJECTS
  316. help
  317. If you say Y here, additional code will be inserted into the
  318. percpu counter routines to track the life time of percpu counter
  319. objects and validate the percpu counter operations.
  320. config DEBUG_OBJECTS_ENABLE_DEFAULT
  321. int "debug_objects bootup default value (0-1)"
  322. range 0 1
  323. default "1"
  324. depends on DEBUG_OBJECTS
  325. help
  326. Debug objects boot parameter default value
  327. config DEBUG_SLAB
  328. bool "Debug slab memory allocations"
  329. depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
  330. help
  331. Say Y here to have the kernel do limited verification on memory
  332. allocation as well as poisoning memory on free to catch use of freed
  333. memory. This can make kmalloc/kfree-intensive workloads much slower.
  334. config DEBUG_SLAB_LEAK
  335. bool "Memory leak debugging"
  336. depends on DEBUG_SLAB
  337. config SLUB_DEBUG_ON
  338. bool "SLUB debugging on by default"
  339. depends on SLUB && SLUB_DEBUG && !KMEMCHECK
  340. default n
  341. help
  342. Boot with debugging on by default. SLUB boots by default with
  343. the runtime debug capabilities switched off. Enabling this is
  344. equivalent to specifying the "slub_debug" parameter on boot.
  345. There is no support for more fine grained debug control like
  346. possible with slub_debug=xxx. SLUB debugging may be switched
  347. off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
  348. "slub_debug=-".
  349. config SLUB_STATS
  350. default n
  351. bool "Enable SLUB performance statistics"
  352. depends on SLUB && SYSFS
  353. help
  354. SLUB statistics are useful to debug SLUBs allocation behavior in
  355. order find ways to optimize the allocator. This should never be
  356. enabled for production use since keeping statistics slows down
  357. the allocator by a few percentage points. The slabinfo command
  358. supports the determination of the most active slabs to figure
  359. out which slabs are relevant to a particular load.
  360. Try running: slabinfo -DA
  361. config HAVE_DEBUG_KMEMLEAK
  362. bool
  363. config DEBUG_KMEMLEAK
  364. bool "Kernel memory leak detector"
  365. depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
  366. select DEBUG_FS
  367. select STACKTRACE if STACKTRACE_SUPPORT
  368. select KALLSYMS
  369. select CRC32
  370. help
  371. Say Y here if you want to enable the memory leak
  372. detector. The memory allocation/freeing is traced in a way
  373. similar to the Boehm's conservative garbage collector, the
  374. difference being that the orphan objects are not freed but
  375. only shown in /sys/kernel/debug/kmemleak. Enabling this
  376. feature will introduce an overhead to memory
  377. allocations. See Documentation/kmemleak.txt for more
  378. details.
  379. Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
  380. of finding leaks due to the slab objects poisoning.
  381. In order to access the kmemleak file, debugfs needs to be
  382. mounted (usually at /sys/kernel/debug).
  383. config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
  384. int "Maximum kmemleak early log entries"
  385. depends on DEBUG_KMEMLEAK
  386. range 200 40000
  387. default 400
  388. help
  389. Kmemleak must track all the memory allocations to avoid
  390. reporting false positives. Since memory may be allocated or
  391. freed before kmemleak is initialised, an early log buffer is
  392. used to store these actions. If kmemleak reports "early log
  393. buffer exceeded", please increase this value.
  394. config DEBUG_KMEMLEAK_TEST
  395. tristate "Simple test for the kernel memory leak detector"
  396. depends on DEBUG_KMEMLEAK && m
  397. help
  398. This option enables a module that explicitly leaks memory.
  399. If unsure, say N.
  400. config DEBUG_KMEMLEAK_DEFAULT_OFF
  401. bool "Default kmemleak to off"
  402. depends on DEBUG_KMEMLEAK
  403. help
  404. Say Y here to disable kmemleak by default. It can then be enabled
  405. on the command line via kmemleak=on.
  406. config DEBUG_STACK_USAGE
  407. bool "Stack utilization instrumentation"
  408. depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
  409. help
  410. Enables the display of the minimum amount of free stack which each
  411. task has ever had available in the sysrq-T and sysrq-P debug output.
  412. This option will slow down process creation somewhat.
  413. config DEBUG_VM
  414. bool "Debug VM"
  415. depends on DEBUG_KERNEL
  416. help
  417. Enable this to turn on extended checks in the virtual-memory system
  418. that may impact performance.
  419. If unsure, say N.
  420. config DEBUG_VM_RB
  421. bool "Debug VM red-black trees"
  422. depends on DEBUG_VM
  423. help
  424. Enable this to turn on more extended checks in the virtual-memory
  425. system that may impact performance.
  426. If unsure, say N.
  427. config DEBUG_VIRTUAL
  428. bool "Debug VM translations"
  429. depends on DEBUG_KERNEL && X86
  430. help
  431. Enable some costly sanity checks in virtual to page code. This can
  432. catch mistakes with virt_to_page() and friends.
  433. If unsure, say N.
  434. config DEBUG_NOMMU_REGIONS
  435. bool "Debug the global anon/private NOMMU mapping region tree"
  436. depends on DEBUG_KERNEL && !MMU
  437. help
  438. This option causes the global tree of anonymous and private mapping
  439. regions to be regularly checked for invalid topology.
  440. config DEBUG_MEMORY_INIT
  441. bool "Debug memory initialisation" if EXPERT
  442. default !EXPERT
  443. help
  444. Enable this for additional checks during memory initialisation.
  445. The sanity checks verify aspects of the VM such as the memory model
  446. and other information provided by the architecture. Verbose
  447. information will be printed at KERN_DEBUG loglevel depending
  448. on the mminit_loglevel= command-line option.
  449. If unsure, say Y
  450. config MEMORY_NOTIFIER_ERROR_INJECT
  451. tristate "Memory hotplug notifier error injection module"
  452. depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
  453. help
  454. This option provides the ability to inject artificial errors to
  455. memory hotplug notifier chain callbacks. It is controlled through
  456. debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
  457. If the notifier call chain should be failed with some events
  458. notified, write the error code to "actions/<notifier event>/error".
  459. Example: Inject memory hotplug offline error (-12 == -ENOMEM)
  460. # cd /sys/kernel/debug/notifier-error-inject/memory
  461. # echo -12 > actions/MEM_GOING_OFFLINE/error
  462. # echo offline > /sys/devices/system/memory/memoryXXX/state
  463. bash: echo: write error: Cannot allocate memory
  464. To compile this code as a module, choose M here: the module will
  465. be called memory-notifier-error-inject.
  466. If unsure, say N.
  467. config DEBUG_PER_CPU_MAPS
  468. bool "Debug access to per_cpu maps"
  469. depends on DEBUG_KERNEL
  470. depends on SMP
  471. help
  472. Say Y to verify that the per_cpu map being accessed has
  473. been set up. This adds a fair amount of code to kernel memory
  474. and decreases performance.
  475. Say N if unsure.
  476. config DEBUG_HIGHMEM
  477. bool "Highmem debugging"
  478. depends on DEBUG_KERNEL && HIGHMEM
  479. help
  480. This options enables addition error checking for high memory systems.
  481. Disable for production systems.
  482. config HAVE_DEBUG_STACKOVERFLOW
  483. bool
  484. config DEBUG_STACKOVERFLOW
  485. bool "Check for stack overflows"
  486. depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
  487. ---help---
  488. Say Y here if you want to check for overflows of kernel, IRQ
  489. and exception stacks (if your archicture uses them). This
  490. option will show detailed messages if free stack space drops
  491. below a certain limit.
  492. These kinds of bugs usually occur when call-chains in the
  493. kernel get too deep, especially when interrupts are
  494. involved.
  495. Use this in cases where you see apparently random memory
  496. corruption, especially if it appears in 'struct thread_info'
  497. If in doubt, say "N".
  498. source "lib/Kconfig.kmemcheck"
  499. endmenu # "Memory Debugging"
  500. config DEBUG_SHIRQ
  501. bool "Debug shared IRQ handlers"
  502. depends on DEBUG_KERNEL && GENERIC_HARDIRQS
  503. help
  504. Enable this to generate a spurious interrupt as soon as a shared
  505. interrupt handler is registered, and just before one is deregistered.
  506. Drivers ought to be able to handle interrupts coming in at those
  507. points; some don't and need to be caught.
  508. menu "Debug Lockups and Hangs"
  509. config LOCKUP_DETECTOR
  510. bool "Detect Hard and Soft Lockups"
  511. depends on DEBUG_KERNEL && !S390
  512. help
  513. Say Y here to enable the kernel to act as a watchdog to detect
  514. hard and soft lockups.
  515. Softlockups are bugs that cause the kernel to loop in kernel
  516. mode for more than 20 seconds, without giving other tasks a
  517. chance to run. The current stack trace is displayed upon
  518. detection and the system will stay locked up.
  519. Hardlockups are bugs that cause the CPU to loop in kernel mode
  520. for more than 10 seconds, without letting other interrupts have a
  521. chance to run. The current stack trace is displayed upon detection
  522. and the system will stay locked up.
  523. The overhead should be minimal. A periodic hrtimer runs to
  524. generate interrupts and kick the watchdog task every 4 seconds.
  525. An NMI is generated every 10 seconds or so to check for hardlockups.
  526. The frequency of hrtimer and NMI events and the soft and hard lockup
  527. thresholds can be controlled through the sysctl watchdog_thresh.
  528. config HARDLOCKUP_DETECTOR
  529. def_bool y
  530. depends on LOCKUP_DETECTOR && !HAVE_NMI_WATCHDOG
  531. depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
  532. config BOOTPARAM_HARDLOCKUP_PANIC
  533. bool "Panic (Reboot) On Hard Lockups"
  534. depends on HARDLOCKUP_DETECTOR
  535. help
  536. Say Y here to enable the kernel to panic on "hard lockups",
  537. which are bugs that cause the kernel to loop in kernel
  538. mode with interrupts disabled for more than 10 seconds (configurable
  539. using the watchdog_thresh sysctl).
  540. Say N if unsure.
  541. config BOOTPARAM_HARDLOCKUP_PANIC_VALUE
  542. int
  543. depends on HARDLOCKUP_DETECTOR
  544. range 0 1
  545. default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
  546. default 1 if BOOTPARAM_HARDLOCKUP_PANIC
  547. config BOOTPARAM_SOFTLOCKUP_PANIC
  548. bool "Panic (Reboot) On Soft Lockups"
  549. depends on LOCKUP_DETECTOR
  550. help
  551. Say Y here to enable the kernel to panic on "soft lockups",
  552. which are bugs that cause the kernel to loop in kernel
  553. mode for more than 20 seconds (configurable using the watchdog_thresh
  554. sysctl), without giving other tasks a chance to run.
  555. The panic can be used in combination with panic_timeout,
  556. to cause the system to reboot automatically after a
  557. lockup has been detected. This feature is useful for
  558. high-availability systems that have uptime guarantees and
  559. where a lockup must be resolved ASAP.
  560. Say N if unsure.
  561. config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
  562. int
  563. depends on LOCKUP_DETECTOR
  564. range 0 1
  565. default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
  566. default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
  567. config DETECT_HUNG_TASK
  568. bool "Detect Hung Tasks"
  569. depends on DEBUG_KERNEL
  570. default LOCKUP_DETECTOR
  571. help
  572. Say Y here to enable the kernel to detect "hung tasks",
  573. which are bugs that cause the task to be stuck in
  574. uninterruptible "D" state indefinitiley.
  575. When a hung task is detected, the kernel will print the
  576. current stack trace (which you should report), but the
  577. task will stay in uninterruptible state. If lockdep is
  578. enabled then all held locks will also be reported. This
  579. feature has negligible overhead.
  580. config DEFAULT_HUNG_TASK_TIMEOUT
  581. int "Default timeout for hung task detection (in seconds)"
  582. depends on DETECT_HUNG_TASK
  583. default 120
  584. help
  585. This option controls the default timeout (in seconds) used
  586. to determine when a task has become non-responsive and should
  587. be considered hung.
  588. It can be adjusted at runtime via the kernel.hung_task_timeout_secs
  589. sysctl or by writing a value to
  590. /proc/sys/kernel/hung_task_timeout_secs.
  591. A timeout of 0 disables the check. The default is two minutes.
  592. Keeping the default should be fine in most cases.
  593. config BOOTPARAM_HUNG_TASK_PANIC
  594. bool "Panic (Reboot) On Hung Tasks"
  595. depends on DETECT_HUNG_TASK
  596. help
  597. Say Y here to enable the kernel to panic on "hung tasks",
  598. which are bugs that cause the kernel to leave a task stuck
  599. in uninterruptible "D" state.
  600. The panic can be used in combination with panic_timeout,
  601. to cause the system to reboot automatically after a
  602. hung task has been detected. This feature is useful for
  603. high-availability systems that have uptime guarantees and
  604. where a hung tasks must be resolved ASAP.
  605. Say N if unsure.
  606. config BOOTPARAM_HUNG_TASK_PANIC_VALUE
  607. int
  608. depends on DETECT_HUNG_TASK
  609. range 0 1
  610. default 0 if !BOOTPARAM_HUNG_TASK_PANIC
  611. default 1 if BOOTPARAM_HUNG_TASK_PANIC
  612. endmenu # "Debug lockups and hangs"
  613. config PANIC_ON_OOPS
  614. bool "Panic on Oops"
  615. help
  616. Say Y here to enable the kernel to panic when it oopses. This
  617. has the same effect as setting oops=panic on the kernel command
  618. line.
  619. This feature is useful to ensure that the kernel does not do
  620. anything erroneous after an oops which could result in data
  621. corruption or other issues.
  622. Say N if unsure.
  623. config PANIC_ON_OOPS_VALUE
  624. int
  625. range 0 1
  626. default 0 if !PANIC_ON_OOPS
  627. default 1 if PANIC_ON_OOPS
  628. config SCHED_DEBUG
  629. bool "Collect scheduler debugging info"
  630. depends on DEBUG_KERNEL && PROC_FS
  631. default y
  632. help
  633. If you say Y here, the /proc/sched_debug file will be provided
  634. that can help debug the scheduler. The runtime overhead of this
  635. option is minimal.
  636. config SCHEDSTATS
  637. bool "Collect scheduler statistics"
  638. depends on DEBUG_KERNEL && PROC_FS
  639. help
  640. If you say Y here, additional code will be inserted into the
  641. scheduler and related routines to collect statistics about
  642. scheduler behavior and provide them in /proc/schedstat. These
  643. stats may be useful for both tuning and debugging the scheduler
  644. If you aren't debugging the scheduler or trying to tune a specific
  645. application, you can say N to avoid the very slight overhead
  646. this adds.
  647. config TIMER_STATS
  648. bool "Collect kernel timers statistics"
  649. depends on DEBUG_KERNEL && PROC_FS
  650. help
  651. If you say Y here, additional code will be inserted into the
  652. timer routines to collect statistics about kernel timers being
  653. reprogrammed. The statistics can be read from /proc/timer_stats.
  654. The statistics collection is started by writing 1 to /proc/timer_stats,
  655. writing 0 stops it. This feature is useful to collect information
  656. about timer usage patterns in kernel and userspace. This feature
  657. is lightweight if enabled in the kernel config but not activated
  658. (it defaults to deactivated on bootup and will only be activated
  659. if some application like powertop activates it explicitly).
  660. config DEBUG_PREEMPT
  661. bool "Debug preemptible kernel"
  662. depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
  663. default y
  664. help
  665. If you say Y here then the kernel will use a debug variant of the
  666. commonly used smp_processor_id() function and will print warnings
  667. if kernel code uses it in a preemption-unsafe way. Also, the kernel
  668. will detect preemption count underflows.
  669. menu "Lock Debugging (spinlocks, mutexes, etc...)"
  670. config DEBUG_RT_MUTEXES
  671. bool "RT Mutex debugging, deadlock detection"
  672. depends on DEBUG_KERNEL && RT_MUTEXES
  673. help
  674. This allows rt mutex semantics violations and rt mutex related
  675. deadlocks (lockups) to be detected and reported automatically.
  676. config DEBUG_PI_LIST
  677. bool
  678. default y
  679. depends on DEBUG_RT_MUTEXES
  680. config RT_MUTEX_TESTER
  681. bool "Built-in scriptable tester for rt-mutexes"
  682. depends on DEBUG_KERNEL && RT_MUTEXES
  683. help
  684. This option enables a rt-mutex tester.
  685. config DEBUG_SPINLOCK
  686. bool "Spinlock and rw-lock debugging: basic checks"
  687. depends on DEBUG_KERNEL
  688. select UNINLINE_SPIN_UNLOCK
  689. help
  690. Say Y here and build SMP to catch missing spinlock initialization
  691. and certain other kinds of spinlock errors commonly made. This is
  692. best used in conjunction with the NMI watchdog so that spinlock
  693. deadlocks are also debuggable.
  694. config DEBUG_MUTEXES
  695. bool "Mutex debugging: basic checks"
  696. depends on DEBUG_KERNEL
  697. help
  698. This feature allows mutex semantics violations to be detected and
  699. reported.
  700. config DEBUG_WW_MUTEX_SLOWPATH
  701. bool "Wait/wound mutex debugging: Slowpath testing"
  702. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  703. select DEBUG_LOCK_ALLOC
  704. select DEBUG_SPINLOCK
  705. select DEBUG_MUTEXES
  706. help
  707. This feature enables slowpath testing for w/w mutex users by
  708. injecting additional -EDEADLK wound/backoff cases. Together with
  709. the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
  710. will test all possible w/w mutex interface abuse with the
  711. exception of simply not acquiring all the required locks.
  712. config DEBUG_LOCK_ALLOC
  713. bool "Lock debugging: detect incorrect freeing of live locks"
  714. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  715. select DEBUG_SPINLOCK
  716. select DEBUG_MUTEXES
  717. select LOCKDEP
  718. help
  719. This feature will check whether any held lock (spinlock, rwlock,
  720. mutex or rwsem) is incorrectly freed by the kernel, via any of the
  721. memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
  722. vfree(), etc.), whether a live lock is incorrectly reinitialized via
  723. spin_lock_init()/mutex_init()/etc., or whether there is any lock
  724. held during task exit.
  725. config PROVE_LOCKING
  726. bool "Lock debugging: prove locking correctness"
  727. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  728. select LOCKDEP
  729. select DEBUG_SPINLOCK
  730. select DEBUG_MUTEXES
  731. select DEBUG_LOCK_ALLOC
  732. select TRACE_IRQFLAGS
  733. default n
  734. help
  735. This feature enables the kernel to prove that all locking
  736. that occurs in the kernel runtime is mathematically
  737. correct: that under no circumstance could an arbitrary (and
  738. not yet triggered) combination of observed locking
  739. sequences (on an arbitrary number of CPUs, running an
  740. arbitrary number of tasks and interrupt contexts) cause a
  741. deadlock.
  742. In short, this feature enables the kernel to report locking
  743. related deadlocks before they actually occur.
  744. The proof does not depend on how hard and complex a
  745. deadlock scenario would be to trigger: how many
  746. participant CPUs, tasks and irq-contexts would be needed
  747. for it to trigger. The proof also does not depend on
  748. timing: if a race and a resulting deadlock is possible
  749. theoretically (no matter how unlikely the race scenario
  750. is), it will be proven so and will immediately be
  751. reported by the kernel (once the event is observed that
  752. makes the deadlock theoretically possible).
  753. If a deadlock is impossible (i.e. the locking rules, as
  754. observed by the kernel, are mathematically correct), the
  755. kernel reports nothing.
  756. NOTE: this feature can also be enabled for rwlocks, mutexes
  757. and rwsems - in which case all dependencies between these
  758. different locking variants are observed and mapped too, and
  759. the proof of observed correctness is also maintained for an
  760. arbitrary combination of these separate locking variants.
  761. For more details, see Documentation/lockdep-design.txt.
  762. config LOCKDEP
  763. bool
  764. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  765. select STACKTRACE
  766. select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC
  767. select KALLSYMS
  768. select KALLSYMS_ALL
  769. config LOCK_STAT
  770. bool "Lock usage statistics"
  771. depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  772. select LOCKDEP
  773. select DEBUG_SPINLOCK
  774. select DEBUG_MUTEXES
  775. select DEBUG_LOCK_ALLOC
  776. default n
  777. help
  778. This feature enables tracking lock contention points
  779. For more details, see Documentation/lockstat.txt
  780. This also enables lock events required by "perf lock",
  781. subcommand of perf.
  782. If you want to use "perf lock", you also need to turn on
  783. CONFIG_EVENT_TRACING.
  784. CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
  785. (CONFIG_LOCKDEP defines "acquire" and "release" events.)
  786. config DEBUG_LOCKDEP
  787. bool "Lock dependency engine debugging"
  788. depends on DEBUG_KERNEL && LOCKDEP
  789. help
  790. If you say Y here, the lock dependency engine will do
  791. additional runtime checks to debug itself, at the price
  792. of more runtime overhead.
  793. config DEBUG_ATOMIC_SLEEP
  794. bool "Sleep inside atomic section checking"
  795. select PREEMPT_COUNT
  796. depends on DEBUG_KERNEL
  797. help
  798. If you say Y here, various routines which may sleep will become very
  799. noisy if they are called inside atomic sections: when a spinlock is
  800. held, inside an rcu read side critical section, inside preempt disabled
  801. sections, inside an interrupt, etc...
  802. config DEBUG_LOCKING_API_SELFTESTS
  803. bool "Locking API boot-time self-tests"
  804. depends on DEBUG_KERNEL
  805. help
  806. Say Y here if you want the kernel to run a short self-test during
  807. bootup. The self-test checks whether common types of locking bugs
  808. are detected by debugging mechanisms or not. (if you disable
  809. lock debugging then those bugs wont be detected of course.)
  810. The following locking APIs are covered: spinlocks, rwlocks,
  811. mutexes and rwsems.
  812. endmenu # lock debugging
  813. config TRACE_IRQFLAGS
  814. bool
  815. help
  816. Enables hooks to interrupt enabling and disabling for
  817. either tracing or lock debugging.
  818. config STACKTRACE
  819. bool
  820. depends on STACKTRACE_SUPPORT
  821. config DEBUG_KOBJECT
  822. bool "kobject debugging"
  823. depends on DEBUG_KERNEL
  824. help
  825. If you say Y here, some extra kobject debugging messages will be sent
  826. to the syslog.
  827. config DEBUG_KOBJECT_RELEASE
  828. bool "kobject release debugging"
  829. depends on DEBUG_KERNEL
  830. help
  831. kobjects are reference counted objects. This means that their
  832. last reference count put is not predictable, and the kobject can
  833. live on past the point at which a driver decides to drop it's
  834. initial reference to the kobject gained on allocation. An
  835. example of this would be a struct device which has just been
  836. unregistered.
  837. However, some buggy drivers assume that after such an operation,
  838. the memory backing the kobject can be immediately freed. This
  839. goes completely against the principles of a refcounted object.
  840. If you say Y here, the kernel will delay the release of kobjects
  841. on the last reference count to improve the visibility of this
  842. kind of kobject release bug.
  843. config HAVE_DEBUG_BUGVERBOSE
  844. bool
  845. config DEBUG_BUGVERBOSE
  846. bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
  847. depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
  848. default y
  849. help
  850. Say Y here to make BUG() panics output the file name and line number
  851. of the BUG call as well as the EIP and oops trace. This aids
  852. debugging but costs about 70-100K of memory.
  853. config DEBUG_WRITECOUNT
  854. bool "Debug filesystem writers count"
  855. depends on DEBUG_KERNEL
  856. help
  857. Enable this to catch wrong use of the writers count in struct
  858. vfsmount. This will increase the size of each file struct by
  859. 32 bits.
  860. If unsure, say N.
  861. config DEBUG_LIST
  862. bool "Debug linked list manipulation"
  863. depends on DEBUG_KERNEL
  864. help
  865. Enable this to turn on extended checks in the linked-list
  866. walking routines.
  867. If unsure, say N.
  868. config DEBUG_SG
  869. bool "Debug SG table operations"
  870. depends on DEBUG_KERNEL
  871. help
  872. Enable this to turn on checks on scatter-gather tables. This can
  873. help find problems with drivers that do not properly initialize
  874. their sg tables.
  875. If unsure, say N.
  876. config DEBUG_NOTIFIERS
  877. bool "Debug notifier call chains"
  878. depends on DEBUG_KERNEL
  879. help
  880. Enable this to turn on sanity checking for notifier call chains.
  881. This is most useful for kernel developers to make sure that
  882. modules properly unregister themselves from notifier chains.
  883. This is a relatively cheap check but if you care about maximum
  884. performance, say N.
  885. config DEBUG_CREDENTIALS
  886. bool "Debug credential management"
  887. depends on DEBUG_KERNEL
  888. help
  889. Enable this to turn on some debug checking for credential
  890. management. The additional code keeps track of the number of
  891. pointers from task_structs to any given cred struct, and checks to
  892. see that this number never exceeds the usage count of the cred
  893. struct.
  894. Furthermore, if SELinux is enabled, this also checks that the
  895. security pointer in the cred struct is never seen to be invalid.
  896. If unsure, say N.
  897. menu "RCU Debugging"
  898. config PROVE_RCU
  899. bool "RCU debugging: prove RCU correctness"
  900. depends on PROVE_LOCKING
  901. default n
  902. help
  903. This feature enables lockdep extensions that check for correct
  904. use of RCU APIs. This is currently under development. Say Y
  905. if you want to debug RCU usage or help work on the PROVE_RCU
  906. feature.
  907. Say N if you are unsure.
  908. config PROVE_RCU_REPEATEDLY
  909. bool "RCU debugging: don't disable PROVE_RCU on first splat"
  910. depends on PROVE_RCU
  911. default n
  912. help
  913. By itself, PROVE_RCU will disable checking upon issuing the
  914. first warning (or "splat"). This feature prevents such
  915. disabling, allowing multiple RCU-lockdep warnings to be printed
  916. on a single reboot.
  917. Say Y to allow multiple RCU-lockdep warnings per boot.
  918. Say N if you are unsure.
  919. config PROVE_RCU_DELAY
  920. bool "RCU debugging: preemptible RCU race provocation"
  921. depends on DEBUG_KERNEL && PREEMPT_RCU
  922. default n
  923. help
  924. There is a class of races that involve an unlikely preemption
  925. of __rcu_read_unlock() just after ->rcu_read_lock_nesting has
  926. been set to INT_MIN. This feature inserts a delay at that
  927. point to increase the probability of these races.
  928. Say Y to increase probability of preemption of __rcu_read_unlock().
  929. Say N if you are unsure.
  930. config SPARSE_RCU_POINTER
  931. bool "RCU debugging: sparse-based checks for pointer usage"
  932. default n
  933. help
  934. This feature enables the __rcu sparse annotation for
  935. RCU-protected pointers. This annotation will cause sparse
  936. to flag any non-RCU used of annotated pointers. This can be
  937. helpful when debugging RCU usage. Please note that this feature
  938. is not intended to enforce code cleanliness; it is instead merely
  939. a debugging aid.
  940. Say Y to make sparse flag questionable use of RCU-protected pointers
  941. Say N if you are unsure.
  942. config RCU_TORTURE_TEST
  943. tristate "torture tests for RCU"
  944. depends on DEBUG_KERNEL
  945. default n
  946. help
  947. This option provides a kernel module that runs torture tests
  948. on the RCU infrastructure. The kernel module may be built
  949. after the fact on the running kernel to be tested, if desired.
  950. Say Y here if you want RCU torture tests to be built into
  951. the kernel.
  952. Say M if you want the RCU torture tests to build as a module.
  953. Say N if you are unsure.
  954. config RCU_TORTURE_TEST_RUNNABLE
  955. bool "torture tests for RCU runnable by default"
  956. depends on RCU_TORTURE_TEST = y
  957. default n
  958. help
  959. This option provides a way to build the RCU torture tests
  960. directly into the kernel without them starting up at boot
  961. time. You can use /proc/sys/kernel/rcutorture_runnable
  962. to manually override this setting. This /proc file is
  963. available only when the RCU torture tests have been built
  964. into the kernel.
  965. Say Y here if you want the RCU torture tests to start during
  966. boot (you probably don't).
  967. Say N here if you want the RCU torture tests to start only
  968. after being manually enabled via /proc.
  969. config RCU_CPU_STALL_TIMEOUT
  970. int "RCU CPU stall timeout in seconds"
  971. depends on RCU_STALL_COMMON
  972. range 3 300
  973. default 21
  974. help
  975. If a given RCU grace period extends more than the specified
  976. number of seconds, a CPU stall warning is printed. If the
  977. RCU grace period persists, additional CPU stall warnings are
  978. printed at more widely spaced intervals.
  979. config RCU_CPU_STALL_VERBOSE
  980. bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
  981. depends on TREE_PREEMPT_RCU
  982. default y
  983. help
  984. This option causes RCU to printk detailed per-task information
  985. for any tasks that are stalling the current RCU grace period.
  986. Say N if you are unsure.
  987. Say Y if you want to enable such checks.
  988. config RCU_CPU_STALL_INFO
  989. bool "Print additional diagnostics on RCU CPU stall"
  990. depends on (TREE_RCU || TREE_PREEMPT_RCU) && DEBUG_KERNEL
  991. default n
  992. help
  993. For each stalled CPU that is aware of the current RCU grace
  994. period, print out additional per-CPU diagnostic information
  995. regarding scheduling-clock ticks, idle state, and,
  996. for RCU_FAST_NO_HZ kernels, idle-entry state.
  997. Say N if you are unsure.
  998. Say Y if you want to enable such diagnostics.
  999. config RCU_TRACE
  1000. bool "Enable tracing for RCU"
  1001. depends on DEBUG_KERNEL
  1002. select TRACE_CLOCK
  1003. help
  1004. This option provides tracing in RCU which presents stats
  1005. in debugfs for debugging RCU implementation.
  1006. Say Y here if you want to enable RCU tracing
  1007. Say N if you are unsure.
  1008. endmenu # "RCU Debugging"
  1009. config DEBUG_BLOCK_EXT_DEVT
  1010. bool "Force extended block device numbers and spread them"
  1011. depends on DEBUG_KERNEL
  1012. depends on BLOCK
  1013. default n
  1014. help
  1015. BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
  1016. SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
  1017. YOU ARE DOING. Distros, please enable this and fix whatever
  1018. is broken.
  1019. Conventionally, block device numbers are allocated from
  1020. predetermined contiguous area. However, extended block area
  1021. may introduce non-contiguous block device numbers. This
  1022. option forces most block device numbers to be allocated from
  1023. the extended space and spreads them to discover kernel or
  1024. userland code paths which assume predetermined contiguous
  1025. device number allocation.
  1026. Note that turning on this debug option shuffles all the
  1027. device numbers for all IDE and SCSI devices including libata
  1028. ones, so root partition specified using device number
  1029. directly (via rdev or root=MAJ:MIN) won't work anymore.
  1030. Textual device names (root=/dev/sdXn) will continue to work.
  1031. Say N if you are unsure.
  1032. config NOTIFIER_ERROR_INJECTION
  1033. tristate "Notifier error injection"
  1034. depends on DEBUG_KERNEL
  1035. select DEBUG_FS
  1036. help
  1037. This option provides the ability to inject artificial errors to
  1038. specified notifier chain callbacks. It is useful to test the error
  1039. handling of notifier call chain failures.
  1040. Say N if unsure.
  1041. config CPU_NOTIFIER_ERROR_INJECT
  1042. tristate "CPU notifier error injection module"
  1043. depends on HOTPLUG_CPU && NOTIFIER_ERROR_INJECTION
  1044. help
  1045. This option provides a kernel module that can be used to test
  1046. the error handling of the cpu notifiers by injecting artificial
  1047. errors to CPU notifier chain callbacks. It is controlled through
  1048. debugfs interface under /sys/kernel/debug/notifier-error-inject/cpu
  1049. If the notifier call chain should be failed with some events
  1050. notified, write the error code to "actions/<notifier event>/error".
  1051. Example: Inject CPU offline error (-1 == -EPERM)
  1052. # cd /sys/kernel/debug/notifier-error-inject/cpu
  1053. # echo -1 > actions/CPU_DOWN_PREPARE/error
  1054. # echo 0 > /sys/devices/system/cpu/cpu1/online
  1055. bash: echo: write error: Operation not permitted
  1056. To compile this code as a module, choose M here: the module will
  1057. be called cpu-notifier-error-inject.
  1058. If unsure, say N.
  1059. config PM_NOTIFIER_ERROR_INJECT
  1060. tristate "PM notifier error injection module"
  1061. depends on PM && NOTIFIER_ERROR_INJECTION
  1062. default m if PM_DEBUG
  1063. help
  1064. This option provides the ability to inject artificial errors to
  1065. PM notifier chain callbacks. It is controlled through debugfs
  1066. interface /sys/kernel/debug/notifier-error-inject/pm
  1067. If the notifier call chain should be failed with some events
  1068. notified, write the error code to "actions/<notifier event>/error".
  1069. Example: Inject PM suspend error (-12 = -ENOMEM)
  1070. # cd /sys/kernel/debug/notifier-error-inject/pm/
  1071. # echo -12 > actions/PM_SUSPEND_PREPARE/error
  1072. # echo mem > /sys/power/state
  1073. bash: echo: write error: Cannot allocate memory
  1074. To compile this code as a module, choose M here: the module will
  1075. be called pm-notifier-error-inject.
  1076. If unsure, say N.
  1077. config OF_RECONFIG_NOTIFIER_ERROR_INJECT
  1078. tristate "OF reconfig notifier error injection module"
  1079. depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
  1080. help
  1081. This option provides the ability to inject artificial errors to
  1082. OF reconfig notifier chain callbacks. It is controlled
  1083. through debugfs interface under
  1084. /sys/kernel/debug/notifier-error-inject/OF-reconfig/
  1085. If the notifier call chain should be failed with some events
  1086. notified, write the error code to "actions/<notifier event>/error".
  1087. To compile this code as a module, choose M here: the module will
  1088. be called of-reconfig-notifier-error-inject.
  1089. If unsure, say N.
  1090. config FAULT_INJECTION
  1091. bool "Fault-injection framework"
  1092. depends on DEBUG_KERNEL
  1093. help
  1094. Provide fault-injection framework.
  1095. For more details, see Documentation/fault-injection/.
  1096. config FAILSLAB
  1097. bool "Fault-injection capability for kmalloc"
  1098. depends on FAULT_INJECTION
  1099. depends on SLAB || SLUB
  1100. help
  1101. Provide fault-injection capability for kmalloc.
  1102. config FAIL_PAGE_ALLOC
  1103. bool "Fault-injection capabilitiy for alloc_pages()"
  1104. depends on FAULT_INJECTION
  1105. help
  1106. Provide fault-injection capability for alloc_pages().
  1107. config FAIL_MAKE_REQUEST
  1108. bool "Fault-injection capability for disk IO"
  1109. depends on FAULT_INJECTION && BLOCK
  1110. help
  1111. Provide fault-injection capability for disk IO.
  1112. config FAIL_IO_TIMEOUT
  1113. bool "Fault-injection capability for faking disk interrupts"
  1114. depends on FAULT_INJECTION && BLOCK
  1115. help
  1116. Provide fault-injection capability on end IO handling. This
  1117. will make the block layer "forget" an interrupt as configured,
  1118. thus exercising the error handling.
  1119. Only works with drivers that use the generic timeout handling,
  1120. for others it wont do anything.
  1121. config FAIL_MMC_REQUEST
  1122. bool "Fault-injection capability for MMC IO"
  1123. select DEBUG_FS
  1124. depends on FAULT_INJECTION && MMC
  1125. help
  1126. Provide fault-injection capability for MMC IO.
  1127. This will make the mmc core return data errors. This is
  1128. useful to test the error handling in the mmc block device
  1129. and to test how the mmc host driver handles retries from
  1130. the block device.
  1131. config FAULT_INJECTION_DEBUG_FS
  1132. bool "Debugfs entries for fault-injection capabilities"
  1133. depends on FAULT_INJECTION && SYSFS && DEBUG_FS
  1134. help
  1135. Enable configuration of fault-injection capabilities via debugfs.
  1136. config FAULT_INJECTION_STACKTRACE_FILTER
  1137. bool "stacktrace filter for fault-injection capabilities"
  1138. depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
  1139. depends on !X86_64
  1140. select STACKTRACE
  1141. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
  1142. help
  1143. Provide stacktrace filter for fault-injection capabilities
  1144. config LATENCYTOP
  1145. bool "Latency measuring infrastructure"
  1146. depends on HAVE_LATENCYTOP_SUPPORT
  1147. depends on DEBUG_KERNEL
  1148. depends on STACKTRACE_SUPPORT
  1149. depends on PROC_FS
  1150. select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
  1151. select KALLSYMS
  1152. select KALLSYMS_ALL
  1153. select STACKTRACE
  1154. select SCHEDSTATS
  1155. select SCHED_DEBUG
  1156. help
  1157. Enable this option if you want to use the LatencyTOP tool
  1158. to find out which userspace is blocking on what kernel operations.
  1159. config ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
  1160. bool
  1161. config DEBUG_STRICT_USER_COPY_CHECKS
  1162. bool "Strict user copy size checks"
  1163. depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
  1164. depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
  1165. help
  1166. Enabling this option turns a certain set of sanity checks for user
  1167. copy operations into compile time failures.
  1168. The copy_from_user() etc checks are there to help test if there
  1169. are sufficient security checks on the length argument of
  1170. the copy operation, by having gcc prove that the argument is
  1171. within bounds.
  1172. If unsure, say N.
  1173. source kernel/trace/Kconfig
  1174. menu "Runtime Testing"
  1175. config LKDTM
  1176. tristate "Linux Kernel Dump Test Tool Module"
  1177. depends on DEBUG_FS
  1178. depends on BLOCK
  1179. default n
  1180. help
  1181. This module enables testing of the different dumping mechanisms by
  1182. inducing system failures at predefined crash points.
  1183. If you don't need it: say N
  1184. Choose M here to compile this code as a module. The module will be
  1185. called lkdtm.
  1186. Documentation on how to use the module can be found in
  1187. Documentation/fault-injection/provoke-crashes.txt
  1188. config TEST_LIST_SORT
  1189. bool "Linked list sorting test"
  1190. depends on DEBUG_KERNEL
  1191. help
  1192. Enable this to turn on 'list_sort()' function test. This test is
  1193. executed only once during system boot, so affects only boot time.
  1194. If unsure, say N.
  1195. config KPROBES_SANITY_TEST
  1196. bool "Kprobes sanity tests"
  1197. depends on DEBUG_KERNEL
  1198. depends on KPROBES
  1199. default n
  1200. help
  1201. This option provides for testing basic kprobes functionality on
  1202. boot. A sample kprobe, jprobe and kretprobe are inserted and
  1203. verified for functionality.
  1204. Say N if you are unsure.
  1205. config BACKTRACE_SELF_TEST
  1206. tristate "Self test for the backtrace code"
  1207. depends on DEBUG_KERNEL
  1208. default n
  1209. help
  1210. This option provides a kernel module that can be used to test
  1211. the kernel stack backtrace code. This option is not useful
  1212. for distributions or general kernels, but only for kernel
  1213. developers working on architecture code.
  1214. Note that if you want to also test saved backtraces, you will
  1215. have to enable STACKTRACE as well.
  1216. Say N if you are unsure.
  1217. config RBTREE_TEST
  1218. tristate "Red-Black tree test"
  1219. depends on m && DEBUG_KERNEL
  1220. help
  1221. A benchmark measuring the performance of the rbtree library.
  1222. Also includes rbtree invariant checks.
  1223. config INTERVAL_TREE_TEST
  1224. tristate "Interval tree test"
  1225. depends on m && DEBUG_KERNEL
  1226. help
  1227. A benchmark measuring the performance of the interval tree library
  1228. config ATOMIC64_SELFTEST
  1229. bool "Perform an atomic64_t self-test at boot"
  1230. help
  1231. Enable this option to test the atomic64_t functions at boot.
  1232. If unsure, say N.
  1233. config ASYNC_RAID6_TEST
  1234. tristate "Self test for hardware accelerated raid6 recovery"
  1235. depends on ASYNC_RAID6_RECOV
  1236. select ASYNC_MEMCPY
  1237. ---help---
  1238. This is a one-shot self test that permutes through the
  1239. recovery of all the possible two disk failure scenarios for a
  1240. N-disk array. Recovery is performed with the asynchronous
  1241. raid6 recovery routines, and will optionally use an offload
  1242. engine if one is available.
  1243. If unsure, say N.
  1244. config TEST_STRING_HELPERS
  1245. tristate "Test functions located in the string_helpers module at runtime"
  1246. config TEST_KSTRTOX
  1247. tristate "Test kstrto*() family of functions at runtime"
  1248. endmenu # runtime tests
  1249. config PROVIDE_OHCI1394_DMA_INIT
  1250. bool "Remote debugging over FireWire early on boot"
  1251. depends on PCI && X86
  1252. help
  1253. If you want to debug problems which hang or crash the kernel early
  1254. on boot and the crashing machine has a FireWire port, you can use
  1255. this feature to remotely access the memory of the crashed machine
  1256. over FireWire. This employs remote DMA as part of the OHCI1394
  1257. specification which is now the standard for FireWire controllers.
  1258. With remote DMA, you can monitor the printk buffer remotely using
  1259. firescope and access all memory below 4GB using fireproxy from gdb.
  1260. Even controlling a kernel debugger is possible using remote DMA.
  1261. Usage:
  1262. If ohci1394_dma=early is used as boot parameter, it will initialize
  1263. all OHCI1394 controllers which are found in the PCI config space.
  1264. As all changes to the FireWire bus such as enabling and disabling
  1265. devices cause a bus reset and thereby disable remote DMA for all
  1266. devices, be sure to have the cable plugged and FireWire enabled on
  1267. the debugging host before booting the debug target for debugging.
  1268. This code (~1k) is freed after boot. By then, the firewire stack
  1269. in charge of the OHCI-1394 controllers should be used instead.
  1270. See Documentation/debugging-via-ohci1394.txt for more information.
  1271. config FIREWIRE_OHCI_REMOTE_DMA
  1272. bool "Remote debugging over FireWire with firewire-ohci"
  1273. depends on FIREWIRE_OHCI
  1274. help
  1275. This option lets you use the FireWire bus for remote debugging
  1276. with help of the firewire-ohci driver. It enables unfiltered
  1277. remote DMA in firewire-ohci.
  1278. See Documentation/debugging-via-ohci1394.txt for more information.
  1279. If unsure, say N.
  1280. config BUILD_DOCSRC
  1281. bool "Build targets in Documentation/ tree"
  1282. depends on HEADERS_CHECK
  1283. help
  1284. This option attempts to build objects from the source files in the
  1285. kernel Documentation/ tree.
  1286. Say N if you are unsure.
  1287. config DMA_API_DEBUG
  1288. bool "Enable debugging of DMA-API usage"
  1289. depends on HAVE_DMA_API_DEBUG
  1290. help
  1291. Enable this option to debug the use of the DMA API by device drivers.
  1292. With this option you will be able to detect common bugs in device
  1293. drivers like double-freeing of DMA mappings or freeing mappings that
  1294. were never allocated.
  1295. This option causes a performance degredation. Use only if you want
  1296. to debug device drivers. If unsure, say N.
  1297. source "samples/Kconfig"
  1298. source "lib/Kconfig.kgdb"