1604ff0dcSDave Hansenmenu "printk and dmesg options" 21da177e4SLinus Torvalds 31da177e4SLinus Torvaldsconfig PRINTK_TIME 41da177e4SLinus Torvalds bool "Show timing information on printks" 5d3b8b6e5SRandy Dunlap depends on PRINTK 61da177e4SLinus Torvalds help 7649e6ee3SKay Sievers Selecting this option causes time stamps of the printk() 8649e6ee3SKay Sievers messages to be added to the output of the syslog() system 9649e6ee3SKay Sievers call and at the console. 10649e6ee3SKay Sievers 11649e6ee3SKay Sievers The timestamp is always recorded internally, and exported 12649e6ee3SKay Sievers to /dev/kmsg. This flag just specifies if the timestamp should 13649e6ee3SKay Sievers be included, not that the timestamp is recorded. 14649e6ee3SKay Sievers 15649e6ee3SKay Sievers The behavior is also controlled by the kernel command line 16649e6ee3SKay Sievers parameter printk.time=1. See Documentation/kernel-parameters.txt 171da177e4SLinus Torvalds 1842a9dc0bSAlex Elderconfig MESSAGE_LOGLEVEL_DEFAULT 195af5bcb8SMandeep Singh Baines int "Default message log level (1-7)" 205af5bcb8SMandeep Singh Baines range 1 7 215af5bcb8SMandeep Singh Baines default "4" 225af5bcb8SMandeep Singh Baines help 235af5bcb8SMandeep Singh Baines Default log level for printk statements with no specified priority. 245af5bcb8SMandeep Singh Baines 255af5bcb8SMandeep Singh Baines This was hard-coded to KERN_WARNING since at least 2.6.10 but folks 265af5bcb8SMandeep Singh Baines that are auditing their logs closely may want to set it to a lower 275af5bcb8SMandeep Singh Baines priority. 285af5bcb8SMandeep Singh Baines 29604ff0dcSDave Hansenconfig BOOT_PRINTK_DELAY 30604ff0dcSDave Hansen bool "Delay each boot printk message by N milliseconds" 31604ff0dcSDave Hansen depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY 32604ff0dcSDave Hansen help 33604ff0dcSDave Hansen This build option allows you to read kernel boot messages 34604ff0dcSDave Hansen by inserting a short delay after each one. The delay is 35604ff0dcSDave Hansen specified in milliseconds on the kernel command line, 36604ff0dcSDave Hansen using "boot_delay=N". 37604ff0dcSDave Hansen 38604ff0dcSDave Hansen It is likely that you would also need to use "lpj=M" to preset 39604ff0dcSDave Hansen the "loops per jiffie" value. 40604ff0dcSDave Hansen See a previous boot log for the "lpj" value to use for your 41604ff0dcSDave Hansen system, and then set "lpj=M" before setting "boot_delay=N". 42604ff0dcSDave Hansen NOTE: Using this option may adversely affect SMP systems. 43604ff0dcSDave Hansen I.e., processors other than the first one may not boot up. 44604ff0dcSDave Hansen BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect 45604ff0dcSDave Hansen what it believes to be lockup conditions. 46604ff0dcSDave Hansen 47604ff0dcSDave Hansenconfig DYNAMIC_DEBUG 48604ff0dcSDave Hansen bool "Enable dynamic printk() support" 49604ff0dcSDave Hansen default n 50604ff0dcSDave Hansen depends on PRINTK 51604ff0dcSDave Hansen depends on DEBUG_FS 52604ff0dcSDave Hansen help 53604ff0dcSDave Hansen 54604ff0dcSDave Hansen Compiles debug level messages into the kernel, which would not 55604ff0dcSDave Hansen otherwise be available at runtime. These messages can then be 56604ff0dcSDave Hansen enabled/disabled based on various levels of scope - per source file, 57604ff0dcSDave Hansen function, module, format string, and line number. This mechanism 58604ff0dcSDave Hansen implicitly compiles in all pr_debug() and dev_dbg() calls, which 59604ff0dcSDave Hansen enlarges the kernel text size by about 2%. 60604ff0dcSDave Hansen 61604ff0dcSDave Hansen If a source file is compiled with DEBUG flag set, any 62604ff0dcSDave Hansen pr_debug() calls in it are enabled by default, but can be 63604ff0dcSDave Hansen disabled at runtime as below. Note that DEBUG flag is 64604ff0dcSDave Hansen turned on by many CONFIG_*DEBUG* options. 65604ff0dcSDave Hansen 66604ff0dcSDave Hansen Usage: 67604ff0dcSDave Hansen 68604ff0dcSDave Hansen Dynamic debugging is controlled via the 'dynamic_debug/control' file, 69604ff0dcSDave Hansen which is contained in the 'debugfs' filesystem. Thus, the debugfs 70604ff0dcSDave Hansen filesystem must first be mounted before making use of this feature. 71604ff0dcSDave Hansen We refer the control file as: <debugfs>/dynamic_debug/control. This 72604ff0dcSDave Hansen file contains a list of the debug statements that can be enabled. The 73604ff0dcSDave Hansen format for each line of the file is: 74604ff0dcSDave Hansen 75604ff0dcSDave Hansen filename:lineno [module]function flags format 76604ff0dcSDave Hansen 77604ff0dcSDave Hansen filename : source file of the debug statement 78604ff0dcSDave Hansen lineno : line number of the debug statement 79604ff0dcSDave Hansen module : module that contains the debug statement 80604ff0dcSDave Hansen function : function that contains the debug statement 81604ff0dcSDave Hansen flags : '=p' means the line is turned 'on' for printing 82604ff0dcSDave Hansen format : the format used for the debug statement 83604ff0dcSDave Hansen 84604ff0dcSDave Hansen From a live system: 85604ff0dcSDave Hansen 86604ff0dcSDave Hansen nullarbor:~ # cat <debugfs>/dynamic_debug/control 87604ff0dcSDave Hansen # filename:lineno [module]function flags format 88604ff0dcSDave Hansen fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012" 89604ff0dcSDave Hansen fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012" 90604ff0dcSDave Hansen fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012" 91604ff0dcSDave Hansen 92604ff0dcSDave Hansen Example usage: 93604ff0dcSDave Hansen 94604ff0dcSDave Hansen // enable the message at line 1603 of file svcsock.c 95604ff0dcSDave Hansen nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' > 96604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 97604ff0dcSDave Hansen 98604ff0dcSDave Hansen // enable all the messages in file svcsock.c 99604ff0dcSDave Hansen nullarbor:~ # echo -n 'file svcsock.c +p' > 100604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 101604ff0dcSDave Hansen 102604ff0dcSDave Hansen // enable all the messages in the NFS server module 103604ff0dcSDave Hansen nullarbor:~ # echo -n 'module nfsd +p' > 104604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 105604ff0dcSDave Hansen 106604ff0dcSDave Hansen // enable all 12 messages in the function svc_process() 107604ff0dcSDave Hansen nullarbor:~ # echo -n 'func svc_process +p' > 108604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 109604ff0dcSDave Hansen 110604ff0dcSDave Hansen // disable all 12 messages in the function svc_process() 111604ff0dcSDave Hansen nullarbor:~ # echo -n 'func svc_process -p' > 112604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 113604ff0dcSDave Hansen 114604ff0dcSDave Hansen See Documentation/dynamic-debug-howto.txt for additional information. 115604ff0dcSDave Hansen 116604ff0dcSDave Hansenendmenu # "printk and dmesg options" 117604ff0dcSDave Hansen 1186dfc0665SDave Hansenmenu "Compile-time checks and compiler options" 1196dfc0665SDave Hansen 1206dfc0665SDave Hansenconfig DEBUG_INFO 1216dfc0665SDave Hansen bool "Compile the kernel with debug info" 12212b13835SLinus Torvalds depends on DEBUG_KERNEL && !COMPILE_TEST 1236dfc0665SDave Hansen help 1246dfc0665SDave Hansen If you say Y here the resulting kernel image will include 1256dfc0665SDave Hansen debugging info resulting in a larger kernel image. 1266dfc0665SDave Hansen This adds debug symbols to the kernel and modules (gcc -g), and 1276dfc0665SDave Hansen is needed if you intend to use kernel crashdump or binary object 1286dfc0665SDave Hansen tools like crash, kgdb, LKCD, gdb, etc on the kernel. 1296dfc0665SDave Hansen Say Y here only if you plan to debug the kernel. 1306dfc0665SDave Hansen 1316dfc0665SDave Hansen If unsure, say N. 1326dfc0665SDave Hansen 1336dfc0665SDave Hansenconfig DEBUG_INFO_REDUCED 1346dfc0665SDave Hansen bool "Reduce debugging information" 1356dfc0665SDave Hansen depends on DEBUG_INFO 1366dfc0665SDave Hansen help 1376dfc0665SDave Hansen If you say Y here gcc is instructed to generate less debugging 1386dfc0665SDave Hansen information for structure types. This means that tools that 1396dfc0665SDave Hansen need full debugging information (like kgdb or systemtap) won't 1406dfc0665SDave Hansen be happy. But if you merely need debugging information to 1416dfc0665SDave Hansen resolve line numbers there is no loss. Advantage is that 1426dfc0665SDave Hansen build directory object sizes shrink dramatically over a full 1436dfc0665SDave Hansen DEBUG_INFO build and compile times are reduced too. 1446dfc0665SDave Hansen Only works with newer gcc versions. 1456dfc0665SDave Hansen 146866ced95SAndi Kleenconfig DEBUG_INFO_SPLIT 147866ced95SAndi Kleen bool "Produce split debuginfo in .dwo files" 148866ced95SAndi Kleen depends on DEBUG_INFO 149866ced95SAndi Kleen help 150866ced95SAndi Kleen Generate debug info into separate .dwo files. This significantly 151866ced95SAndi Kleen reduces the build directory size for builds with DEBUG_INFO, 152866ced95SAndi Kleen because it stores the information only once on disk in .dwo 153866ced95SAndi Kleen files instead of multiple times in object files and executables. 154866ced95SAndi Kleen In addition the debug information is also compressed. 155866ced95SAndi Kleen 156866ced95SAndi Kleen Requires recent gcc (4.7+) and recent gdb/binutils. 157866ced95SAndi Kleen Any tool that packages or reads debug information would need 158866ced95SAndi Kleen to know about the .dwo files and include them. 159866ced95SAndi Kleen Incompatible with older versions of ccache. 160866ced95SAndi Kleen 161bfaf2dd3SAndi Kleenconfig DEBUG_INFO_DWARF4 162bfaf2dd3SAndi Kleen bool "Generate dwarf4 debuginfo" 163bfaf2dd3SAndi Kleen depends on DEBUG_INFO 164bfaf2dd3SAndi Kleen help 165bfaf2dd3SAndi Kleen Generate dwarf4 debug info. This requires recent versions 166bfaf2dd3SAndi Kleen of gcc and gdb. It makes the debug information larger. 167bfaf2dd3SAndi Kleen But it significantly improves the success of resolving 168bfaf2dd3SAndi Kleen variables in gdb on optimized code. 169bfaf2dd3SAndi Kleen 1703ee7b3faSJan Kiszkaconfig GDB_SCRIPTS 1713ee7b3faSJan Kiszka bool "Provide GDB scripts for kernel debugging" 1723ee7b3faSJan Kiszka depends on DEBUG_INFO 1733ee7b3faSJan Kiszka help 1743ee7b3faSJan Kiszka This creates the required links to GDB helper scripts in the 1753ee7b3faSJan Kiszka build directory. If you load vmlinux into gdb, the helper 1763ee7b3faSJan Kiszka scripts will be automatically imported by gdb as well, and 1773ee7b3faSJan Kiszka additional functions are available to analyze a Linux kernel 1783ee7b3faSJan Kiszka instance. See Documentation/gdb-kernel-debugging.txt for further 1793ee7b3faSJan Kiszka details. 1803ee7b3faSJan Kiszka 181de488443SJeff Garzikconfig ENABLE_WARN_DEPRECATED 182de488443SJeff Garzik bool "Enable __deprecated logic" 183de488443SJeff Garzik default y 184de488443SJeff Garzik help 185de488443SJeff Garzik Enable the __deprecated logic in the kernel build. 186de488443SJeff Garzik Disable this to suppress the "warning: 'foo' is deprecated 187de488443SJeff Garzik (declared at kernel/power/somefile.c:1234)" messages. 188de488443SJeff Garzik 189cebc04baSAndrew Mortonconfig ENABLE_MUST_CHECK 190cebc04baSAndrew Morton bool "Enable __must_check logic" 191cebc04baSAndrew Morton default y 192cebc04baSAndrew Morton help 193cebc04baSAndrew Morton Enable the __must_check logic in the kernel build. Disable this to 194cebc04baSAndrew Morton suppress the "warning: ignoring return value of 'foo', declared with 195cebc04baSAndrew Morton attribute warn_unused_result" messages. 1961da177e4SLinus Torvalds 19735bb5b1eSAndi Kleenconfig FRAME_WARN 19835bb5b1eSAndi Kleen int "Warn for stack frames larger than (needs gcc 4.4)" 19935bb5b1eSAndi Kleen range 0 8192 20035bb5b1eSAndi Kleen default 1024 if !64BIT 20135bb5b1eSAndi Kleen default 2048 if 64BIT 20235bb5b1eSAndi Kleen help 20335bb5b1eSAndi Kleen Tell gcc to warn at build time for stack frames larger than this. 20435bb5b1eSAndi Kleen Setting this too low will cause a lot of warnings. 20535bb5b1eSAndi Kleen Setting it to 0 disables the warning. 20635bb5b1eSAndi Kleen Requires gcc 4.4 20735bb5b1eSAndi Kleen 20899657c78SRandy Dunlapconfig STRIP_ASM_SYMS 20999657c78SRandy Dunlap bool "Strip assembler-generated symbols during link" 21099657c78SRandy Dunlap default n 21199657c78SRandy Dunlap help 21299657c78SRandy Dunlap Strip internal assembler-generated symbols during a link (symbols 21399657c78SRandy Dunlap that look like '.Lxxx') so they don't pollute the output of 21499657c78SRandy Dunlap get_wchan() and suchlike. 21599657c78SRandy Dunlap 2161873e870SAndi Kleenconfig READABLE_ASM 2171873e870SAndi Kleen bool "Generate readable assembler code" 2181873e870SAndi Kleen depends on DEBUG_KERNEL 2191873e870SAndi Kleen help 2201873e870SAndi Kleen Disable some compiler optimizations that tend to generate human unreadable 2211873e870SAndi Kleen assembler output. This may make the kernel slightly slower, but it helps 2221873e870SAndi Kleen to keep kernel developers who have to stare a lot at assembler listings 2231873e870SAndi Kleen sane. 2241873e870SAndi Kleen 225f71d20e9SArjan van de Venconfig UNUSED_SYMBOLS 226f71d20e9SArjan van de Ven bool "Enable unused/obsolete exported symbols" 227f71d20e9SArjan van de Ven default y if X86 228f71d20e9SArjan van de Ven help 229f71d20e9SArjan van de Ven Unused but exported symbols make the kernel needlessly bigger. For 230f71d20e9SArjan van de Ven that reason most of these unused exports will soon be removed. This 231f71d20e9SArjan van de Ven option is provided temporarily to provide a transition period in case 232f71d20e9SArjan van de Ven some external kernel module needs one of these symbols anyway. If you 233f71d20e9SArjan van de Ven encounter such a case in your module, consider if you are actually 234f71d20e9SArjan van de Ven using the right API. (rationale: since nobody in the kernel is using 235f71d20e9SArjan van de Ven this in a module, there is a pretty good chance it's actually the 236f71d20e9SArjan van de Ven wrong interface to use). If you really need the symbol, please send a 237f71d20e9SArjan van de Ven mail to the linux kernel mailing list mentioning the symbol and why 238f71d20e9SArjan van de Ven you really need it, and what the merge plan to the mainline kernel for 239f71d20e9SArjan van de Ven your module is. 240f71d20e9SArjan van de Ven 24148c96a36SJoonsoo Kimconfig PAGE_OWNER 24248c96a36SJoonsoo Kim bool "Track page owner" 24348c96a36SJoonsoo Kim depends on DEBUG_KERNEL && STACKTRACE_SUPPORT 24448c96a36SJoonsoo Kim select DEBUG_FS 24548c96a36SJoonsoo Kim select STACKTRACE 24648c96a36SJoonsoo Kim select PAGE_EXTENSION 24748c96a36SJoonsoo Kim help 24848c96a36SJoonsoo Kim This keeps track of what call chain is the owner of a page, may 24948c96a36SJoonsoo Kim help to find bare alloc_page(s) leaks. Even if you include this 25048c96a36SJoonsoo Kim feature on your build, it is disabled in default. You should pass 25148c96a36SJoonsoo Kim "page_owner=on" to boot parameter in order to enable it. Eats 25248c96a36SJoonsoo Kim a fair amount of memory if enabled. See tools/vm/page_owner_sort.c 25348c96a36SJoonsoo Kim for user-space helper. 25448c96a36SJoonsoo Kim 25548c96a36SJoonsoo Kim If unsure, say N. 25648c96a36SJoonsoo Kim 257bf4735a4SDon Mullisconfig DEBUG_FS 258bf4735a4SDon Mullis bool "Debug Filesystem" 259bf4735a4SDon Mullis help 260bf4735a4SDon Mullis debugfs is a virtual file system that kernel developers use to put 261bf4735a4SDon Mullis debugging files into. Enable this option to be able to read and 262bf4735a4SDon Mullis write to these files. 263bf4735a4SDon Mullis 264ff543332SRobert P. J. Day For detailed documentation on the debugfs API, see 265ff543332SRobert P. J. Day Documentation/DocBook/filesystems. 266ff543332SRobert P. J. Day 267bf4735a4SDon Mullis If unsure, say N. 268bf4735a4SDon Mullis 269bf4735a4SDon Mullisconfig HEADERS_CHECK 270bf4735a4SDon Mullis bool "Run 'make headers_check' when building vmlinux" 271bf4735a4SDon Mullis depends on !UML 272bf4735a4SDon Mullis help 273bf4735a4SDon Mullis This option will extract the user-visible kernel headers whenever 274bf4735a4SDon Mullis building the kernel, and will run basic sanity checks on them to 275bf4735a4SDon Mullis ensure that exported files do not attempt to include files which 276bf4735a4SDon Mullis were not exported, etc. 277bf4735a4SDon Mullis 278bf4735a4SDon Mullis If you're making modifications to header files which are 279bf4735a4SDon Mullis relevant for userspace, say 'Y', and check the headers 280bf4735a4SDon Mullis exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in 281bf4735a4SDon Mullis your build tree), to make sure they're suitable. 282bf4735a4SDon Mullis 28391341d4bSSam Ravnborgconfig DEBUG_SECTION_MISMATCH 28491341d4bSSam Ravnborg bool "Enable full Section mismatch analysis" 28591341d4bSSam Ravnborg help 28691341d4bSSam Ravnborg The section mismatch analysis checks if there are illegal 28791341d4bSSam Ravnborg references from one section to another section. 288e809ab01SMichael Witten During linktime or runtime, some sections are dropped; 289e809ab01SMichael Witten any use of code/data previously in these sections would 29091341d4bSSam Ravnborg most likely result in an oops. 291e809ab01SMichael Witten In the code, functions and variables are annotated with 2920db0628dSPaul Gortmaker __init,, etc. (see the full list in include/linux/init.h), 293d6fbfa4fSGeert Uytterhoeven which results in the code/data being placed in specific sections. 294e809ab01SMichael Witten The section mismatch analysis is always performed after a full 295e809ab01SMichael Witten kernel build, and enabling this option causes the following 296e809ab01SMichael Witten additional steps to occur: 297e809ab01SMichael Witten - Add the option -fno-inline-functions-called-once to gcc commands. 298e809ab01SMichael Witten When inlining a function annotated with __init in a non-init 299e809ab01SMichael Witten function, we would lose the section information and thus 30091341d4bSSam Ravnborg the analysis would not catch the illegal reference. 301e809ab01SMichael Witten This option tells gcc to inline less (but it does result in 302e809ab01SMichael Witten a larger kernel). 303e809ab01SMichael Witten - Run the section mismatch analysis for each module/built-in.o file. 304e809ab01SMichael Witten When we run the section mismatch analysis on vmlinux.o, we 305d6fbfa4fSGeert Uytterhoeven lose valueble information about where the mismatch was 30691341d4bSSam Ravnborg introduced. 30791341d4bSSam Ravnborg Running the analysis for each module/built-in.o file 308e809ab01SMichael Witten tells where the mismatch happens much closer to the 309e809ab01SMichael Witten source. The drawback is that the same mismatch is 310e809ab01SMichael Witten reported at least twice. 311e809ab01SMichael Witten - Enable verbose reporting from modpost in order to help resolve 312e809ab01SMichael Witten the section mismatches that are reported. 31391341d4bSSam Ravnborg 3146dfc0665SDave Hansen# 3156dfc0665SDave Hansen# Select this config option from the architecture Kconfig, if it 3166dfc0665SDave Hansen# is preferred to always offer frame pointers as a config 3176dfc0665SDave Hansen# option on the architecture (regardless of KERNEL_DEBUG): 3186dfc0665SDave Hansen# 3196dfc0665SDave Hansenconfig ARCH_WANT_FRAME_POINTERS 3206dfc0665SDave Hansen bool 3216dfc0665SDave Hansen help 3226dfc0665SDave Hansen 3236dfc0665SDave Hansenconfig FRAME_POINTER 3246dfc0665SDave Hansen bool "Compile the kernel with frame pointers" 3256dfc0665SDave Hansen depends on DEBUG_KERNEL && \ 3266dfc0665SDave Hansen (CRIS || M68K || FRV || UML || \ 3276dfc0665SDave Hansen AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \ 3286dfc0665SDave Hansen ARCH_WANT_FRAME_POINTERS 3296dfc0665SDave Hansen default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS 3306dfc0665SDave Hansen help 3316dfc0665SDave Hansen If you say Y here the resulting kernel image will be slightly 3326dfc0665SDave Hansen larger and slower, but it gives very useful debugging information 3336dfc0665SDave Hansen in case of kernel bugs. (precise oopses/stacktraces/warnings) 3346dfc0665SDave Hansen 3356dfc0665SDave Hansenconfig DEBUG_FORCE_WEAK_PER_CPU 3366dfc0665SDave Hansen bool "Force weak per-cpu definitions" 3376dfc0665SDave Hansen depends on DEBUG_KERNEL 3386dfc0665SDave Hansen help 3396dfc0665SDave Hansen s390 and alpha require percpu variables in modules to be 3406dfc0665SDave Hansen defined weak to work around addressing range issue which 3416dfc0665SDave Hansen puts the following two restrictions on percpu variable 3426dfc0665SDave Hansen definitions. 3436dfc0665SDave Hansen 3446dfc0665SDave Hansen 1. percpu symbols must be unique whether static or not 3456dfc0665SDave Hansen 2. percpu variables can't be defined inside a function 3466dfc0665SDave Hansen 3476dfc0665SDave Hansen To ensure that generic code follows the above rules, this 3486dfc0665SDave Hansen option forces all percpu variables to be defined as weak. 3496dfc0665SDave Hansen 3506dfc0665SDave Hansenendmenu # "Compiler options" 3516dfc0665SDave Hansen 3526dfc0665SDave Hansenconfig MAGIC_SYSRQ 3536dfc0665SDave Hansen bool "Magic SysRq key" 3546dfc0665SDave Hansen depends on !UML 3556dfc0665SDave Hansen help 3566dfc0665SDave Hansen If you say Y here, you will have some control over the system even 3576dfc0665SDave Hansen if the system crashes for example during kernel debugging (e.g., you 3586dfc0665SDave Hansen will be able to flush the buffer cache to disk, reboot the system 3596dfc0665SDave Hansen immediately or dump some status information). This is accomplished 3606dfc0665SDave Hansen by pressing various keys while holding SysRq (Alt+PrintScreen). It 3616dfc0665SDave Hansen also works on a serial console (on PC hardware at least), if you 3626dfc0665SDave Hansen send a BREAK and then within 5 seconds a command keypress. The 3636dfc0665SDave Hansen keys are documented in <file:Documentation/sysrq.txt>. Don't say Y 3646dfc0665SDave Hansen unless you really know what this hack does. 3656dfc0665SDave Hansen 3668eaede49SBen Hutchingsconfig MAGIC_SYSRQ_DEFAULT_ENABLE 3678eaede49SBen Hutchings hex "Enable magic SysRq key functions by default" 3688eaede49SBen Hutchings depends on MAGIC_SYSRQ 3698eaede49SBen Hutchings default 0x1 3708eaede49SBen Hutchings help 3718eaede49SBen Hutchings Specifies which SysRq key functions are enabled by default. 3728eaede49SBen Hutchings This may be set to 1 or 0 to enable or disable them all, or 3738eaede49SBen Hutchings to a bitmask as described in Documentation/sysrq.txt. 3748eaede49SBen Hutchings 375f346f4b3SAdrian Bunkconfig DEBUG_KERNEL 376f346f4b3SAdrian Bunk bool "Kernel debugging" 377f346f4b3SAdrian Bunk help 378f346f4b3SAdrian Bunk Say Y here if you are developing drivers or trying to debug and 379f346f4b3SAdrian Bunk identify kernel problems. 380f346f4b3SAdrian Bunk 3810610c8a8SDave Hansenmenu "Memory Debugging" 382a304e1b8SDavid Woodhouse 3830610c8a8SDave Hansensource mm/Kconfig.debug 38482f67cd9SIngo Molnar 3853ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS 3863ac7fe5aSThomas Gleixner bool "Debug object operations" 3873ac7fe5aSThomas Gleixner depends on DEBUG_KERNEL 3883ac7fe5aSThomas Gleixner help 3893ac7fe5aSThomas Gleixner If you say Y here, additional code will be inserted into the 3903ac7fe5aSThomas Gleixner kernel to track the life time of various objects and validate 3913ac7fe5aSThomas Gleixner the operations on those objects. 3923ac7fe5aSThomas Gleixner 3933ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_SELFTEST 3943ac7fe5aSThomas Gleixner bool "Debug objects selftest" 3953ac7fe5aSThomas Gleixner depends on DEBUG_OBJECTS 3963ac7fe5aSThomas Gleixner help 3973ac7fe5aSThomas Gleixner This enables the selftest of the object debug code. 3983ac7fe5aSThomas Gleixner 3993ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_FREE 4003ac7fe5aSThomas Gleixner bool "Debug objects in freed memory" 4013ac7fe5aSThomas Gleixner depends on DEBUG_OBJECTS 4023ac7fe5aSThomas Gleixner help 4033ac7fe5aSThomas Gleixner This enables checks whether a k/v free operation frees an area 4043ac7fe5aSThomas Gleixner which contains an object which has not been deactivated 4053ac7fe5aSThomas Gleixner properly. This can make kmalloc/kfree-intensive workloads 4063ac7fe5aSThomas Gleixner much slower. 4073ac7fe5aSThomas Gleixner 408c6f3a97fSThomas Gleixnerconfig DEBUG_OBJECTS_TIMERS 409c6f3a97fSThomas Gleixner bool "Debug timer objects" 410c6f3a97fSThomas Gleixner depends on DEBUG_OBJECTS 411c6f3a97fSThomas Gleixner help 412c6f3a97fSThomas Gleixner If you say Y here, additional code will be inserted into the 413c6f3a97fSThomas Gleixner timer routines to track the life time of timer objects and 414c6f3a97fSThomas Gleixner validate the timer operations. 415c6f3a97fSThomas Gleixner 416dc186ad7SThomas Gleixnerconfig DEBUG_OBJECTS_WORK 417dc186ad7SThomas Gleixner bool "Debug work objects" 418dc186ad7SThomas Gleixner depends on DEBUG_OBJECTS 419dc186ad7SThomas Gleixner help 420dc186ad7SThomas Gleixner If you say Y here, additional code will be inserted into the 421dc186ad7SThomas Gleixner work queue routines to track the life time of work objects and 422dc186ad7SThomas Gleixner validate the work operations. 423dc186ad7SThomas Gleixner 424551d55a9SMathieu Desnoyersconfig DEBUG_OBJECTS_RCU_HEAD 425551d55a9SMathieu Desnoyers bool "Debug RCU callbacks objects" 426fc2ecf7eSMathieu Desnoyers depends on DEBUG_OBJECTS 427551d55a9SMathieu Desnoyers help 428551d55a9SMathieu Desnoyers Enable this to turn on debugging of RCU list heads (call_rcu() usage). 429551d55a9SMathieu Desnoyers 430e2852ae8STejun Heoconfig DEBUG_OBJECTS_PERCPU_COUNTER 431e2852ae8STejun Heo bool "Debug percpu counter objects" 432e2852ae8STejun Heo depends on DEBUG_OBJECTS 433e2852ae8STejun Heo help 434e2852ae8STejun Heo If you say Y here, additional code will be inserted into the 435e2852ae8STejun Heo percpu counter routines to track the life time of percpu counter 436e2852ae8STejun Heo objects and validate the percpu counter operations. 437e2852ae8STejun Heo 4383ae70205SIngo Molnarconfig DEBUG_OBJECTS_ENABLE_DEFAULT 4393ae70205SIngo Molnar int "debug_objects bootup default value (0-1)" 4403ae70205SIngo Molnar range 0 1 4413ae70205SIngo Molnar default "1" 4423ae70205SIngo Molnar depends on DEBUG_OBJECTS 4433ae70205SIngo Molnar help 4443ae70205SIngo Molnar Debug objects boot parameter default value 4453ae70205SIngo Molnar 4461da177e4SLinus Torvaldsconfig DEBUG_SLAB 4474a2f0acfSAndrew Morton bool "Debug slab memory allocations" 4487d46d9e6SVegard Nossum depends on DEBUG_KERNEL && SLAB && !KMEMCHECK 4491da177e4SLinus Torvalds help 4501da177e4SLinus Torvalds Say Y here to have the kernel do limited verification on memory 4511da177e4SLinus Torvalds allocation as well as poisoning memory on free to catch use of freed 4521da177e4SLinus Torvalds memory. This can make kmalloc/kfree-intensive workloads much slower. 4531da177e4SLinus Torvalds 454871751e2SAl Viroconfig DEBUG_SLAB_LEAK 455871751e2SAl Viro bool "Memory leak debugging" 456871751e2SAl Viro depends on DEBUG_SLAB 457871751e2SAl Viro 458f0630fffSChristoph Lameterconfig SLUB_DEBUG_ON 459f0630fffSChristoph Lameter bool "SLUB debugging on by default" 4607d46d9e6SVegard Nossum depends on SLUB && SLUB_DEBUG && !KMEMCHECK 461f0630fffSChristoph Lameter default n 462f0630fffSChristoph Lameter help 463f0630fffSChristoph Lameter Boot with debugging on by default. SLUB boots by default with 464f0630fffSChristoph Lameter the runtime debug capabilities switched off. Enabling this is 465f0630fffSChristoph Lameter equivalent to specifying the "slub_debug" parameter on boot. 466f0630fffSChristoph Lameter There is no support for more fine grained debug control like 467f0630fffSChristoph Lameter possible with slub_debug=xxx. SLUB debugging may be switched 468f0630fffSChristoph Lameter off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying 469f0630fffSChristoph Lameter "slub_debug=-". 470f0630fffSChristoph Lameter 4718ff12cfcSChristoph Lameterconfig SLUB_STATS 4728ff12cfcSChristoph Lameter default n 4738ff12cfcSChristoph Lameter bool "Enable SLUB performance statistics" 474ab4d5ed5SChristoph Lameter depends on SLUB && SYSFS 4758ff12cfcSChristoph Lameter help 4768ff12cfcSChristoph Lameter SLUB statistics are useful to debug SLUBs allocation behavior in 4778ff12cfcSChristoph Lameter order find ways to optimize the allocator. This should never be 4788ff12cfcSChristoph Lameter enabled for production use since keeping statistics slows down 4798ff12cfcSChristoph Lameter the allocator by a few percentage points. The slabinfo command 4808ff12cfcSChristoph Lameter supports the determination of the most active slabs to figure 4818ff12cfcSChristoph Lameter out which slabs are relevant to a particular load. 4828ff12cfcSChristoph Lameter Try running: slabinfo -DA 4838ff12cfcSChristoph Lameter 484b69ec42bSCatalin Marinasconfig HAVE_DEBUG_KMEMLEAK 485b69ec42bSCatalin Marinas bool 486b69ec42bSCatalin Marinas 4873bba00d7SCatalin Marinasconfig DEBUG_KMEMLEAK 4883bba00d7SCatalin Marinas bool "Kernel memory leak detector" 489525c1f92SKees Cook depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK 49079e0d9bdSCatalin Marinas select DEBUG_FS 4913bba00d7SCatalin Marinas select STACKTRACE if STACKTRACE_SUPPORT 4923bba00d7SCatalin Marinas select KALLSYMS 493b60e26a2SRandy Dunlap select CRC32 4943bba00d7SCatalin Marinas help 4953bba00d7SCatalin Marinas Say Y here if you want to enable the memory leak 4963bba00d7SCatalin Marinas detector. The memory allocation/freeing is traced in a way 4973bba00d7SCatalin Marinas similar to the Boehm's conservative garbage collector, the 4983bba00d7SCatalin Marinas difference being that the orphan objects are not freed but 4993bba00d7SCatalin Marinas only shown in /sys/kernel/debug/kmemleak. Enabling this 5003bba00d7SCatalin Marinas feature will introduce an overhead to memory 5013bba00d7SCatalin Marinas allocations. See Documentation/kmemleak.txt for more 5023bba00d7SCatalin Marinas details. 5033bba00d7SCatalin Marinas 504bf96d1e3SCatalin Marinas Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances 505bf96d1e3SCatalin Marinas of finding leaks due to the slab objects poisoning. 506bf96d1e3SCatalin Marinas 5073bba00d7SCatalin Marinas In order to access the kmemleak file, debugfs needs to be 5083bba00d7SCatalin Marinas mounted (usually at /sys/kernel/debug). 5093bba00d7SCatalin Marinas 510a9d9058aSCatalin Marinasconfig DEBUG_KMEMLEAK_EARLY_LOG_SIZE 511a9d9058aSCatalin Marinas int "Maximum kmemleak early log entries" 512a9d9058aSCatalin Marinas depends on DEBUG_KMEMLEAK 513dfcc3e6aSHeiko Carstens range 200 40000 514a9d9058aSCatalin Marinas default 400 515a9d9058aSCatalin Marinas help 516a9d9058aSCatalin Marinas Kmemleak must track all the memory allocations to avoid 517a9d9058aSCatalin Marinas reporting false positives. Since memory may be allocated or 518a9d9058aSCatalin Marinas freed before kmemleak is initialised, an early log buffer is 519a9d9058aSCatalin Marinas used to store these actions. If kmemleak reports "early log 520a9d9058aSCatalin Marinas buffer exceeded", please increase this value. 521a9d9058aSCatalin Marinas 5220822ee4aSCatalin Marinasconfig DEBUG_KMEMLEAK_TEST 5230822ee4aSCatalin Marinas tristate "Simple test for the kernel memory leak detector" 5249718269aSDaniel Baluta depends on DEBUG_KMEMLEAK && m 5250822ee4aSCatalin Marinas help 5269718269aSDaniel Baluta This option enables a module that explicitly leaks memory. 5270822ee4aSCatalin Marinas 5280822ee4aSCatalin Marinas If unsure, say N. 5290822ee4aSCatalin Marinas 530ab0155a2SJason Baronconfig DEBUG_KMEMLEAK_DEFAULT_OFF 531ab0155a2SJason Baron bool "Default kmemleak to off" 532ab0155a2SJason Baron depends on DEBUG_KMEMLEAK 533ab0155a2SJason Baron help 534ab0155a2SJason Baron Say Y here to disable kmemleak by default. It can then be enabled 535ab0155a2SJason Baron on the command line via kmemleak=on. 536ab0155a2SJason Baron 5370610c8a8SDave Hansenconfig DEBUG_STACK_USAGE 5380610c8a8SDave Hansen bool "Stack utilization instrumentation" 5390610c8a8SDave Hansen depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG 5400610c8a8SDave Hansen help 5410610c8a8SDave Hansen Enables the display of the minimum amount of free stack which each 5420610c8a8SDave Hansen task has ever had available in the sysrq-T and sysrq-P debug output. 5430610c8a8SDave Hansen 5440610c8a8SDave Hansen This option will slow down process creation somewhat. 5450610c8a8SDave Hansen 5460610c8a8SDave Hansenconfig DEBUG_VM 5470610c8a8SDave Hansen bool "Debug VM" 5480610c8a8SDave Hansen depends on DEBUG_KERNEL 5490610c8a8SDave Hansen help 5500610c8a8SDave Hansen Enable this to turn on extended checks in the virtual-memory system 5510610c8a8SDave Hansen that may impact performance. 5520610c8a8SDave Hansen 5530610c8a8SDave Hansen If unsure, say N. 5540610c8a8SDave Hansen 5554f115147SDavidlohr Buesoconfig DEBUG_VM_VMACACHE 5564f115147SDavidlohr Bueso bool "Debug VMA caching" 5574f115147SDavidlohr Bueso depends on DEBUG_VM 5584f115147SDavidlohr Bueso help 5594f115147SDavidlohr Bueso Enable this to turn on VMA caching debug information. Doing so 5604f115147SDavidlohr Bueso can cause significant overhead, so only enable it in non-production 5614f115147SDavidlohr Bueso environments. 5624f115147SDavidlohr Bueso 5634f115147SDavidlohr Bueso If unsure, say N. 5644f115147SDavidlohr Bueso 5650610c8a8SDave Hansenconfig DEBUG_VM_RB 5660610c8a8SDave Hansen bool "Debug VM red-black trees" 5670610c8a8SDave Hansen depends on DEBUG_VM 5680610c8a8SDave Hansen help 569a663dad6SDavidlohr Bueso Enable VM red-black tree debugging information and extra validations. 5700610c8a8SDave Hansen 5710610c8a8SDave Hansen If unsure, say N. 5720610c8a8SDave Hansen 5730610c8a8SDave Hansenconfig DEBUG_VIRTUAL 5740610c8a8SDave Hansen bool "Debug VM translations" 5750610c8a8SDave Hansen depends on DEBUG_KERNEL && X86 5760610c8a8SDave Hansen help 5770610c8a8SDave Hansen Enable some costly sanity checks in virtual to page code. This can 5780610c8a8SDave Hansen catch mistakes with virt_to_page() and friends. 5790610c8a8SDave Hansen 5800610c8a8SDave Hansen If unsure, say N. 5810610c8a8SDave Hansen 5820610c8a8SDave Hansenconfig DEBUG_NOMMU_REGIONS 5830610c8a8SDave Hansen bool "Debug the global anon/private NOMMU mapping region tree" 5840610c8a8SDave Hansen depends on DEBUG_KERNEL && !MMU 5850610c8a8SDave Hansen help 5860610c8a8SDave Hansen This option causes the global tree of anonymous and private mapping 5870610c8a8SDave Hansen regions to be regularly checked for invalid topology. 5880610c8a8SDave Hansen 5890610c8a8SDave Hansenconfig DEBUG_MEMORY_INIT 5900610c8a8SDave Hansen bool "Debug memory initialisation" if EXPERT 5910610c8a8SDave Hansen default !EXPERT 5920610c8a8SDave Hansen help 5930610c8a8SDave Hansen Enable this for additional checks during memory initialisation. 5940610c8a8SDave Hansen The sanity checks verify aspects of the VM such as the memory model 5950610c8a8SDave Hansen and other information provided by the architecture. Verbose 5960610c8a8SDave Hansen information will be printed at KERN_DEBUG loglevel depending 5970610c8a8SDave Hansen on the mminit_loglevel= command-line option. 5980610c8a8SDave Hansen 5990610c8a8SDave Hansen If unsure, say Y 6000610c8a8SDave Hansen 6010610c8a8SDave Hansenconfig MEMORY_NOTIFIER_ERROR_INJECT 6020610c8a8SDave Hansen tristate "Memory hotplug notifier error injection module" 6030610c8a8SDave Hansen depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION 6040610c8a8SDave Hansen help 6050610c8a8SDave Hansen This option provides the ability to inject artificial errors to 6060610c8a8SDave Hansen memory hotplug notifier chain callbacks. It is controlled through 6070610c8a8SDave Hansen debugfs interface under /sys/kernel/debug/notifier-error-inject/memory 6080610c8a8SDave Hansen 6090610c8a8SDave Hansen If the notifier call chain should be failed with some events 6100610c8a8SDave Hansen notified, write the error code to "actions/<notifier event>/error". 6110610c8a8SDave Hansen 6120610c8a8SDave Hansen Example: Inject memory hotplug offline error (-12 == -ENOMEM) 6130610c8a8SDave Hansen 6140610c8a8SDave Hansen # cd /sys/kernel/debug/notifier-error-inject/memory 6150610c8a8SDave Hansen # echo -12 > actions/MEM_GOING_OFFLINE/error 6160610c8a8SDave Hansen # echo offline > /sys/devices/system/memory/memoryXXX/state 6170610c8a8SDave Hansen bash: echo: write error: Cannot allocate memory 6180610c8a8SDave Hansen 6190610c8a8SDave Hansen To compile this code as a module, choose M here: the module will 6200610c8a8SDave Hansen be called memory-notifier-error-inject. 6210610c8a8SDave Hansen 6220610c8a8SDave Hansen If unsure, say N. 6230610c8a8SDave Hansen 6240610c8a8SDave Hansenconfig DEBUG_PER_CPU_MAPS 6250610c8a8SDave Hansen bool "Debug access to per_cpu maps" 6260610c8a8SDave Hansen depends on DEBUG_KERNEL 6270610c8a8SDave Hansen depends on SMP 6280610c8a8SDave Hansen help 6290610c8a8SDave Hansen Say Y to verify that the per_cpu map being accessed has 6300610c8a8SDave Hansen been set up. This adds a fair amount of code to kernel memory 6310610c8a8SDave Hansen and decreases performance. 6320610c8a8SDave Hansen 6330610c8a8SDave Hansen Say N if unsure. 6340610c8a8SDave Hansen 6350610c8a8SDave Hansenconfig DEBUG_HIGHMEM 6360610c8a8SDave Hansen bool "Highmem debugging" 6370610c8a8SDave Hansen depends on DEBUG_KERNEL && HIGHMEM 6380610c8a8SDave Hansen help 639b1357c9fSGeert Uytterhoeven This option enables additional error checking for high memory 640b1357c9fSGeert Uytterhoeven systems. Disable for production systems. 6410610c8a8SDave Hansen 6420610c8a8SDave Hansenconfig HAVE_DEBUG_STACKOVERFLOW 6430610c8a8SDave Hansen bool 6440610c8a8SDave Hansen 6450610c8a8SDave Hansenconfig DEBUG_STACKOVERFLOW 6460610c8a8SDave Hansen bool "Check for stack overflows" 6470610c8a8SDave Hansen depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW 6480610c8a8SDave Hansen ---help--- 6490610c8a8SDave Hansen Say Y here if you want to check for overflows of kernel, IRQ 650edb0ec07SBorislav Petkov and exception stacks (if your architecture uses them). This 6510610c8a8SDave Hansen option will show detailed messages if free stack space drops 6520610c8a8SDave Hansen below a certain limit. 6530610c8a8SDave Hansen 6540610c8a8SDave Hansen These kinds of bugs usually occur when call-chains in the 6550610c8a8SDave Hansen kernel get too deep, especially when interrupts are 6560610c8a8SDave Hansen involved. 6570610c8a8SDave Hansen 6580610c8a8SDave Hansen Use this in cases where you see apparently random memory 6590610c8a8SDave Hansen corruption, especially if it appears in 'struct thread_info' 6600610c8a8SDave Hansen 6610610c8a8SDave Hansen If in doubt, say "N". 6620610c8a8SDave Hansen 6630610c8a8SDave Hansensource "lib/Kconfig.kmemcheck" 6640610c8a8SDave Hansen 6650b24beccSAndrey Ryabininsource "lib/Kconfig.kasan" 6660b24beccSAndrey Ryabinin 6670610c8a8SDave Hansenendmenu # "Memory Debugging" 6680610c8a8SDave Hansen 6691da177e4SLinus Torvaldsconfig DEBUG_SHIRQ 6701da177e4SLinus Torvalds bool "Debug shared IRQ handlers" 6710244ad00SMartin Schwidefsky depends on DEBUG_KERNEL 6721da177e4SLinus Torvalds help 6731da177e4SLinus Torvalds Enable this to generate a spurious interrupt as soon as a shared 6741da177e4SLinus Torvalds interrupt handler is registered, and just before one is deregistered. 6751da177e4SLinus Torvalds Drivers ought to be able to handle interrupts coming in at those 6761da177e4SLinus Torvalds points; some don't and need to be caught. 6771da177e4SLinus Torvalds 67892aef8fbSDave Hansenmenu "Debug Lockups and Hangs" 67992aef8fbSDave Hansen 6801da177e4SLinus Torvaldsconfig LOCKUP_DETECTOR 6811da177e4SLinus Torvalds bool "Detect Hard and Soft Lockups" 6821da177e4SLinus Torvalds depends on DEBUG_KERNEL && !S390 6831da177e4SLinus Torvalds help 6841da177e4SLinus Torvalds Say Y here to enable the kernel to act as a watchdog to detect 6851da177e4SLinus Torvalds hard and soft lockups. 6861da177e4SLinus Torvalds 6871da177e4SLinus Torvalds Softlockups are bugs that cause the kernel to loop in kernel 6881da177e4SLinus Torvalds mode for more than 20 seconds, without giving other tasks a 6891da177e4SLinus Torvalds chance to run. The current stack trace is displayed upon 6901da177e4SLinus Torvalds detection and the system will stay locked up. 6911da177e4SLinus Torvalds 6921da177e4SLinus Torvalds Hardlockups are bugs that cause the CPU to loop in kernel mode 6931da177e4SLinus Torvalds for more than 10 seconds, without letting other interrupts have a 6941da177e4SLinus Torvalds chance to run. The current stack trace is displayed upon detection 6951da177e4SLinus Torvalds and the system will stay locked up. 6961da177e4SLinus Torvalds 6971da177e4SLinus Torvalds The overhead should be minimal. A periodic hrtimer runs to 6981da177e4SLinus Torvalds generate interrupts and kick the watchdog task every 4 seconds. 6991da177e4SLinus Torvalds An NMI is generated every 10 seconds or so to check for hardlockups. 7001da177e4SLinus Torvalds 7011da177e4SLinus Torvalds The frequency of hrtimer and NMI events and the soft and hard lockup 7021da177e4SLinus Torvalds thresholds can be controlled through the sysctl watchdog_thresh. 7031da177e4SLinus Torvalds 7041da177e4SLinus Torvaldsconfig HARDLOCKUP_DETECTOR 7051da177e4SLinus Torvalds def_bool y 7061da177e4SLinus Torvalds depends on LOCKUP_DETECTOR && !HAVE_NMI_WATCHDOG 7071da177e4SLinus Torvalds depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI 7081da177e4SLinus Torvalds 7091da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC 7101da177e4SLinus Torvalds bool "Panic (Reboot) On Hard Lockups" 7111da177e4SLinus Torvalds depends on HARDLOCKUP_DETECTOR 7121da177e4SLinus Torvalds help 7131da177e4SLinus Torvalds Say Y here to enable the kernel to panic on "hard lockups", 7141da177e4SLinus Torvalds which are bugs that cause the kernel to loop in kernel 7151da177e4SLinus Torvalds mode with interrupts disabled for more than 10 seconds (configurable 7161da177e4SLinus Torvalds using the watchdog_thresh sysctl). 7171da177e4SLinus Torvalds 7181da177e4SLinus Torvalds Say N if unsure. 7191da177e4SLinus Torvalds 7201da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC_VALUE 7211da177e4SLinus Torvalds int 7221da177e4SLinus Torvalds depends on HARDLOCKUP_DETECTOR 7231da177e4SLinus Torvalds range 0 1 7241da177e4SLinus Torvalds default 0 if !BOOTPARAM_HARDLOCKUP_PANIC 7251da177e4SLinus Torvalds default 1 if BOOTPARAM_HARDLOCKUP_PANIC 7261da177e4SLinus Torvalds 7271da177e4SLinus Torvaldsconfig BOOTPARAM_SOFTLOCKUP_PANIC 7281da177e4SLinus Torvalds bool "Panic (Reboot) On Soft Lockups" 7291da177e4SLinus Torvalds depends on LOCKUP_DETECTOR 7301da177e4SLinus Torvalds help 7311da177e4SLinus Torvalds Say Y here to enable the kernel to panic on "soft lockups", 7321da177e4SLinus Torvalds which are bugs that cause the kernel to loop in kernel 7331da177e4SLinus Torvalds mode for more than 20 seconds (configurable using the watchdog_thresh 7341da177e4SLinus Torvalds sysctl), without giving other tasks a chance to run. 7351da177e4SLinus Torvalds 7361da177e4SLinus Torvalds The panic can be used in combination with panic_timeout, 7371da177e4SLinus Torvalds to cause the system to reboot automatically after a 7381da177e4SLinus Torvalds lockup has been detected. This feature is useful for 7391da177e4SLinus Torvalds high-availability systems that have uptime guarantees and 7401da177e4SLinus Torvalds where a lockup must be resolved ASAP. 7411da177e4SLinus Torvalds 7428637c099SIngo Molnar Say N if unsure. 7431da177e4SLinus Torvalds 7441da177e4SLinus Torvaldsconfig BOOTPARAM_SOFTLOCKUP_PANIC_VALUE 7451da177e4SLinus Torvalds int 7461da177e4SLinus Torvalds depends on LOCKUP_DETECTOR 7471da177e4SLinus Torvalds range 0 1 7481da177e4SLinus Torvalds default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC 7491da177e4SLinus Torvalds default 1 if BOOTPARAM_SOFTLOCKUP_PANIC 750e7eebaf6SIngo Molnar 7511da177e4SLinus Torvaldsconfig DETECT_HUNG_TASK 7521da177e4SLinus Torvalds bool "Detect Hung Tasks" 7531da177e4SLinus Torvalds depends on DEBUG_KERNEL 7541da177e4SLinus Torvalds default LOCKUP_DETECTOR 7551da177e4SLinus Torvalds help 7561da177e4SLinus Torvalds Say Y here to enable the kernel to detect "hung tasks", 7571da177e4SLinus Torvalds which are bugs that cause the task to be stuck in 7581da177e4SLinus Torvalds uninterruptible "D" state indefinitiley. 7591da177e4SLinus Torvalds 7601da177e4SLinus Torvalds When a hung task is detected, the kernel will print the 7611da177e4SLinus Torvalds current stack trace (which you should report), but the 7621da177e4SLinus Torvalds task will stay in uninterruptible state. If lockdep is 7631da177e4SLinus Torvalds enabled then all held locks will also be reported. This 7641da177e4SLinus Torvalds feature has negligible overhead. 7651da177e4SLinus Torvalds 7661da177e4SLinus Torvaldsconfig DEFAULT_HUNG_TASK_TIMEOUT 7671da177e4SLinus Torvalds int "Default timeout for hung task detection (in seconds)" 7681da177e4SLinus Torvalds depends on DETECT_HUNG_TASK 7691da177e4SLinus Torvalds default 120 7701da177e4SLinus Torvalds help 7711da177e4SLinus Torvalds This option controls the default timeout (in seconds) used 7721da177e4SLinus Torvalds to determine when a task has become non-responsive and should 7731da177e4SLinus Torvalds be considered hung. 7741da177e4SLinus Torvalds 7751da177e4SLinus Torvalds It can be adjusted at runtime via the kernel.hung_task_timeout_secs 7761da177e4SLinus Torvalds sysctl or by writing a value to 7771da177e4SLinus Torvalds /proc/sys/kernel/hung_task_timeout_secs. 7781da177e4SLinus Torvalds 779408894eeSIngo Molnar A timeout of 0 disables the check. The default is two minutes. 780408894eeSIngo Molnar Keeping the default should be fine in most cases. 781408894eeSIngo Molnar 782408894eeSIngo Molnarconfig BOOTPARAM_HUNG_TASK_PANIC 783408894eeSIngo Molnar bool "Panic (Reboot) On Hung Tasks" 784408894eeSIngo Molnar depends on DETECT_HUNG_TASK 785cca57c5bSTim Chen help 786408894eeSIngo Molnar Say Y here to enable the kernel to panic on "hung tasks", 787408894eeSIngo Molnar which are bugs that cause the kernel to leave a task stuck 788408894eeSIngo Molnar in uninterruptible "D" state. 789408894eeSIngo Molnar 790408894eeSIngo Molnar The panic can be used in combination with panic_timeout, 791e7eebaf6SIngo Molnar to cause the system to reboot automatically after a 792e7eebaf6SIngo Molnar hung task has been detected. This feature is useful for 793e7eebaf6SIngo Molnar high-availability systems that have uptime guarantees and 794e7eebaf6SIngo Molnar where a hung tasks must be resolved ASAP. 795e7eebaf6SIngo Molnar 796e7eebaf6SIngo Molnar Say N if unsure. 797e7eebaf6SIngo Molnar 798e7eebaf6SIngo Molnarconfig BOOTPARAM_HUNG_TASK_PANIC_VALUE 799e7eebaf6SIngo Molnar int 800e7eebaf6SIngo Molnar depends on DETECT_HUNG_TASK 801e7eebaf6SIngo Molnar range 0 1 802048c8bc9SHugh Dickins default 0 if !BOOTPARAM_HUNG_TASK_PANIC 8031da177e4SLinus Torvalds default 1 if BOOTPARAM_HUNG_TASK_PANIC 8041da177e4SLinus Torvalds 80592aef8fbSDave Hansenendmenu # "Debug lockups and hangs" 80692aef8fbSDave Hansen 80792aef8fbSDave Hansenconfig PANIC_ON_OOPS 80892aef8fbSDave Hansen bool "Panic on Oops" 80992aef8fbSDave Hansen help 81092aef8fbSDave Hansen Say Y here to enable the kernel to panic when it oopses. This 81192aef8fbSDave Hansen has the same effect as setting oops=panic on the kernel command 81292aef8fbSDave Hansen line. 81392aef8fbSDave Hansen 81492aef8fbSDave Hansen This feature is useful to ensure that the kernel does not do 81592aef8fbSDave Hansen anything erroneous after an oops which could result in data 81692aef8fbSDave Hansen corruption or other issues. 81792aef8fbSDave Hansen 81892aef8fbSDave Hansen Say N if unsure. 81992aef8fbSDave Hansen 82092aef8fbSDave Hansenconfig PANIC_ON_OOPS_VALUE 82192aef8fbSDave Hansen int 82292aef8fbSDave Hansen range 0 1 82392aef8fbSDave Hansen default 0 if !PANIC_ON_OOPS 82492aef8fbSDave Hansen default 1 if PANIC_ON_OOPS 82592aef8fbSDave Hansen 8265800dc3cSJason Baronconfig PANIC_TIMEOUT 8275800dc3cSJason Baron int "panic timeout" 8285800dc3cSJason Baron default 0 8295800dc3cSJason Baron help 8305800dc3cSJason Baron Set the timeout value (in seconds) until a reboot occurs when the 8315800dc3cSJason Baron the kernel panics. If n = 0, then we wait forever. A timeout 8325800dc3cSJason Baron value n > 0 will wait n seconds before rebooting, while a timeout 8335800dc3cSJason Baron value n < 0 will reboot immediately. 8345800dc3cSJason Baron 8351da177e4SLinus Torvaldsconfig SCHED_DEBUG 8361da177e4SLinus Torvalds bool "Collect scheduler debugging info" 8371da177e4SLinus Torvalds depends on DEBUG_KERNEL && PROC_FS 8381da177e4SLinus Torvalds default y 8391da177e4SLinus Torvalds help 8401da177e4SLinus Torvalds If you say Y here, the /proc/sched_debug file will be provided 8411da177e4SLinus Torvalds that can help debug the scheduler. The runtime overhead of this 8421da177e4SLinus Torvalds option is minimal. 8431da177e4SLinus Torvalds 8441da177e4SLinus Torvaldsconfig SCHEDSTATS 8451da177e4SLinus Torvalds bool "Collect scheduler statistics" 8461da177e4SLinus Torvalds depends on DEBUG_KERNEL && PROC_FS 8471da177e4SLinus Torvalds help 8481da177e4SLinus Torvalds If you say Y here, additional code will be inserted into the 8491da177e4SLinus Torvalds scheduler and related routines to collect statistics about 8501da177e4SLinus Torvalds scheduler behavior and provide them in /proc/schedstat. These 8511da177e4SLinus Torvalds stats may be useful for both tuning and debugging the scheduler 8521da177e4SLinus Torvalds If you aren't debugging the scheduler or trying to tune a specific 8531da177e4SLinus Torvalds application, you can say N to avoid the very slight overhead 8541da177e4SLinus Torvalds this adds. 8551da177e4SLinus Torvalds 8560d9e2632SAaron Tomlinconfig SCHED_STACK_END_CHECK 8570d9e2632SAaron Tomlin bool "Detect stack corruption on calls to schedule()" 8580d9e2632SAaron Tomlin depends on DEBUG_KERNEL 8590d9e2632SAaron Tomlin default n 8600d9e2632SAaron Tomlin help 8610d9e2632SAaron Tomlin This option checks for a stack overrun on calls to schedule(). 8620d9e2632SAaron Tomlin If the stack end location is found to be over written always panic as 8630d9e2632SAaron Tomlin the content of the corrupted region can no longer be trusted. 8640d9e2632SAaron Tomlin This is to ensure no erroneous behaviour occurs which could result in 8650d9e2632SAaron Tomlin data corruption or a sporadic crash at a later stage once the region 8660d9e2632SAaron Tomlin is examined. The runtime overhead introduced is minimal. 8670d9e2632SAaron Tomlin 8683c17ad19SJohn Stultzconfig DEBUG_TIMEKEEPING 8693c17ad19SJohn Stultz bool "Enable extra timekeeping sanity checking" 8703c17ad19SJohn Stultz help 8713c17ad19SJohn Stultz This option will enable additional timekeeping sanity checks 8723c17ad19SJohn Stultz which may be helpful when diagnosing issues where timekeeping 8733c17ad19SJohn Stultz problems are suspected. 8743c17ad19SJohn Stultz 8753c17ad19SJohn Stultz This may include checks in the timekeeping hotpaths, so this 8763c17ad19SJohn Stultz option may have a (very small) performance impact to some 8773c17ad19SJohn Stultz workloads. 8783c17ad19SJohn Stultz 8793c17ad19SJohn Stultz If unsure, say N. 8803c17ad19SJohn Stultz 8811da177e4SLinus Torvaldsconfig TIMER_STATS 8821da177e4SLinus Torvalds bool "Collect kernel timers statistics" 8831da177e4SLinus Torvalds depends on DEBUG_KERNEL && PROC_FS 8841da177e4SLinus Torvalds help 8851da177e4SLinus Torvalds If you say Y here, additional code will be inserted into the 8861da177e4SLinus Torvalds timer routines to collect statistics about kernel timers being 8871da177e4SLinus Torvalds reprogrammed. The statistics can be read from /proc/timer_stats. 8881da177e4SLinus Torvalds The statistics collection is started by writing 1 to /proc/timer_stats, 8891da177e4SLinus Torvalds writing 0 stops it. This feature is useful to collect information 8901da177e4SLinus Torvalds about timer usage patterns in kernel and userspace. This feature 8911da177e4SLinus Torvalds is lightweight if enabled in the kernel config but not activated 8921da177e4SLinus Torvalds (it defaults to deactivated on bootup and will only be activated 8931da177e4SLinus Torvalds if some application like powertop activates it explicitly). 8941da177e4SLinus Torvalds 8951da177e4SLinus Torvaldsconfig DEBUG_PREEMPT 8961da177e4SLinus Torvalds bool "Debug preemptible kernel" 89701deab98SKumar Gala depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT 8981da177e4SLinus Torvalds default y 8991da177e4SLinus Torvalds help 9001da177e4SLinus Torvalds If you say Y here then the kernel will use a debug variant of the 9011da177e4SLinus Torvalds commonly used smp_processor_id() function and will print warnings 9021da177e4SLinus Torvalds if kernel code uses it in a preemption-unsafe way. Also, the kernel 9031da177e4SLinus Torvalds will detect preemption count underflows. 9041da177e4SLinus Torvalds 9059eade16bSDave Hansenmenu "Lock Debugging (spinlocks, mutexes, etc...)" 9069eade16bSDave Hansen 907e7eebaf6SIngo Molnarconfig DEBUG_RT_MUTEXES 908e7eebaf6SIngo Molnar bool "RT Mutex debugging, deadlock detection" 909e7eebaf6SIngo Molnar depends on DEBUG_KERNEL && RT_MUTEXES 910e7eebaf6SIngo Molnar help 911e7eebaf6SIngo Molnar This allows rt mutex semantics violations and rt mutex related 912e7eebaf6SIngo Molnar deadlocks (lockups) to be detected and reported automatically. 913e7eebaf6SIngo Molnar 91461a87122SThomas Gleixnerconfig RT_MUTEX_TESTER 91561a87122SThomas Gleixner bool "Built-in scriptable tester for rt-mutexes" 9166cc620bcSThomas Gleixner depends on DEBUG_KERNEL && RT_MUTEXES && BROKEN 91761a87122SThomas Gleixner help 91861a87122SThomas Gleixner This option enables a rt-mutex tester. 91961a87122SThomas Gleixner 9201da177e4SLinus Torvaldsconfig DEBUG_SPINLOCK 9214d9f34adSIngo Molnar bool "Spinlock and rw-lock debugging: basic checks" 9221da177e4SLinus Torvalds depends on DEBUG_KERNEL 923e335e3ebSRaghavendra K T select UNINLINE_SPIN_UNLOCK 9241da177e4SLinus Torvalds help 9251da177e4SLinus Torvalds Say Y here and build SMP to catch missing spinlock initialization 9261da177e4SLinus Torvalds and certain other kinds of spinlock errors commonly made. This is 9271da177e4SLinus Torvalds best used in conjunction with the NMI watchdog so that spinlock 9281da177e4SLinus Torvalds deadlocks are also debuggable. 9291da177e4SLinus Torvalds 9304d9f34adSIngo Molnarconfig DEBUG_MUTEXES 9314d9f34adSIngo Molnar bool "Mutex debugging: basic checks" 9324d9f34adSIngo Molnar depends on DEBUG_KERNEL 9334d9f34adSIngo Molnar help 9344d9f34adSIngo Molnar This feature allows mutex semantics violations to be detected and 9354d9f34adSIngo Molnar reported. 9364d9f34adSIngo Molnar 93723010027SDaniel Vetterconfig DEBUG_WW_MUTEX_SLOWPATH 93823010027SDaniel Vetter bool "Wait/wound mutex debugging: Slowpath testing" 93923010027SDaniel Vetter depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 94023010027SDaniel Vetter select DEBUG_LOCK_ALLOC 94123010027SDaniel Vetter select DEBUG_SPINLOCK 94223010027SDaniel Vetter select DEBUG_MUTEXES 94323010027SDaniel Vetter help 94423010027SDaniel Vetter This feature enables slowpath testing for w/w mutex users by 94523010027SDaniel Vetter injecting additional -EDEADLK wound/backoff cases. Together with 94623010027SDaniel Vetter the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this 94723010027SDaniel Vetter will test all possible w/w mutex interface abuse with the 94823010027SDaniel Vetter exception of simply not acquiring all the required locks. 9494d692373SRob Clark Note that this feature can introduce significant overhead, so 9504d692373SRob Clark it really should not be enabled in a production or distro kernel, 9514d692373SRob Clark even a debug kernel. If you are a driver writer, enable it. If 9524d692373SRob Clark you are a distro, do not. 95323010027SDaniel Vetter 9544d9f34adSIngo Molnarconfig DEBUG_LOCK_ALLOC 9554d9f34adSIngo Molnar bool "Lock debugging: detect incorrect freeing of live locks" 956517e7aa5SAdrian Bunk depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 9574d9f34adSIngo Molnar select DEBUG_SPINLOCK 9584d9f34adSIngo Molnar select DEBUG_MUTEXES 9594d9f34adSIngo Molnar select LOCKDEP 9604d9f34adSIngo Molnar help 9614d9f34adSIngo Molnar This feature will check whether any held lock (spinlock, rwlock, 9624d9f34adSIngo Molnar mutex or rwsem) is incorrectly freed by the kernel, via any of the 9634d9f34adSIngo Molnar memory-freeing routines (kfree(), kmem_cache_free(), free_pages(), 9644d9f34adSIngo Molnar vfree(), etc.), whether a live lock is incorrectly reinitialized via 9654d9f34adSIngo Molnar spin_lock_init()/mutex_init()/etc., or whether there is any lock 9664d9f34adSIngo Molnar held during task exit. 9674d9f34adSIngo Molnar 9684d9f34adSIngo Molnarconfig PROVE_LOCKING 9694d9f34adSIngo Molnar bool "Lock debugging: prove locking correctness" 970517e7aa5SAdrian Bunk depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 9714d9f34adSIngo Molnar select LOCKDEP 9724d9f34adSIngo Molnar select DEBUG_SPINLOCK 9734d9f34adSIngo Molnar select DEBUG_MUTEXES 9744d9f34adSIngo Molnar select DEBUG_LOCK_ALLOC 97546b93b74SSteven Rostedt select TRACE_IRQFLAGS 9764d9f34adSIngo Molnar default n 9774d9f34adSIngo Molnar help 9784d9f34adSIngo Molnar This feature enables the kernel to prove that all locking 9794d9f34adSIngo Molnar that occurs in the kernel runtime is mathematically 9804d9f34adSIngo Molnar correct: that under no circumstance could an arbitrary (and 9814d9f34adSIngo Molnar not yet triggered) combination of observed locking 9824d9f34adSIngo Molnar sequences (on an arbitrary number of CPUs, running an 9834d9f34adSIngo Molnar arbitrary number of tasks and interrupt contexts) cause a 9844d9f34adSIngo Molnar deadlock. 9854d9f34adSIngo Molnar 9864d9f34adSIngo Molnar In short, this feature enables the kernel to report locking 9874d9f34adSIngo Molnar related deadlocks before they actually occur. 9884d9f34adSIngo Molnar 9894d9f34adSIngo Molnar The proof does not depend on how hard and complex a 9904d9f34adSIngo Molnar deadlock scenario would be to trigger: how many 9914d9f34adSIngo Molnar participant CPUs, tasks and irq-contexts would be needed 9924d9f34adSIngo Molnar for it to trigger. The proof also does not depend on 9934d9f34adSIngo Molnar timing: if a race and a resulting deadlock is possible 9944d9f34adSIngo Molnar theoretically (no matter how unlikely the race scenario 9954d9f34adSIngo Molnar is), it will be proven so and will immediately be 9964d9f34adSIngo Molnar reported by the kernel (once the event is observed that 9974d9f34adSIngo Molnar makes the deadlock theoretically possible). 9984d9f34adSIngo Molnar 9994d9f34adSIngo Molnar If a deadlock is impossible (i.e. the locking rules, as 10004d9f34adSIngo Molnar observed by the kernel, are mathematically correct), the 10014d9f34adSIngo Molnar kernel reports nothing. 10024d9f34adSIngo Molnar 10034d9f34adSIngo Molnar NOTE: this feature can also be enabled for rwlocks, mutexes 10044d9f34adSIngo Molnar and rwsems - in which case all dependencies between these 10054d9f34adSIngo Molnar different locking variants are observed and mapped too, and 10064d9f34adSIngo Molnar the proof of observed correctness is also maintained for an 10074d9f34adSIngo Molnar arbitrary combination of these separate locking variants. 10084d9f34adSIngo Molnar 1009214e0aedSDavidlohr Bueso For more details, see Documentation/locking/lockdep-design.txt. 10104d9f34adSIngo Molnar 10114d9f34adSIngo Molnarconfig LOCKDEP 10124d9f34adSIngo Molnar bool 1013517e7aa5SAdrian Bunk depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 10144d9f34adSIngo Molnar select STACKTRACE 1015df2e1ef6SChen Gang select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE 10164d9f34adSIngo Molnar select KALLSYMS 10174d9f34adSIngo Molnar select KALLSYMS_ALL 10184d9f34adSIngo Molnar 1019f20786ffSPeter Zijlstraconfig LOCK_STAT 1020fdfb870fSDanny ter Haar bool "Lock usage statistics" 1021f20786ffSPeter Zijlstra depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 1022f20786ffSPeter Zijlstra select LOCKDEP 1023f20786ffSPeter Zijlstra select DEBUG_SPINLOCK 1024f20786ffSPeter Zijlstra select DEBUG_MUTEXES 1025f20786ffSPeter Zijlstra select DEBUG_LOCK_ALLOC 1026f20786ffSPeter Zijlstra default n 1027f20786ffSPeter Zijlstra help 1028f20786ffSPeter Zijlstra This feature enables tracking lock contention points 1029f20786ffSPeter Zijlstra 1030214e0aedSDavidlohr Bueso For more details, see Documentation/locking/lockstat.txt 1031a560aa48SPeter Zijlstra 1032dd8b1cf6SFrederic Weisbecker This also enables lock events required by "perf lock", 1033dd8b1cf6SFrederic Weisbecker subcommand of perf. 1034dd8b1cf6SFrederic Weisbecker If you want to use "perf lock", you also need to turn on 1035dd8b1cf6SFrederic Weisbecker CONFIG_EVENT_TRACING. 103684c6f88fSHitoshi Mitake 103784c6f88fSHitoshi Mitake CONFIG_LOCK_STAT defines "contended" and "acquired" lock events. 103884c6f88fSHitoshi Mitake (CONFIG_LOCKDEP defines "acquire" and "release" events.) 103984c6f88fSHitoshi Mitake 10404d9f34adSIngo Molnarconfig DEBUG_LOCKDEP 10414d9f34adSIngo Molnar bool "Lock dependency engine debugging" 1042517e7aa5SAdrian Bunk depends on DEBUG_KERNEL && LOCKDEP 10434d9f34adSIngo Molnar help 10444d9f34adSIngo Molnar If you say Y here, the lock dependency engine will do 10454d9f34adSIngo Molnar additional runtime checks to debug itself, at the price 10464d9f34adSIngo Molnar of more runtime overhead. 10474d9f34adSIngo Molnar 1048d902db1eSFrederic Weisbeckerconfig DEBUG_ATOMIC_SLEEP 1049d902db1eSFrederic Weisbecker bool "Sleep inside atomic section checking" 1050e8f7c70fSFrederic Weisbecker select PREEMPT_COUNT 10511da177e4SLinus Torvalds depends on DEBUG_KERNEL 10521da177e4SLinus Torvalds help 10531da177e4SLinus Torvalds If you say Y here, various routines which may sleep will become very 1054d902db1eSFrederic Weisbecker noisy if they are called inside atomic sections: when a spinlock is 1055d902db1eSFrederic Weisbecker held, inside an rcu read side critical section, inside preempt disabled 1056d902db1eSFrederic Weisbecker sections, inside an interrupt, etc... 10571da177e4SLinus Torvalds 1058cae2ed9aSIngo Molnarconfig DEBUG_LOCKING_API_SELFTESTS 1059cae2ed9aSIngo Molnar bool "Locking API boot-time self-tests" 1060cae2ed9aSIngo Molnar depends on DEBUG_KERNEL 1061cae2ed9aSIngo Molnar help 1062cae2ed9aSIngo Molnar Say Y here if you want the kernel to run a short self-test during 1063cae2ed9aSIngo Molnar bootup. The self-test checks whether common types of locking bugs 1064cae2ed9aSIngo Molnar are detected by debugging mechanisms or not. (if you disable 1065cae2ed9aSIngo Molnar lock debugging then those bugs wont be detected of course.) 1066cae2ed9aSIngo Molnar The following locking APIs are covered: spinlocks, rwlocks, 1067cae2ed9aSIngo Molnar mutexes and rwsems. 1068cae2ed9aSIngo Molnar 10690af3fe1eSPaul E. McKenneyconfig LOCK_TORTURE_TEST 10700af3fe1eSPaul E. McKenney tristate "torture tests for locking" 10710af3fe1eSPaul E. McKenney depends on DEBUG_KERNEL 10720af3fe1eSPaul E. McKenney select TORTURE_TEST 10730af3fe1eSPaul E. McKenney default n 10740af3fe1eSPaul E. McKenney help 10750af3fe1eSPaul E. McKenney This option provides a kernel module that runs torture tests 10760af3fe1eSPaul E. McKenney on kernel locking primitives. The kernel module may be built 10770af3fe1eSPaul E. McKenney after the fact on the running kernel to be tested, if desired. 10780af3fe1eSPaul E. McKenney 10790af3fe1eSPaul E. McKenney Say Y here if you want kernel locking-primitive torture tests 10800af3fe1eSPaul E. McKenney to be built into the kernel. 10810af3fe1eSPaul E. McKenney Say M if you want these torture tests to build as a module. 10820af3fe1eSPaul E. McKenney Say N if you are unsure. 10830af3fe1eSPaul E. McKenney 10849eade16bSDave Hansenendmenu # lock debugging 10859eade16bSDave Hansen 10869eade16bSDave Hansenconfig TRACE_IRQFLAGS 10879eade16bSDave Hansen bool 10889eade16bSDave Hansen help 10899eade16bSDave Hansen Enables hooks to interrupt enabling and disabling for 10909eade16bSDave Hansen either tracing or lock debugging. 10919eade16bSDave Hansen 10928637c099SIngo Molnarconfig STACKTRACE 10930c38e1feSDave Jones bool "Stack backtrace support" 10948637c099SIngo Molnar depends on STACKTRACE_SUPPORT 10950c38e1feSDave Jones help 10960c38e1feSDave Jones This option causes the kernel to create a /proc/pid/stack for 10970c38e1feSDave Jones every process, showing its current stack trace. 10980c38e1feSDave Jones It is also used by various kernel debugging features that require 10990c38e1feSDave Jones stack trace generation. 11008637c099SIngo Molnar 11011da177e4SLinus Torvaldsconfig DEBUG_KOBJECT 11021da177e4SLinus Torvalds bool "kobject debugging" 11031da177e4SLinus Torvalds depends on DEBUG_KERNEL 11041da177e4SLinus Torvalds help 11051da177e4SLinus Torvalds If you say Y here, some extra kobject debugging messages will be sent 11061da177e4SLinus Torvalds to the syslog. 11071da177e4SLinus Torvalds 1108c817a67eSRussell Kingconfig DEBUG_KOBJECT_RELEASE 1109c817a67eSRussell King bool "kobject release debugging" 11102a999aa0SLinus Torvalds depends on DEBUG_OBJECTS_TIMERS 1111c817a67eSRussell King help 1112c817a67eSRussell King kobjects are reference counted objects. This means that their 1113c817a67eSRussell King last reference count put is not predictable, and the kobject can 1114c817a67eSRussell King live on past the point at which a driver decides to drop it's 1115c817a67eSRussell King initial reference to the kobject gained on allocation. An 1116c817a67eSRussell King example of this would be a struct device which has just been 1117c817a67eSRussell King unregistered. 1118c817a67eSRussell King 1119c817a67eSRussell King However, some buggy drivers assume that after such an operation, 1120c817a67eSRussell King the memory backing the kobject can be immediately freed. This 1121c817a67eSRussell King goes completely against the principles of a refcounted object. 1122c817a67eSRussell King 1123c817a67eSRussell King If you say Y here, the kernel will delay the release of kobjects 1124c817a67eSRussell King on the last reference count to improve the visibility of this 1125c817a67eSRussell King kind of kobject release bug. 1126c817a67eSRussell King 11279b2a60c4SCatalin Marinasconfig HAVE_DEBUG_BUGVERBOSE 11289b2a60c4SCatalin Marinas bool 11299b2a60c4SCatalin Marinas 11301da177e4SLinus Torvaldsconfig DEBUG_BUGVERBOSE 11316a108a14SDavid Rientjes bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT 11329b2a60c4SCatalin Marinas depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) 11338420e7efSAlexey Dobriyan default y 11341da177e4SLinus Torvalds help 11351da177e4SLinus Torvalds Say Y here to make BUG() panics output the file name and line number 11361da177e4SLinus Torvalds of the BUG call as well as the EIP and oops trace. This aids 11371da177e4SLinus Torvalds debugging but costs about 70-100K of memory. 11381da177e4SLinus Torvalds 1139199a9afcSDave Jonesconfig DEBUG_LIST 1140199a9afcSDave Jones bool "Debug linked list manipulation" 1141199a9afcSDave Jones depends on DEBUG_KERNEL 1142199a9afcSDave Jones help 1143199a9afcSDave Jones Enable this to turn on extended checks in the linked-list 1144199a9afcSDave Jones walking routines. 1145199a9afcSDave Jones 1146199a9afcSDave Jones If unsure, say N. 1147199a9afcSDave Jones 1148b8cfff68SDan Streetmanconfig DEBUG_PI_LIST 1149b8cfff68SDan Streetman bool "Debug priority linked list manipulation" 1150b8cfff68SDan Streetman depends on DEBUG_KERNEL 1151b8cfff68SDan Streetman help 1152b8cfff68SDan Streetman Enable this to turn on extended checks in the priority-ordered 1153b8cfff68SDan Streetman linked-list (plist) walking routines. This checks the entire 1154b8cfff68SDan Streetman list multiple times during each manipulation. 1155b8cfff68SDan Streetman 1156b8cfff68SDan Streetman If unsure, say N. 1157b8cfff68SDan Streetman 1158d6ec0842SJens Axboeconfig DEBUG_SG 1159d6ec0842SJens Axboe bool "Debug SG table operations" 1160d6ec0842SJens Axboe depends on DEBUG_KERNEL 1161d6ec0842SJens Axboe help 1162d6ec0842SJens Axboe Enable this to turn on checks on scatter-gather tables. This can 1163d6ec0842SJens Axboe help find problems with drivers that do not properly initialize 1164d6ec0842SJens Axboe their sg tables. 1165d6ec0842SJens Axboe 1166d6ec0842SJens Axboe If unsure, say N. 1167d6ec0842SJens Axboe 11681b2439dbSArjan van de Venconfig DEBUG_NOTIFIERS 11691b2439dbSArjan van de Ven bool "Debug notifier call chains" 11701b2439dbSArjan van de Ven depends on DEBUG_KERNEL 11711b2439dbSArjan van de Ven help 11721b2439dbSArjan van de Ven Enable this to turn on sanity checking for notifier call chains. 11731b2439dbSArjan van de Ven This is most useful for kernel developers to make sure that 11741b2439dbSArjan van de Ven modules properly unregister themselves from notifier chains. 11751b2439dbSArjan van de Ven This is a relatively cheap check but if you care about maximum 11761b2439dbSArjan van de Ven performance, say N. 11771b2439dbSArjan van de Ven 1178e0e81739SDavid Howellsconfig DEBUG_CREDENTIALS 1179e0e81739SDavid Howells bool "Debug credential management" 1180e0e81739SDavid Howells depends on DEBUG_KERNEL 1181e0e81739SDavid Howells help 1182e0e81739SDavid Howells Enable this to turn on some debug checking for credential 1183e0e81739SDavid Howells management. The additional code keeps track of the number of 1184e0e81739SDavid Howells pointers from task_structs to any given cred struct, and checks to 1185e0e81739SDavid Howells see that this number never exceeds the usage count of the cred 1186e0e81739SDavid Howells struct. 1187e0e81739SDavid Howells 1188e0e81739SDavid Howells Furthermore, if SELinux is enabled, this also checks that the 1189e0e81739SDavid Howells security pointer in the cred struct is never seen to be invalid. 1190e0e81739SDavid Howells 1191e0e81739SDavid Howells If unsure, say N. 1192e0e81739SDavid Howells 11932f03e3caSDave Hansenmenu "RCU Debugging" 11942f03e3caSDave Hansen 11952f03e3caSDave Hansenconfig PROVE_RCU 11962f03e3caSDave Hansen bool "RCU debugging: prove RCU correctness" 11972f03e3caSDave Hansen depends on PROVE_LOCKING 11982f03e3caSDave Hansen default n 11992f03e3caSDave Hansen help 12002f03e3caSDave Hansen This feature enables lockdep extensions that check for correct 12012f03e3caSDave Hansen use of RCU APIs. This is currently under development. Say Y 12022f03e3caSDave Hansen if you want to debug RCU usage or help work on the PROVE_RCU 12032f03e3caSDave Hansen feature. 12042f03e3caSDave Hansen 12052f03e3caSDave Hansen Say N if you are unsure. 12062f03e3caSDave Hansen 12072f03e3caSDave Hansenconfig PROVE_RCU_REPEATEDLY 12082f03e3caSDave Hansen bool "RCU debugging: don't disable PROVE_RCU on first splat" 12092f03e3caSDave Hansen depends on PROVE_RCU 12102f03e3caSDave Hansen default n 12112f03e3caSDave Hansen help 12122f03e3caSDave Hansen By itself, PROVE_RCU will disable checking upon issuing the 12132f03e3caSDave Hansen first warning (or "splat"). This feature prevents such 12142f03e3caSDave Hansen disabling, allowing multiple RCU-lockdep warnings to be printed 12152f03e3caSDave Hansen on a single reboot. 12162f03e3caSDave Hansen 12172f03e3caSDave Hansen Say Y to allow multiple RCU-lockdep warnings per boot. 12182f03e3caSDave Hansen 12192f03e3caSDave Hansen Say N if you are unsure. 12202f03e3caSDave Hansen 12212f03e3caSDave Hansenconfig SPARSE_RCU_POINTER 12222f03e3caSDave Hansen bool "RCU debugging: sparse-based checks for pointer usage" 12232f03e3caSDave Hansen default n 12242f03e3caSDave Hansen help 12252f03e3caSDave Hansen This feature enables the __rcu sparse annotation for 12262f03e3caSDave Hansen RCU-protected pointers. This annotation will cause sparse 12272f03e3caSDave Hansen to flag any non-RCU used of annotated pointers. This can be 12282f03e3caSDave Hansen helpful when debugging RCU usage. Please note that this feature 12292f03e3caSDave Hansen is not intended to enforce code cleanliness; it is instead merely 12302f03e3caSDave Hansen a debugging aid. 12312f03e3caSDave Hansen 12322f03e3caSDave Hansen Say Y to make sparse flag questionable use of RCU-protected pointers 12332f03e3caSDave Hansen 12342f03e3caSDave Hansen Say N if you are unsure. 12352f03e3caSDave Hansen 123651b1130eSPaul E. McKenneyconfig TORTURE_TEST 123751b1130eSPaul E. McKenney tristate 123851b1130eSPaul E. McKenney default n 123951b1130eSPaul E. McKenney 1240a241ec65SPaul E. McKenneyconfig RCU_TORTURE_TEST 1241a241ec65SPaul E. McKenney tristate "torture tests for RCU" 1242a241ec65SPaul E. McKenney depends on DEBUG_KERNEL 124351b1130eSPaul E. McKenney select TORTURE_TEST 124483fe27eaSPranith Kumar select SRCU 1245a241ec65SPaul E. McKenney default n 1246a241ec65SPaul E. McKenney help 1247a241ec65SPaul E. McKenney This option provides a kernel module that runs torture tests 1248a241ec65SPaul E. McKenney on the RCU infrastructure. The kernel module may be built 1249a241ec65SPaul E. McKenney after the fact on the running kernel to be tested, if desired. 1250a241ec65SPaul E. McKenney 125131a72bceSPaul E. McKenney Say Y here if you want RCU torture tests to be built into 125231a72bceSPaul E. McKenney the kernel. 1253a241ec65SPaul E. McKenney Say M if you want the RCU torture tests to build as a module. 1254a241ec65SPaul E. McKenney Say N if you are unsure. 12558bb31b9dSAnkita Garg 125631a72bceSPaul E. McKenneyconfig RCU_TORTURE_TEST_RUNNABLE 125731a72bceSPaul E. McKenney bool "torture tests for RCU runnable by default" 125831a72bceSPaul E. McKenney depends on RCU_TORTURE_TEST = y 125931a72bceSPaul E. McKenney default n 126031a72bceSPaul E. McKenney help 126131a72bceSPaul E. McKenney This option provides a way to build the RCU torture tests 126231a72bceSPaul E. McKenney directly into the kernel without them starting up at boot 126331a72bceSPaul E. McKenney time. You can use /proc/sys/kernel/rcutorture_runnable 126431a72bceSPaul E. McKenney to manually override this setting. This /proc file is 126531a72bceSPaul E. McKenney available only when the RCU torture tests have been built 126631a72bceSPaul E. McKenney into the kernel. 126731a72bceSPaul E. McKenney 126831a72bceSPaul E. McKenney Say Y here if you want the RCU torture tests to start during 126931a72bceSPaul E. McKenney boot (you probably don't). 127031a72bceSPaul E. McKenney Say N here if you want the RCU torture tests to start only 127131a72bceSPaul E. McKenney after being manually enabled via /proc. 127231a72bceSPaul E. McKenney 1273b163760eSPaul E. McKenneyconfig RCU_CPU_STALL_TIMEOUT 1274b163760eSPaul E. McKenney int "RCU CPU stall timeout in seconds" 12756bfc09e2SPaul E. McKenney depends on RCU_STALL_COMMON 1276b163760eSPaul E. McKenney range 3 300 1277c896054fSPaul E. McKenney default 21 1278b163760eSPaul E. McKenney help 1279b163760eSPaul E. McKenney If a given RCU grace period extends more than the specified 1280b163760eSPaul E. McKenney number of seconds, a CPU stall warning is printed. If the 1281b163760eSPaul E. McKenney RCU grace period persists, additional CPU stall warnings are 1282b163760eSPaul E. McKenney printed at more widely spaced intervals. 1283b163760eSPaul E. McKenney 1284a858af28SPaul E. McKenneyconfig RCU_CPU_STALL_INFO 1285a858af28SPaul E. McKenney bool "Print additional diagnostics on RCU CPU stall" 128628f6569aSPranith Kumar depends on (TREE_RCU || PREEMPT_RCU) && DEBUG_KERNEL 128768158fe2SPaul E. McKenney default y 1288a858af28SPaul E. McKenney help 1289a858af28SPaul E. McKenney For each stalled CPU that is aware of the current RCU grace 1290a858af28SPaul E. McKenney period, print out additional per-CPU diagnostic information 1291a858af28SPaul E. McKenney regarding scheduling-clock ticks, idle state, and, 1292a858af28SPaul E. McKenney for RCU_FAST_NO_HZ kernels, idle-entry state. 1293a858af28SPaul E. McKenney 1294a858af28SPaul E. McKenney Say N if you are unsure. 1295a858af28SPaul E. McKenney 1296a858af28SPaul E. McKenney Say Y if you want to enable such diagnostics. 1297a858af28SPaul E. McKenney 12985c8806a0SPaul E. McKenneyconfig RCU_TRACE 12995c8806a0SPaul E. McKenney bool "Enable tracing for RCU" 13005c8806a0SPaul E. McKenney depends on DEBUG_KERNEL 130152494535SPaul E. McKenney select TRACE_CLOCK 13025c8806a0SPaul E. McKenney help 13035c8806a0SPaul E. McKenney This option provides tracing in RCU which presents stats 13045c8806a0SPaul E. McKenney in debugfs for debugging RCU implementation. 13055c8806a0SPaul E. McKenney 13065c8806a0SPaul E. McKenney Say Y here if you want to enable RCU tracing 13075c8806a0SPaul E. McKenney Say N if you are unsure. 13085c8806a0SPaul E. McKenney 13092f03e3caSDave Hansenendmenu # "RCU Debugging" 13102f03e3caSDave Hansen 1311870d6656STejun Heoconfig DEBUG_BLOCK_EXT_DEVT 1312870d6656STejun Heo bool "Force extended block device numbers and spread them" 1313870d6656STejun Heo depends on DEBUG_KERNEL 1314870d6656STejun Heo depends on BLOCK 1315759f8ca3SJens Axboe default n 1316870d6656STejun Heo help 13170e11e342STejun Heo BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON 13180e11e342STejun Heo SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT 13190e11e342STejun Heo YOU ARE DOING. Distros, please enable this and fix whatever 13200e11e342STejun Heo is broken. 13210e11e342STejun Heo 1322870d6656STejun Heo Conventionally, block device numbers are allocated from 1323870d6656STejun Heo predetermined contiguous area. However, extended block area 1324870d6656STejun Heo may introduce non-contiguous block device numbers. This 1325870d6656STejun Heo option forces most block device numbers to be allocated from 1326870d6656STejun Heo the extended space and spreads them to discover kernel or 1327870d6656STejun Heo userland code paths which assume predetermined contiguous 1328870d6656STejun Heo device number allocation. 1329870d6656STejun Heo 133055dc7db7STejun Heo Note that turning on this debug option shuffles all the 133155dc7db7STejun Heo device numbers for all IDE and SCSI devices including libata 133255dc7db7STejun Heo ones, so root partition specified using device number 133355dc7db7STejun Heo directly (via rdev or root=MAJ:MIN) won't work anymore. 133455dc7db7STejun Heo Textual device names (root=/dev/sdXn) will continue to work. 133555dc7db7STejun Heo 1336870d6656STejun Heo Say N if you are unsure. 1337870d6656STejun Heo 13388d438288SAkinobu Mitaconfig NOTIFIER_ERROR_INJECTION 13398d438288SAkinobu Mita tristate "Notifier error injection" 13408d438288SAkinobu Mita depends on DEBUG_KERNEL 13418d438288SAkinobu Mita select DEBUG_FS 13428d438288SAkinobu Mita help 1343e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 13448d438288SAkinobu Mita specified notifier chain callbacks. It is useful to test the error 13458d438288SAkinobu Mita handling of notifier call chain failures. 13468d438288SAkinobu Mita 13478d438288SAkinobu Mita Say N if unsure. 13488d438288SAkinobu Mita 1349c9d221f8SAkinobu Mitaconfig CPU_NOTIFIER_ERROR_INJECT 1350c9d221f8SAkinobu Mita tristate "CPU notifier error injection module" 1351f5a9f52eSAkinobu Mita depends on HOTPLUG_CPU && NOTIFIER_ERROR_INJECTION 1352c9d221f8SAkinobu Mita help 1353c9d221f8SAkinobu Mita This option provides a kernel module that can be used to test 1354e41e85ccSMasanari Iida the error handling of the cpu notifiers by injecting artificial 1355f5a9f52eSAkinobu Mita errors to CPU notifier chain callbacks. It is controlled through 1356f5a9f52eSAkinobu Mita debugfs interface under /sys/kernel/debug/notifier-error-inject/cpu 1357f5a9f52eSAkinobu Mita 1358f5a9f52eSAkinobu Mita If the notifier call chain should be failed with some events 1359f5a9f52eSAkinobu Mita notified, write the error code to "actions/<notifier event>/error". 1360f5a9f52eSAkinobu Mita 1361f5a9f52eSAkinobu Mita Example: Inject CPU offline error (-1 == -EPERM) 1362f5a9f52eSAkinobu Mita 1363f5a9f52eSAkinobu Mita # cd /sys/kernel/debug/notifier-error-inject/cpu 1364f5a9f52eSAkinobu Mita # echo -1 > actions/CPU_DOWN_PREPARE/error 1365f5a9f52eSAkinobu Mita # echo 0 > /sys/devices/system/cpu/cpu1/online 1366f5a9f52eSAkinobu Mita bash: echo: write error: Operation not permitted 1367c9d221f8SAkinobu Mita 1368c9d221f8SAkinobu Mita To compile this code as a module, choose M here: the module will 1369c9d221f8SAkinobu Mita be called cpu-notifier-error-inject. 1370c9d221f8SAkinobu Mita 1371c9d221f8SAkinobu Mita If unsure, say N. 1372c9d221f8SAkinobu Mita 1373048b9c35SAkinobu Mitaconfig PM_NOTIFIER_ERROR_INJECT 1374048b9c35SAkinobu Mita tristate "PM notifier error injection module" 1375048b9c35SAkinobu Mita depends on PM && NOTIFIER_ERROR_INJECTION 1376048b9c35SAkinobu Mita default m if PM_DEBUG 1377048b9c35SAkinobu Mita help 1378e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 1379048b9c35SAkinobu Mita PM notifier chain callbacks. It is controlled through debugfs 1380048b9c35SAkinobu Mita interface /sys/kernel/debug/notifier-error-inject/pm 1381048b9c35SAkinobu Mita 1382048b9c35SAkinobu Mita If the notifier call chain should be failed with some events 1383048b9c35SAkinobu Mita notified, write the error code to "actions/<notifier event>/error". 1384048b9c35SAkinobu Mita 1385048b9c35SAkinobu Mita Example: Inject PM suspend error (-12 = -ENOMEM) 1386048b9c35SAkinobu Mita 1387048b9c35SAkinobu Mita # cd /sys/kernel/debug/notifier-error-inject/pm/ 1388048b9c35SAkinobu Mita # echo -12 > actions/PM_SUSPEND_PREPARE/error 1389048b9c35SAkinobu Mita # echo mem > /sys/power/state 1390048b9c35SAkinobu Mita bash: echo: write error: Cannot allocate memory 1391048b9c35SAkinobu Mita 1392048b9c35SAkinobu Mita To compile this code as a module, choose M here: the module will 1393048b9c35SAkinobu Mita be called pm-notifier-error-inject. 1394048b9c35SAkinobu Mita 1395048b9c35SAkinobu Mita If unsure, say N. 1396048b9c35SAkinobu Mita 1397d526e85fSBenjamin Herrenschmidtconfig OF_RECONFIG_NOTIFIER_ERROR_INJECT 1398d526e85fSBenjamin Herrenschmidt tristate "OF reconfig notifier error injection module" 1399d526e85fSBenjamin Herrenschmidt depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION 140008dfb4ddSAkinobu Mita help 1401e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 1402d526e85fSBenjamin Herrenschmidt OF reconfig notifier chain callbacks. It is controlled 140308dfb4ddSAkinobu Mita through debugfs interface under 1404d526e85fSBenjamin Herrenschmidt /sys/kernel/debug/notifier-error-inject/OF-reconfig/ 140508dfb4ddSAkinobu Mita 140608dfb4ddSAkinobu Mita If the notifier call chain should be failed with some events 140708dfb4ddSAkinobu Mita notified, write the error code to "actions/<notifier event>/error". 140808dfb4ddSAkinobu Mita 140908dfb4ddSAkinobu Mita To compile this code as a module, choose M here: the module will 1410e12a95f4SAkinobu Mita be called of-reconfig-notifier-error-inject. 141108dfb4ddSAkinobu Mita 141208dfb4ddSAkinobu Mita If unsure, say N. 141308dfb4ddSAkinobu Mita 14146ff1cb35SAkinobu Mitaconfig FAULT_INJECTION 14151ab8509aSAndrew Morton bool "Fault-injection framework" 14161ab8509aSAndrew Morton depends on DEBUG_KERNEL 1417329409aeSAkinobu Mita help 1418329409aeSAkinobu Mita Provide fault-injection framework. 1419329409aeSAkinobu Mita For more details, see Documentation/fault-injection/. 14206ff1cb35SAkinobu Mita 14218a8b6502SAkinobu Mitaconfig FAILSLAB 14221ab8509aSAndrew Morton bool "Fault-injection capability for kmalloc" 14231ab8509aSAndrew Morton depends on FAULT_INJECTION 1424773ff60eSAkinobu Mita depends on SLAB || SLUB 14258a8b6502SAkinobu Mita help 14261ab8509aSAndrew Morton Provide fault-injection capability for kmalloc. 14278a8b6502SAkinobu Mita 1428933e312eSAkinobu Mitaconfig FAIL_PAGE_ALLOC 1429933e312eSAkinobu Mita bool "Fault-injection capabilitiy for alloc_pages()" 14301ab8509aSAndrew Morton depends on FAULT_INJECTION 1431933e312eSAkinobu Mita help 14321ab8509aSAndrew Morton Provide fault-injection capability for alloc_pages(). 1433933e312eSAkinobu Mita 1434c17bb495SAkinobu Mitaconfig FAIL_MAKE_REQUEST 143586327d19SDave Jones bool "Fault-injection capability for disk IO" 1436581d4e28SJens Axboe depends on FAULT_INJECTION && BLOCK 1437c17bb495SAkinobu Mita help 14381ab8509aSAndrew Morton Provide fault-injection capability for disk IO. 1439c17bb495SAkinobu Mita 1440581d4e28SJens Axboeconfig FAIL_IO_TIMEOUT 1441f4d01439STakuya Yoshikawa bool "Fault-injection capability for faking disk interrupts" 1442581d4e28SJens Axboe depends on FAULT_INJECTION && BLOCK 1443581d4e28SJens Axboe help 1444581d4e28SJens Axboe Provide fault-injection capability on end IO handling. This 1445581d4e28SJens Axboe will make the block layer "forget" an interrupt as configured, 1446581d4e28SJens Axboe thus exercising the error handling. 1447581d4e28SJens Axboe 1448581d4e28SJens Axboe Only works with drivers that use the generic timeout handling, 1449581d4e28SJens Axboe for others it wont do anything. 1450581d4e28SJens Axboe 14511b676f70SPer Forlinconfig FAIL_MMC_REQUEST 14521b676f70SPer Forlin bool "Fault-injection capability for MMC IO" 14531b676f70SPer Forlin select DEBUG_FS 14541b676f70SPer Forlin depends on FAULT_INJECTION && MMC 14551b676f70SPer Forlin help 14561b676f70SPer Forlin Provide fault-injection capability for MMC IO. 14571b676f70SPer Forlin This will make the mmc core return data errors. This is 14581b676f70SPer Forlin useful to test the error handling in the mmc block device 14591b676f70SPer Forlin and to test how the mmc host driver handles retries from 14601b676f70SPer Forlin the block device. 14611b676f70SPer Forlin 14626ff1cb35SAkinobu Mitaconfig FAULT_INJECTION_DEBUG_FS 14636ff1cb35SAkinobu Mita bool "Debugfs entries for fault-injection capabilities" 14641ab8509aSAndrew Morton depends on FAULT_INJECTION && SYSFS && DEBUG_FS 14656ff1cb35SAkinobu Mita help 14661ab8509aSAndrew Morton Enable configuration of fault-injection capabilities via debugfs. 14671df49008SAkinobu Mita 14681df49008SAkinobu Mitaconfig FAULT_INJECTION_STACKTRACE_FILTER 14691df49008SAkinobu Mita bool "stacktrace filter for fault-injection capabilities" 14701df49008SAkinobu Mita depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT 14716d690dcaSAkinobu Mita depends on !X86_64 14721df49008SAkinobu Mita select STACKTRACE 1473df2e1ef6SChen Gang select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE 14741df49008SAkinobu Mita help 14751df49008SAkinobu Mita Provide stacktrace filter for fault-injection capabilities 1476267c4025SMathieu Desnoyers 14779745512cSArjan van de Venconfig LATENCYTOP 14789745512cSArjan van de Ven bool "Latency measuring infrastructure" 1479625fdcaaSRandy Dunlap depends on HAVE_LATENCYTOP_SUPPORT 1480625fdcaaSRandy Dunlap depends on DEBUG_KERNEL 1481625fdcaaSRandy Dunlap depends on STACKTRACE_SUPPORT 1482625fdcaaSRandy Dunlap depends on PROC_FS 1483cc80ae38SVineet Gupta select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC 14849745512cSArjan van de Ven select KALLSYMS 14859745512cSArjan van de Ven select KALLSYMS_ALL 14869745512cSArjan van de Ven select STACKTRACE 14879745512cSArjan van de Ven select SCHEDSTATS 14889745512cSArjan van de Ven select SCHED_DEBUG 14899745512cSArjan van de Ven help 14909745512cSArjan van de Ven Enable this option if you want to use the LatencyTOP tool 14919745512cSArjan van de Ven to find out which userspace is blocking on what kernel operations. 14929745512cSArjan van de Ven 1493446f24d1SStephen Boydconfig ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 1494446f24d1SStephen Boyd bool 1495446f24d1SStephen Boyd 1496446f24d1SStephen Boydconfig DEBUG_STRICT_USER_COPY_CHECKS 1497446f24d1SStephen Boyd bool "Strict user copy size checks" 1498446f24d1SStephen Boyd depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 1499446f24d1SStephen Boyd depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING 1500446f24d1SStephen Boyd help 1501446f24d1SStephen Boyd Enabling this option turns a certain set of sanity checks for user 1502446f24d1SStephen Boyd copy operations into compile time failures. 1503446f24d1SStephen Boyd 1504446f24d1SStephen Boyd The copy_from_user() etc checks are there to help test if there 1505446f24d1SStephen Boyd are sufficient security checks on the length argument of 1506446f24d1SStephen Boyd the copy operation, by having gcc prove that the argument is 1507446f24d1SStephen Boyd within bounds. 1508446f24d1SStephen Boyd 1509446f24d1SStephen Boyd If unsure, say N. 1510446f24d1SStephen Boyd 151116444a8aSArnaldo Carvalho de Melosource kernel/trace/Kconfig 151216444a8aSArnaldo Carvalho de Melo 1513881c5149SDave Hansenmenu "Runtime Testing" 1514881c5149SDave Hansen 1515881c5149SDave Hansenconfig LKDTM 1516881c5149SDave Hansen tristate "Linux Kernel Dump Test Tool Module" 1517881c5149SDave Hansen depends on DEBUG_FS 1518881c5149SDave Hansen depends on BLOCK 1519881c5149SDave Hansen default n 1520881c5149SDave Hansen help 1521881c5149SDave Hansen This module enables testing of the different dumping mechanisms by 1522881c5149SDave Hansen inducing system failures at predefined crash points. 1523881c5149SDave Hansen If you don't need it: say N 1524881c5149SDave Hansen Choose M here to compile this code as a module. The module will be 1525881c5149SDave Hansen called lkdtm. 1526881c5149SDave Hansen 1527881c5149SDave Hansen Documentation on how to use the module can be found in 1528881c5149SDave Hansen Documentation/fault-injection/provoke-crashes.txt 1529881c5149SDave Hansen 1530881c5149SDave Hansenconfig TEST_LIST_SORT 1531881c5149SDave Hansen bool "Linked list sorting test" 1532881c5149SDave Hansen depends on DEBUG_KERNEL 1533881c5149SDave Hansen help 1534881c5149SDave Hansen Enable this to turn on 'list_sort()' function test. This test is 1535881c5149SDave Hansen executed only once during system boot, so affects only boot time. 1536881c5149SDave Hansen 1537881c5149SDave Hansen If unsure, say N. 1538881c5149SDave Hansen 1539881c5149SDave Hansenconfig KPROBES_SANITY_TEST 1540881c5149SDave Hansen bool "Kprobes sanity tests" 1541881c5149SDave Hansen depends on DEBUG_KERNEL 1542881c5149SDave Hansen depends on KPROBES 1543881c5149SDave Hansen default n 1544881c5149SDave Hansen help 1545881c5149SDave Hansen This option provides for testing basic kprobes functionality on 1546881c5149SDave Hansen boot. A sample kprobe, jprobe and kretprobe are inserted and 1547881c5149SDave Hansen verified for functionality. 1548881c5149SDave Hansen 1549881c5149SDave Hansen Say N if you are unsure. 1550881c5149SDave Hansen 1551881c5149SDave Hansenconfig BACKTRACE_SELF_TEST 1552881c5149SDave Hansen tristate "Self test for the backtrace code" 1553881c5149SDave Hansen depends on DEBUG_KERNEL 1554881c5149SDave Hansen default n 1555881c5149SDave Hansen help 1556881c5149SDave Hansen This option provides a kernel module that can be used to test 1557881c5149SDave Hansen the kernel stack backtrace code. This option is not useful 1558881c5149SDave Hansen for distributions or general kernels, but only for kernel 1559881c5149SDave Hansen developers working on architecture code. 1560881c5149SDave Hansen 1561881c5149SDave Hansen Note that if you want to also test saved backtraces, you will 1562881c5149SDave Hansen have to enable STACKTRACE as well. 1563881c5149SDave Hansen 1564881c5149SDave Hansen Say N if you are unsure. 1565881c5149SDave Hansen 1566910a742dSMichel Lespinasseconfig RBTREE_TEST 1567910a742dSMichel Lespinasse tristate "Red-Black tree test" 15687c993e11SCody P Schafer depends on DEBUG_KERNEL 1569910a742dSMichel Lespinasse help 1570910a742dSMichel Lespinasse A benchmark measuring the performance of the rbtree library. 1571910a742dSMichel Lespinasse Also includes rbtree invariant checks. 1572910a742dSMichel Lespinasse 1573fff3fd8aSMichel Lespinasseconfig INTERVAL_TREE_TEST 1574fff3fd8aSMichel Lespinasse tristate "Interval tree test" 1575fff3fd8aSMichel Lespinasse depends on m && DEBUG_KERNEL 1576a88cc108SChris Wilson select INTERVAL_TREE 1577fff3fd8aSMichel Lespinasse help 1578fff3fd8aSMichel Lespinasse A benchmark measuring the performance of the interval tree library 1579fff3fd8aSMichel Lespinasse 1580623fd807SGreg Thelenconfig PERCPU_TEST 1581623fd807SGreg Thelen tristate "Per cpu operations test" 1582623fd807SGreg Thelen depends on m && DEBUG_KERNEL 1583623fd807SGreg Thelen help 1584623fd807SGreg Thelen Enable this option to build test module which validates per-cpu 1585623fd807SGreg Thelen operations. 1586623fd807SGreg Thelen 1587623fd807SGreg Thelen If unsure, say N. 1588623fd807SGreg Thelen 1589881c5149SDave Hansenconfig ATOMIC64_SELFTEST 1590881c5149SDave Hansen bool "Perform an atomic64_t self-test at boot" 1591881c5149SDave Hansen help 1592881c5149SDave Hansen Enable this option to test the atomic64_t functions at boot. 1593881c5149SDave Hansen 1594881c5149SDave Hansen If unsure, say N. 1595881c5149SDave Hansen 1596881c5149SDave Hansenconfig ASYNC_RAID6_TEST 1597881c5149SDave Hansen tristate "Self test for hardware accelerated raid6 recovery" 1598881c5149SDave Hansen depends on ASYNC_RAID6_RECOV 1599881c5149SDave Hansen select ASYNC_MEMCPY 1600881c5149SDave Hansen ---help--- 1601881c5149SDave Hansen This is a one-shot self test that permutes through the 1602881c5149SDave Hansen recovery of all the possible two disk failure scenarios for a 1603881c5149SDave Hansen N-disk array. Recovery is performed with the asynchronous 1604881c5149SDave Hansen raid6 recovery routines, and will optionally use an offload 1605881c5149SDave Hansen engine if one is available. 1606881c5149SDave Hansen 1607881c5149SDave Hansen If unsure, say N. 1608881c5149SDave Hansen 160964d1d77aSAndy Shevchenkoconfig TEST_HEXDUMP 161064d1d77aSAndy Shevchenko tristate "Test functions located in the hexdump module at runtime" 161164d1d77aSAndy Shevchenko 1612881c5149SDave Hansenconfig TEST_STRING_HELPERS 1613881c5149SDave Hansen tristate "Test functions located in the string_helpers module at runtime" 1614881c5149SDave Hansen 1615881c5149SDave Hansenconfig TEST_KSTRTOX 1616881c5149SDave Hansen tristate "Test kstrto*() family of functions at runtime" 1617881c5149SDave Hansen 16187e1e7763SThomas Grafconfig TEST_RHASHTABLE 16199d6dbe1bSGeert Uytterhoeven tristate "Perform selftest on resizable hash table" 16207e1e7763SThomas Graf default n 16217e1e7763SThomas Graf help 16227e1e7763SThomas Graf Enable this option to test the rhashtable functions at boot. 16237e1e7763SThomas Graf 16247e1e7763SThomas Graf If unsure, say N. 16257e1e7763SThomas Graf 1626881c5149SDave Hansenendmenu # runtime tests 1627881c5149SDave Hansen 1628f212ec4bSBernhard Kaindlconfig PROVIDE_OHCI1394_DMA_INIT 1629080de8c2SStefan Richter bool "Remote debugging over FireWire early on boot" 1630f212ec4bSBernhard Kaindl depends on PCI && X86 1631f212ec4bSBernhard Kaindl help 1632f212ec4bSBernhard Kaindl If you want to debug problems which hang or crash the kernel early 1633f212ec4bSBernhard Kaindl on boot and the crashing machine has a FireWire port, you can use 1634f212ec4bSBernhard Kaindl this feature to remotely access the memory of the crashed machine 1635f212ec4bSBernhard Kaindl over FireWire. This employs remote DMA as part of the OHCI1394 1636f212ec4bSBernhard Kaindl specification which is now the standard for FireWire controllers. 1637f212ec4bSBernhard Kaindl 1638f212ec4bSBernhard Kaindl With remote DMA, you can monitor the printk buffer remotely using 1639f212ec4bSBernhard Kaindl firescope and access all memory below 4GB using fireproxy from gdb. 1640f212ec4bSBernhard Kaindl Even controlling a kernel debugger is possible using remote DMA. 1641f212ec4bSBernhard Kaindl 1642f212ec4bSBernhard Kaindl Usage: 1643f212ec4bSBernhard Kaindl 1644f212ec4bSBernhard Kaindl If ohci1394_dma=early is used as boot parameter, it will initialize 1645f212ec4bSBernhard Kaindl all OHCI1394 controllers which are found in the PCI config space. 1646f212ec4bSBernhard Kaindl 1647f212ec4bSBernhard Kaindl As all changes to the FireWire bus such as enabling and disabling 1648f212ec4bSBernhard Kaindl devices cause a bus reset and thereby disable remote DMA for all 1649f212ec4bSBernhard Kaindl devices, be sure to have the cable plugged and FireWire enabled on 1650f212ec4bSBernhard Kaindl the debugging host before booting the debug target for debugging. 1651f212ec4bSBernhard Kaindl 1652f212ec4bSBernhard Kaindl This code (~1k) is freed after boot. By then, the firewire stack 1653f212ec4bSBernhard Kaindl in charge of the OHCI-1394 controllers should be used instead. 1654f212ec4bSBernhard Kaindl 1655f212ec4bSBernhard Kaindl See Documentation/debugging-via-ohci1394.txt for more information. 16569745512cSArjan van de Ven 1657152de30bSRandy Dunlapconfig BUILD_DOCSRC 16583794f3e8SRandy Dunlap bool "Build targets in Documentation/ tree" 16593794f3e8SRandy Dunlap depends on HEADERS_CHECK 16603794f3e8SRandy Dunlap help 16613794f3e8SRandy Dunlap This option attempts to build objects from the source files in the 16623794f3e8SRandy Dunlap kernel Documentation/ tree. 16633794f3e8SRandy Dunlap 16643794f3e8SRandy Dunlap Say N if you are unsure. 16653794f3e8SRandy Dunlap 16665ee00bd4SJoerg Roedelconfig DMA_API_DEBUG 16675ee00bd4SJoerg Roedel bool "Enable debugging of DMA-API usage" 16685ee00bd4SJoerg Roedel depends on HAVE_DMA_API_DEBUG 16695ee00bd4SJoerg Roedel help 16705ee00bd4SJoerg Roedel Enable this option to debug the use of the DMA API by device drivers. 16715ee00bd4SJoerg Roedel With this option you will be able to detect common bugs in device 16725ee00bd4SJoerg Roedel drivers like double-freeing of DMA mappings or freeing mappings that 16735ee00bd4SJoerg Roedel were never allocated. 16740abdd7a8SDan Williams 16750abdd7a8SDan Williams This also attempts to catch cases where a page owned by DMA is 16760abdd7a8SDan Williams accessed by the cpu in a way that could cause data corruption. For 16770abdd7a8SDan Williams example, this enables cow_user_page() to check that the source page is 16780abdd7a8SDan Williams not undergoing DMA. 16790abdd7a8SDan Williams 16800abdd7a8SDan Williams This option causes a performance degradation. Use only if you want to 16810abdd7a8SDan Williams debug device drivers and dma interactions. 16820abdd7a8SDan Williams 16830abdd7a8SDan Williams If unsure, say N. 1684346e15beSJason Baron 16858a6f0b47SValentin Rothbergconfig TEST_LKM 168693e9ef83SKees Cook tristate "Test module loading with 'hello world' module" 168793e9ef83SKees Cook default n 168893e9ef83SKees Cook depends on m 168993e9ef83SKees Cook help 169093e9ef83SKees Cook This builds the "test_module" module that emits "Hello, world" 169193e9ef83SKees Cook on printk when loaded. It is designed to be used for basic 169293e9ef83SKees Cook evaluation of the module loading subsystem (for example when 169393e9ef83SKees Cook validating module verification). It lacks any extra dependencies, 169493e9ef83SKees Cook and will not normally be loaded by the system unless explicitly 169593e9ef83SKees Cook requested by name. 169693e9ef83SKees Cook 169793e9ef83SKees Cook If unsure, say N. 169893e9ef83SKees Cook 16993e2a4c18SKees Cookconfig TEST_USER_COPY 17003e2a4c18SKees Cook tristate "Test user/kernel boundary protections" 17013e2a4c18SKees Cook default n 17023e2a4c18SKees Cook depends on m 17033e2a4c18SKees Cook help 17043e2a4c18SKees Cook This builds the "test_user_copy" module that runs sanity checks 17053e2a4c18SKees Cook on the copy_to/from_user infrastructure, making sure basic 17063e2a4c18SKees Cook user/kernel boundary testing is working. If it fails to load, 17073e2a4c18SKees Cook a regression has been detected in the user/kernel memory boundary 17083e2a4c18SKees Cook protections. 17093e2a4c18SKees Cook 17103e2a4c18SKees Cook If unsure, say N. 17113e2a4c18SKees Cook 171264a8946bSAlexei Starovoitovconfig TEST_BPF 171364a8946bSAlexei Starovoitov tristate "Test BPF filter functionality" 171464a8946bSAlexei Starovoitov default n 171598920ba6SRandy Dunlap depends on m && NET 171664a8946bSAlexei Starovoitov help 171764a8946bSAlexei Starovoitov This builds the "test_bpf" module that runs various test vectors 171864a8946bSAlexei Starovoitov against the BPF interpreter or BPF JIT compiler depending on the 171964a8946bSAlexei Starovoitov current setting. This is in particular useful for BPF JIT compiler 172064a8946bSAlexei Starovoitov development, but also to run regression tests against changes in 17213c731ebaSAlexei Starovoitov the interpreter code. It also enables test stubs for eBPF maps and 17223c731ebaSAlexei Starovoitov verifier used by user space verifier testsuite. 172364a8946bSAlexei Starovoitov 172464a8946bSAlexei Starovoitov If unsure, say N. 172564a8946bSAlexei Starovoitov 17260a8adf58SKees Cookconfig TEST_FIRMWARE 17270a8adf58SKees Cook tristate "Test firmware loading via userspace interface" 17280a8adf58SKees Cook default n 17290a8adf58SKees Cook depends on FW_LOADER 17300a8adf58SKees Cook help 17310a8adf58SKees Cook This builds the "test_firmware" module that creates a userspace 17320a8adf58SKees Cook interface for testing firmware loading. This can be used to 17330a8adf58SKees Cook control the triggering of firmware loading without needing an 17340a8adf58SKees Cook actual firmware-using device. The contents can be rechecked by 17350a8adf58SKees Cook userspace. 17360a8adf58SKees Cook 17370a8adf58SKees Cook If unsure, say N. 17380a8adf58SKees Cook 1739e704f93aSDavid Rileyconfig TEST_UDELAY 1740e704f93aSDavid Riley tristate "udelay test driver" 1741e704f93aSDavid Riley default n 1742e704f93aSDavid Riley help 1743e704f93aSDavid Riley This builds the "udelay_test" module that helps to make sure 1744e704f93aSDavid Riley that udelay() is working properly. 1745e704f93aSDavid Riley 1746e704f93aSDavid Riley If unsure, say N. 1747e704f93aSDavid Riley 17484a20799dSVladimir Murzinconfig MEMTEST 17494a20799dSVladimir Murzin bool "Memtest" 17504a20799dSVladimir Murzin depends on HAVE_MEMBLOCK 17514a20799dSVladimir Murzin ---help--- 17524a20799dSVladimir Murzin This option adds a kernel parameter 'memtest', which allows memtest 17534a20799dSVladimir Murzin to be set. 17544a20799dSVladimir Murzin memtest=0, mean disabled; -- default 17554a20799dSVladimir Murzin memtest=1, mean do 1 test pattern; 17564a20799dSVladimir Murzin ... 17578d8cfb47SVladimir Murzin memtest=17, mean do 17 test patterns. 17584a20799dSVladimir Murzin If you are unsure how to answer this question, answer N. 17594a20799dSVladimir Murzin 1760267c4025SMathieu Desnoyerssource "samples/Kconfig" 1761dc7d5527SJason Wessel 1762dc7d5527SJason Wesselsource "lib/Kconfig.kgdb" 17630a4af3b0SPekka Enberg 1764