1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 206ec64b8SChristoph Hellwigmenu "Kernel hacking" 306ec64b8SChristoph Hellwig 4604ff0dcSDave Hansenmenu "printk and dmesg options" 51da177e4SLinus Torvalds 61da177e4SLinus Torvaldsconfig PRINTK_TIME 71da177e4SLinus Torvalds bool "Show timing information on printks" 8d3b8b6e5SRandy Dunlap depends on PRINTK 91da177e4SLinus Torvalds help 10649e6ee3SKay Sievers Selecting this option causes time stamps of the printk() 11649e6ee3SKay Sievers messages to be added to the output of the syslog() system 12649e6ee3SKay Sievers call and at the console. 13649e6ee3SKay Sievers 14649e6ee3SKay Sievers The timestamp is always recorded internally, and exported 15649e6ee3SKay Sievers to /dev/kmsg. This flag just specifies if the timestamp should 16649e6ee3SKay Sievers be included, not that the timestamp is recorded. 17649e6ee3SKay Sievers 18649e6ee3SKay Sievers The behavior is also controlled by the kernel command line 198c27ceffSMauro Carvalho Chehab parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst 201da177e4SLinus Torvalds 2115ff2069STetsuo Handaconfig PRINTK_CALLER 2215ff2069STetsuo Handa bool "Show caller information on printks" 2315ff2069STetsuo Handa depends on PRINTK 2415ff2069STetsuo Handa help 2515ff2069STetsuo Handa Selecting this option causes printk() to add a caller "thread id" (if 2615ff2069STetsuo Handa in task context) or a caller "processor id" (if not in task context) 2715ff2069STetsuo Handa to every message. 2815ff2069STetsuo Handa 2915ff2069STetsuo Handa This option is intended for environments where multiple threads 3015ff2069STetsuo Handa concurrently call printk() for many times, for it is difficult to 3115ff2069STetsuo Handa interpret without knowing where these lines (or sometimes individual 3215ff2069STetsuo Handa line which was divided into multiple lines due to race) came from. 3315ff2069STetsuo Handa 3415ff2069STetsuo Handa Since toggling after boot makes the code racy, currently there is 3515ff2069STetsuo Handa no option to enable/disable at the kernel command line parameter or 3615ff2069STetsuo Handa sysfs interface. 3715ff2069STetsuo Handa 3822f4e66dSStephen Boydconfig STACKTRACE_BUILD_ID 3922f4e66dSStephen Boyd bool "Show build ID information in stacktraces" 4022f4e66dSStephen Boyd depends on PRINTK 4122f4e66dSStephen Boyd help 4222f4e66dSStephen Boyd Selecting this option adds build ID information for symbols in 4322f4e66dSStephen Boyd stacktraces printed with the printk format '%p[SR]b'. 4422f4e66dSStephen Boyd 4522f4e66dSStephen Boyd This option is intended for distros where debuginfo is not easily 4622f4e66dSStephen Boyd accessible but can be downloaded given the build ID of the vmlinux or 4722f4e66dSStephen Boyd kernel module where the function is located. 4822f4e66dSStephen Boyd 49a8cfdc68SOlof Johanssonconfig CONSOLE_LOGLEVEL_DEFAULT 50a8cfdc68SOlof Johansson int "Default console loglevel (1-15)" 51a8cfdc68SOlof Johansson range 1 15 52a8cfdc68SOlof Johansson default "7" 53a8cfdc68SOlof Johansson help 54a8cfdc68SOlof Johansson Default loglevel to determine what will be printed on the console. 55a8cfdc68SOlof Johansson 56a8cfdc68SOlof Johansson Setting a default here is equivalent to passing in loglevel=<x> in 57a8cfdc68SOlof Johansson the kernel bootargs. loglevel=<x> continues to override whatever 58a8cfdc68SOlof Johansson value is specified here as well. 59a8cfdc68SOlof Johansson 6050f4d9bdSBorislav Petkov Note: This does not affect the log level of un-prefixed printk() 61a8cfdc68SOlof Johansson usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT 62a8cfdc68SOlof Johansson option. 63a8cfdc68SOlof Johansson 6422eceb8bSHans de Goedeconfig CONSOLE_LOGLEVEL_QUIET 6522eceb8bSHans de Goede int "quiet console loglevel (1-15)" 6622eceb8bSHans de Goede range 1 15 6722eceb8bSHans de Goede default "4" 6822eceb8bSHans de Goede help 6922eceb8bSHans de Goede loglevel to use when "quiet" is passed on the kernel commandline. 7022eceb8bSHans de Goede 7122eceb8bSHans de Goede When "quiet" is passed on the kernel commandline this loglevel 7222eceb8bSHans de Goede will be used as the loglevel. IOW passing "quiet" will be the 7322eceb8bSHans de Goede equivalent of passing "loglevel=<CONSOLE_LOGLEVEL_QUIET>" 7422eceb8bSHans de Goede 7542a9dc0bSAlex Elderconfig MESSAGE_LOGLEVEL_DEFAULT 765af5bcb8SMandeep Singh Baines int "Default message log level (1-7)" 775af5bcb8SMandeep Singh Baines range 1 7 785af5bcb8SMandeep Singh Baines default "4" 795af5bcb8SMandeep Singh Baines help 805af5bcb8SMandeep Singh Baines Default log level for printk statements with no specified priority. 815af5bcb8SMandeep Singh Baines 825af5bcb8SMandeep Singh Baines This was hard-coded to KERN_WARNING since at least 2.6.10 but folks 835af5bcb8SMandeep Singh Baines that are auditing their logs closely may want to set it to a lower 845af5bcb8SMandeep Singh Baines priority. 855af5bcb8SMandeep Singh Baines 86a8cfdc68SOlof Johansson Note: This does not affect what message level gets printed on the console 87a8cfdc68SOlof Johansson by default. To change that, use loglevel=<x> in the kernel bootargs, 88a8cfdc68SOlof Johansson or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value. 89a8cfdc68SOlof Johansson 90604ff0dcSDave Hansenconfig BOOT_PRINTK_DELAY 91604ff0dcSDave Hansen bool "Delay each boot printk message by N milliseconds" 92604ff0dcSDave Hansen depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY 93604ff0dcSDave Hansen help 94604ff0dcSDave Hansen This build option allows you to read kernel boot messages 95604ff0dcSDave Hansen by inserting a short delay after each one. The delay is 96604ff0dcSDave Hansen specified in milliseconds on the kernel command line, 97604ff0dcSDave Hansen using "boot_delay=N". 98604ff0dcSDave Hansen 99604ff0dcSDave Hansen It is likely that you would also need to use "lpj=M" to preset 100bd7c8ff9SAnna-Maria Behnsen the "loops per jiffy" value. 101604ff0dcSDave Hansen See a previous boot log for the "lpj" value to use for your 102604ff0dcSDave Hansen system, and then set "lpj=M" before setting "boot_delay=N". 103604ff0dcSDave Hansen NOTE: Using this option may adversely affect SMP systems. 104604ff0dcSDave Hansen I.e., processors other than the first one may not boot up. 105604ff0dcSDave Hansen BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect 106604ff0dcSDave Hansen what it believes to be lockup conditions. 107604ff0dcSDave Hansen 108604ff0dcSDave Hansenconfig DYNAMIC_DEBUG 109604ff0dcSDave Hansen bool "Enable dynamic printk() support" 110604ff0dcSDave Hansen default n 111604ff0dcSDave Hansen depends on PRINTK 112239a5791SGreg Kroah-Hartman depends on (DEBUG_FS || PROC_FS) 113ceabef7dSOrson Zhai select DYNAMIC_DEBUG_CORE 114604ff0dcSDave Hansen help 115604ff0dcSDave Hansen 116604ff0dcSDave Hansen Compiles debug level messages into the kernel, which would not 117604ff0dcSDave Hansen otherwise be available at runtime. These messages can then be 118604ff0dcSDave Hansen enabled/disabled based on various levels of scope - per source file, 119604ff0dcSDave Hansen function, module, format string, and line number. This mechanism 120604ff0dcSDave Hansen implicitly compiles in all pr_debug() and dev_dbg() calls, which 121604ff0dcSDave Hansen enlarges the kernel text size by about 2%. 122604ff0dcSDave Hansen 123604ff0dcSDave Hansen If a source file is compiled with DEBUG flag set, any 124604ff0dcSDave Hansen pr_debug() calls in it are enabled by default, but can be 125604ff0dcSDave Hansen disabled at runtime as below. Note that DEBUG flag is 126604ff0dcSDave Hansen turned on by many CONFIG_*DEBUG* options. 127604ff0dcSDave Hansen 128604ff0dcSDave Hansen Usage: 129604ff0dcSDave Hansen 130604ff0dcSDave Hansen Dynamic debugging is controlled via the 'dynamic_debug/control' file, 131239a5791SGreg Kroah-Hartman which is contained in the 'debugfs' filesystem or procfs. 132239a5791SGreg Kroah-Hartman Thus, the debugfs or procfs filesystem must first be mounted before 133239a5791SGreg Kroah-Hartman making use of this feature. 134604ff0dcSDave Hansen We refer the control file as: <debugfs>/dynamic_debug/control. This 135604ff0dcSDave Hansen file contains a list of the debug statements that can be enabled. The 136604ff0dcSDave Hansen format for each line of the file is: 137604ff0dcSDave Hansen 138604ff0dcSDave Hansen filename:lineno [module]function flags format 139604ff0dcSDave Hansen 140604ff0dcSDave Hansen filename : source file of the debug statement 141604ff0dcSDave Hansen lineno : line number of the debug statement 142604ff0dcSDave Hansen module : module that contains the debug statement 143604ff0dcSDave Hansen function : function that contains the debug statement 144604ff0dcSDave Hansen flags : '=p' means the line is turned 'on' for printing 145604ff0dcSDave Hansen format : the format used for the debug statement 146604ff0dcSDave Hansen 147604ff0dcSDave Hansen From a live system: 148604ff0dcSDave Hansen 149604ff0dcSDave Hansen nullarbor:~ # cat <debugfs>/dynamic_debug/control 150604ff0dcSDave Hansen # filename:lineno [module]function flags format 151604ff0dcSDave Hansen fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012" 152604ff0dcSDave Hansen fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012" 153604ff0dcSDave Hansen fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012" 154604ff0dcSDave Hansen 155604ff0dcSDave Hansen Example usage: 156604ff0dcSDave Hansen 157604ff0dcSDave Hansen // enable the message at line 1603 of file svcsock.c 158604ff0dcSDave Hansen nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' > 159604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 160604ff0dcSDave Hansen 161604ff0dcSDave Hansen // enable all the messages in file svcsock.c 162604ff0dcSDave Hansen nullarbor:~ # echo -n 'file svcsock.c +p' > 163604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 164604ff0dcSDave Hansen 165604ff0dcSDave Hansen // enable all the messages in the NFS server module 166604ff0dcSDave Hansen nullarbor:~ # echo -n 'module nfsd +p' > 167604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 168604ff0dcSDave Hansen 169604ff0dcSDave Hansen // enable all 12 messages in the function svc_process() 170604ff0dcSDave Hansen nullarbor:~ # echo -n 'func svc_process +p' > 171604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 172604ff0dcSDave Hansen 173604ff0dcSDave Hansen // disable all 12 messages in the function svc_process() 174604ff0dcSDave Hansen nullarbor:~ # echo -n 'func svc_process -p' > 175604ff0dcSDave Hansen <debugfs>/dynamic_debug/control 176604ff0dcSDave Hansen 177f8998c22SHans Holmberg See Documentation/admin-guide/dynamic-debug-howto.rst for additional 178f8998c22SHans Holmberg information. 179604ff0dcSDave Hansen 180ceabef7dSOrson Zhaiconfig DYNAMIC_DEBUG_CORE 181ceabef7dSOrson Zhai bool "Enable core function of dynamic debug support" 182ceabef7dSOrson Zhai depends on PRINTK 183ceabef7dSOrson Zhai depends on (DEBUG_FS || PROC_FS) 184ceabef7dSOrson Zhai help 185ceabef7dSOrson Zhai Enable core functional support of dynamic debug. It is useful 186ceabef7dSOrson Zhai when you want to tie dynamic debug to your kernel modules with 187ceabef7dSOrson Zhai DYNAMIC_DEBUG_MODULE defined for each of them, especially for 188ceabef7dSOrson Zhai the case of embedded system where the kernel image size is 189ceabef7dSOrson Zhai sensitive for people. 190ceabef7dSOrson Zhai 19157f5677eSRasmus Villemoesconfig SYMBOLIC_ERRNAME 19257f5677eSRasmus Villemoes bool "Support symbolic error names in printf" 19357f5677eSRasmus Villemoes default y if PRINTK 19457f5677eSRasmus Villemoes help 19557f5677eSRasmus Villemoes If you say Y here, the kernel's printf implementation will 19657f5677eSRasmus Villemoes be able to print symbolic error names such as ENOSPC instead 19757f5677eSRasmus Villemoes of the number 28. It makes the kernel image slightly larger 19857f5677eSRasmus Villemoes (about 3KB), but can make the kernel logs easier to read. 19957f5677eSRasmus Villemoes 2002b05bb75SChangbin Duconfig DEBUG_BUGVERBOSE 2012b05bb75SChangbin Du bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT 2022b05bb75SChangbin Du depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) 2032b05bb75SChangbin Du default y 2042b05bb75SChangbin Du help 2052b05bb75SChangbin Du Say Y here to make BUG() panics output the file name and line number 2062b05bb75SChangbin Du of the BUG call as well as the EIP and oops trace. This aids 2072b05bb75SChangbin Du debugging but costs about 70-100K of memory. 2082b05bb75SChangbin Du 209604ff0dcSDave Hansenendmenu # "printk and dmesg options" 210604ff0dcSDave Hansen 211f9b3cd24SKees Cookconfig DEBUG_KERNEL 212f9b3cd24SKees Cook bool "Kernel debugging" 213f9b3cd24SKees Cook help 214f9b3cd24SKees Cook Say Y here if you are developing drivers or trying to debug and 215f9b3cd24SKees Cook identify kernel problems. 216f9b3cd24SKees Cook 217f9b3cd24SKees Cookconfig DEBUG_MISC 218f9b3cd24SKees Cook bool "Miscellaneous debug code" 219f9b3cd24SKees Cook default DEBUG_KERNEL 220f9b3cd24SKees Cook depends on DEBUG_KERNEL 221f9b3cd24SKees Cook help 222f9b3cd24SKees Cook Say Y here if you need to enable miscellaneous debug code that should 223f9b3cd24SKees Cook be under a more specific debug option but isn't. 224f9b3cd24SKees Cook 2256dfc0665SDave Hansenmenu "Compile-time checks and compiler options" 2266dfc0665SDave Hansen 2276dfc0665SDave Hansenconfig DEBUG_INFO 228f9b3cd24SKees Cook bool 2296dfc0665SDave Hansen help 230f9b3cd24SKees Cook A kernel debug info option other than "None" has been selected 231f9b3cd24SKees Cook in the "Debug information" choice below, indicating that debug 232f9b3cd24SKees Cook information will be generated for build targets. 233f9b3cd24SKees Cook 234a4426641SNathan Chancellor# Clang generates .uleb128 with label differences for DWARF v5, a feature that 235a4426641SNathan Chancellor# older binutils ports do not support when utilizing RISC-V style linker 236a4426641SNathan Chancellor# relaxation: https://sourceware.org/bugzilla/show_bug.cgi?id=27215 237a4426641SNathan Chancellorconfig AS_HAS_NON_CONST_ULEB128 2380a6de78cSNathan Chancellor def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:) 2390a6de78cSNathan Chancellor 240f9b3cd24SKees Cookchoice 241f9b3cd24SKees Cook prompt "Debug information" 242f9b3cd24SKees Cook depends on DEBUG_KERNEL 243f9b3cd24SKees Cook help 244f9b3cd24SKees Cook Selecting something other than "None" results in a kernel image 245f9b3cd24SKees Cook that will include debugging info resulting in a larger kernel image. 2466dfc0665SDave Hansen This adds debug symbols to the kernel and modules (gcc -g), and 2476dfc0665SDave Hansen is needed if you intend to use kernel crashdump or binary object 2486dfc0665SDave Hansen tools like crash, kgdb, LKCD, gdb, etc on the kernel. 2496dfc0665SDave Hansen 250f9b3cd24SKees Cook Choose which version of DWARF debug info to emit. If unsure, 251f9b3cd24SKees Cook select "Toolchain default". 252f9b3cd24SKees Cook 253f9b3cd24SKees Cookconfig DEBUG_INFO_NONE 254f9b3cd24SKees Cook bool "Disable debug information" 255f9b3cd24SKees Cook help 256f9b3cd24SKees Cook Do not build the kernel with debugging information, which will 257f9b3cd24SKees Cook result in a faster and smaller build. 258f9b3cd24SKees Cook 259f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT 260f9b3cd24SKees Cook bool "Rely on the toolchain's implicit default DWARF version" 261f9b3cd24SKees Cook select DEBUG_INFO 262a4426641SNathan Chancellor depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128) 263f9b3cd24SKees Cook help 264f9b3cd24SKees Cook The implicit default version of DWARF debug info produced by a 265f9b3cd24SKees Cook toolchain changes over time. 266f9b3cd24SKees Cook 267f9b3cd24SKees Cook This can break consumers of the debug info that haven't upgraded to 268f9b3cd24SKees Cook support newer revisions, and prevent testing newer versions, but 269f9b3cd24SKees Cook those should be less common scenarios. 270f9b3cd24SKees Cook 271f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF4 272f9b3cd24SKees Cook bool "Generate DWARF Version 4 debuginfo" 273f9b3cd24SKees Cook select DEBUG_INFO 2744f001a21SMasahiro Yamada depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502) 275f9b3cd24SKees Cook help 27632ef9e50SNick Desaulniers Generate DWARF v4 debug info. This requires gcc 4.5+, binutils 2.35.2 27732ef9e50SNick Desaulniers if using clang without clang's integrated assembler, and gdb 7.0+. 278f9b3cd24SKees Cook 279f9b3cd24SKees Cook If you have consumers of DWARF debug info that are not ready for 280f9b3cd24SKees Cook newer revisions of DWARF, you may wish to choose this or have your 281f9b3cd24SKees Cook config select this. 282f9b3cd24SKees Cook 283f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF5 284f9b3cd24SKees Cook bool "Generate DWARF Version 5 debuginfo" 285f9b3cd24SKees Cook select DEBUG_INFO 286ae84ff9aSNathan Chancellor depends on !ARCH_HAS_BROKEN_DWARF5 287a4426641SNathan Chancellor depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128) 288f9b3cd24SKees Cook help 289f9b3cd24SKees Cook Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc 290f9b3cd24SKees Cook 5.0+ accepts the -gdwarf-5 flag but only had partial support for some 291f9b3cd24SKees Cook draft features until 7.0), and gdb 8.0+. 292f9b3cd24SKees Cook 293f9b3cd24SKees Cook Changes to the structure of debug info in Version 5 allow for around 294f9b3cd24SKees Cook 15-18% savings in resulting image and debug info section sizes as 295f9b3cd24SKees Cook compared to DWARF Version 4. DWARF Version 5 standardizes previous 296f9b3cd24SKees Cook extensions such as accelerators for symbol indexing and the format 297f9b3cd24SKees Cook for fission (.dwo/.dwp) files. Users may not want to select this 298f9b3cd24SKees Cook config if they rely on tooling that has not yet been updated to 299f9b3cd24SKees Cook support DWARF Version 5. 300f9b3cd24SKees Cook 301f9b3cd24SKees Cookendchoice # "Debug information" 3026dfc0665SDave Hansen 303695afd3dSSedat Dilekif DEBUG_INFO 304695afd3dSSedat Dilek 3056dfc0665SDave Hansenconfig DEBUG_INFO_REDUCED 3066dfc0665SDave Hansen bool "Reduce debugging information" 3076dfc0665SDave Hansen help 3086dfc0665SDave Hansen If you say Y here gcc is instructed to generate less debugging 3096dfc0665SDave Hansen information for structure types. This means that tools that 3106dfc0665SDave Hansen need full debugging information (like kgdb or systemtap) won't 3116dfc0665SDave Hansen be happy. But if you merely need debugging information to 3126dfc0665SDave Hansen resolve line numbers there is no loss. Advantage is that 3136dfc0665SDave Hansen build directory object sizes shrink dramatically over a full 3146dfc0665SDave Hansen DEBUG_INFO build and compile times are reduced too. 3156dfc0665SDave Hansen Only works with newer gcc versions. 3166dfc0665SDave Hansen 3179f8fe647SNick Desaulnierschoice 3189f8fe647SNick Desaulniers prompt "Compressed Debug information" 3199f8fe647SNick Desaulniers help 3209f8fe647SNick Desaulniers Compress the resulting debug info. Results in smaller debug info sections, 3219f8fe647SNick Desaulniers but requires that consumers are able to decompress the results. 3229f8fe647SNick Desaulniers 3239f8fe647SNick Desaulniers If unsure, choose DEBUG_INFO_COMPRESSED_NONE. 3249f8fe647SNick Desaulniers 3259f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_NONE 3269f8fe647SNick Desaulniers bool "Don't compress debug information" 3279f8fe647SNick Desaulniers help 3289f8fe647SNick Desaulniers Don't compress debug info sections. 3299f8fe647SNick Desaulniers 3309f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_ZLIB 3319f8fe647SNick Desaulniers bool "Compress debugging information with zlib" 33210e68b02SNick Desaulniers depends on $(cc-option,-gz=zlib) 33310e68b02SNick Desaulniers depends on $(ld-option,--compress-debug-sections=zlib) 33410e68b02SNick Desaulniers help 33510e68b02SNick Desaulniers Compress the debug information using zlib. Requires GCC 5.0+ or Clang 33610e68b02SNick Desaulniers 5.0+, binutils 2.26+, and zlib. 33710e68b02SNick Desaulniers 338a7a05b1bSMasahiro Yamada Users of dpkg-deb via debian/rules may find an increase in 33910e68b02SNick Desaulniers size of their debug .deb packages with this config set, due to the 34010e68b02SNick Desaulniers debug info being compressed with zlib, then the object files being 34110e68b02SNick Desaulniers recompressed with a different compression scheme. But this is still 342a7a05b1bSMasahiro Yamada preferable to setting KDEB_COMPRESS or DPKG_DEB_COMPRESSOR_TYPE to 343a7a05b1bSMasahiro Yamada "none" which would be even larger. 34410e68b02SNick Desaulniers 3459f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_ZSTD 3469f8fe647SNick Desaulniers bool "Compress debugging information with zstd" 3479f8fe647SNick Desaulniers depends on $(cc-option,-gz=zstd) 3489f8fe647SNick Desaulniers depends on $(ld-option,--compress-debug-sections=zstd) 3499f8fe647SNick Desaulniers help 3509f8fe647SNick Desaulniers Compress the debug information using zstd. This may provide better 3519f8fe647SNick Desaulniers compression than zlib, for about the same time costs, but requires newer 3529f8fe647SNick Desaulniers toolchain support. Requires GCC 13.0+ or Clang 16.0+, binutils 2.40+, and 3539f8fe647SNick Desaulniers zstd. 3549f8fe647SNick Desaulniers 3559f8fe647SNick Desaulniersendchoice # "Compressed Debug information" 3569f8fe647SNick Desaulniers 357866ced95SAndi Kleenconfig DEBUG_INFO_SPLIT 358866ced95SAndi Kleen bool "Produce split debuginfo in .dwo files" 3599d937444SMasahiro Yamada depends on $(cc-option,-gsplit-dwarf) 36089775a27SNathan Chancellor # RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC 36189775a27SNathan Chancellor # prior to 12.x: 36289775a27SNathan Chancellor # https://github.com/llvm/llvm-project/issues/56642 36389775a27SNathan Chancellor # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090 36489775a27SNathan Chancellor depends on !RISCV || GCC_VERSION >= 120000 365866ced95SAndi Kleen help 366866ced95SAndi Kleen Generate debug info into separate .dwo files. This significantly 367866ced95SAndi Kleen reduces the build directory size for builds with DEBUG_INFO, 368866ced95SAndi Kleen because it stores the information only once on disk in .dwo 369866ced95SAndi Kleen files instead of multiple times in object files and executables. 370866ced95SAndi Kleen In addition the debug information is also compressed. 371866ced95SAndi Kleen 372866ced95SAndi Kleen Requires recent gcc (4.7+) and recent gdb/binutils. 373866ced95SAndi Kleen Any tool that packages or reads debug information would need 374866ced95SAndi Kleen to know about the .dwo files and include them. 375866ced95SAndi Kleen Incompatible with older versions of ccache. 376866ced95SAndi Kleen 377e83b9f55SAndrii Nakryikoconfig DEBUG_INFO_BTF 378229087f6SAndrii Nakryiko bool "Generate BTF type information" 3797d32e693SSlava Bacherikov depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED 3807d32e693SSlava Bacherikov depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST 381d9847eb8SKumar Kartikeya Dwivedi depends on BPF_SYSCALL 38242450f7aSMasahiro Yamada depends on PAHOLE_VERSION >= 116 3835277d130SMasahiro Yamada depends on DEBUG_INFO_DWARF4 || PAHOLE_VERSION >= 121 384aaa2c9a9SNathan Chancellor # pahole uses elfutils, which does not have support for Hexagon relocations 385aaa2c9a9SNathan Chancellor depends on !HEXAGON 386e83b9f55SAndrii Nakryiko help 387e83b9f55SAndrii Nakryiko Generate deduplicated BTF type information from DWARF debug info. 38842450f7aSMasahiro Yamada Turning this on requires pahole v1.16 or later (v1.21 or later to 38942450f7aSMasahiro Yamada support DWARF 5), which will convert DWARF type info into equivalent 39042450f7aSMasahiro Yamada deduplicated BTF type info. 391e83b9f55SAndrii Nakryiko 3925f9ae91fSAndrii Nakryikoconfig PAHOLE_HAS_SPLIT_BTF 3936323c813SNathan Chancellor def_bool PAHOLE_VERSION >= 119 3945f9ae91fSAndrii Nakryiko 3957472d5a6SYonghong Songconfig PAHOLE_HAS_BTF_TAG 3966323c813SNathan Chancellor def_bool PAHOLE_VERSION >= 123 3977472d5a6SYonghong Song depends on CC_IS_CLANG 3987472d5a6SYonghong Song help 3997472d5a6SYonghong Song Decide whether pahole emits btf_tag attributes (btf_type_tag and 4007472d5a6SYonghong Song btf_decl_tag) or not. Currently only clang compiler implements 4017472d5a6SYonghong Song these attributes, so make the config depend on CC_IS_CLANG. 4025f9ae91fSAndrii Nakryiko 403c1177979SMartin Rodriguez Reboredoconfig PAHOLE_HAS_LANG_EXCLUDE 404c1177979SMartin Rodriguez Reboredo def_bool PAHOLE_VERSION >= 124 405c1177979SMartin Rodriguez Reboredo help 406c1177979SMartin Rodriguez Reboredo Support for the --lang_exclude flag which makes pahole exclude 407c1177979SMartin Rodriguez Reboredo compilation units from the supplied language. Used in Kbuild to 408c1177979SMartin Rodriguez Reboredo omit Rust CUs which are not supported in version 1.24 of pahole, 409c1177979SMartin Rodriguez Reboredo otherwise it would emit malformed kernel and module binaries when 410c1177979SMartin Rodriguez Reboredo using DEBUG_INFO_BTF_MODULES. 411c1177979SMartin Rodriguez Reboredo 4125f9ae91fSAndrii Nakryikoconfig DEBUG_INFO_BTF_MODULES 413229087f6SAndrii Nakryiko bool "Generate BTF type information for kernel modules" 414229087f6SAndrii Nakryiko default y 4155f9ae91fSAndrii Nakryiko depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF 4165f9ae91fSAndrii Nakryiko help 4175f9ae91fSAndrii Nakryiko Generate compact split BTF type information for kernel modules. 4185f9ae91fSAndrii Nakryiko 4195e214f2eSConnor O'Brienconfig MODULE_ALLOW_BTF_MISMATCH 4205e214f2eSConnor O'Brien bool "Allow loading modules with non-matching BTF type info" 4215e214f2eSConnor O'Brien depends on DEBUG_INFO_BTF_MODULES 4225e214f2eSConnor O'Brien help 4235e214f2eSConnor O'Brien For modules whose split BTF does not match vmlinux, load without 4245e214f2eSConnor O'Brien BTF rather than refusing to load. The default behavior with 4255e214f2eSConnor O'Brien module BTF enabled is to reject modules with such mismatches; 4265e214f2eSConnor O'Brien this option will still load module BTF where possible but ignore 4275e214f2eSConnor O'Brien it when a mismatch is found. 4285e214f2eSConnor O'Brien 4293ee7b3faSJan Kiszkaconfig GDB_SCRIPTS 4303ee7b3faSJan Kiszka bool "Provide GDB scripts for kernel debugging" 4313ee7b3faSJan Kiszka help 4323ee7b3faSJan Kiszka This creates the required links to GDB helper scripts in the 4333ee7b3faSJan Kiszka build directory. If you load vmlinux into gdb, the helper 4343ee7b3faSJan Kiszka scripts will be automatically imported by gdb as well, and 4353ee7b3faSJan Kiszka additional functions are available to analyze a Linux kernel 436d5af79c0SRandy Dunlap instance. See Documentation/process/debugging/gdb-kernel-debugging.rst 437700199b0SAndreas Platschek for further details. 4383ee7b3faSJan Kiszka 439695afd3dSSedat Dilekendif # DEBUG_INFO 440695afd3dSSedat Dilek 44135bb5b1eSAndi Kleenconfig FRAME_WARN 442a83e4ca2SMasahiro Yamada int "Warn for stack frames larger than" 44335bb5b1eSAndi Kleen range 0 8192 444ac66998dSAlexander Potapenko default 0 if KMSAN 4450e07f663SKees Cook default 2048 if GCC_PLUGIN_LATENT_ENTROPY 4468d192becSHelge Deller default 2048 if PARISC 4478d192becSHelge Deller default 1536 if (!64BIT && XTENSA) 448152fe65fSLee Jones default 1280 if KASAN && !64BIT 4498d192becSHelge Deller default 1024 if !64BIT 45035bb5b1eSAndi Kleen default 2048 if 64BIT 45135bb5b1eSAndi Kleen help 452921757bcSAlexander Potapenko Tell the compiler to warn at build time for stack frames larger than this. 45335bb5b1eSAndi Kleen Setting this too low will cause a lot of warnings. 45435bb5b1eSAndi Kleen Setting it to 0 disables the warning. 45535bb5b1eSAndi Kleen 45699657c78SRandy Dunlapconfig STRIP_ASM_SYMS 45799657c78SRandy Dunlap bool "Strip assembler-generated symbols during link" 45899657c78SRandy Dunlap default n 45999657c78SRandy Dunlap help 46099657c78SRandy Dunlap Strip internal assembler-generated symbols during a link (symbols 46199657c78SRandy Dunlap that look like '.Lxxx') so they don't pollute the output of 46299657c78SRandy Dunlap get_wchan() and suchlike. 46399657c78SRandy Dunlap 4641873e870SAndi Kleenconfig READABLE_ASM 4651873e870SAndi Kleen bool "Generate readable assembler code" 4661873e870SAndi Kleen depends on DEBUG_KERNEL 4677d73c3e9SNick Desaulniers depends on CC_IS_GCC 4681873e870SAndi Kleen help 4691873e870SAndi Kleen Disable some compiler optimizations that tend to generate human unreadable 4701873e870SAndi Kleen assembler output. This may make the kernel slightly slower, but it helps 4711873e870SAndi Kleen to keep kernel developers who have to stare a lot at assembler listings 4721873e870SAndi Kleen sane. 4731873e870SAndi Kleen 474e949f4c2SMasahiro Yamadaconfig HEADERS_INSTALL 475e949f4c2SMasahiro Yamada bool "Install uapi headers to usr/include" 476bf4735a4SDon Mullis help 477e949f4c2SMasahiro Yamada This option will install uapi headers (headers exported to user-space) 478e949f4c2SMasahiro Yamada into the usr/include directory for use during the kernel build. 479e949f4c2SMasahiro Yamada This is unneeded for building the kernel itself, but needed for some 480e949f4c2SMasahiro Yamada user-space program samples. It is also needed by some features such 481e949f4c2SMasahiro Yamada as uapi header sanity checks. 482e949f4c2SMasahiro Yamada 48391341d4bSSam Ravnborgconfig DEBUG_SECTION_MISMATCH 48491341d4bSSam Ravnborg bool "Enable full Section mismatch analysis" 4857d73c3e9SNick Desaulniers depends on CC_IS_GCC 48691341d4bSSam Ravnborg help 48791341d4bSSam Ravnborg The section mismatch analysis checks if there are illegal 48891341d4bSSam Ravnborg references from one section to another section. 489e809ab01SMichael Witten During linktime or runtime, some sections are dropped; 490e809ab01SMichael Witten any use of code/data previously in these sections would 49191341d4bSSam Ravnborg most likely result in an oops. 492e809ab01SMichael Witten In the code, functions and variables are annotated with 4930db0628dSPaul Gortmaker __init,, etc. (see the full list in include/linux/init.h), 494d6fbfa4fSGeert Uytterhoeven which results in the code/data being placed in specific sections. 495e809ab01SMichael Witten The section mismatch analysis is always performed after a full 496e809ab01SMichael Witten kernel build, and enabling this option causes the following 497b7dca6ddSMasahiro Yamada additional step to occur: 498e809ab01SMichael Witten - Add the option -fno-inline-functions-called-once to gcc commands. 499e809ab01SMichael Witten When inlining a function annotated with __init in a non-init 500e809ab01SMichael Witten function, we would lose the section information and thus 50191341d4bSSam Ravnborg the analysis would not catch the illegal reference. 502e809ab01SMichael Witten This option tells gcc to inline less (but it does result in 503e809ab01SMichael Witten a larger kernel). 50491341d4bSSam Ravnborg 50547490ec1SNicolas Boichatconfig SECTION_MISMATCH_WARN_ONLY 50647490ec1SNicolas Boichat bool "Make section mismatch errors non-fatal" 50747490ec1SNicolas Boichat default y 50847490ec1SNicolas Boichat help 50947490ec1SNicolas Boichat If you say N here, the build process will fail if there are any 51047490ec1SNicolas Boichat section mismatch, instead of just throwing warnings. 51147490ec1SNicolas Boichat 51247490ec1SNicolas Boichat If unsure, say Y. 51347490ec1SNicolas Boichat 514cf536e18SFeng Tangconfig DEBUG_FORCE_FUNCTION_ALIGN_64B 5151bf18da6SFeng Tang bool "Force all function address 64B aligned" 5163ed8513cSJisheng Zhang depends on EXPERT && (X86_64 || ARM64 || PPC32 || PPC64 || ARC || RISCV || S390) 517d49a0626SPeter Zijlstra select FUNCTION_ALIGNMENT_64B 51809c60546SFeng Tang help 51909c60546SFeng Tang There are cases that a commit from one domain changes the function 52009c60546SFeng Tang address alignment of other domains, and cause magic performance 52109c60546SFeng Tang bump (regression or improvement). Enable this option will help to 52209c60546SFeng Tang verify if the bump is caused by function alignment changes, while 52309c60546SFeng Tang it will slightly increase the kernel size and affect icache usage. 52409c60546SFeng Tang 52509c60546SFeng Tang It is mainly for debug and performance tuning use. 52609c60546SFeng Tang 5276dfc0665SDave Hansen# 5286dfc0665SDave Hansen# Select this config option from the architecture Kconfig, if it 5296dfc0665SDave Hansen# is preferred to always offer frame pointers as a config 5306dfc0665SDave Hansen# option on the architecture (regardless of KERNEL_DEBUG): 5316dfc0665SDave Hansen# 5326dfc0665SDave Hansenconfig ARCH_WANT_FRAME_POINTERS 5336dfc0665SDave Hansen bool 5346dfc0665SDave Hansen 5356dfc0665SDave Hansenconfig FRAME_POINTER 5366dfc0665SDave Hansen bool "Compile the kernel with frame pointers" 537a687a533SArnd Bergmann depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS 5386dfc0665SDave Hansen default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS 5396dfc0665SDave Hansen help 5406dfc0665SDave Hansen If you say Y here the resulting kernel image will be slightly 5416dfc0665SDave Hansen larger and slower, but it gives very useful debugging information 5426dfc0665SDave Hansen in case of kernel bugs. (precise oopses/stacktraces/warnings) 5436dfc0665SDave Hansen 54403f16cd0SJosh Poimboeufconfig OBJTOOL 54503f16cd0SJosh Poimboeuf bool 54603f16cd0SJosh Poimboeuf 54736799069SJosh Poimboeufconfig OBJTOOL_WERROR 54836799069SJosh Poimboeuf bool "Upgrade objtool warnings to errors" 54936799069SJosh Poimboeuf depends on OBJTOOL && !COMPILE_TEST 55036799069SJosh Poimboeuf help 55136799069SJosh Poimboeuf Fail the build on objtool warnings. 55236799069SJosh Poimboeuf 55336799069SJosh Poimboeuf Objtool warnings can indicate kernel instability, including boot 55436799069SJosh Poimboeuf failures. This option is highly recommended. 55536799069SJosh Poimboeuf 55636799069SJosh Poimboeuf If unsure, say Y. 55736799069SJosh Poimboeuf 558b9ab5ebbSJosh Poimboeufconfig STACK_VALIDATION 559b9ab5ebbSJosh Poimboeuf bool "Compile-time stack metadata validation" 56003f16cd0SJosh Poimboeuf depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER 56103f16cd0SJosh Poimboeuf select OBJTOOL 562b9ab5ebbSJosh Poimboeuf default n 563b9ab5ebbSJosh Poimboeuf help 56403f16cd0SJosh Poimboeuf Validate frame pointer rules at compile-time. This helps ensure that 56503f16cd0SJosh Poimboeuf runtime stack traces are more reliable. 566ee9f8fceSJosh Poimboeuf 567b9ab5ebbSJosh Poimboeuf For more information, see 568d6a21f2dSMauro Carvalho Chehab tools/objtool/Documentation/objtool.txt. 569b9ab5ebbSJosh Poimboeuf 5700f620cefSJosh Poimboeufconfig NOINSTR_VALIDATION 5716804c1afSPeter Zijlstra bool 572489e355bSJosh Poimboeuf depends on HAVE_NOINSTR_VALIDATION && DEBUG_ENTRY 57303f16cd0SJosh Poimboeuf select OBJTOOL 5746804c1afSPeter Zijlstra default y 5756804c1afSPeter Zijlstra 5765cc12472SRasmus Villemoesconfig VMLINUX_MAP 5775cc12472SRasmus Villemoes bool "Generate vmlinux.map file when linking" 5785cc12472SRasmus Villemoes depends on EXPERT 5795cc12472SRasmus Villemoes help 5805cc12472SRasmus Villemoes Selecting this option will pass "-Map=vmlinux.map" to ld 5815cc12472SRasmus Villemoes when linking vmlinux. That file can be useful for verifying 5825cc12472SRasmus Villemoes and debugging magic section games, and for seeing which 5835cc12472SRasmus Villemoes pieces of code get eliminated with 5845cc12472SRasmus Villemoes CONFIG_LD_DEAD_CODE_DATA_ELIMINATION. 5855cc12472SRasmus Villemoes 5865f5e7344SKris Van Heesconfig BUILTIN_MODULE_RANGES 5875f5e7344SKris Van Hees bool "Generate address range information for builtin modules" 5885f5e7344SKris Van Hees depends on !LTO 5895f5e7344SKris Van Hees depends on VMLINUX_MAP 5905f5e7344SKris Van Hees help 5915f5e7344SKris Van Hees When modules are built into the kernel, there will be no module name 5925f5e7344SKris Van Hees associated with its symbols in /proc/kallsyms. Tracers may want to 5935f5e7344SKris Van Hees identify symbols by module name and symbol name regardless of whether 5945f5e7344SKris Van Hees the module is configured as loadable or not. 5955f5e7344SKris Van Hees 5965f5e7344SKris Van Hees This option generates modules.builtin.ranges in the build tree with 5975f5e7344SKris Van Hees offset ranges (per ELF section) for the module(s) they belong to. 5985f5e7344SKris Van Hees It also records an anchor symbol to determine the load address of the 5995f5e7344SKris Van Hees section. 6005f5e7344SKris Van Hees 6016dfc0665SDave Hansenconfig DEBUG_FORCE_WEAK_PER_CPU 6026dfc0665SDave Hansen bool "Force weak per-cpu definitions" 6036dfc0665SDave Hansen depends on DEBUG_KERNEL 6046dfc0665SDave Hansen help 6056dfc0665SDave Hansen s390 and alpha require percpu variables in modules to be 6066dfc0665SDave Hansen defined weak to work around addressing range issue which 6076dfc0665SDave Hansen puts the following two restrictions on percpu variable 6086dfc0665SDave Hansen definitions. 6096dfc0665SDave Hansen 6106dfc0665SDave Hansen 1. percpu symbols must be unique whether static or not 6116dfc0665SDave Hansen 2. percpu variables can't be defined inside a function 6126dfc0665SDave Hansen 6136dfc0665SDave Hansen To ensure that generic code follows the above rules, this 6146dfc0665SDave Hansen option forces all percpu variables to be defined as weak. 6156dfc0665SDave Hansen 6166dfc0665SDave Hansenendmenu # "Compiler options" 6176dfc0665SDave Hansen 6186210b640SChangbin Dumenu "Generic Kernel Debugging Instruments" 6196210b640SChangbin Du 6206dfc0665SDave Hansenconfig MAGIC_SYSRQ 6216dfc0665SDave Hansen bool "Magic SysRq key" 6226dfc0665SDave Hansen depends on !UML 6236dfc0665SDave Hansen help 6246dfc0665SDave Hansen If you say Y here, you will have some control over the system even 6256dfc0665SDave Hansen if the system crashes for example during kernel debugging (e.g., you 6266dfc0665SDave Hansen will be able to flush the buffer cache to disk, reboot the system 6276dfc0665SDave Hansen immediately or dump some status information). This is accomplished 6286dfc0665SDave Hansen by pressing various keys while holding SysRq (Alt+PrintScreen). It 6296dfc0665SDave Hansen also works on a serial console (on PC hardware at least), if you 6306dfc0665SDave Hansen send a BREAK and then within 5 seconds a command keypress. The 631f8998c22SHans Holmberg keys are documented in <file:Documentation/admin-guide/sysrq.rst>. 632f8998c22SHans Holmberg Don't say Y unless you really know what this hack does. 6336dfc0665SDave Hansen 6348eaede49SBen Hutchingsconfig MAGIC_SYSRQ_DEFAULT_ENABLE 6358eaede49SBen Hutchings hex "Enable magic SysRq key functions by default" 6368eaede49SBen Hutchings depends on MAGIC_SYSRQ 6378eaede49SBen Hutchings default 0x1 6388eaede49SBen Hutchings help 6398eaede49SBen Hutchings Specifies which SysRq key functions are enabled by default. 6408eaede49SBen Hutchings This may be set to 1 or 0 to enable or disable them all, or 641f8998c22SHans Holmberg to a bitmask as described in Documentation/admin-guide/sysrq.rst. 6428eaede49SBen Hutchings 643732dbf3aSFelix Fietkauconfig MAGIC_SYSRQ_SERIAL 644732dbf3aSFelix Fietkau bool "Enable magic SysRq key over serial" 645732dbf3aSFelix Fietkau depends on MAGIC_SYSRQ 646732dbf3aSFelix Fietkau default y 647732dbf3aSFelix Fietkau help 648732dbf3aSFelix Fietkau Many embedded boards have a disconnected TTL level serial which can 649732dbf3aSFelix Fietkau generate some garbage that can lead to spurious false sysrq detects. 650732dbf3aSFelix Fietkau This option allows you to decide whether you want to enable the 651732dbf3aSFelix Fietkau magic SysRq key. 652732dbf3aSFelix Fietkau 65368af4317SDmitry Safonovconfig MAGIC_SYSRQ_SERIAL_SEQUENCE 65468af4317SDmitry Safonov string "Char sequence that enables magic SysRq over serial" 65568af4317SDmitry Safonov depends on MAGIC_SYSRQ_SERIAL 65668af4317SDmitry Safonov default "" 65768af4317SDmitry Safonov help 65868af4317SDmitry Safonov Specifies a sequence of characters that can follow BREAK to enable 65968af4317SDmitry Safonov SysRq on a serial console. 66068af4317SDmitry Safonov 661d3394b3dSDmitry Safonov If unsure, leave an empty string and the option will not be enabled. 662d3394b3dSDmitry Safonov 663ec29a5c1SChangbin Duconfig DEBUG_FS 664ec29a5c1SChangbin Du bool "Debug Filesystem" 665ec29a5c1SChangbin Du help 666ec29a5c1SChangbin Du debugfs is a virtual file system that kernel developers use to put 667ec29a5c1SChangbin Du debugging files into. Enable this option to be able to read and 668ec29a5c1SChangbin Du write to these files. 669ec29a5c1SChangbin Du 670ec29a5c1SChangbin Du For detailed documentation on the debugfs API, see 671ec29a5c1SChangbin Du Documentation/filesystems/. 672ec29a5c1SChangbin Du 673ec29a5c1SChangbin Du If unsure, say N. 674ec29a5c1SChangbin Du 675a24c6f7bSPeter Enderborgchoice 676a24c6f7bSPeter Enderborg prompt "Debugfs default access" 677a24c6f7bSPeter Enderborg depends on DEBUG_FS 678a24c6f7bSPeter Enderborg default DEBUG_FS_ALLOW_ALL 679a24c6f7bSPeter Enderborg help 680a24c6f7bSPeter Enderborg This selects the default access restrictions for debugfs. 681a24c6f7bSPeter Enderborg It can be overridden with kernel command line option 682a24c6f7bSPeter Enderborg debugfs=[on,no-mount,off]. The restrictions apply for API access 683a24c6f7bSPeter Enderborg and filesystem registration. 684a24c6f7bSPeter Enderborg 685a24c6f7bSPeter Enderborgconfig DEBUG_FS_ALLOW_ALL 686a24c6f7bSPeter Enderborg bool "Access normal" 687a24c6f7bSPeter Enderborg help 688a24c6f7bSPeter Enderborg No restrictions apply. Both API and filesystem registration 689a24c6f7bSPeter Enderborg is on. This is the normal default operation. 690a24c6f7bSPeter Enderborg 691a24c6f7bSPeter Enderborgconfig DEBUG_FS_DISALLOW_MOUNT 692a24c6f7bSPeter Enderborg bool "Do not register debugfs as filesystem" 693a24c6f7bSPeter Enderborg help 694a24c6f7bSPeter Enderborg The API is open but filesystem is not loaded. Clients can still do 695a24c6f7bSPeter Enderborg their work and read with debug tools that do not need 696a24c6f7bSPeter Enderborg debugfs filesystem. 697a24c6f7bSPeter Enderborg 698a24c6f7bSPeter Enderborgconfig DEBUG_FS_ALLOW_NONE 699a24c6f7bSPeter Enderborg bool "No access" 700a24c6f7bSPeter Enderborg help 701a24c6f7bSPeter Enderborg Access is off. Clients get -PERM when trying to create nodes in 702a24c6f7bSPeter Enderborg debugfs tree and debugfs is not registered as a filesystem. 703a24c6f7bSPeter Enderborg Client can then back-off or continue without debugfs access. 704a24c6f7bSPeter Enderborg 705a24c6f7bSPeter Enderborgendchoice 706a24c6f7bSPeter Enderborg 7076210b640SChangbin Dusource "lib/Kconfig.kgdb" 7086210b640SChangbin Dusource "lib/Kconfig.ubsan" 7092645d432SChangbin Dusource "lib/Kconfig.kcsan" 7106210b640SChangbin Du 7116210b640SChangbin Duendmenu 7126210b640SChangbin Du 7134d92b95fSEric Dumazetmenu "Networking Debugging" 7144d92b95fSEric Dumazet 7154d92b95fSEric Dumazetsource "net/Kconfig.debug" 7164d92b95fSEric Dumazet 7174d92b95fSEric Dumazetendmenu # "Networking Debugging" 718c66d7a27SSinan Kaya 7190610c8a8SDave Hansenmenu "Memory Debugging" 720a304e1b8SDavid Woodhouse 7218636a1f9SMasahiro Yamadasource "mm/Kconfig.debug" 72282f67cd9SIngo Molnar 7233ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS 7243ac7fe5aSThomas Gleixner bool "Debug object operations" 7253ac7fe5aSThomas Gleixner depends on DEBUG_KERNEL 7263ac7fe5aSThomas Gleixner help 7273ac7fe5aSThomas Gleixner If you say Y here, additional code will be inserted into the 7283ac7fe5aSThomas Gleixner kernel to track the life time of various objects and validate 7293ac7fe5aSThomas Gleixner the operations on those objects. 7303ac7fe5aSThomas Gleixner 7313ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_SELFTEST 7323ac7fe5aSThomas Gleixner bool "Debug objects selftest" 7333ac7fe5aSThomas Gleixner depends on DEBUG_OBJECTS 7343ac7fe5aSThomas Gleixner help 7353ac7fe5aSThomas Gleixner This enables the selftest of the object debug code. 7363ac7fe5aSThomas Gleixner 7373ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_FREE 7383ac7fe5aSThomas Gleixner bool "Debug objects in freed memory" 7393ac7fe5aSThomas Gleixner depends on DEBUG_OBJECTS 7403ac7fe5aSThomas Gleixner help 7413ac7fe5aSThomas Gleixner This enables checks whether a k/v free operation frees an area 7423ac7fe5aSThomas Gleixner which contains an object which has not been deactivated 7433ac7fe5aSThomas Gleixner properly. This can make kmalloc/kfree-intensive workloads 7443ac7fe5aSThomas Gleixner much slower. 7453ac7fe5aSThomas Gleixner 746c6f3a97fSThomas Gleixnerconfig DEBUG_OBJECTS_TIMERS 747c6f3a97fSThomas Gleixner bool "Debug timer objects" 748c6f3a97fSThomas Gleixner depends on DEBUG_OBJECTS 749c6f3a97fSThomas Gleixner help 750c6f3a97fSThomas Gleixner If you say Y here, additional code will be inserted into the 751c6f3a97fSThomas Gleixner timer routines to track the life time of timer objects and 752c6f3a97fSThomas Gleixner validate the timer operations. 753c6f3a97fSThomas Gleixner 754dc186ad7SThomas Gleixnerconfig DEBUG_OBJECTS_WORK 755dc186ad7SThomas Gleixner bool "Debug work objects" 756dc186ad7SThomas Gleixner depends on DEBUG_OBJECTS 757dc186ad7SThomas Gleixner help 758dc186ad7SThomas Gleixner If you say Y here, additional code will be inserted into the 759dc186ad7SThomas Gleixner work queue routines to track the life time of work objects and 760dc186ad7SThomas Gleixner validate the work operations. 761dc186ad7SThomas Gleixner 762551d55a9SMathieu Desnoyersconfig DEBUG_OBJECTS_RCU_HEAD 763551d55a9SMathieu Desnoyers bool "Debug RCU callbacks objects" 764fc2ecf7eSMathieu Desnoyers depends on DEBUG_OBJECTS 765551d55a9SMathieu Desnoyers help 766551d55a9SMathieu Desnoyers Enable this to turn on debugging of RCU list heads (call_rcu() usage). 767551d55a9SMathieu Desnoyers 768e2852ae8STejun Heoconfig DEBUG_OBJECTS_PERCPU_COUNTER 769e2852ae8STejun Heo bool "Debug percpu counter objects" 770e2852ae8STejun Heo depends on DEBUG_OBJECTS 771e2852ae8STejun Heo help 772e2852ae8STejun Heo If you say Y here, additional code will be inserted into the 773e2852ae8STejun Heo percpu counter routines to track the life time of percpu counter 774e2852ae8STejun Heo objects and validate the percpu counter operations. 775e2852ae8STejun Heo 7763ae70205SIngo Molnarconfig DEBUG_OBJECTS_ENABLE_DEFAULT 7773ae70205SIngo Molnar int "debug_objects bootup default value (0-1)" 7783ae70205SIngo Molnar range 0 1 7793ae70205SIngo Molnar default "1" 7803ae70205SIngo Molnar depends on DEBUG_OBJECTS 7813ae70205SIngo Molnar help 7823ae70205SIngo Molnar Debug objects boot parameter default value 7833ae70205SIngo Molnar 7845035ebc6SRoman Gushchinconfig SHRINKER_DEBUG 7855035ebc6SRoman Gushchin bool "Enable shrinker debugging support" 7865035ebc6SRoman Gushchin depends on DEBUG_FS 7875035ebc6SRoman Gushchin help 7885035ebc6SRoman Gushchin Say Y to enable the shrinker debugfs interface which provides 7895035ebc6SRoman Gushchin visibility into the kernel memory shrinkers subsystem. 7905035ebc6SRoman Gushchin Disable it to avoid an extra memory footprint. 7915035ebc6SRoman Gushchin 7920610c8a8SDave Hansenconfig DEBUG_STACK_USAGE 7930610c8a8SDave Hansen bool "Stack utilization instrumentation" 794cf8e8658SArd Biesheuvel depends on DEBUG_KERNEL 7950610c8a8SDave Hansen help 7960610c8a8SDave Hansen Enables the display of the minimum amount of free stack which each 7970610c8a8SDave Hansen task has ever had available in the sysrq-T and sysrq-P debug output. 798bc09d1deSUwe Kleine-König Also emits a message to dmesg when a process exits if that process 799bc09d1deSUwe Kleine-König used more stack space than previously exiting processes. 8000610c8a8SDave Hansen 8010610c8a8SDave Hansen This option will slow down process creation somewhat. 8020610c8a8SDave Hansen 803dc9b9638SChangbin Duconfig SCHED_STACK_END_CHECK 804dc9b9638SChangbin Du bool "Detect stack corruption on calls to schedule()" 805dc9b9638SChangbin Du depends on DEBUG_KERNEL 806dc9b9638SChangbin Du default n 807dc9b9638SChangbin Du help 808dc9b9638SChangbin Du This option checks for a stack overrun on calls to schedule(). 809dc9b9638SChangbin Du If the stack end location is found to be over written always panic as 810dc9b9638SChangbin Du the content of the corrupted region can no longer be trusted. 811dc9b9638SChangbin Du This is to ensure no erroneous behaviour occurs which could result in 812dc9b9638SChangbin Du data corruption or a sporadic crash at a later stage once the region 813dc9b9638SChangbin Du is examined. The runtime overhead introduced is minimal. 814dc9b9638SChangbin Du 815399145f9SAnshuman Khandualconfig ARCH_HAS_DEBUG_VM_PGTABLE 816399145f9SAnshuman Khandual bool 817399145f9SAnshuman Khandual help 818399145f9SAnshuman Khandual An architecture should select this when it can successfully 819399145f9SAnshuman Khandual build and run DEBUG_VM_PGTABLE. 820399145f9SAnshuman Khandual 8218b17e540SMateusz Guzikconfig DEBUG_VFS 8228b17e540SMateusz Guzik bool "Debug VFS" 8238b17e540SMateusz Guzik depends on DEBUG_KERNEL 8248b17e540SMateusz Guzik help 8258b17e540SMateusz Guzik Enable this to turn on extended checks in the VFS layer that may impact 8268b17e540SMateusz Guzik performance. 8278b17e540SMateusz Guzik 8288b17e540SMateusz Guzik If unsure, say N. 8298b17e540SMateusz Guzik 830a738e9baSThomas Gleixnerconfig DEBUG_VM_IRQSOFF 831a738e9baSThomas Gleixner def_bool DEBUG_VM && !PREEMPT_RT 832a738e9baSThomas Gleixner 8330610c8a8SDave Hansenconfig DEBUG_VM 8340610c8a8SDave Hansen bool "Debug VM" 8350610c8a8SDave Hansen depends on DEBUG_KERNEL 8360610c8a8SDave Hansen help 8370610c8a8SDave Hansen Enable this to turn on extended checks in the virtual-memory system 8380610c8a8SDave Hansen that may impact performance. 8390610c8a8SDave Hansen 8400610c8a8SDave Hansen If unsure, say N. 8410610c8a8SDave Hansen 8422655421aSNicholas Pigginconfig DEBUG_VM_SHOOT_LAZIES 8432655421aSNicholas Piggin bool "Debug MMU_LAZY_TLB_SHOOTDOWN implementation" 8442655421aSNicholas Piggin depends on DEBUG_VM 8452655421aSNicholas Piggin depends on MMU_LAZY_TLB_SHOOTDOWN 8462655421aSNicholas Piggin help 8472655421aSNicholas Piggin Enable additional IPIs that ensure lazy tlb mm references are removed 8482655421aSNicholas Piggin before the mm is freed. 8492655421aSNicholas Piggin 8502655421aSNicholas Piggin If unsure, say N. 8512655421aSNicholas Piggin 85254a611b6SLiam R. Howlettconfig DEBUG_VM_MAPLE_TREE 85354a611b6SLiam R. Howlett bool "Debug VM maple trees" 8544f115147SDavidlohr Bueso depends on DEBUG_VM 85554a611b6SLiam R. Howlett select DEBUG_MAPLE_TREE 8564f115147SDavidlohr Bueso help 85754a611b6SLiam R. Howlett Enable VM maple tree debugging information and extra validations. 8584f115147SDavidlohr Bueso 8594f115147SDavidlohr Bueso If unsure, say N. 8604f115147SDavidlohr Bueso 8610610c8a8SDave Hansenconfig DEBUG_VM_RB 8620610c8a8SDave Hansen bool "Debug VM red-black trees" 8630610c8a8SDave Hansen depends on DEBUG_VM 8640610c8a8SDave Hansen help 865a663dad6SDavidlohr Bueso Enable VM red-black tree debugging information and extra validations. 8660610c8a8SDave Hansen 8670610c8a8SDave Hansen If unsure, say N. 8680610c8a8SDave Hansen 86995ad9755SKirill A. Shutemovconfig DEBUG_VM_PGFLAGS 87095ad9755SKirill A. Shutemov bool "Debug page-flags operations" 87195ad9755SKirill A. Shutemov depends on DEBUG_VM 87295ad9755SKirill A. Shutemov help 87395ad9755SKirill A. Shutemov Enables extra validation on page flags operations. 87495ad9755SKirill A. Shutemov 87595ad9755SKirill A. Shutemov If unsure, say N. 87695ad9755SKirill A. Shutemov 877399145f9SAnshuman Khandualconfig DEBUG_VM_PGTABLE 878399145f9SAnshuman Khandual bool "Debug arch page table for semantics compliance" 879399145f9SAnshuman Khandual depends on MMU 880399145f9SAnshuman Khandual depends on ARCH_HAS_DEBUG_VM_PGTABLE 881399145f9SAnshuman Khandual default y if DEBUG_VM 882399145f9SAnshuman Khandual help 883399145f9SAnshuman Khandual This option provides a debug method which can be used to test 884399145f9SAnshuman Khandual architecture page table helper functions on various platforms in 885399145f9SAnshuman Khandual verifying if they comply with expected generic MM semantics. This 886399145f9SAnshuman Khandual will help architecture code in making sure that any changes or 887399145f9SAnshuman Khandual new additions of these helpers still conform to expected 888399145f9SAnshuman Khandual semantics of the generic MM. Platforms will have to opt in for 889399145f9SAnshuman Khandual this through ARCH_HAS_DEBUG_VM_PGTABLE. 890399145f9SAnshuman Khandual 891399145f9SAnshuman Khandual If unsure, say N. 892399145f9SAnshuman Khandual 893fa5b6ec9SLaura Abbottconfig ARCH_HAS_DEBUG_VIRTUAL 894fa5b6ec9SLaura Abbott bool 895fa5b6ec9SLaura Abbott 8960610c8a8SDave Hansenconfig DEBUG_VIRTUAL 8970610c8a8SDave Hansen bool "Debug VM translations" 898fa5b6ec9SLaura Abbott depends on DEBUG_KERNEL && ARCH_HAS_DEBUG_VIRTUAL 8990610c8a8SDave Hansen help 9000610c8a8SDave Hansen Enable some costly sanity checks in virtual to page code. This can 9010610c8a8SDave Hansen catch mistakes with virt_to_page() and friends. 9020610c8a8SDave Hansen 9030610c8a8SDave Hansen If unsure, say N. 9040610c8a8SDave Hansen 9050610c8a8SDave Hansenconfig DEBUG_NOMMU_REGIONS 9060610c8a8SDave Hansen bool "Debug the global anon/private NOMMU mapping region tree" 9070610c8a8SDave Hansen depends on DEBUG_KERNEL && !MMU 9080610c8a8SDave Hansen help 9090610c8a8SDave Hansen This option causes the global tree of anonymous and private mapping 9100610c8a8SDave Hansen regions to be regularly checked for invalid topology. 9110610c8a8SDave Hansen 9120610c8a8SDave Hansenconfig DEBUG_MEMORY_INIT 9130610c8a8SDave Hansen bool "Debug memory initialisation" if EXPERT 9140610c8a8SDave Hansen default !EXPERT 9150610c8a8SDave Hansen help 9160610c8a8SDave Hansen Enable this for additional checks during memory initialisation. 9170610c8a8SDave Hansen The sanity checks verify aspects of the VM such as the memory model 9180610c8a8SDave Hansen and other information provided by the architecture. Verbose 9190610c8a8SDave Hansen information will be printed at KERN_DEBUG loglevel depending 9200610c8a8SDave Hansen on the mminit_loglevel= command-line option. 9210610c8a8SDave Hansen 9220610c8a8SDave Hansen If unsure, say Y 9230610c8a8SDave Hansen 9240610c8a8SDave Hansenconfig MEMORY_NOTIFIER_ERROR_INJECT 9250610c8a8SDave Hansen tristate "Memory hotplug notifier error injection module" 92650f9481eSDavid Hildenbrand depends on MEMORY_HOTPLUG && NOTIFIER_ERROR_INJECTION 9270610c8a8SDave Hansen help 9280610c8a8SDave Hansen This option provides the ability to inject artificial errors to 9290610c8a8SDave Hansen memory hotplug notifier chain callbacks. It is controlled through 9300610c8a8SDave Hansen debugfs interface under /sys/kernel/debug/notifier-error-inject/memory 9310610c8a8SDave Hansen 9320610c8a8SDave Hansen If the notifier call chain should be failed with some events 9330610c8a8SDave Hansen notified, write the error code to "actions/<notifier event>/error". 9340610c8a8SDave Hansen 9350610c8a8SDave Hansen Example: Inject memory hotplug offline error (-12 == -ENOMEM) 9360610c8a8SDave Hansen 9370610c8a8SDave Hansen # cd /sys/kernel/debug/notifier-error-inject/memory 9380610c8a8SDave Hansen # echo -12 > actions/MEM_GOING_OFFLINE/error 9390610c8a8SDave Hansen # echo offline > /sys/devices/system/memory/memoryXXX/state 9400610c8a8SDave Hansen bash: echo: write error: Cannot allocate memory 9410610c8a8SDave Hansen 9420610c8a8SDave Hansen To compile this code as a module, choose M here: the module will 9430610c8a8SDave Hansen be called memory-notifier-error-inject. 9440610c8a8SDave Hansen 9450610c8a8SDave Hansen If unsure, say N. 9460610c8a8SDave Hansen 9470610c8a8SDave Hansenconfig DEBUG_PER_CPU_MAPS 9480610c8a8SDave Hansen bool "Debug access to per_cpu maps" 9490610c8a8SDave Hansen depends on DEBUG_KERNEL 9500610c8a8SDave Hansen depends on SMP 9510610c8a8SDave Hansen help 9520610c8a8SDave Hansen Say Y to verify that the per_cpu map being accessed has 9530610c8a8SDave Hansen been set up. This adds a fair amount of code to kernel memory 9540610c8a8SDave Hansen and decreases performance. 9550610c8a8SDave Hansen 9560610c8a8SDave Hansen Say N if unsure. 9570610c8a8SDave Hansen 9586e799cb6SThomas Gleixnerconfig DEBUG_KMAP_LOCAL 9596e799cb6SThomas Gleixner bool "Debug kmap_local temporary mappings" 9606e799cb6SThomas Gleixner depends on DEBUG_KERNEL && KMAP_LOCAL 9616e799cb6SThomas Gleixner help 9626e799cb6SThomas Gleixner This option enables additional error checking for the kmap_local 9636e799cb6SThomas Gleixner infrastructure. Disable for production use. 9646e799cb6SThomas Gleixner 9650e91a0c6SThomas Gleixnerconfig ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP 9660e91a0c6SThomas Gleixner bool 9670e91a0c6SThomas Gleixner 9680e91a0c6SThomas Gleixnerconfig DEBUG_KMAP_LOCAL_FORCE_MAP 9690e91a0c6SThomas Gleixner bool "Enforce kmap_local temporary mappings" 9700e91a0c6SThomas Gleixner depends on DEBUG_KERNEL && ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP 9710e91a0c6SThomas Gleixner select KMAP_LOCAL 9720e91a0c6SThomas Gleixner select DEBUG_KMAP_LOCAL 9730e91a0c6SThomas Gleixner help 9740e91a0c6SThomas Gleixner This option enforces temporary mappings through the kmap_local 9750e91a0c6SThomas Gleixner mechanism for non-highmem pages and on non-highmem systems. 9760e91a0c6SThomas Gleixner Disable this for production systems! 9770e91a0c6SThomas Gleixner 9780610c8a8SDave Hansenconfig DEBUG_HIGHMEM 9790610c8a8SDave Hansen bool "Highmem debugging" 9800610c8a8SDave Hansen depends on DEBUG_KERNEL && HIGHMEM 9810e91a0c6SThomas Gleixner select DEBUG_KMAP_LOCAL_FORCE_MAP if ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP 9826e799cb6SThomas Gleixner select DEBUG_KMAP_LOCAL 9830610c8a8SDave Hansen help 984b1357c9fSGeert Uytterhoeven This option enables additional error checking for high memory 985b1357c9fSGeert Uytterhoeven systems. Disable for production systems. 9860610c8a8SDave Hansen 9870610c8a8SDave Hansenconfig HAVE_DEBUG_STACKOVERFLOW 9880610c8a8SDave Hansen bool 9890610c8a8SDave Hansen 9900610c8a8SDave Hansenconfig DEBUG_STACKOVERFLOW 9910610c8a8SDave Hansen bool "Check for stack overflows" 9920610c8a8SDave Hansen depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW 993a7f7f624SMasahiro Yamada help 9940610c8a8SDave Hansen Say Y here if you want to check for overflows of kernel, IRQ 995edb0ec07SBorislav Petkov and exception stacks (if your architecture uses them). This 9960610c8a8SDave Hansen option will show detailed messages if free stack space drops 9970610c8a8SDave Hansen below a certain limit. 9980610c8a8SDave Hansen 9990610c8a8SDave Hansen These kinds of bugs usually occur when call-chains in the 10000610c8a8SDave Hansen kernel get too deep, especially when interrupts are 10010610c8a8SDave Hansen involved. 10020610c8a8SDave Hansen 10030610c8a8SDave Hansen Use this in cases where you see apparently random memory 10040610c8a8SDave Hansen corruption, especially if it appears in 'struct thread_info' 10050610c8a8SDave Hansen 10060610c8a8SDave Hansen If in doubt, say "N". 10070610c8a8SDave Hansen 1008916cc516SSuren Baghdasaryanconfig CODE_TAGGING 1009916cc516SSuren Baghdasaryan bool 1010916cc516SSuren Baghdasaryan select KALLSYMS 1011916cc516SSuren Baghdasaryan 101222d407b1SSuren Baghdasaryanconfig MEM_ALLOC_PROFILING 101322d407b1SSuren Baghdasaryan bool "Enable memory allocation profiling" 101422d407b1SSuren Baghdasaryan default n 10150f9b6856SSuren Baghdasaryan depends on MMU 101622d407b1SSuren Baghdasaryan depends on PROC_FS 101722d407b1SSuren Baghdasaryan depends on !DEBUG_FORCE_WEAK_PER_CPU 101822d407b1SSuren Baghdasaryan select CODE_TAGGING 1019dcfe378cSSuren Baghdasaryan select PAGE_EXTENSION 1020c789b5feSSuren Baghdasaryan select SLAB_OBJ_EXT 102122d407b1SSuren Baghdasaryan help 102222d407b1SSuren Baghdasaryan Track allocation source code and record total allocation size 102322d407b1SSuren Baghdasaryan initiated at that code location. The mechanism can be used to track 102422d407b1SSuren Baghdasaryan memory leaks with a low performance and memory impact. 102522d407b1SSuren Baghdasaryan 102622d407b1SSuren Baghdasaryanconfig MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT 102722d407b1SSuren Baghdasaryan bool "Enable memory allocation profiling by default" 102822d407b1SSuren Baghdasaryan default y 102922d407b1SSuren Baghdasaryan depends on MEM_ALLOC_PROFILING 103022d407b1SSuren Baghdasaryan 103122d407b1SSuren Baghdasaryanconfig MEM_ALLOC_PROFILING_DEBUG 103222d407b1SSuren Baghdasaryan bool "Memory allocation profiler debugging" 103322d407b1SSuren Baghdasaryan default n 103422d407b1SSuren Baghdasaryan depends on MEM_ALLOC_PROFILING 103522d407b1SSuren Baghdasaryan select MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT 103622d407b1SSuren Baghdasaryan help 103722d407b1SSuren Baghdasaryan Adds warnings with helpful error messages for memory allocation 103822d407b1SSuren Baghdasaryan profiling. 103922d407b1SSuren Baghdasaryan 10400b24beccSAndrey Ryabininsource "lib/Kconfig.kasan" 10410ce20dd8SAlexander Potapenkosource "lib/Kconfig.kfence" 1042f80be457SAlexander Potapenkosource "lib/Kconfig.kmsan" 10430b24beccSAndrey Ryabinin 10440610c8a8SDave Hansenendmenu # "Memory Debugging" 10450610c8a8SDave Hansen 1046f346f4b3SAdrian Bunkconfig DEBUG_SHIRQ 1047f346f4b3SAdrian Bunk bool "Debug shared IRQ handlers" 10480244ad00SMartin Schwidefsky depends on DEBUG_KERNEL 1049f346f4b3SAdrian Bunk help 10500a2fae2aSWolfram Sang Enable this to generate a spurious interrupt just before a shared 10510a2fae2aSWolfram Sang interrupt handler is deregistered (generating one when registering 10520a2fae2aSWolfram Sang is currently disabled). Drivers need to handle this correctly. Some 10530a2fae2aSWolfram Sang don't and need to be caught. 10541da177e4SLinus Torvalds 1055f43a289dSChangbin Dumenu "Debug Oops, Lockups and Hangs" 1056f43a289dSChangbin Du 1057f43a289dSChangbin Duconfig PANIC_ON_OOPS 1058f43a289dSChangbin Du bool "Panic on Oops" 1059f43a289dSChangbin Du help 1060f43a289dSChangbin Du Say Y here to enable the kernel to panic when it oopses. This 1061f43a289dSChangbin Du has the same effect as setting oops=panic on the kernel command 1062f43a289dSChangbin Du line. 1063f43a289dSChangbin Du 1064f43a289dSChangbin Du This feature is useful to ensure that the kernel does not do 1065f43a289dSChangbin Du anything erroneous after an oops which could result in data 1066f43a289dSChangbin Du corruption or other issues. 1067f43a289dSChangbin Du 1068f43a289dSChangbin Du Say N if unsure. 1069f43a289dSChangbin Du 1070f43a289dSChangbin Duconfig PANIC_ON_OOPS_VALUE 1071f43a289dSChangbin Du int 1072f43a289dSChangbin Du range 0 1 1073f43a289dSChangbin Du default 0 if !PANIC_ON_OOPS 1074f43a289dSChangbin Du default 1 if PANIC_ON_OOPS 1075f43a289dSChangbin Du 1076f43a289dSChangbin Duconfig PANIC_TIMEOUT 1077f43a289dSChangbin Du int "panic timeout" 1078f43a289dSChangbin Du default 0 1079f43a289dSChangbin Du help 10809d5b134fSTiezhu Yang Set the timeout value (in seconds) until a reboot occurs when 1081f43a289dSChangbin Du the kernel panics. If n = 0, then we wait forever. A timeout 1082f43a289dSChangbin Du value n > 0 will wait n seconds before rebooting, while a timeout 1083d0bff054SBrian Masney value n < 0 will reboot immediately. This setting can be overridden 1084d0bff054SBrian Masney with the kernel command line option panic=, and from userspace via 1085d0bff054SBrian Masney /proc/sys/kernel/panic. 108692aef8fbSDave Hansen 10871da177e4SLinus Torvaldsconfig LOCKUP_DETECTOR 108805a4a952SNicholas Piggin bool 108905a4a952SNicholas Piggin 109005a4a952SNicholas Pigginconfig SOFTLOCKUP_DETECTOR 109105a4a952SNicholas Piggin bool "Detect Soft Lockups" 1092fbb9ce95SIngo Molnar depends on DEBUG_KERNEL && !S390 109305a4a952SNicholas Piggin select LOCKUP_DETECTOR 10941da177e4SLinus Torvalds help 10951da177e4SLinus Torvalds Say Y here to enable the kernel to act as a watchdog to detect 109605a4a952SNicholas Piggin soft lockups. 10971da177e4SLinus Torvalds 10981da177e4SLinus Torvalds Softlockups are bugs that cause the kernel to loop in kernel 10991da177e4SLinus Torvalds mode for more than 20 seconds, without giving other tasks a 11001da177e4SLinus Torvalds chance to run. The current stack trace is displayed upon 11011da177e4SLinus Torvalds detection and the system will stay locked up. 11021da177e4SLinus Torvalds 1103d7037381SBitao Huconfig SOFTLOCKUP_DETECTOR_INTR_STORM 1104d7037381SBitao Hu bool "Detect Interrupt Storm in Soft Lockups" 1105d7037381SBitao Hu depends on SOFTLOCKUP_DETECTOR && IRQ_TIME_ACCOUNTING 1106d7037381SBitao Hu select GENERIC_IRQ_STAT_SNAPSHOT 1107d7037381SBitao Hu default y if NR_CPUS <= 128 1108d7037381SBitao Hu help 1109d7037381SBitao Hu Say Y here to enable the kernel to detect interrupt storm 1110d7037381SBitao Hu during "soft lockups". 1111d7037381SBitao Hu 1112d7037381SBitao Hu "soft lockups" can be caused by a variety of reasons. If one is 1113d7037381SBitao Hu caused by an interrupt storm, then the storming interrupts will not 1114d7037381SBitao Hu be on the callstack. To detect this case, it is necessary to report 1115d7037381SBitao Hu the CPU stats and the interrupt counts during the "soft lockups". 1116d7037381SBitao Hu 11175f00ae0dSRandy Dunlapconfig BOOTPARAM_SOFTLOCKUP_PANIC 11185f00ae0dSRandy Dunlap bool "Panic (Reboot) On Soft Lockups" 11195f00ae0dSRandy Dunlap depends on SOFTLOCKUP_DETECTOR 11205f00ae0dSRandy Dunlap help 11215f00ae0dSRandy Dunlap Say Y here to enable the kernel to panic on "soft lockups", 11225f00ae0dSRandy Dunlap which are bugs that cause the kernel to loop in kernel 11235f00ae0dSRandy Dunlap mode for more than 20 seconds (configurable using the watchdog_thresh 11245f00ae0dSRandy Dunlap sysctl), without giving other tasks a chance to run. 11255f00ae0dSRandy Dunlap 11265f00ae0dSRandy Dunlap The panic can be used in combination with panic_timeout, 11275f00ae0dSRandy Dunlap to cause the system to reboot automatically after a 11285f00ae0dSRandy Dunlap lockup has been detected. This feature is useful for 11295f00ae0dSRandy Dunlap high-availability systems that have uptime guarantees and 11305f00ae0dSRandy Dunlap where a lockup must be resolved ASAP. 11315f00ae0dSRandy Dunlap 11325f00ae0dSRandy Dunlap Say N if unsure. 11335f00ae0dSRandy Dunlap 11341356d0b9SPetr Mladekconfig HAVE_HARDLOCKUP_DETECTOR_BUDDY 11351356d0b9SPetr Mladek bool 11361356d0b9SPetr Mladek depends on SMP 11371356d0b9SPetr Mladek default y 11381356d0b9SPetr Mladek 11397edaeb68SThomas Gleixner# 11401356d0b9SPetr Mladek# Global switch whether to build a hardlockup detector at all. It is available 11411356d0b9SPetr Mladek# only when the architecture supports at least one implementation. There are 11421356d0b9SPetr Mladek# two exceptions. The hardlockup detector is never enabled on: 11431356d0b9SPetr Mladek# 11441356d0b9SPetr Mladek# s390: it reported many false positives there 11451356d0b9SPetr Mladek# 11461356d0b9SPetr Mladek# sparc64: has a custom implementation which is not using the common 11471356d0b9SPetr Mladek# hardlockup command line options and sysctl interface. 11481356d0b9SPetr Mladek# 114905a4a952SNicholas Pigginconfig HARDLOCKUP_DETECTOR 115005a4a952SNicholas Piggin bool "Detect Hard Lockups" 115147f4cb43SPetr Mladek depends on DEBUG_KERNEL && !S390 && !HARDLOCKUP_DETECTOR_SPARC64 1152a5fcc236SPetr Mladek depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_BUDDY || HAVE_HARDLOCKUP_DETECTOR_ARCH 11531356d0b9SPetr Mladek imply HARDLOCKUP_DETECTOR_PERF 11541356d0b9SPetr Mladek imply HARDLOCKUP_DETECTOR_BUDDY 11557ca8fe94SPetr Mladek imply HARDLOCKUP_DETECTOR_ARCH 115605a4a952SNicholas Piggin select LOCKUP_DETECTOR 11571f423c90SDouglas Anderson 115805a4a952SNicholas Piggin help 115905a4a952SNicholas Piggin Say Y here to enable the kernel to act as a watchdog to detect 116005a4a952SNicholas Piggin hard lockups. 116105a4a952SNicholas Piggin 11628446f1d3SIngo Molnar Hardlockups are bugs that cause the CPU to loop in kernel mode 11638446f1d3SIngo Molnar for more than 10 seconds, without letting other interrupts have a 11648446f1d3SIngo Molnar chance to run. The current stack trace is displayed upon detection 11658446f1d3SIngo Molnar and the system will stay locked up. 11668446f1d3SIngo Molnar 11671356d0b9SPetr Mladek# 11681356d0b9SPetr Mladek# Note that arch-specific variants are always preferred. 11691356d0b9SPetr Mladek# 11704917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_PREFER_BUDDY 11714917a25fSPetr Mladek bool "Prefer the buddy CPU hardlockup detector" 11721356d0b9SPetr Mladek depends on HARDLOCKUP_DETECTOR 11731356d0b9SPetr Mladek depends on HAVE_HARDLOCKUP_DETECTOR_PERF && HAVE_HARDLOCKUP_DETECTOR_BUDDY 1174a8992d8aSLukas Bulwahn depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH 11754917a25fSPetr Mladek help 11764917a25fSPetr Mladek Say Y here to prefer the buddy hardlockup detector over the perf one. 11774917a25fSPetr Mladek 11784917a25fSPetr Mladek With the buddy detector, each CPU uses its softlockup hrtimer 11794917a25fSPetr Mladek to check that the next CPU is processing hrtimer interrupts by 11804917a25fSPetr Mladek verifying that a counter is increasing. 11814917a25fSPetr Mladek 11824917a25fSPetr Mladek This hardlockup detector is useful on systems that don't have 11834917a25fSPetr Mladek an arch-specific hardlockup detector or if resources needed 11844917a25fSPetr Mladek for the hardlockup detector are better used for other things. 11854917a25fSPetr Mladek 11861da177e4SLinus Torvaldsconfig HARDLOCKUP_DETECTOR_PERF 11871da177e4SLinus Torvalds bool 11881356d0b9SPetr Mladek depends on HARDLOCKUP_DETECTOR 11891356d0b9SPetr Mladek depends on HAVE_HARDLOCKUP_DETECTOR_PERF && !HARDLOCKUP_DETECTOR_PREFER_BUDDY 1190a5fcc236SPetr Mladek depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH 11914917a25fSPetr Mladek select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER 11924917a25fSPetr Mladek 11934917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_BUDDY 11944917a25fSPetr Mladek bool 11951356d0b9SPetr Mladek depends on HARDLOCKUP_DETECTOR 11961356d0b9SPetr Mladek depends on HAVE_HARDLOCKUP_DETECTOR_BUDDY 11971356d0b9SPetr Mladek depends on !HAVE_HARDLOCKUP_DETECTOR_PERF || HARDLOCKUP_DETECTOR_PREFER_BUDDY 1198a5fcc236SPetr Mladek depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH 11994917a25fSPetr Mladek select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER 12004917a25fSPetr Mladek 12017ca8fe94SPetr Mladekconfig HARDLOCKUP_DETECTOR_ARCH 12027ca8fe94SPetr Mladek bool 12037ca8fe94SPetr Mladek depends on HARDLOCKUP_DETECTOR 12047ca8fe94SPetr Mladek depends on HAVE_HARDLOCKUP_DETECTOR_ARCH 12057ca8fe94SPetr Mladek help 12067ca8fe94SPetr Mladek The arch-specific implementation of the hardlockup detector will 12077ca8fe94SPetr Mladek be used. 12087ca8fe94SPetr Mladek 12091356d0b9SPetr Mladek# 12104917a25fSPetr Mladek# Both the "perf" and "buddy" hardlockup detectors count hrtimer 12114917a25fSPetr Mladek# interrupts. This config enables functions managing this common code. 12121356d0b9SPetr Mladek# 12134917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_COUNTS_HRTIMER 12144917a25fSPetr Mladek bool 12151da177e4SLinus Torvalds select SOFTLOCKUP_DETECTOR 12161da177e4SLinus Torvalds 12171da177e4SLinus Torvalds# 12181da177e4SLinus Torvalds# Enables a timestamp based low pass filter to compensate for perf based 12191da177e4SLinus Torvalds# hard lockup detection which runs too fast due to turbo modes. 12201da177e4SLinus Torvalds# 12211da177e4SLinus Torvaldsconfig HARDLOCKUP_CHECK_TIMESTAMP 12221da177e4SLinus Torvalds bool 12231da177e4SLinus Torvalds 12241da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC 12251da177e4SLinus Torvalds bool "Panic (Reboot) On Hard Lockups" 12261da177e4SLinus Torvalds depends on HARDLOCKUP_DETECTOR 12271da177e4SLinus Torvalds help 12281da177e4SLinus Torvalds Say Y here to enable the kernel to panic on "hard lockups", 12291da177e4SLinus Torvalds which are bugs that cause the kernel to loop in kernel 12301da177e4SLinus Torvalds mode with interrupts disabled for more than 10 seconds (configurable 12311da177e4SLinus Torvalds using the watchdog_thresh sysctl). 12321da177e4SLinus Torvalds 12331da177e4SLinus Torvalds Say N if unsure. 12341da177e4SLinus Torvalds 12351da177e4SLinus Torvaldsconfig DETECT_HUNG_TASK 12361da177e4SLinus Torvalds bool "Detect Hung Tasks" 12371da177e4SLinus Torvalds depends on DEBUG_KERNEL 123805a4a952SNicholas Piggin default SOFTLOCKUP_DETECTOR 12391da177e4SLinus Torvalds help 12401da177e4SLinus Torvalds Say Y here to enable the kernel to detect "hung tasks", 12414a2f0acfSAndrew Morton which are bugs that cause the task to be stuck in 124296b03ab8SVivien Didelot uninterruptible "D" state indefinitely. 12431da177e4SLinus Torvalds 12441da177e4SLinus Torvalds When a hung task is detected, the kernel will print the 12451da177e4SLinus Torvalds current stack trace (which you should report), but the 12461da177e4SLinus Torvalds task will stay in uninterruptible state. If lockdep is 12471da177e4SLinus Torvalds enabled then all held locks will also be reported. This 12481da177e4SLinus Torvalds feature has negligible overhead. 12491da177e4SLinus Torvalds 12501da177e4SLinus Torvaldsconfig DEFAULT_HUNG_TASK_TIMEOUT 12511da177e4SLinus Torvalds int "Default timeout for hung task detection (in seconds)" 12521da177e4SLinus Torvalds depends on DETECT_HUNG_TASK 12531da177e4SLinus Torvalds default 120 12541da177e4SLinus Torvalds help 12551da177e4SLinus Torvalds This option controls the default timeout (in seconds) used 12561da177e4SLinus Torvalds to determine when a task has become non-responsive and should 125750dd26baSIngo Molnar be considered hung. 12581da177e4SLinus Torvalds 12591da177e4SLinus Torvalds It can be adjusted at runtime via the kernel.hung_task_timeout_secs 12601da177e4SLinus Torvalds sysctl or by writing a value to 12611da177e4SLinus Torvalds /proc/sys/kernel/hung_task_timeout_secs. 12621da177e4SLinus Torvalds 1263871751e2SAl Viro A timeout of 0 disables the check. The default is two minutes. 1264871751e2SAl Viro Keeping the default should be fine in most cases. 1265871751e2SAl Viro 1266871751e2SAl Viroconfig BOOTPARAM_HUNG_TASK_PANIC 12671da177e4SLinus Torvalds bool "Panic (Reboot) On Hung Tasks" 12681da177e4SLinus Torvalds depends on DETECT_HUNG_TASK 12698637c099SIngo Molnar help 12701da177e4SLinus Torvalds Say Y here to enable the kernel to panic on "hung tasks", 12711da177e4SLinus Torvalds which are bugs that cause the kernel to leave a task stuck 12721da177e4SLinus Torvalds in uninterruptible "D" state. 12731da177e4SLinus Torvalds 12741da177e4SLinus Torvalds The panic can be used in combination with panic_timeout, 12751da177e4SLinus Torvalds to cause the system to reboot automatically after a 12761da177e4SLinus Torvalds hung task has been detected. This feature is useful for 1277e7eebaf6SIngo Molnar high-availability systems that have uptime guarantees and 1278e7eebaf6SIngo Molnar where a hung tasks must be resolved ASAP. 1279e7eebaf6SIngo Molnar 1280e7eebaf6SIngo Molnar Say N if unsure. 1281e7eebaf6SIngo Molnar 12823cf67d61SMasami Hiramatsu (Google)config DETECT_HUNG_TASK_BLOCKER 12833cf67d61SMasami Hiramatsu (Google) bool "Dump Hung Tasks Blocker" 12843cf67d61SMasami Hiramatsu (Google) depends on DETECT_HUNG_TASK 12853cf67d61SMasami Hiramatsu (Google) depends on !PREEMPT_RT 12863cf67d61SMasami Hiramatsu (Google) default y 12873cf67d61SMasami Hiramatsu (Google) help 12883cf67d61SMasami Hiramatsu (Google) Say Y here to show the blocker task's stacktrace who acquires 12893cf67d61SMasami Hiramatsu (Google) the mutex lock which "hung tasks" are waiting. 12903cf67d61SMasami Hiramatsu (Google) This will add overhead a bit but shows suspicious tasks and 12913cf67d61SMasami Hiramatsu (Google) call trace if it comes from waiting a mutex. 12923cf67d61SMasami Hiramatsu (Google) 129382607adcSTejun Heoconfig WQ_WATCHDOG 129482607adcSTejun Heo bool "Detect Workqueue Stalls" 129582607adcSTejun Heo depends on DEBUG_KERNEL 129682607adcSTejun Heo help 129782607adcSTejun Heo Say Y here to enable stall detection on workqueues. If a 129882607adcSTejun Heo worker pool doesn't make forward progress on a pending work 129982607adcSTejun Heo item for over a given amount of time, 30s by default, a 130082607adcSTejun Heo warning message is printed along with dump of workqueue 130182607adcSTejun Heo state. This can be configured through kernel parameter 130282607adcSTejun Heo "workqueue.watchdog_thresh" and its sysfs counterpart. 130382607adcSTejun Heo 130463638450STejun Heoconfig WQ_CPU_INTENSIVE_REPORT 130563638450STejun Heo bool "Report per-cpu work items which hog CPU for too long" 130663638450STejun Heo depends on DEBUG_KERNEL 130763638450STejun Heo help 130863638450STejun Heo Say Y here to enable reporting of concurrency-managed per-cpu work 130963638450STejun Heo items that hog CPUs for longer than 1310b2ec116aSGeert Uytterhoeven workqueue.cpu_intensive_thresh_us. Workqueue automatically 131163638450STejun Heo detects and excludes them from concurrency management to prevent 131263638450STejun Heo them from stalling other per-cpu work items. Occassional 131363638450STejun Heo triggering may not necessarily indicate a problem. Repeated 131463638450STejun Heo triggering likely indicates that the work item should be switched 131563638450STejun Heo to use an unbound workqueue. 131663638450STejun Heo 131730428ef5SKonstantin Khlebnikovconfig TEST_LOCKUP 131830428ef5SKonstantin Khlebnikov tristate "Test module to generate lockups" 131963646bc9STiezhu Yang depends on m 132030428ef5SKonstantin Khlebnikov help 132130428ef5SKonstantin Khlebnikov This builds the "test_lockup" module that helps to make sure 132230428ef5SKonstantin Khlebnikov that watchdogs and lockup detectors are working properly. 132330428ef5SKonstantin Khlebnikov 132430428ef5SKonstantin Khlebnikov Depending on module parameters it could emulate soft or hard 132530428ef5SKonstantin Khlebnikov lockup, "hung task", or locking arbitrary lock for a long time. 132630428ef5SKonstantin Khlebnikov Also it could generate series of lockups with cooling-down periods. 132730428ef5SKonstantin Khlebnikov 132830428ef5SKonstantin Khlebnikov If unsure, say N. 132930428ef5SKonstantin Khlebnikov 133092aef8fbSDave Hansenendmenu # "Debug lockups and hangs" 133192aef8fbSDave Hansen 1332ebebdd09SChangbin Dumenu "Scheduler Debugging" 13335800dc3cSJason Baron 1334f6db8347SNaveen N. Raoconfig SCHED_INFO 1335f6db8347SNaveen N. Rao bool 1336f6db8347SNaveen N. Rao default n 1337f6db8347SNaveen N. Rao 13381da177e4SLinus Torvaldsconfig SCHEDSTATS 13391da177e4SLinus Torvalds bool "Collect scheduler statistics" 13409ab121d6SIngo Molnar depends on PROC_FS 1341f6db8347SNaveen N. Rao select SCHED_INFO 13421da177e4SLinus Torvalds help 13431da177e4SLinus Torvalds If you say Y here, additional code will be inserted into the 13441da177e4SLinus Torvalds scheduler and related routines to collect statistics about 13451da177e4SLinus Torvalds scheduler behavior and provide them in /proc/schedstat. These 13461da177e4SLinus Torvalds stats may be useful for both tuning and debugging the scheduler 13471da177e4SLinus Torvalds If you aren't debugging the scheduler or trying to tune a specific 13481da177e4SLinus Torvalds application, you can say N to avoid the very slight overhead 13491da177e4SLinus Torvalds this adds. 13501da177e4SLinus Torvalds 1351ebebdd09SChangbin Duendmenu 13520d9e2632SAaron Tomlin 13531da177e4SLinus Torvaldsconfig DEBUG_PREEMPT 13541da177e4SLinus Torvalds bool "Debug preemptible kernel" 13559f472869SSebastian Andrzej Siewior depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT 13561da177e4SLinus Torvalds help 13571da177e4SLinus Torvalds If you say Y here then the kernel will use a debug variant of the 13581da177e4SLinus Torvalds commonly used smp_processor_id() function and will print warnings 13591da177e4SLinus Torvalds if kernel code uses it in a preemption-unsafe way. Also, the kernel 13601da177e4SLinus Torvalds will detect preemption count underflows. 1361408894eeSIngo Molnar 1362cc600391SHyeonggon Yoo This option has potential to introduce high runtime overhead, 1363cc600391SHyeonggon Yoo depending on workload as it triggers debugging routines for each 1364cc600391SHyeonggon Yoo this_cpu operation. It should only be used for debugging purposes. 1365cc600391SHyeonggon Yoo 13669eade16bSDave Hansenmenu "Lock Debugging (spinlocks, mutexes, etc...)" 13679eade16bSDave Hansen 1368f07cbebbSWaiman Longconfig LOCK_DEBUGGING_SUPPORT 1369f07cbebbSWaiman Long bool 1370f07cbebbSWaiman Long depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 1371f07cbebbSWaiman Long default y 1372f07cbebbSWaiman Long 137319193bcaSWaiman Longconfig PROVE_LOCKING 137419193bcaSWaiman Long bool "Lock debugging: prove locking correctness" 137519193bcaSWaiman Long depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 137619193bcaSWaiman Long select LOCKDEP 137719193bcaSWaiman Long select DEBUG_SPINLOCK 1378bb630f9fSThomas Gleixner select DEBUG_MUTEXES if !PREEMPT_RT 137919193bcaSWaiman Long select DEBUG_RT_MUTEXES if RT_MUTEXES 1380f22f7132SWaiman Long select DEBUG_RWSEMS if !PREEMPT_RT 138119193bcaSWaiman Long select DEBUG_WW_MUTEX_SLOWPATH 138219193bcaSWaiman Long select DEBUG_LOCK_ALLOC 13838fd8ad5cSAhmed S. Darwish select PREEMPT_COUNT if !ARCH_NO_PREEMPT 138419193bcaSWaiman Long select TRACE_IRQFLAGS 138519193bcaSWaiman Long default n 138619193bcaSWaiman Long help 138719193bcaSWaiman Long This feature enables the kernel to prove that all locking 138819193bcaSWaiman Long that occurs in the kernel runtime is mathematically 138919193bcaSWaiman Long correct: that under no circumstance could an arbitrary (and 139019193bcaSWaiman Long not yet triggered) combination of observed locking 139119193bcaSWaiman Long sequences (on an arbitrary number of CPUs, running an 139219193bcaSWaiman Long arbitrary number of tasks and interrupt contexts) cause a 139319193bcaSWaiman Long deadlock. 139419193bcaSWaiman Long 139519193bcaSWaiman Long In short, this feature enables the kernel to report locking 139619193bcaSWaiman Long related deadlocks before they actually occur. 139719193bcaSWaiman Long 139819193bcaSWaiman Long The proof does not depend on how hard and complex a 139919193bcaSWaiman Long deadlock scenario would be to trigger: how many 140019193bcaSWaiman Long participant CPUs, tasks and irq-contexts would be needed 140119193bcaSWaiman Long for it to trigger. The proof also does not depend on 140219193bcaSWaiman Long timing: if a race and a resulting deadlock is possible 140319193bcaSWaiman Long theoretically (no matter how unlikely the race scenario 140419193bcaSWaiman Long is), it will be proven so and will immediately be 140519193bcaSWaiman Long reported by the kernel (once the event is observed that 140619193bcaSWaiman Long makes the deadlock theoretically possible). 140719193bcaSWaiman Long 140819193bcaSWaiman Long If a deadlock is impossible (i.e. the locking rules, as 140919193bcaSWaiman Long observed by the kernel, are mathematically correct), the 141019193bcaSWaiman Long kernel reports nothing. 141119193bcaSWaiman Long 141219193bcaSWaiman Long NOTE: this feature can also be enabled for rwlocks, mutexes 141319193bcaSWaiman Long and rwsems - in which case all dependencies between these 141419193bcaSWaiman Long different locking variants are observed and mapped too, and 141519193bcaSWaiman Long the proof of observed correctness is also maintained for an 141619193bcaSWaiman Long arbitrary combination of these separate locking variants. 141719193bcaSWaiman Long 1418387b1468SMauro Carvalho Chehab For more details, see Documentation/locking/lockdep-design.rst. 141919193bcaSWaiman Long 1420de8f5e4fSPeter Zijlstraconfig PROVE_RAW_LOCK_NESTING 1421d387ceb1SWaiman Long bool "Enable raw_spinlock - spinlock nesting checks" if !ARCH_SUPPORTS_RT 1422de8f5e4fSPeter Zijlstra depends on PROVE_LOCKING 1423d387ceb1SWaiman Long default y if ARCH_SUPPORTS_RT 1424de8f5e4fSPeter Zijlstra help 1425de8f5e4fSPeter Zijlstra Enable the raw_spinlock vs. spinlock nesting checks which ensure 1426de8f5e4fSPeter Zijlstra that the lock nesting rules for PREEMPT_RT enabled kernels are 1427de8f5e4fSPeter Zijlstra not violated. 1428de8f5e4fSPeter Zijlstra 142919193bcaSWaiman Longconfig LOCK_STAT 143019193bcaSWaiman Long bool "Lock usage statistics" 143119193bcaSWaiman Long depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 143219193bcaSWaiman Long select LOCKDEP 143319193bcaSWaiman Long select DEBUG_SPINLOCK 1434bb630f9fSThomas Gleixner select DEBUG_MUTEXES if !PREEMPT_RT 143519193bcaSWaiman Long select DEBUG_RT_MUTEXES if RT_MUTEXES 143619193bcaSWaiman Long select DEBUG_LOCK_ALLOC 143719193bcaSWaiman Long default n 143819193bcaSWaiman Long help 143919193bcaSWaiman Long This feature enables tracking lock contention points 144019193bcaSWaiman Long 1441387b1468SMauro Carvalho Chehab For more details, see Documentation/locking/lockstat.rst 144219193bcaSWaiman Long 144319193bcaSWaiman Long This also enables lock events required by "perf lock", 144419193bcaSWaiman Long subcommand of perf. 144519193bcaSWaiman Long If you want to use "perf lock", you also need to turn on 144619193bcaSWaiman Long CONFIG_EVENT_TRACING. 144719193bcaSWaiman Long 144819193bcaSWaiman Long CONFIG_LOCK_STAT defines "contended" and "acquired" lock events. 144919193bcaSWaiman Long (CONFIG_LOCKDEP defines "acquire" and "release" events.) 145019193bcaSWaiman Long 1451e7eebaf6SIngo Molnarconfig DEBUG_RT_MUTEXES 1452e7eebaf6SIngo Molnar bool "RT Mutex debugging, deadlock detection" 1453e7eebaf6SIngo Molnar depends on DEBUG_KERNEL && RT_MUTEXES 1454e7eebaf6SIngo Molnar help 1455e7eebaf6SIngo Molnar This allows rt mutex semantics violations and rt mutex related 1456e7eebaf6SIngo Molnar deadlocks (lockups) to be detected and reported automatically. 1457e7eebaf6SIngo Molnar 14581da177e4SLinus Torvaldsconfig DEBUG_SPINLOCK 14594d9f34adSIngo Molnar bool "Spinlock and rw-lock debugging: basic checks" 14601da177e4SLinus Torvalds depends on DEBUG_KERNEL 1461e335e3ebSRaghavendra K T select UNINLINE_SPIN_UNLOCK 14621da177e4SLinus Torvalds help 14631da177e4SLinus Torvalds Say Y here and build SMP to catch missing spinlock initialization 14641da177e4SLinus Torvalds and certain other kinds of spinlock errors commonly made. This is 14651da177e4SLinus Torvalds best used in conjunction with the NMI watchdog so that spinlock 14661da177e4SLinus Torvalds deadlocks are also debuggable. 14671da177e4SLinus Torvalds 14684d9f34adSIngo Molnarconfig DEBUG_MUTEXES 14694d9f34adSIngo Molnar bool "Mutex debugging: basic checks" 1470bb630f9fSThomas Gleixner depends on DEBUG_KERNEL && !PREEMPT_RT 14714d9f34adSIngo Molnar help 14724d9f34adSIngo Molnar This feature allows mutex semantics violations to be detected and 14734d9f34adSIngo Molnar reported. 14744d9f34adSIngo Molnar 147523010027SDaniel Vetterconfig DEBUG_WW_MUTEX_SLOWPATH 147623010027SDaniel Vetter bool "Wait/wound mutex debugging: Slowpath testing" 1477f07cbebbSWaiman Long depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 147823010027SDaniel Vetter select DEBUG_LOCK_ALLOC 147923010027SDaniel Vetter select DEBUG_SPINLOCK 1480bb630f9fSThomas Gleixner select DEBUG_MUTEXES if !PREEMPT_RT 1481bb630f9fSThomas Gleixner select DEBUG_RT_MUTEXES if PREEMPT_RT 148223010027SDaniel Vetter help 148323010027SDaniel Vetter This feature enables slowpath testing for w/w mutex users by 148423010027SDaniel Vetter injecting additional -EDEADLK wound/backoff cases. Together with 148523010027SDaniel Vetter the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this 148623010027SDaniel Vetter will test all possible w/w mutex interface abuse with the 148723010027SDaniel Vetter exception of simply not acquiring all the required locks. 14884d692373SRob Clark Note that this feature can introduce significant overhead, so 14894d692373SRob Clark it really should not be enabled in a production or distro kernel, 14904d692373SRob Clark even a debug kernel. If you are a driver writer, enable it. If 14914d692373SRob Clark you are a distro, do not. 149223010027SDaniel Vetter 14935149cbacSWaiman Longconfig DEBUG_RWSEMS 14945149cbacSWaiman Long bool "RW Semaphore debugging: basic checks" 1495f22f7132SWaiman Long depends on DEBUG_KERNEL && !PREEMPT_RT 14965149cbacSWaiman Long help 1497c71fd893SWaiman Long This debugging feature allows mismatched rw semaphore locks 1498c71fd893SWaiman Long and unlocks to be detected and reported. 14995149cbacSWaiman Long 15004d9f34adSIngo Molnarconfig DEBUG_LOCK_ALLOC 15014d9f34adSIngo Molnar bool "Lock debugging: detect incorrect freeing of live locks" 1502f07cbebbSWaiman Long depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 15034d9f34adSIngo Molnar select DEBUG_SPINLOCK 1504bb630f9fSThomas Gleixner select DEBUG_MUTEXES if !PREEMPT_RT 1505f5694788SPeter Zijlstra select DEBUG_RT_MUTEXES if RT_MUTEXES 15064d9f34adSIngo Molnar select LOCKDEP 15074d9f34adSIngo Molnar help 15084d9f34adSIngo Molnar This feature will check whether any held lock (spinlock, rwlock, 15094d9f34adSIngo Molnar mutex or rwsem) is incorrectly freed by the kernel, via any of the 15104d9f34adSIngo Molnar memory-freeing routines (kfree(), kmem_cache_free(), free_pages(), 15114d9f34adSIngo Molnar vfree(), etc.), whether a live lock is incorrectly reinitialized via 15124d9f34adSIngo Molnar spin_lock_init()/mutex_init()/etc., or whether there is any lock 15134d9f34adSIngo Molnar held during task exit. 15144d9f34adSIngo Molnar 15154d9f34adSIngo Molnarconfig LOCKDEP 15164d9f34adSIngo Molnar bool 1517f07cbebbSWaiman Long depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 15184d9f34adSIngo Molnar select STACKTRACE 15194d9f34adSIngo Molnar select KALLSYMS 15204d9f34adSIngo Molnar select KALLSYMS_ALL 15214d9f34adSIngo Molnar 1522395102dbSDaniel Jordanconfig LOCKDEP_SMALL 1523395102dbSDaniel Jordan bool 1524395102dbSDaniel Jordan 15255dc33592STetsuo Handaconfig LOCKDEP_BITS 152688a79e88SCarlos Llamas int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)" 15275dc33592STetsuo Handa depends on LOCKDEP && !LOCKDEP_SMALL 1528e638072eSCarlos Llamas range 10 24 15295dc33592STetsuo Handa default 15 15305dc33592STetsuo Handa help 15315dc33592STetsuo Handa Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message. 15325dc33592STetsuo Handa 15335dc33592STetsuo Handaconfig LOCKDEP_CHAINS_BITS 153488a79e88SCarlos Llamas int "Size for MAX_LOCKDEP_CHAINS (as Nth power of 2)" 15355dc33592STetsuo Handa depends on LOCKDEP && !LOCKDEP_SMALL 1536e0ba72e3SJ. R. Okajima range 10 21 15375dc33592STetsuo Handa default 16 15385dc33592STetsuo Handa help 15395dc33592STetsuo Handa Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message. 15405dc33592STetsuo Handa 15415dc33592STetsuo Handaconfig LOCKDEP_STACK_TRACE_BITS 154288a79e88SCarlos Llamas int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)" 15435dc33592STetsuo Handa depends on LOCKDEP && !LOCKDEP_SMALL 1544e638072eSCarlos Llamas range 10 26 15455dc33592STetsuo Handa default 19 15465dc33592STetsuo Handa help 15475dc33592STetsuo Handa Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message. 15485dc33592STetsuo Handa 15495dc33592STetsuo Handaconfig LOCKDEP_STACK_TRACE_HASH_BITS 155088a79e88SCarlos Llamas int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)" 15515dc33592STetsuo Handa depends on LOCKDEP && !LOCKDEP_SMALL 1552e638072eSCarlos Llamas range 10 26 15535dc33592STetsuo Handa default 14 15545dc33592STetsuo Handa help 1555f478b998STiezhu Yang Try increasing this value if you need large STACK_TRACE_HASH_SIZE. 15565dc33592STetsuo Handa 15575dc33592STetsuo Handaconfig LOCKDEP_CIRCULAR_QUEUE_BITS 155888a79e88SCarlos Llamas int "Size for elements in circular_queue struct (as Nth power of 2)" 15595dc33592STetsuo Handa depends on LOCKDEP 1560e638072eSCarlos Llamas range 10 26 15615dc33592STetsuo Handa default 12 15625dc33592STetsuo Handa help 15635dc33592STetsuo Handa Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure. 15645dc33592STetsuo Handa 15654d9f34adSIngo Molnarconfig DEBUG_LOCKDEP 15664d9f34adSIngo Molnar bool "Lock dependency engine debugging" 1567517e7aa5SAdrian Bunk depends on DEBUG_KERNEL && LOCKDEP 1568997acaf6SMark Rutland select DEBUG_IRQFLAGS 15694d9f34adSIngo Molnar help 15704d9f34adSIngo Molnar If you say Y here, the lock dependency engine will do 15714d9f34adSIngo Molnar additional runtime checks to debug itself, at the price 15724d9f34adSIngo Molnar of more runtime overhead. 15734d9f34adSIngo Molnar 1574d902db1eSFrederic Weisbeckerconfig DEBUG_ATOMIC_SLEEP 1575d902db1eSFrederic Weisbecker bool "Sleep inside atomic section checking" 1576e8f7c70fSFrederic Weisbecker select PREEMPT_COUNT 15771da177e4SLinus Torvalds depends on DEBUG_KERNEL 157887a4c375SChristoph Hellwig depends on !ARCH_NO_PREEMPT 15791da177e4SLinus Torvalds help 15801da177e4SLinus Torvalds If you say Y here, various routines which may sleep will become very 1581d902db1eSFrederic Weisbecker noisy if they are called inside atomic sections: when a spinlock is 1582d902db1eSFrederic Weisbecker held, inside an rcu read side critical section, inside preempt disabled 1583d902db1eSFrederic Weisbecker sections, inside an interrupt, etc... 15841da177e4SLinus Torvalds 1585cae2ed9aSIngo Molnarconfig DEBUG_LOCKING_API_SELFTESTS 1586cae2ed9aSIngo Molnar bool "Locking API boot-time self-tests" 1587cae2ed9aSIngo Molnar depends on DEBUG_KERNEL 1588cae2ed9aSIngo Molnar help 1589cae2ed9aSIngo Molnar Say Y here if you want the kernel to run a short self-test during 1590cae2ed9aSIngo Molnar bootup. The self-test checks whether common types of locking bugs 1591cae2ed9aSIngo Molnar are detected by debugging mechanisms or not. (if you disable 15929dbbc3b9SZhen Lei lock debugging then those bugs won't be detected of course.) 1593cae2ed9aSIngo Molnar The following locking APIs are covered: spinlocks, rwlocks, 1594cae2ed9aSIngo Molnar mutexes and rwsems. 1595cae2ed9aSIngo Molnar 15960af3fe1eSPaul E. McKenneyconfig LOCK_TORTURE_TEST 15970af3fe1eSPaul E. McKenney tristate "torture tests for locking" 15980af3fe1eSPaul E. McKenney depends on DEBUG_KERNEL 15990af3fe1eSPaul E. McKenney select TORTURE_TEST 16000af3fe1eSPaul E. McKenney help 16010af3fe1eSPaul E. McKenney This option provides a kernel module that runs torture tests 16020af3fe1eSPaul E. McKenney on kernel locking primitives. The kernel module may be built 16030af3fe1eSPaul E. McKenney after the fact on the running kernel to be tested, if desired. 16040af3fe1eSPaul E. McKenney 16050af3fe1eSPaul E. McKenney Say Y here if you want kernel locking-primitive torture tests 16060af3fe1eSPaul E. McKenney to be built into the kernel. 16070af3fe1eSPaul E. McKenney Say M if you want these torture tests to build as a module. 16080af3fe1eSPaul E. McKenney Say N if you are unsure. 16090af3fe1eSPaul E. McKenney 1610f2a5fec1SChris Wilsonconfig WW_MUTEX_SELFTEST 1611f2a5fec1SChris Wilson tristate "Wait/wound mutex selftests" 1612f2a5fec1SChris Wilson help 1613f2a5fec1SChris Wilson This option provides a kernel module that runs tests on the 1614f2a5fec1SChris Wilson on the struct ww_mutex locking API. 1615f2a5fec1SChris Wilson 1616f2a5fec1SChris Wilson It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction 1617f2a5fec1SChris Wilson with this test harness. 1618f2a5fec1SChris Wilson 1619f2a5fec1SChris Wilson Say M if you want these self tests to build as a module. 1620f2a5fec1SChris Wilson Say N if you are unsure. 1621f2a5fec1SChris Wilson 1622e9d338a0SPaul E. McKenneyconfig SCF_TORTURE_TEST 1623e9d338a0SPaul E. McKenney tristate "torture tests for smp_call_function*()" 1624e9d338a0SPaul E. McKenney depends on DEBUG_KERNEL 1625e9d338a0SPaul E. McKenney select TORTURE_TEST 1626e9d338a0SPaul E. McKenney help 1627e9d338a0SPaul E. McKenney This option provides a kernel module that runs torture tests 1628e9d338a0SPaul E. McKenney on the smp_call_function() family of primitives. The kernel 1629e9d338a0SPaul E. McKenney module may be built after the fact on the running kernel to 1630e9d338a0SPaul E. McKenney be tested, if desired. 1631e9d338a0SPaul E. McKenney 163235feb604SPaul E. McKenneyconfig CSD_LOCK_WAIT_DEBUG 163335feb604SPaul E. McKenney bool "Debugging for csd_lock_wait(), called from smp_call_function*()" 163435feb604SPaul E. McKenney depends on DEBUG_KERNEL 1635ac9d4554SPaul E. McKenney depends on SMP 163635feb604SPaul E. McKenney depends on 64BIT 163735feb604SPaul E. McKenney default n 163835feb604SPaul E. McKenney help 163935feb604SPaul E. McKenney This option enables debug prints when CPUs are slow to respond 164035feb604SPaul E. McKenney to the smp_call_function*() IPI wrappers. These debug prints 164135feb604SPaul E. McKenney include the IPI handler function currently executing (if any) 164235feb604SPaul E. McKenney and relevant stack traces. 164335feb604SPaul E. McKenney 1644c5219860SPaul E. McKenneyconfig CSD_LOCK_WAIT_DEBUG_DEFAULT 1645c5219860SPaul E. McKenney bool "Default csd_lock_wait() debugging on at boot time" 1646c5219860SPaul E. McKenney depends on CSD_LOCK_WAIT_DEBUG 1647c5219860SPaul E. McKenney depends on 64BIT 1648c5219860SPaul E. McKenney default n 1649c5219860SPaul E. McKenney help 1650c5219860SPaul E. McKenney This option causes the csdlock_debug= kernel boot parameter to 1651c5219860SPaul E. McKenney default to 1 (basic debugging) instead of 0 (no debugging). 1652c5219860SPaul E. McKenney 16539eade16bSDave Hansenendmenu # lock debugging 16549eade16bSDave Hansen 16559eade16bSDave Hansenconfig TRACE_IRQFLAGS 1656ed004953S[email protected] depends on TRACE_IRQFLAGS_SUPPORT 16579eade16bSDave Hansen bool 16589eade16bSDave Hansen help 16599eade16bSDave Hansen Enables hooks to interrupt enabling and disabling for 16609eade16bSDave Hansen either tracing or lock debugging. 16619eade16bSDave Hansen 1662ed004953S[email protected]config TRACE_IRQFLAGS_NMI 1663ed004953S[email protected] def_bool y 1664ed004953S[email protected] depends on TRACE_IRQFLAGS 1665ed004953S[email protected] depends on TRACE_IRQFLAGS_NMI_SUPPORT 1666ed004953S[email protected] 16671a3ea611SPaul E. McKenneyconfig NMI_CHECK_CPU 16681a3ea611SPaul E. McKenney bool "Debugging for CPUs failing to respond to backtrace requests" 16691a3ea611SPaul E. McKenney depends on DEBUG_KERNEL 16701a3ea611SPaul E. McKenney depends on X86 16711a3ea611SPaul E. McKenney default n 16721a3ea611SPaul E. McKenney help 16731a3ea611SPaul E. McKenney Enables debug prints when a CPU fails to respond to a given 16741a3ea611SPaul E. McKenney backtrace NMI. These prints provide some reasons why a CPU 16751a3ea611SPaul E. McKenney might legitimately be failing to respond, for example, if it 16761a3ea611SPaul E. McKenney is offline of if ignore_nmis is set. 16771a3ea611SPaul E. McKenney 1678997acaf6SMark Rutlandconfig DEBUG_IRQFLAGS 1679997acaf6SMark Rutland bool "Debug IRQ flag manipulation" 1680997acaf6SMark Rutland help 1681997acaf6SMark Rutland Enables checks for potentially unsafe enabling or disabling of 1682997acaf6SMark Rutland interrupts, such as calling raw_local_irq_restore() when interrupts 1683997acaf6SMark Rutland are enabled. 1684997acaf6SMark Rutland 16858637c099SIngo Molnarconfig STACKTRACE 16860c38e1feSDave Jones bool "Stack backtrace support" 16878637c099SIngo Molnar depends on STACKTRACE_SUPPORT 16880c38e1feSDave Jones help 16890c38e1feSDave Jones This option causes the kernel to create a /proc/pid/stack for 16900c38e1feSDave Jones every process, showing its current stack trace. 16910c38e1feSDave Jones It is also used by various kernel debugging features that require 16920c38e1feSDave Jones stack trace generation. 16938637c099SIngo Molnar 1694eecabf56STheodore Ts'oconfig WARN_ALL_UNSEEDED_RANDOM 1695eecabf56STheodore Ts'o bool "Warn for all uses of unseeded randomness" 1696eecabf56STheodore Ts'o default n 1697d06bfd19SJason A. Donenfeld help 1698d06bfd19SJason A. Donenfeld Some parts of the kernel contain bugs relating to their use of 1699d06bfd19SJason A. Donenfeld cryptographically secure random numbers before it's actually possible 1700d06bfd19SJason A. Donenfeld to generate those numbers securely. This setting ensures that these 1701d06bfd19SJason A. Donenfeld flaws don't go unnoticed, by enabling a message, should this ever 1702d06bfd19SJason A. Donenfeld occur. This will allow people with obscure setups to know when things 1703d06bfd19SJason A. Donenfeld are going wrong, so that they might contact developers about fixing 1704d06bfd19SJason A. Donenfeld it. 1705d06bfd19SJason A. Donenfeld 1706eecabf56STheodore Ts'o Unfortunately, on some models of some architectures getting 1707eecabf56STheodore Ts'o a fully seeded CRNG is extremely difficult, and so this can 1708eecabf56STheodore Ts'o result in dmesg getting spammed for a surprisingly long 1709eecabf56STheodore Ts'o time. This is really bad from a security perspective, and 1710eecabf56STheodore Ts'o so architecture maintainers really need to do what they can 1711eecabf56STheodore Ts'o to get the CRNG seeded sooner after the system is booted. 17124c5d114eSThibaut Sautereau However, since users cannot do anything actionable to 1713cc1e127bSJason A. Donenfeld address this, by default this option is disabled. 1714eecabf56STheodore Ts'o 1715eecabf56STheodore Ts'o Say Y here if you want to receive warnings for all uses of 1716eecabf56STheodore Ts'o unseeded randomness. This will be of use primarily for 17174c5d114eSThibaut Sautereau those developers interested in improving the security of 1718eecabf56STheodore Ts'o Linux kernels running on their architecture (or 1719eecabf56STheodore Ts'o subarchitecture). 1720d06bfd19SJason A. Donenfeld 17211da177e4SLinus Torvaldsconfig DEBUG_KOBJECT 17221da177e4SLinus Torvalds bool "kobject debugging" 17231da177e4SLinus Torvalds depends on DEBUG_KERNEL 17241da177e4SLinus Torvalds help 17251da177e4SLinus Torvalds If you say Y here, some extra kobject debugging messages will be sent 17261da177e4SLinus Torvalds to the syslog. 17271da177e4SLinus Torvalds 1728c817a67eSRussell Kingconfig DEBUG_KOBJECT_RELEASE 1729c817a67eSRussell King bool "kobject release debugging" 17302a999aa0SLinus Torvalds depends on DEBUG_OBJECTS_TIMERS 1731c817a67eSRussell King help 1732c817a67eSRussell King kobjects are reference counted objects. This means that their 1733c817a67eSRussell King last reference count put is not predictable, and the kobject can 1734b6c69474SRandy Dunlap live on past the point at which a driver decides to drop its 1735c817a67eSRussell King initial reference to the kobject gained on allocation. An 1736c817a67eSRussell King example of this would be a struct device which has just been 1737c817a67eSRussell King unregistered. 1738c817a67eSRussell King 1739c817a67eSRussell King However, some buggy drivers assume that after such an operation, 1740c817a67eSRussell King the memory backing the kobject can be immediately freed. This 1741c817a67eSRussell King goes completely against the principles of a refcounted object. 1742c817a67eSRussell King 1743c817a67eSRussell King If you say Y here, the kernel will delay the release of kobjects 1744c817a67eSRussell King on the last reference count to improve the visibility of this 1745c817a67eSRussell King kind of kobject release bug. 1746c817a67eSRussell King 17479b2a60c4SCatalin Marinasconfig HAVE_DEBUG_BUGVERBOSE 17489b2a60c4SCatalin Marinas bool 17499b2a60c4SCatalin Marinas 17503be5cbcdSChangbin Dumenu "Debug kernel data structures" 17511da177e4SLinus Torvalds 1752199a9afcSDave Jonesconfig DEBUG_LIST 1753199a9afcSDave Jones bool "Debug linked list manipulation" 1754aa9f10d5SMarco Elver depends on DEBUG_KERNEL 1755aebc7b0dSMarco Elver select LIST_HARDENED 1756199a9afcSDave Jones help 1757aebc7b0dSMarco Elver Enable this to turn on extended checks in the linked-list walking 1758aebc7b0dSMarco Elver routines. 1759aebc7b0dSMarco Elver 1760aebc7b0dSMarco Elver This option trades better quality error reports for performance, and 1761aebc7b0dSMarco Elver is more suitable for kernel debugging. If you care about performance, 1762aebc7b0dSMarco Elver you should only enable CONFIG_LIST_HARDENED instead. 1763199a9afcSDave Jones 1764199a9afcSDave Jones If unsure, say N. 1765199a9afcSDave Jones 17668e18faeaSDavidlohr Buesoconfig DEBUG_PLIST 1767b8cfff68SDan Streetman bool "Debug priority linked list manipulation" 1768b8cfff68SDan Streetman depends on DEBUG_KERNEL 1769b8cfff68SDan Streetman help 1770b8cfff68SDan Streetman Enable this to turn on extended checks in the priority-ordered 1771b8cfff68SDan Streetman linked-list (plist) walking routines. This checks the entire 1772b8cfff68SDan Streetman list multiple times during each manipulation. 1773b8cfff68SDan Streetman 1774b8cfff68SDan Streetman If unsure, say N. 1775b8cfff68SDan Streetman 1776d6ec0842SJens Axboeconfig DEBUG_SG 1777d6ec0842SJens Axboe bool "Debug SG table operations" 1778d6ec0842SJens Axboe depends on DEBUG_KERNEL 1779d6ec0842SJens Axboe help 1780d6ec0842SJens Axboe Enable this to turn on checks on scatter-gather tables. This can 1781d6ec0842SJens Axboe help find problems with drivers that do not properly initialize 1782d6ec0842SJens Axboe their sg tables. 1783d6ec0842SJens Axboe 1784d6ec0842SJens Axboe If unsure, say N. 1785d6ec0842SJens Axboe 17861b2439dbSArjan van de Venconfig DEBUG_NOTIFIERS 17871b2439dbSArjan van de Ven bool "Debug notifier call chains" 17881b2439dbSArjan van de Ven depends on DEBUG_KERNEL 17891b2439dbSArjan van de Ven help 17901b2439dbSArjan van de Ven Enable this to turn on sanity checking for notifier call chains. 17911b2439dbSArjan van de Ven This is most useful for kernel developers to make sure that 17921b2439dbSArjan van de Ven modules properly unregister themselves from notifier chains. 17931b2439dbSArjan van de Ven This is a relatively cheap check but if you care about maximum 17941b2439dbSArjan van de Ven performance, say N. 17951b2439dbSArjan van de Ven 17968c8d2d96SKent Overstreetconfig DEBUG_CLOSURES 17978c8d2d96SKent Overstreet bool "Debug closures (bcache async widgits)" 17988c8d2d96SKent Overstreet depends on CLOSURES 17998c8d2d96SKent Overstreet select DEBUG_FS 18008c8d2d96SKent Overstreet help 18018c8d2d96SKent Overstreet Keeps all active closures in a linked list and provides a debugfs 18028c8d2d96SKent Overstreet interface to list them, which makes it possible to see asynchronous 18038c8d2d96SKent Overstreet operations that get stuck. 18048c8d2d96SKent Overstreet 180554a611b6SLiam R. Howlettconfig DEBUG_MAPLE_TREE 180654a611b6SLiam R. Howlett bool "Debug maple trees" 180754a611b6SLiam R. Howlett depends on DEBUG_KERNEL 180854a611b6SLiam R. Howlett help 180954a611b6SLiam R. Howlett Enable maple tree debugging information and extra validations. 181054a611b6SLiam R. Howlett 181154a611b6SLiam R. Howlett If unsure, say N. 181254a611b6SLiam R. Howlett 18133be5cbcdSChangbin Duendmenu 18143be5cbcdSChangbin Du 181543a0a2a7SPaul E. McKenneysource "kernel/rcu/Kconfig.debug" 18162f03e3caSDave Hansen 1817f303fccbSTejun Heoconfig DEBUG_WQ_FORCE_RR_CPU 1818f303fccbSTejun Heo bool "Force round-robin CPU selection for unbound work items" 1819f303fccbSTejun Heo depends on DEBUG_KERNEL 1820f303fccbSTejun Heo default n 1821f303fccbSTejun Heo help 1822f303fccbSTejun Heo Workqueue used to implicitly guarantee that work items queued 1823f303fccbSTejun Heo without explicit CPU specified are put on the local CPU. This 1824f303fccbSTejun Heo guarantee is no longer true and while local CPU is still 1825f303fccbSTejun Heo preferred work items may be put on foreign CPUs. Kernel 1826f303fccbSTejun Heo parameter "workqueue.debug_force_rr_cpu" is added to force 1827f303fccbSTejun Heo round-robin CPU selection to flush out usages which depend on the 1828f303fccbSTejun Heo now broken guarantee. This config option enables the debug 1829f303fccbSTejun Heo feature by default. When enabled, memory and cache locality will 1830f303fccbSTejun Heo be impacted. 1831f303fccbSTejun Heo 1832757c989bSThomas Gleixnerconfig CPU_HOTPLUG_STATE_CONTROL 1833757c989bSThomas Gleixner bool "Enable CPU hotplug state control" 1834757c989bSThomas Gleixner depends on DEBUG_KERNEL 1835757c989bSThomas Gleixner depends on HOTPLUG_CPU 1836757c989bSThomas Gleixner default n 1837757c989bSThomas Gleixner help 1838757c989bSThomas Gleixner Allows to write steps between "offline" and "online" to the CPUs 1839757c989bSThomas Gleixner sysfs target file so states can be stepped granular. This is a debug 1840757c989bSThomas Gleixner option for now as the hotplug machinery cannot be stopped and 1841757c989bSThomas Gleixner restarted at arbitrary points yet. 1842757c989bSThomas Gleixner 1843757c989bSThomas Gleixner Say N if your are unsure. 1844757c989bSThomas Gleixner 184509a74952SChangbin Duconfig LATENCYTOP 184609a74952SChangbin Du bool "Latency measuring infrastructure" 184709a74952SChangbin Du depends on DEBUG_KERNEL 184809a74952SChangbin Du depends on STACKTRACE_SUPPORT 184909a74952SChangbin Du depends on PROC_FS 18507d37cb2cSJulian Braha depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 185109a74952SChangbin Du select KALLSYMS 185209a74952SChangbin Du select KALLSYMS_ALL 185309a74952SChangbin Du select STACKTRACE 185409a74952SChangbin Du select SCHEDSTATS 185509a74952SChangbin Du help 185609a74952SChangbin Du Enable this option if you want to use the LatencyTOP tool 185709a74952SChangbin Du to find out which userspace is blocking on what kernel operations. 185809a74952SChangbin Du 18596ab42860STejun Heoconfig DEBUG_CGROUP_REF 18606ab42860STejun Heo bool "Disable inlining of cgroup css reference count functions" 18616ab42860STejun Heo depends on DEBUG_KERNEL 18626ab42860STejun Heo depends on CGROUPS 18636ab42860STejun Heo depends on KPROBES 18646ab42860STejun Heo default n 18656ab42860STejun Heo help 18666ab42860STejun Heo Force cgroup css reference count functions to not be inlined so 18676ab42860STejun Heo that they can be kprobed for debugging. 18686ab42860STejun Heo 186909a74952SChangbin Dusource "kernel/trace/Kconfig" 187009a74952SChangbin Du 187109a74952SChangbin Duconfig PROVIDE_OHCI1394_DMA_INIT 187209a74952SChangbin Du bool "Remote debugging over FireWire early on boot" 187309a74952SChangbin Du depends on PCI && X86 187409a74952SChangbin Du help 187509a74952SChangbin Du If you want to debug problems which hang or crash the kernel early 187609a74952SChangbin Du on boot and the crashing machine has a FireWire port, you can use 187709a74952SChangbin Du this feature to remotely access the memory of the crashed machine 187809a74952SChangbin Du over FireWire. This employs remote DMA as part of the OHCI1394 187909a74952SChangbin Du specification which is now the standard for FireWire controllers. 188009a74952SChangbin Du 188109a74952SChangbin Du With remote DMA, you can monitor the printk buffer remotely using 188209a74952SChangbin Du firescope and access all memory below 4GB using fireproxy from gdb. 188309a74952SChangbin Du Even controlling a kernel debugger is possible using remote DMA. 188409a74952SChangbin Du 188509a74952SChangbin Du Usage: 188609a74952SChangbin Du 188709a74952SChangbin Du If ohci1394_dma=early is used as boot parameter, it will initialize 188809a74952SChangbin Du all OHCI1394 controllers which are found in the PCI config space. 188909a74952SChangbin Du 189009a74952SChangbin Du As all changes to the FireWire bus such as enabling and disabling 189109a74952SChangbin Du devices cause a bus reset and thereby disable remote DMA for all 189209a74952SChangbin Du devices, be sure to have the cable plugged and FireWire enabled on 189309a74952SChangbin Du the debugging host before booting the debug target for debugging. 189409a74952SChangbin Du 189509a74952SChangbin Du This code (~1k) is freed after boot. By then, the firewire stack 189609a74952SChangbin Du in charge of the OHCI-1394 controllers should be used instead. 189709a74952SChangbin Du 1898a74e2a22SMauro Carvalho Chehab See Documentation/core-api/debugging-via-ohci1394.rst for more information. 189909a74952SChangbin Du 1900045f6d79SChangbin Dusource "samples/Kconfig" 1901045f6d79SChangbin Du 1902045f6d79SChangbin Duconfig ARCH_HAS_DEVMEM_IS_ALLOWED 1903045f6d79SChangbin Du bool 1904045f6d79SChangbin Du 1905045f6d79SChangbin Duconfig STRICT_DEVMEM 1906045f6d79SChangbin Du bool "Filter access to /dev/mem" 1907045f6d79SChangbin Du depends on MMU && DEVMEM 1908527701edSPalmer Dabbelt depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED 19092b37c814SDavid Hildenbrand default y if PPC || X86 || ARM64 || S390 1910045f6d79SChangbin Du help 1911045f6d79SChangbin Du If this option is disabled, you allow userspace (root) access to all 1912045f6d79SChangbin Du of memory, including kernel and userspace memory. Accidental 1913045f6d79SChangbin Du access to this is obviously disastrous, but specific access can 1914045f6d79SChangbin Du be used by people debugging the kernel. Note that with PAT support 1915045f6d79SChangbin Du enabled, even in this case there are restrictions on /dev/mem 1916045f6d79SChangbin Du use due to the cache aliasing requirements. 1917045f6d79SChangbin Du 1918045f6d79SChangbin Du If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem 1919045f6d79SChangbin Du file only allows userspace access to PCI space and the BIOS code and 1920045f6d79SChangbin Du data regions. This is sufficient for dosemu and X and all common 1921045f6d79SChangbin Du users of /dev/mem. 1922045f6d79SChangbin Du 1923045f6d79SChangbin Du If in doubt, say Y. 1924045f6d79SChangbin Du 1925045f6d79SChangbin Duconfig IO_STRICT_DEVMEM 1926045f6d79SChangbin Du bool "Filter I/O access to /dev/mem" 1927045f6d79SChangbin Du depends on STRICT_DEVMEM 1928045f6d79SChangbin Du help 1929045f6d79SChangbin Du If this option is disabled, you allow userspace (root) access to all 1930045f6d79SChangbin Du io-memory regardless of whether a driver is actively using that 1931045f6d79SChangbin Du range. Accidental access to this is obviously disastrous, but 1932045f6d79SChangbin Du specific access can be used by people debugging kernel drivers. 1933045f6d79SChangbin Du 1934045f6d79SChangbin Du If this option is switched on, the /dev/mem file only allows 1935045f6d79SChangbin Du userspace access to *idle* io-memory ranges (see /proc/iomem) This 1936045f6d79SChangbin Du may break traditional users of /dev/mem (dosemu, legacy X, etc...) 1937045f6d79SChangbin Du if the driver using a given range cannot be disabled. 1938045f6d79SChangbin Du 1939045f6d79SChangbin Du If in doubt, say Y. 1940045f6d79SChangbin Du 1941045f6d79SChangbin Dumenu "$(SRCARCH) Debugging" 1942045f6d79SChangbin Du 1943045f6d79SChangbin Dusource "arch/$(SRCARCH)/Kconfig.debug" 1944045f6d79SChangbin Du 1945045f6d79SChangbin Duendmenu 1946045f6d79SChangbin Du 1947045f6d79SChangbin Dumenu "Kernel Testing and Coverage" 1948045f6d79SChangbin Du 194909a74952SChangbin Dusource "lib/kunit/Kconfig" 195009a74952SChangbin Du 19518d438288SAkinobu Mitaconfig NOTIFIER_ERROR_INJECTION 19528d438288SAkinobu Mita tristate "Notifier error injection" 19538d438288SAkinobu Mita depends on DEBUG_KERNEL 19548d438288SAkinobu Mita select DEBUG_FS 19558d438288SAkinobu Mita help 1956e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 19578d438288SAkinobu Mita specified notifier chain callbacks. It is useful to test the error 19588d438288SAkinobu Mita handling of notifier call chain failures. 19598d438288SAkinobu Mita 19608d438288SAkinobu Mita Say N if unsure. 19618d438288SAkinobu Mita 1962048b9c35SAkinobu Mitaconfig PM_NOTIFIER_ERROR_INJECT 1963048b9c35SAkinobu Mita tristate "PM notifier error injection module" 1964048b9c35SAkinobu Mita depends on PM && NOTIFIER_ERROR_INJECTION 1965048b9c35SAkinobu Mita default m if PM_DEBUG 1966048b9c35SAkinobu Mita help 1967e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 1968048b9c35SAkinobu Mita PM notifier chain callbacks. It is controlled through debugfs 1969048b9c35SAkinobu Mita interface /sys/kernel/debug/notifier-error-inject/pm 1970048b9c35SAkinobu Mita 1971048b9c35SAkinobu Mita If the notifier call chain should be failed with some events 1972048b9c35SAkinobu Mita notified, write the error code to "actions/<notifier event>/error". 1973048b9c35SAkinobu Mita 1974048b9c35SAkinobu Mita Example: Inject PM suspend error (-12 = -ENOMEM) 1975048b9c35SAkinobu Mita 1976048b9c35SAkinobu Mita # cd /sys/kernel/debug/notifier-error-inject/pm/ 1977048b9c35SAkinobu Mita # echo -12 > actions/PM_SUSPEND_PREPARE/error 1978048b9c35SAkinobu Mita # echo mem > /sys/power/state 1979048b9c35SAkinobu Mita bash: echo: write error: Cannot allocate memory 1980048b9c35SAkinobu Mita 1981048b9c35SAkinobu Mita To compile this code as a module, choose M here: the module will 1982048b9c35SAkinobu Mita be called pm-notifier-error-inject. 1983048b9c35SAkinobu Mita 1984048b9c35SAkinobu Mita If unsure, say N. 1985048b9c35SAkinobu Mita 1986d526e85fSBenjamin Herrenschmidtconfig OF_RECONFIG_NOTIFIER_ERROR_INJECT 1987d526e85fSBenjamin Herrenschmidt tristate "OF reconfig notifier error injection module" 1988d526e85fSBenjamin Herrenschmidt depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION 198908dfb4ddSAkinobu Mita help 1990e41e85ccSMasanari Iida This option provides the ability to inject artificial errors to 1991d526e85fSBenjamin Herrenschmidt OF reconfig notifier chain callbacks. It is controlled 199208dfb4ddSAkinobu Mita through debugfs interface under 1993d526e85fSBenjamin Herrenschmidt /sys/kernel/debug/notifier-error-inject/OF-reconfig/ 199408dfb4ddSAkinobu Mita 199508dfb4ddSAkinobu Mita If the notifier call chain should be failed with some events 199608dfb4ddSAkinobu Mita notified, write the error code to "actions/<notifier event>/error". 199708dfb4ddSAkinobu Mita 199808dfb4ddSAkinobu Mita To compile this code as a module, choose M here: the module will 1999e12a95f4SAkinobu Mita be called of-reconfig-notifier-error-inject. 200008dfb4ddSAkinobu Mita 200108dfb4ddSAkinobu Mita If unsure, say N. 200208dfb4ddSAkinobu Mita 200302fff96aSNikolay Aleksandrovconfig NETDEV_NOTIFIER_ERROR_INJECT 200402fff96aSNikolay Aleksandrov tristate "Netdev notifier error injection module" 200502fff96aSNikolay Aleksandrov depends on NET && NOTIFIER_ERROR_INJECTION 200602fff96aSNikolay Aleksandrov help 200702fff96aSNikolay Aleksandrov This option provides the ability to inject artificial errors to 200802fff96aSNikolay Aleksandrov netdevice notifier chain callbacks. It is controlled through debugfs 200902fff96aSNikolay Aleksandrov interface /sys/kernel/debug/notifier-error-inject/netdev 201002fff96aSNikolay Aleksandrov 201102fff96aSNikolay Aleksandrov If the notifier call chain should be failed with some events 201202fff96aSNikolay Aleksandrov notified, write the error code to "actions/<notifier event>/error". 201302fff96aSNikolay Aleksandrov 201402fff96aSNikolay Aleksandrov Example: Inject netdevice mtu change error (-22 = -EINVAL) 201502fff96aSNikolay Aleksandrov 201602fff96aSNikolay Aleksandrov # cd /sys/kernel/debug/notifier-error-inject/netdev 201702fff96aSNikolay Aleksandrov # echo -22 > actions/NETDEV_CHANGEMTU/error 201802fff96aSNikolay Aleksandrov # ip link set eth0 mtu 1024 201902fff96aSNikolay Aleksandrov RTNETLINK answers: Invalid argument 202002fff96aSNikolay Aleksandrov 202102fff96aSNikolay Aleksandrov To compile this code as a module, choose M here: the module will 202202fff96aSNikolay Aleksandrov be called netdev-notifier-error-inject. 202302fff96aSNikolay Aleksandrov 202402fff96aSNikolay Aleksandrov If unsure, say N. 202502fff96aSNikolay Aleksandrov 2026f1b4bd06SMikulas Patockaconfig FUNCTION_ERROR_INJECTION 2027a4412fddSSteven Rostedt (Google) bool "Fault-injections of functions" 2028f1b4bd06SMikulas Patocka depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES 2029a4412fddSSteven Rostedt (Google) help 2030a4412fddSSteven Rostedt (Google) Add fault injections into various functions that are annotated with 2031a4412fddSSteven Rostedt (Google) ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return 2032ca0f2cfcSRandy Dunlap value of these functions. This is useful to test error paths of code. 2033a4412fddSSteven Rostedt (Google) 2034a4412fddSSteven Rostedt (Google) If unsure, say N 2035f1b4bd06SMikulas Patocka 20366ff1cb35SAkinobu Mitaconfig FAULT_INJECTION 20371ab8509aSAndrew Morton bool "Fault-injection framework" 20381ab8509aSAndrew Morton depends on DEBUG_KERNEL 2039329409aeSAkinobu Mita help 2040329409aeSAkinobu Mita Provide fault-injection framework. 2041329409aeSAkinobu Mita For more details, see Documentation/fault-injection/. 20426ff1cb35SAkinobu Mita 20438a8b6502SAkinobu Mitaconfig FAILSLAB 20441ab8509aSAndrew Morton bool "Fault-injection capability for kmalloc" 20451ab8509aSAndrew Morton depends on FAULT_INJECTION 20468a8b6502SAkinobu Mita help 20471ab8509aSAndrew Morton Provide fault-injection capability for kmalloc. 20488a8b6502SAkinobu Mita 2049933e312eSAkinobu Mitaconfig FAIL_PAGE_ALLOC 205029b46fa3SQiujun Huang bool "Fault-injection capability for alloc_pages()" 20511ab8509aSAndrew Morton depends on FAULT_INJECTION 2052933e312eSAkinobu Mita help 20531ab8509aSAndrew Morton Provide fault-injection capability for alloc_pages(). 2054933e312eSAkinobu Mita 20552c739cedSAlbert van der Lindeconfig FAULT_INJECTION_USERCOPY 20562c739cedSAlbert van der Linde bool "Fault injection capability for usercopy functions" 20572c739cedSAlbert van der Linde depends on FAULT_INJECTION 20582c739cedSAlbert van der Linde help 20592c739cedSAlbert van der Linde Provides fault-injection capability to inject failures 20602c739cedSAlbert van der Linde in usercopy functions (copy_from_user(), get_user(), ...). 20612c739cedSAlbert van der Linde 2062c17bb495SAkinobu Mitaconfig FAIL_MAKE_REQUEST 206386327d19SDave Jones bool "Fault-injection capability for disk IO" 2064581d4e28SJens Axboe depends on FAULT_INJECTION && BLOCK 2065c17bb495SAkinobu Mita help 20661ab8509aSAndrew Morton Provide fault-injection capability for disk IO. 2067c17bb495SAkinobu Mita 2068581d4e28SJens Axboeconfig FAIL_IO_TIMEOUT 2069f4d01439STakuya Yoshikawa bool "Fault-injection capability for faking disk interrupts" 2070581d4e28SJens Axboe depends on FAULT_INJECTION && BLOCK 2071581d4e28SJens Axboe help 2072581d4e28SJens Axboe Provide fault-injection capability on end IO handling. This 2073581d4e28SJens Axboe will make the block layer "forget" an interrupt as configured, 2074581d4e28SJens Axboe thus exercising the error handling. 2075581d4e28SJens Axboe 2076581d4e28SJens Axboe Only works with drivers that use the generic timeout handling, 20779dbbc3b9SZhen Lei for others it won't do anything. 2078581d4e28SJens Axboe 2079ab51fbabSDavidlohr Buesoconfig FAIL_FUTEX 2080ab51fbabSDavidlohr Bueso bool "Fault-injection capability for futexes" 2081ab51fbabSDavidlohr Bueso select DEBUG_FS 2082ab51fbabSDavidlohr Bueso depends on FAULT_INJECTION && FUTEX 2083ab51fbabSDavidlohr Bueso help 2084ab51fbabSDavidlohr Bueso Provide fault-injection capability for futexes. 2085ab51fbabSDavidlohr Bueso 2086f1b4bd06SMikulas Patockaconfig FAULT_INJECTION_DEBUG_FS 2087f1b4bd06SMikulas Patocka bool "Debugfs entries for fault-injection capabilities" 2088f1b4bd06SMikulas Patocka depends on FAULT_INJECTION && SYSFS && DEBUG_FS 2089f1b4bd06SMikulas Patocka help 2090f1b4bd06SMikulas Patocka Enable configuration of fault-injection capabilities via debugfs. 2091f1b4bd06SMikulas Patocka 20924b1a29a7SMasami Hiramatsuconfig FAIL_FUNCTION 20934b1a29a7SMasami Hiramatsu bool "Fault-injection capability for functions" 20944b1a29a7SMasami Hiramatsu depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION 20954b1a29a7SMasami Hiramatsu help 20964b1a29a7SMasami Hiramatsu Provide function-based fault-injection capability. 20974b1a29a7SMasami Hiramatsu This will allow you to override a specific function with a return 20984b1a29a7SMasami Hiramatsu with given return value. As a result, function caller will see 20994b1a29a7SMasami Hiramatsu an error value and have to handle it. This is useful to test the 21004b1a29a7SMasami Hiramatsu error handling in various subsystems. 21014b1a29a7SMasami Hiramatsu 2102f1b4bd06SMikulas Patockaconfig FAIL_MMC_REQUEST 2103f1b4bd06SMikulas Patocka bool "Fault-injection capability for MMC IO" 2104f1b4bd06SMikulas Patocka depends on FAULT_INJECTION_DEBUG_FS && MMC 21056ff1cb35SAkinobu Mita help 2106f1b4bd06SMikulas Patocka Provide fault-injection capability for MMC IO. 2107f1b4bd06SMikulas Patocka This will make the mmc core return data errors. This is 2108f1b4bd06SMikulas Patocka useful to test the error handling in the mmc block device 2109f1b4bd06SMikulas Patocka and to test how the mmc host driver handles retries from 2110f1b4bd06SMikulas Patocka the block device. 21111df49008SAkinobu Mita 2112c782af25SChuck Leverconfig FAIL_SUNRPC 2113c782af25SChuck Lever bool "Fault-injection capability for SunRPC" 2114c782af25SChuck Lever depends on FAULT_INJECTION_DEBUG_FS && SUNRPC_DEBUG 2115c782af25SChuck Lever help 2116c782af25SChuck Lever Provide fault-injection capability for SunRPC and 2117c782af25SChuck Lever its consumers. 2118c782af25SChuck Lever 211912079a59SBreno Leitaoconfig FAIL_SKB_REALLOC 212012079a59SBreno Leitao bool "Fault-injection capability forcing skb to reallocate" 212112079a59SBreno Leitao depends on FAULT_INJECTION_DEBUG_FS 212212079a59SBreno Leitao help 212312079a59SBreno Leitao Provide fault-injection capability that forces the skb to be 212412079a59SBreno Leitao reallocated, catching possible invalid pointers to the skb. 212512079a59SBreno Leitao 212612079a59SBreno Leitao For more information, check 212704ec365eSUjwal Kundur Documentation/fault-injection/fault-injection.rst 212812079a59SBreno Leitao 21294668c7a2SAkinobu Mitaconfig FAULT_INJECTION_CONFIGFS 21304668c7a2SAkinobu Mita bool "Configfs interface for fault-injection capabilities" 2131d325c162SAkinobu Mita depends on FAULT_INJECTION 2132d325c162SAkinobu Mita select CONFIGFS_FS 21334668c7a2SAkinobu Mita help 21344668c7a2SAkinobu Mita This option allows configfs-based drivers to dynamically configure 21354668c7a2SAkinobu Mita fault-injection via configfs. Each parameter for driver-specific 21364668c7a2SAkinobu Mita fault-injection can be made visible as a configfs attribute in a 21374668c7a2SAkinobu Mita configfs group. 21384668c7a2SAkinobu Mita 21394668c7a2SAkinobu Mita 21401df49008SAkinobu Mitaconfig FAULT_INJECTION_STACKTRACE_FILTER 21411df49008SAkinobu Mita bool "stacktrace filter for fault-injection capabilities" 21424668c7a2SAkinobu Mita depends on FAULT_INJECTION 21434668c7a2SAkinobu Mita depends on (FAULT_INJECTION_DEBUG_FS || FAULT_INJECTION_CONFIGFS) && STACKTRACE_SUPPORT 21441df49008SAkinobu Mita select STACKTRACE 21457d37cb2cSJulian Braha depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 21461df49008SAkinobu Mita help 21471df49008SAkinobu Mita Provide stacktrace filter for fault-injection capabilities 2148267c4025SMathieu Desnoyers 214909a74952SChangbin Duconfig ARCH_HAS_KCOV 215009a74952SChangbin Du bool 21519745512cSArjan van de Ven help 215209a74952SChangbin Du An architecture should select this when it can successfully 215309a74952SChangbin Du build and run with CONFIG_KCOV. This typically requires 215409a74952SChangbin Du disabling instrumentation for some early boot code. 21559745512cSArjan van de Ven 215609a74952SChangbin Duconfig CC_HAS_SANCOV_TRACE_PC 215709a74952SChangbin Du def_bool $(cc-option,-fsanitize-coverage=trace-pc) 215816444a8aSArnaldo Carvalho de Melo 215909a74952SChangbin Du 216009a74952SChangbin Duconfig KCOV 216109a74952SChangbin Du bool "Code coverage for fuzzing" 216209a74952SChangbin Du depends on ARCH_HAS_KCOV 216309a74952SChangbin Du depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS 216422102f45SJosh Poimboeuf depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \ 21659feceff1SNathan Chancellor GCC_VERSION >= 120000 || CC_IS_CLANG 216609a74952SChangbin Du select DEBUG_FS 216709a74952SChangbin Du select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC 216822102f45SJosh Poimboeuf select OBJTOOL if HAVE_NOINSTR_HACK 2169cc3fa840SRandy Dunlap help 217009a74952SChangbin Du KCOV exposes kernel code coverage information in a form suitable 217109a74952SChangbin Du for coverage-guided fuzzing (randomized testing). 2172cc3fa840SRandy Dunlap 217309a74952SChangbin Du For more details, see Documentation/dev-tools/kcov.rst. 2174cc3fa840SRandy Dunlap 217509a74952SChangbin Duconfig KCOV_ENABLE_COMPARISONS 217609a74952SChangbin Du bool "Enable comparison operands collection by KCOV" 217709a74952SChangbin Du depends on KCOV 217809a74952SChangbin Du depends on $(cc-option,-fsanitize-coverage=trace-cmp) 217909a74952SChangbin Du help 218009a74952SChangbin Du KCOV also exposes operands of every comparison in the instrumented 218109a74952SChangbin Du code along with operand sizes and PCs of the comparison instructions. 218209a74952SChangbin Du These operands can be used by fuzzing engines to improve the quality 218309a74952SChangbin Du of fuzzing coverage. 2184cc3fa840SRandy Dunlap 218509a74952SChangbin Duconfig KCOV_INSTRUMENT_ALL 218609a74952SChangbin Du bool "Instrument all code by default" 218709a74952SChangbin Du depends on KCOV 218809a74952SChangbin Du default y 218909a74952SChangbin Du help 219009a74952SChangbin Du If you are doing generic system call fuzzing (like e.g. syzkaller), 219109a74952SChangbin Du then you will want to instrument the whole kernel and you should 219209a74952SChangbin Du say y here. If you are doing more targeted fuzzing (like e.g. 219309a74952SChangbin Du filesystem fuzzing with AFL) then you will want to enable coverage 219409a74952SChangbin Du for more specific subsets of files, and should say n here. 219584bc809eSBrendan Higgins 21965ff3b30aSAndrey Konovalovconfig KCOV_IRQ_AREA_SIZE 21975ff3b30aSAndrey Konovalov hex "Size of interrupt coverage collection area in words" 21985ff3b30aSAndrey Konovalov depends on KCOV 21995ff3b30aSAndrey Konovalov default 0x40000 22005ff3b30aSAndrey Konovalov help 22015ff3b30aSAndrey Konovalov KCOV uses preallocated per-cpu areas to collect coverage from 22025ff3b30aSAndrey Konovalov soft interrupts. This specifies the size of those areas in the 22035ff3b30aSAndrey Konovalov number of unsigned long words. 22045ff3b30aSAndrey Konovalov 22056cd0dd93SDmitry Vyukovconfig KCOV_SELFTEST 22066cd0dd93SDmitry Vyukov bool "Perform short selftests on boot" 22076cd0dd93SDmitry Vyukov depends on KCOV 22086cd0dd93SDmitry Vyukov help 22096cd0dd93SDmitry Vyukov Run short KCOV coverage collection selftests on boot. 22106cd0dd93SDmitry Vyukov On test failure, causes the kernel to panic. Recommended to be 22116cd0dd93SDmitry Vyukov enabled, ensuring critical functionality works as intended. 22126cd0dd93SDmitry Vyukov 2213d3deafaaSVincent Legollmenuconfig RUNTIME_TESTING_MENU 2214d3deafaaSVincent Legoll bool "Runtime Testing" 2215cd14b018SMasahiro Yamada default y 2216d3deafaaSVincent Legoll 2217d3deafaaSVincent Legollif RUNTIME_TESTING_MENU 2218881c5149SDave Hansen 2219d5528cc1SGeert Uytterhoevenconfig TEST_DHRY 2220d5528cc1SGeert Uytterhoeven tristate "Dhrystone benchmark test" 2221d5528cc1SGeert Uytterhoeven help 2222d5528cc1SGeert Uytterhoeven Enable this to include the Dhrystone 2.1 benchmark. This test 2223d5528cc1SGeert Uytterhoeven calculates the number of Dhrystones per second, and the number of 2224d5528cc1SGeert Uytterhoeven DMIPS (Dhrystone MIPS) obtained when the Dhrystone score is divided 2225d5528cc1SGeert Uytterhoeven by 1757 (the number of Dhrystones per second obtained on the VAX 2226d5528cc1SGeert Uytterhoeven 11/780, nominally a 1 MIPS machine). 2227d5528cc1SGeert Uytterhoeven 2228d5528cc1SGeert Uytterhoeven To run the benchmark, it needs to be enabled explicitly, either from 2229d5528cc1SGeert Uytterhoeven the kernel command line (when built-in), or from userspace (when 2230f785785cSGeert Uytterhoeven built-in or modular). 2231d5528cc1SGeert Uytterhoeven 2232d5528cc1SGeert Uytterhoeven Run once during kernel boot: 2233d5528cc1SGeert Uytterhoeven 2234d5528cc1SGeert Uytterhoeven test_dhry.run 2235d5528cc1SGeert Uytterhoeven 2236d5528cc1SGeert Uytterhoeven Set number of iterations from kernel command line: 2237d5528cc1SGeert Uytterhoeven 2238d5528cc1SGeert Uytterhoeven test_dhry.iterations=<n> 2239d5528cc1SGeert Uytterhoeven 2240d5528cc1SGeert Uytterhoeven Set number of iterations from userspace: 2241d5528cc1SGeert Uytterhoeven 2242d5528cc1SGeert Uytterhoeven echo <n> > /sys/module/test_dhry/parameters/iterations 2243d5528cc1SGeert Uytterhoeven 2244d5528cc1SGeert Uytterhoeven Trigger manual run from userspace: 2245d5528cc1SGeert Uytterhoeven 2246d5528cc1SGeert Uytterhoeven echo y > /sys/module/test_dhry/parameters/run 2247d5528cc1SGeert Uytterhoeven 2248d5528cc1SGeert Uytterhoeven If the number of iterations is <= 0, the test will devise a suitable 2249d5528cc1SGeert Uytterhoeven number of iterations (test runs for at least 2s) automatically. 2250d5528cc1SGeert Uytterhoeven This process takes ca. 4s. 2251d5528cc1SGeert Uytterhoeven 2252d5528cc1SGeert Uytterhoeven If unsure, say N. 2253d5528cc1SGeert Uytterhoeven 2254881c5149SDave Hansenconfig LKDTM 2255881c5149SDave Hansen tristate "Linux Kernel Dump Test Tool Module" 2256881c5149SDave Hansen depends on DEBUG_FS 2257881c5149SDave Hansen help 2258881c5149SDave Hansen This module enables testing of the different dumping mechanisms by 2259881c5149SDave Hansen inducing system failures at predefined crash points. 2260881c5149SDave Hansen If you don't need it: say N 2261881c5149SDave Hansen Choose M here to compile this code as a module. The module will be 2262881c5149SDave Hansen called lkdtm. 2263881c5149SDave Hansen 2264881c5149SDave Hansen Documentation on how to use the module can be found in 226510ffebbeSMauro Carvalho Chehab Documentation/fault-injection/provoke-crashes.rst 2266881c5149SDave Hansen 2267d3c0ca49SSander Vanheuleconfig CPUMASK_KUNIT_TEST 2268d3c0ca49SSander Vanheule tristate "KUnit test for cpumask" if !KUNIT_ALL_TESTS 2269c41e8866SSander Vanheule depends on KUNIT 2270c41e8866SSander Vanheule default KUNIT_ALL_TESTS 2271c41e8866SSander Vanheule help 2272c41e8866SSander Vanheule Enable to turn on cpumask tests, running at boot or module load time. 2273c41e8866SSander Vanheule 2274d3c0ca49SSander Vanheule For more information on KUnit and unit tests in general, please refer 2275d3c0ca49SSander Vanheule to the KUnit documentation in Documentation/dev-tools/kunit/. 2276d3c0ca49SSander Vanheule 2277c41e8866SSander Vanheule If unsure, say N. 2278c41e8866SSander Vanheule 2279881c5149SDave Hansenconfig TEST_LIST_SORT 2280ebd09577SDaniel Latypov tristate "Linked list sorting test" if !KUNIT_ALL_TESTS 2281ebd09577SDaniel Latypov depends on KUNIT 2282ebd09577SDaniel Latypov default KUNIT_ALL_TESTS 2283881c5149SDave Hansen help 2284881c5149SDave Hansen Enable this to turn on 'list_sort()' function test. This test is 2285e327fd7cSGeert Uytterhoeven executed only once during system boot (so affects only boot time), 2286e327fd7cSGeert Uytterhoeven or at module load time. 2287881c5149SDave Hansen 2288881c5149SDave Hansen If unsure, say N. 2289881c5149SDave Hansen 22906e24628dSIan Rogersconfig TEST_MIN_HEAP 22916e24628dSIan Rogers tristate "Min heap test" 22926e24628dSIan Rogers depends on DEBUG_KERNEL || m 22936e24628dSIan Rogers help 22946e24628dSIan Rogers Enable this to turn on min heap function tests. This test is 22956e24628dSIan Rogers executed only once during system boot (so affects only boot time), 22966e24628dSIan Rogers or at module load time. 22976e24628dSIan Rogers 22986e24628dSIan Rogers If unsure, say N. 22996e24628dSIan Rogers 2300c5adae95SKostenzer Felixconfig TEST_SORT 230136f33b56SDaniel Latypov tristate "Array-based sort test" if !KUNIT_ALL_TESTS 230236f33b56SDaniel Latypov depends on KUNIT 230336f33b56SDaniel Latypov default KUNIT_ALL_TESTS 2304c5adae95SKostenzer Felix help 23055c4e6798SGeert Uytterhoeven This option enables the self-test function of 'sort()' at boot, 23065c4e6798SGeert Uytterhoeven or at module load time. 2307c5adae95SKostenzer Felix 2308c5adae95SKostenzer Felix If unsure, say N. 2309c5adae95SKostenzer Felix 23105086ea4bSMaciej W. Rozyckiconfig TEST_DIV64 23115086ea4bSMaciej W. Rozycki tristate "64bit/32bit division and modulo test" 23125086ea4bSMaciej W. Rozycki depends on DEBUG_KERNEL || m 23135086ea4bSMaciej W. Rozycki help 23145086ea4bSMaciej W. Rozycki Enable this to turn on 'do_div()' function test. This test is 23155086ea4bSMaciej W. Rozycki executed only once during system boot (so affects only boot time), 23165086ea4bSMaciej W. Rozycki or at module load time. 23175086ea4bSMaciej W. Rozycki 23185086ea4bSMaciej W. Rozycki If unsure, say N. 23195086ea4bSMaciej W. Rozycki 23201635e62eSNicolas Pitreconfig TEST_MULDIV64 23211635e62eSNicolas Pitre tristate "mul_u64_u64_div_u64() test" 23221635e62eSNicolas Pitre depends on DEBUG_KERNEL || m 23231635e62eSNicolas Pitre help 23241635e62eSNicolas Pitre Enable this to turn on 'mul_u64_u64_div_u64()' function test. 23251635e62eSNicolas Pitre This test is executed only once during system boot (so affects 23261635e62eSNicolas Pitre only boot time), or at module load time. 23271635e62eSNicolas Pitre 23281635e62eSNicolas Pitre If unsure, say N. 23291635e62eSNicolas Pitre 23302d71340fSDavid Howellsconfig TEST_IOV_ITER 23312d71340fSDavid Howells tristate "Test iov_iter operation" if !KUNIT_ALL_TESTS 23322d71340fSDavid Howells depends on KUNIT 23331eb1e984SGuenter Roeck depends on MMU 23342d71340fSDavid Howells default KUNIT_ALL_TESTS 23352d71340fSDavid Howells help 23362d71340fSDavid Howells Enable this to turn on testing of the operation of the I/O iterator 23372d71340fSDavid Howells (iov_iter). This test is executed only once during system boot (so 23382d71340fSDavid Howells affects only boot time), or at module load time. 23392d71340fSDavid Howells 23402d71340fSDavid Howells If unsure, say N. 23412d71340fSDavid Howells 2342881c5149SDave Hansenconfig KPROBES_SANITY_TEST 2343dcbb2ee2SDaniel Latypov tristate "Kprobes sanity tests" if !KUNIT_ALL_TESTS 2344881c5149SDave Hansen depends on DEBUG_KERNEL 2345881c5149SDave Hansen depends on KPROBES 2346e44e81c5SSven Schnelle depends on KUNIT 2347de3db3f8SLi Hua select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE 2348dcbb2ee2SDaniel Latypov default KUNIT_ALL_TESTS 2349881c5149SDave Hansen help 2350881c5149SDave Hansen This option provides for testing basic kprobes functionality on 23515a6cf77fSMasami Hiramatsu boot. Samples of kprobe and kretprobe are inserted and 2352881c5149SDave Hansen verified for functionality. 2353881c5149SDave Hansen 2354881c5149SDave Hansen Say N if you are unsure. 2355881c5149SDave Hansen 2356f4616fabSMasami Hiramatsuconfig FPROBE_SANITY_TEST 2357f4616fabSMasami Hiramatsu bool "Self test for fprobe" 2358f4616fabSMasami Hiramatsu depends on DEBUG_KERNEL 2359f4616fabSMasami Hiramatsu depends on FPROBE 2360f4616fabSMasami Hiramatsu depends on KUNIT=y 2361f4616fabSMasami Hiramatsu help 2362f4616fabSMasami Hiramatsu This option will enable testing the fprobe when the system boot. 2363f4616fabSMasami Hiramatsu A series of tests are made to verify that the fprobe is functioning 2364f4616fabSMasami Hiramatsu properly. 2365f4616fabSMasami Hiramatsu 2366f4616fabSMasami Hiramatsu Say N if you are unsure. 2367f4616fabSMasami Hiramatsu 2368881c5149SDave Hansenconfig BACKTRACE_SELF_TEST 2369881c5149SDave Hansen tristate "Self test for the backtrace code" 2370881c5149SDave Hansen depends on DEBUG_KERNEL 2371881c5149SDave Hansen help 2372881c5149SDave Hansen This option provides a kernel module that can be used to test 2373881c5149SDave Hansen the kernel stack backtrace code. This option is not useful 2374881c5149SDave Hansen for distributions or general kernels, but only for kernel 2375881c5149SDave Hansen developers working on architecture code. 2376881c5149SDave Hansen 2377881c5149SDave Hansen Note that if you want to also test saved backtraces, you will 2378881c5149SDave Hansen have to enable STACKTRACE as well. 2379881c5149SDave Hansen 2380881c5149SDave Hansen Say N if you are unsure. 2381881c5149SDave Hansen 2382914a7b50SEric Dumazetconfig TEST_REF_TRACKER 2383914a7b50SEric Dumazet tristate "Self test for reference tracker" 2384914a7b50SEric Dumazet depends on DEBUG_KERNEL && STACKTRACE_SUPPORT 2385914a7b50SEric Dumazet select REF_TRACKER 2386914a7b50SEric Dumazet help 2387914a7b50SEric Dumazet This option provides a kernel module performing tests 2388914a7b50SEric Dumazet using reference tracker infrastructure. 2389914a7b50SEric Dumazet 2390914a7b50SEric Dumazet Say N if you are unsure. 2391914a7b50SEric Dumazet 2392910a742dSMichel Lespinasseconfig RBTREE_TEST 2393910a742dSMichel Lespinasse tristate "Red-Black tree test" 23947c993e11SCody P Schafer depends on DEBUG_KERNEL 2395910a742dSMichel Lespinasse help 2396910a742dSMichel Lespinasse A benchmark measuring the performance of the rbtree library. 2397910a742dSMichel Lespinasse Also includes rbtree invariant checks. 2398910a742dSMichel Lespinasse 23994b4f3accSFerdinand Blomqvistconfig REED_SOLOMON_TEST 24004b4f3accSFerdinand Blomqvist tristate "Reed-Solomon library test" 24014b4f3accSFerdinand Blomqvist depends on DEBUG_KERNEL || m 24024b4f3accSFerdinand Blomqvist select REED_SOLOMON 24034b4f3accSFerdinand Blomqvist select REED_SOLOMON_ENC16 24044b4f3accSFerdinand Blomqvist select REED_SOLOMON_DEC16 24054b4f3accSFerdinand Blomqvist help 24064b4f3accSFerdinand Blomqvist This option enables the self-test function of rslib at boot, 24074b4f3accSFerdinand Blomqvist or at module load time. 24084b4f3accSFerdinand Blomqvist 24094b4f3accSFerdinand Blomqvist If unsure, say N. 24104b4f3accSFerdinand Blomqvist 2411fff3fd8aSMichel Lespinasseconfig INTERVAL_TREE_TEST 2412fff3fd8aSMichel Lespinasse tristate "Interval tree test" 24130f789b67SDavidlohr Bueso depends on DEBUG_KERNEL 2414a88cc108SChris Wilson select INTERVAL_TREE 2415fff3fd8aSMichel Lespinasse help 2416fff3fd8aSMichel Lespinasse A benchmark measuring the performance of the interval tree library 2417fff3fd8aSMichel Lespinasse 2418623fd807SGreg Thelenconfig PERCPU_TEST 2419623fd807SGreg Thelen tristate "Per cpu operations test" 2420623fd807SGreg Thelen depends on m && DEBUG_KERNEL 2421623fd807SGreg Thelen help 2422623fd807SGreg Thelen Enable this option to build test module which validates per-cpu 2423623fd807SGreg Thelen operations. 2424623fd807SGreg Thelen 2425623fd807SGreg Thelen If unsure, say N. 2426623fd807SGreg Thelen 2427881c5149SDave Hansenconfig ATOMIC64_SELFTEST 242855ded955SGeert Uytterhoeven tristate "Perform an atomic64_t self-test" 2429881c5149SDave Hansen help 243055ded955SGeert Uytterhoeven Enable this option to test the atomic64_t functions at boot or 243155ded955SGeert Uytterhoeven at module load time. 2432881c5149SDave Hansen 2433881c5149SDave Hansen If unsure, say N. 2434881c5149SDave Hansen 2435881c5149SDave Hansenconfig ASYNC_RAID6_TEST 2436881c5149SDave Hansen tristate "Self test for hardware accelerated raid6 recovery" 2437881c5149SDave Hansen depends on ASYNC_RAID6_RECOV 2438881c5149SDave Hansen select ASYNC_MEMCPY 2439a7f7f624SMasahiro Yamada help 2440881c5149SDave Hansen This is a one-shot self test that permutes through the 2441881c5149SDave Hansen recovery of all the possible two disk failure scenarios for a 2442881c5149SDave Hansen N-disk array. Recovery is performed with the asynchronous 2443881c5149SDave Hansen raid6 recovery routines, and will optionally use an offload 2444881c5149SDave Hansen engine if one is available. 2445881c5149SDave Hansen 2446881c5149SDave Hansen If unsure, say N. 2447881c5149SDave Hansen 244864d1d77aSAndy Shevchenkoconfig TEST_HEXDUMP 244964d1d77aSAndy Shevchenko tristate "Test functions located in the hexdump module at runtime" 245064d1d77aSAndy Shevchenko 24517a79e7daSTamir Dubersteinconfig PRINTF_KUNIT_TEST 24527a79e7daSTamir Duberstein tristate "KUnit test printf() family of functions at runtime" if !KUNIT_ALL_TESTS 24537a79e7daSTamir Duberstein depends on KUNIT 24547a79e7daSTamir Duberstein default KUNIT_ALL_TESTS 24557a79e7daSTamir Duberstein help 24567a79e7daSTamir Duberstein Enable this option to test the printf functions at runtime. 24577a79e7daSTamir Duberstein 24587a79e7daSTamir Duberstein If unsure, say N. 24597a79e7daSTamir Duberstein 246097c1f302STamir Dubersteinconfig SCANF_KUNIT_TEST 246197c1f302STamir Duberstein tristate "KUnit test scanf() family of functions at runtime" if !KUNIT_ALL_TESTS 246297c1f302STamir Duberstein depends on KUNIT 246397c1f302STamir Duberstein default KUNIT_ALL_TESTS 246497c1f302STamir Duberstein help 246597c1f302STamir Duberstein Enable this option to test the scanf functions at runtime. 246697c1f302STamir Duberstein 246797c1f302STamir Duberstein If unsure, say N. 246897c1f302STamir Duberstein 246929d85688SKees Cookconfig STRING_KUNIT_TEST 247029d85688SKees Cook tristate "KUnit test string functions at runtime" if !KUNIT_ALL_TESTS 247129d85688SKees Cook depends on KUNIT 247229d85688SKees Cook default KUNIT_ALL_TESTS 2473b2ff70a0SMatteo Croce 2474fb57550fSKees Cookconfig STRING_HELPERS_KUNIT_TEST 2475fb57550fSKees Cook tristate "KUnit test string helpers at runtime" if !KUNIT_ALL_TESTS 2476fb57550fSKees Cook depends on KUNIT 2477fb57550fSKees Cook default KUNIT_ALL_TESTS 2478881c5149SDave Hansen 2479881c5149SDave Hansenconfig TEST_KSTRTOX 2480881c5149SDave Hansen tristate "Test kstrto*() family of functions at runtime" 2481881c5149SDave Hansen 24825fd003f5SDavid Decotignyconfig TEST_BITMAP 24835fd003f5SDavid Decotigny tristate "Test bitmap_*() family of functions at runtime" 24845fd003f5SDavid Decotigny help 24855fd003f5SDavid Decotigny Enable this option to test the bitmap functions at boot. 24865fd003f5SDavid Decotigny 24875fd003f5SDavid Decotigny If unsure, say N. 24885fd003f5SDavid Decotigny 2489cfaff0e5SAndy Shevchenkoconfig TEST_UUID 2490cfaff0e5SAndy Shevchenko tristate "Test functions located in the uuid module at runtime" 2491cfaff0e5SAndy Shevchenko 249205033905SAndrew Mortonconfig TEST_XARRAY 249305033905SAndrew Morton tristate "Test the XArray code at runtime" 2494ad3d6c72SMatthew Wilcox 2495120b1162SLiam Howlettconfig TEST_MAPLE_TREE 2496a5199577SLiam R. Howlett tristate "Test the Maple Tree code at runtime or module load" 2497a5199577SLiam R. Howlett help 2498a5199577SLiam R. Howlett Enable this option to test the maple tree code functions at boot, or 2499a5199577SLiam R. Howlett when the module is loaded. Enable "Debug Maple Trees" will enable 2500a5199577SLiam R. Howlett more verbose output on failures. 2501a5199577SLiam R. Howlett 2502a5199577SLiam R. Howlett If unsure, say N. 2503120b1162SLiam Howlett 25047e1e7763SThomas Grafconfig TEST_RHASHTABLE 25059d6dbe1bSGeert Uytterhoeven tristate "Perform selftest on resizable hash table" 25067e1e7763SThomas Graf help 25077e1e7763SThomas Graf Enable this option to test the rhashtable functions at boot. 25087e1e7763SThomas Graf 25097e1e7763SThomas Graf If unsure, say N. 25107e1e7763SThomas Graf 25118ab8ba38SMatthew Wilcoxconfig TEST_IDA 25128ab8ba38SMatthew Wilcox tristate "Perform selftest on IDA functions" 25138ab8ba38SMatthew Wilcox 251437df9043SVimal Agrawalconfig TEST_MISC_MINOR 25156aa98263SThadeu Lima de Souza Cascardo tristate "miscdevice KUnit test" if !KUNIT_ALL_TESTS 251637df9043SVimal Agrawal depends on KUNIT 251737df9043SVimal Agrawal default KUNIT_ALL_TESTS 251837df9043SVimal Agrawal help 25196aa98263SThadeu Lima de Souza Cascardo Kunit test for miscdevice API, specially its behavior in respect to 25206aa98263SThadeu Lima de Souza Cascardo static and dynamic minor numbers. 25216aa98263SThadeu Lima de Souza Cascardo 25226aa98263SThadeu Lima de Souza Cascardo KUnit tests run during boot and output the results to the debug log 25236aa98263SThadeu Lima de Souza Cascardo in TAP format (https://testanything.org/). Only useful for kernel devs 25246aa98263SThadeu Lima de Souza Cascardo running the KUnit test harness, and not intended for inclusion into a 25256aa98263SThadeu Lima de Souza Cascardo production build. 25266aa98263SThadeu Lima de Souza Cascardo 25276aa98263SThadeu Lima de Souza Cascardo For more information on KUnit and unit tests in general please refer 25286aa98263SThadeu Lima de Souza Cascardo to the KUnit documentation in Documentation/dev-tools/kunit/. 252937df9043SVimal Agrawal 253037df9043SVimal Agrawal If unsure, say N. 253137df9043SVimal Agrawal 253244091d29SJiri Pirkoconfig TEST_PARMAN 253344091d29SJiri Pirko tristate "Perform selftest on priority array manager" 253444091d29SJiri Pirko depends on PARMAN 253544091d29SJiri Pirko help 253644091d29SJiri Pirko Enable this option to test priority array manager on boot 253744091d29SJiri Pirko (or module load). 253844091d29SJiri Pirko 253944091d29SJiri Pirko If unsure, say N. 254044091d29SJiri Pirko 25416aed82deSDaniel Lezcanoconfig TEST_IRQ_TIMINGS 25426aed82deSDaniel Lezcano bool "IRQ timings selftest" 25436aed82deSDaniel Lezcano depends on IRQ_TIMINGS 25446aed82deSDaniel Lezcano help 25456aed82deSDaniel Lezcano Enable this option to test the irq timings code on boot. 25466aed82deSDaniel Lezcano 25476aed82deSDaniel Lezcano If unsure, say N. 25486aed82deSDaniel Lezcano 25498a6f0b47SValentin Rothbergconfig TEST_LKM 255093e9ef83SKees Cook tristate "Test module loading with 'hello world' module" 255193e9ef83SKees Cook depends on m 255293e9ef83SKees Cook help 255393e9ef83SKees Cook This builds the "test_module" module that emits "Hello, world" 255493e9ef83SKees Cook on printk when loaded. It is designed to be used for basic 255593e9ef83SKees Cook evaluation of the module loading subsystem (for example when 255693e9ef83SKees Cook validating module verification). It lacks any extra dependencies, 255793e9ef83SKees Cook and will not normally be loaded by the system unless explicitly 255893e9ef83SKees Cook requested by name. 255993e9ef83SKees Cook 256093e9ef83SKees Cook If unsure, say N. 256193e9ef83SKees Cook 2562c348c163SJesse Brandeburgconfig TEST_BITOPS 25636af132f3SWei Yang tristate "Test module for compilation of bitops operations" 2564c348c163SJesse Brandeburg help 2565c348c163SJesse Brandeburg This builds the "test_bitops" module that is much like the 2566c348c163SJesse Brandeburg TEST_LKM module except that it does a basic exercise of the 25676af132f3SWei Yang set/clear_bit macros and get_count_order/long to make sure there are 25686af132f3SWei Yang no compiler warnings from C=1 sparse checker or -Wextra 25696af132f3SWei Yang compilations. It has no dependencies and doesn't run or load unless 25706af132f3SWei Yang explicitly requested by name. for example: modprobe test_bitops. 2571c348c163SJesse Brandeburg 2572c348c163SJesse Brandeburg If unsure, say N. 2573c348c163SJesse Brandeburg 25743f21a6b7SUladzislau Rezki (Sony)config TEST_VMALLOC 25753f21a6b7SUladzislau Rezki (Sony) tristate "Test module for stress/performance analysis of vmalloc allocator" 25763f21a6b7SUladzislau Rezki (Sony) default n 25773f21a6b7SUladzislau Rezki (Sony) depends on MMU 25783f21a6b7SUladzislau Rezki (Sony) depends on m 25793f21a6b7SUladzislau Rezki (Sony) help 25803f21a6b7SUladzislau Rezki (Sony) This builds the "test_vmalloc" module that should be used for 25813f21a6b7SUladzislau Rezki (Sony) stress and performance analysis. So, any new change for vmalloc 25823f21a6b7SUladzislau Rezki (Sony) subsystem can be evaluated from performance and stability point 25833f21a6b7SUladzislau Rezki (Sony) of view. 25843f21a6b7SUladzislau Rezki (Sony) 25853f21a6b7SUladzislau Rezki (Sony) If unsure, say N. 25863f21a6b7SUladzislau Rezki (Sony) 258764a8946bSAlexei Starovoitovconfig TEST_BPF 258864a8946bSAlexei Starovoitov tristate "Test BPF filter functionality" 258998920ba6SRandy Dunlap depends on m && NET 259064a8946bSAlexei Starovoitov help 259164a8946bSAlexei Starovoitov This builds the "test_bpf" module that runs various test vectors 259264a8946bSAlexei Starovoitov against the BPF interpreter or BPF JIT compiler depending on the 259364a8946bSAlexei Starovoitov current setting. This is in particular useful for BPF JIT compiler 259464a8946bSAlexei Starovoitov development, but also to run regression tests against changes in 25953c731ebaSAlexei Starovoitov the interpreter code. It also enables test stubs for eBPF maps and 25963c731ebaSAlexei Starovoitov verifier used by user space verifier testsuite. 259764a8946bSAlexei Starovoitov 259864a8946bSAlexei Starovoitov If unsure, say N. 259964a8946bSAlexei Starovoitov 2600dceeb3e7SYury Norovconfig FIND_BIT_BENCHMARK 26014441fca0SYury Norov tristate "Test find_bit functions" 26024441fca0SYury Norov help 26034441fca0SYury Norov This builds the "test_find_bit" module that measure find_*_bit() 26044441fca0SYury Norov functions performance. 26054441fca0SYury Norov 26064441fca0SYury Norov If unsure, say N. 26074441fca0SYury Norov 26080a8adf58SKees Cookconfig TEST_FIRMWARE 26090a8adf58SKees Cook tristate "Test firmware loading via userspace interface" 26100a8adf58SKees Cook depends on FW_LOADER 26110a8adf58SKees Cook help 26120a8adf58SKees Cook This builds the "test_firmware" module that creates a userspace 26130a8adf58SKees Cook interface for testing firmware loading. This can be used to 26140a8adf58SKees Cook control the triggering of firmware loading without needing an 26150a8adf58SKees Cook actual firmware-using device. The contents can be rechecked by 26160a8adf58SKees Cook userspace. 26170a8adf58SKees Cook 26180a8adf58SKees Cook If unsure, say N. 26190a8adf58SKees Cook 26209308f2f9SLuis R. Rodriguezconfig TEST_SYSCTL 26219308f2f9SLuis R. Rodriguez tristate "sysctl test driver" 26229308f2f9SLuis R. Rodriguez depends on PROC_SYSCTL 26239308f2f9SLuis R. Rodriguez help 26249308f2f9SLuis R. Rodriguez This builds the "test_sysctl" module. This driver enables to test the 26259308f2f9SLuis R. Rodriguez proc sysctl interfaces available to drivers safely without affecting 26269308f2f9SLuis R. Rodriguez production knobs which might alter system functionality. 26279308f2f9SLuis R. Rodriguez 26289308f2f9SLuis R. Rodriguez If unsure, say N. 26299308f2f9SLuis R. Rodriguez 2630d2585f51SVitor Massaru Ihaconfig BITFIELD_KUNIT 2631dcbb2ee2SDaniel Latypov tristate "KUnit test bitfield functions at runtime" if !KUNIT_ALL_TESTS 2632d2585f51SVitor Massaru Iha depends on KUNIT 2633dcbb2ee2SDaniel Latypov default KUNIT_ALL_TESTS 2634d2585f51SVitor Massaru Iha help 2635d2585f51SVitor Massaru Iha Enable this option to test the bitfield functions at boot. 2636d2585f51SVitor Massaru Iha 2637d2585f51SVitor Massaru Iha KUnit tests run during boot and output the results to the debug log 2638d2585f51SVitor Massaru Iha in TAP format (http://testanything.org/). Only useful for kernel devs 2639d2585f51SVitor Massaru Iha running the KUnit test harness, and not intended for inclusion into a 2640d2585f51SVitor Massaru Iha production build. 2641d2585f51SVitor Massaru Iha 2642d2585f51SVitor Massaru Iha For more information on KUnit and unit tests in general please refer 2643d2585f51SVitor Massaru Iha to the KUnit documentation in Documentation/dev-tools/kunit/. 2644d2585f51SVitor Massaru Iha 2645d2585f51SVitor Massaru Iha If unsure, say N. 2646d2585f51SVitor Massaru Iha 2647688eb819SNoah Goldsteinconfig CHECKSUM_KUNIT 2648688eb819SNoah Goldstein tristate "KUnit test checksum functions at runtime" if !KUNIT_ALL_TESTS 2649688eb819SNoah Goldstein depends on KUNIT 2650688eb819SNoah Goldstein default KUNIT_ALL_TESTS 2651688eb819SNoah Goldstein help 2652688eb819SNoah Goldstein Enable this option to test the checksum functions at boot. 2653688eb819SNoah Goldstein 2654688eb819SNoah Goldstein KUnit tests run during boot and output the results to the debug log 2655688eb819SNoah Goldstein in TAP format (http://testanything.org/). Only useful for kernel devs 2656688eb819SNoah Goldstein running the KUnit test harness, and not intended for inclusion into a 2657688eb819SNoah Goldstein production build. 2658688eb819SNoah Goldstein 2659688eb819SNoah Goldstein For more information on KUnit and unit tests in general please refer 2660688eb819SNoah Goldstein to the KUnit documentation in Documentation/dev-tools/kunit/. 2661688eb819SNoah Goldstein 2662688eb819SNoah Goldstein If unsure, say N. 2663688eb819SNoah Goldstein 266411131415SAlexandru Ardeleanconfig UTIL_MACROS_KUNIT 266511131415SAlexandru Ardelean tristate "KUnit test util_macros.h functions at runtime" if !KUNIT_ALL_TESTS 266611131415SAlexandru Ardelean depends on KUNIT 266711131415SAlexandru Ardelean default KUNIT_ALL_TESTS 266811131415SAlexandru Ardelean help 266911131415SAlexandru Ardelean Enable this option to test the util_macros.h function at boot. 267011131415SAlexandru Ardelean 267111131415SAlexandru Ardelean KUnit tests run during boot and output the results to the debug log 267211131415SAlexandru Ardelean in TAP format (http://testanything.org/). Only useful for kernel devs 267311131415SAlexandru Ardelean running the KUnit test harness, and not intended for inclusion into a 267411131415SAlexandru Ardelean production build. 267511131415SAlexandru Ardelean 267611131415SAlexandru Ardelean For more information on KUnit and unit tests in general please refer 267711131415SAlexandru Ardelean to the KUnit documentation in Documentation/dev-tools/kunit/. 267811131415SAlexandru Ardelean 267911131415SAlexandru Ardelean If unsure, say N. 268011131415SAlexandru Ardelean 26810acc968fSIsabella Bassoconfig HASH_KUNIT_TEST 26820acc968fSIsabella Basso tristate "KUnit Test for integer hash functions" if !KUNIT_ALL_TESTS 26830acc968fSIsabella Basso depends on KUNIT 26840acc968fSIsabella Basso default KUNIT_ALL_TESTS 26850acc968fSIsabella Basso help 26860acc968fSIsabella Basso Enable this option to test the kernel's string (<linux/stringhash.h>), and 26870acc968fSIsabella Basso integer (<linux/hash.h>) hash functions on boot. 26880acc968fSIsabella Basso 26890acc968fSIsabella Basso KUnit tests run during boot and output the results to the debug log 26900acc968fSIsabella Basso in TAP format (https://testanything.org/). Only useful for kernel devs 26910acc968fSIsabella Basso running the KUnit test harness, and not intended for inclusion into a 26920acc968fSIsabella Basso production build. 26930acc968fSIsabella Basso 26940acc968fSIsabella Basso For more information on KUnit and unit tests in general please refer 26950acc968fSIsabella Basso to the KUnit documentation in Documentation/dev-tools/kunit/. 26960acc968fSIsabella Basso 26970acc968fSIsabella Basso This is intended to help people writing architecture-specific 26980acc968fSIsabella Basso optimized versions. If unsure, say N. 26990acc968fSIsabella Basso 27005df38ca6SAndy Shevchenkoconfig RESOURCE_KUNIT_TEST 2701dcbb2ee2SDaniel Latypov tristate "KUnit test for resource API" if !KUNIT_ALL_TESTS 27025df38ca6SAndy Shevchenko depends on KUNIT 2703dcbb2ee2SDaniel Latypov default KUNIT_ALL_TESTS 270499185c10SHuang Ying select GET_FREE_REGION 27055df38ca6SAndy Shevchenko help 27065df38ca6SAndy Shevchenko This builds the resource API unit test. 27075df38ca6SAndy Shevchenko Tests the logic of API provided by resource.c and ioport.h. 27085df38ca6SAndy Shevchenko For more information on KUnit and unit tests in general please refer 27095df38ca6SAndy Shevchenko to the KUnit documentation in Documentation/dev-tools/kunit/. 27105df38ca6SAndy Shevchenko 27115df38ca6SAndy Shevchenko If unsure, say N. 27125df38ca6SAndy Shevchenko 27132cb80dbbSIurii Zaikinconfig SYSCTL_KUNIT_TEST 27145f215aabSAnders Roxell tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS 27152cb80dbbSIurii Zaikin depends on KUNIT 27165f215aabSAnders Roxell default KUNIT_ALL_TESTS 27172cb80dbbSIurii Zaikin help 27182cb80dbbSIurii Zaikin This builds the proc sysctl unit test, which runs on boot. 27192cb80dbbSIurii Zaikin Tests the API contract and implementation correctness of sysctl. 27202cb80dbbSIurii Zaikin For more information on KUnit and unit tests in general please refer 27212cb80dbbSIurii Zaikin to the KUnit documentation in Documentation/dev-tools/kunit/. 27222cb80dbbSIurii Zaikin 27232cb80dbbSIurii Zaikin If unsure, say N. 27242cb80dbbSIurii Zaikin 27254d557cb4SDiego Vieiraconfig KFIFO_KUNIT_TEST 27264d557cb4SDiego Vieira tristate "KUnit Test for the generic kernel FIFO implementation" if !KUNIT_ALL_TESTS 27274d557cb4SDiego Vieira depends on KUNIT 27284d557cb4SDiego Vieira default KUNIT_ALL_TESTS 27294d557cb4SDiego Vieira help 27304d557cb4SDiego Vieira This builds the generic FIFO implementation KUnit test suite. 27314d557cb4SDiego Vieira It tests that the API and basic functionality of the kfifo type 27324d557cb4SDiego Vieira and associated macros. 27334d557cb4SDiego Vieira 27344d557cb4SDiego Vieira For more information on KUnit and unit tests in general please refer 27354d557cb4SDiego Vieira to the KUnit documentation in Documentation/dev-tools/kunit/. 27364d557cb4SDiego Vieira 27374d557cb4SDiego Vieira If unsure, say N. 27384d557cb4SDiego Vieira 2739ea2dd7c0SDavid Gowconfig LIST_KUNIT_TEST 27405f215aabSAnders Roxell tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS 2741ea2dd7c0SDavid Gow depends on KUNIT 27425f215aabSAnders Roxell default KUNIT_ALL_TESTS 2743ea2dd7c0SDavid Gow help 2744ea2dd7c0SDavid Gow This builds the linked list KUnit test suite. 2745ea2dd7c0SDavid Gow It tests that the API and basic functionality of the list_head type 2746ea2dd7c0SDavid Gow and associated macros. 2747ea2dd7c0SDavid Gow 2748ea2dd7c0SDavid Gow KUnit tests run during boot and output the results to the debug log 2749d89775fcSAlexander A. Klimov in TAP format (https://testanything.org/). Only useful for kernel devs 2750ea2dd7c0SDavid Gow running the KUnit test harness, and not intended for inclusion into a 2751ea2dd7c0SDavid Gow production build. 2752ea2dd7c0SDavid Gow 2753ea2dd7c0SDavid Gow For more information on KUnit and unit tests in general please refer 2754ea2dd7c0SDavid Gow to the KUnit documentation in Documentation/dev-tools/kunit/. 2755ea2dd7c0SDavid Gow 2756ea2dd7c0SDavid Gow If unsure, say N. 2757ea2dd7c0SDavid Gow 2758789538c6SRae Moarconfig HASHTABLE_KUNIT_TEST 2759789538c6SRae Moar tristate "KUnit Test for Kernel Hashtable structures" if !KUNIT_ALL_TESTS 2760789538c6SRae Moar depends on KUNIT 2761789538c6SRae Moar default KUNIT_ALL_TESTS 2762789538c6SRae Moar help 2763789538c6SRae Moar This builds the hashtable KUnit test suite. 2764789538c6SRae Moar It tests the basic functionality of the API defined in 2765789538c6SRae Moar include/linux/hashtable.h. For more information on KUnit and 2766789538c6SRae Moar unit tests in general please refer to the KUnit documentation 2767789538c6SRae Moar in Documentation/dev-tools/kunit/. 2768789538c6SRae Moar 2769789538c6SRae Moar If unsure, say N. 2770789538c6SRae Moar 277133d599f0SMatti Vaittinenconfig LINEAR_RANGES_TEST 277233d599f0SMatti Vaittinen tristate "KUnit test for linear_ranges" 277333d599f0SMatti Vaittinen depends on KUNIT 277433d599f0SMatti Vaittinen select LINEAR_RANGES 277533d599f0SMatti Vaittinen help 277633d599f0SMatti Vaittinen This builds the linear_ranges unit test, which runs on boot. 277733d599f0SMatti Vaittinen Tests the linear_ranges logic correctness. 277833d599f0SMatti Vaittinen For more information on KUnit and unit tests in general please refer 277933d599f0SMatti Vaittinen to the KUnit documentation in Documentation/dev-tools/kunit/. 278033d599f0SMatti Vaittinen 278133d599f0SMatti Vaittinen If unsure, say N. 278233d599f0SMatti Vaittinen 27837546861aSAndy Shevchenkoconfig CMDLINE_KUNIT_TEST 2784dcbb2ee2SDaniel Latypov tristate "KUnit test for cmdline API" if !KUNIT_ALL_TESTS 27857546861aSAndy Shevchenko depends on KUNIT 2786dcbb2ee2SDaniel Latypov default KUNIT_ALL_TESTS 27877546861aSAndy Shevchenko help 27887546861aSAndy Shevchenko This builds the cmdline API unit test. 27897546861aSAndy Shevchenko Tests the logic of API provided by cmdline.c. 27907546861aSAndy Shevchenko For more information on KUnit and unit tests in general please refer 27917546861aSAndy Shevchenko to the KUnit documentation in Documentation/dev-tools/kunit/. 27927546861aSAndy Shevchenko 27937546861aSAndy Shevchenko If unsure, say N. 27947546861aSAndy Shevchenko 27956d511020SRikard Falkebornconfig BITS_TEST 2796dcbb2ee2SDaniel Latypov tristate "KUnit test for bits.h" if !KUNIT_ALL_TESTS 27976d511020SRikard Falkeborn depends on KUNIT 2798dcbb2ee2SDaniel Latypov default KUNIT_ALL_TESTS 27996d511020SRikard Falkeborn help 28006d511020SRikard Falkeborn This builds the bits unit test. 28016d511020SRikard Falkeborn Tests the logic of macros defined in bits.h. 28026d511020SRikard Falkeborn For more information on KUnit and unit tests in general please refer 28036d511020SRikard Falkeborn to the KUnit documentation in Documentation/dev-tools/kunit/. 28046d511020SRikard Falkeborn 28056d511020SRikard Falkeborn If unsure, say N. 28066d511020SRikard Falkeborn 28071f9f78b1SOliver Glittaconfig SLUB_KUNIT_TEST 28081f9f78b1SOliver Glitta tristate "KUnit test for SLUB cache error detection" if !KUNIT_ALL_TESTS 28091f9f78b1SOliver Glitta depends on SLUB_DEBUG && KUNIT 28101f9f78b1SOliver Glitta default KUNIT_ALL_TESTS 28111f9f78b1SOliver Glitta help 28121f9f78b1SOliver Glitta This builds SLUB allocator unit test. 28131f9f78b1SOliver Glitta Tests SLUB cache debugging functionality. 28141f9f78b1SOliver Glitta For more information on KUnit and unit tests in general please refer 28151f9f78b1SOliver Glitta to the KUnit documentation in Documentation/dev-tools/kunit/. 28161f9f78b1SOliver Glitta 28171f9f78b1SOliver Glitta If unsure, say N. 28181f9f78b1SOliver Glitta 2819b6c75c4aSTrent Piephoconfig RATIONAL_KUNIT_TEST 2820b6c75c4aSTrent Piepho tristate "KUnit test for rational.c" if !KUNIT_ALL_TESTS 28218ba739edSGeert Uytterhoeven depends on KUNIT && RATIONAL 2822b6c75c4aSTrent Piepho default KUNIT_ALL_TESTS 2823b6c75c4aSTrent Piepho help 2824b6c75c4aSTrent Piepho This builds the rational math unit test. 2825b6c75c4aSTrent Piepho For more information on KUnit and unit tests in general please refer 2826b6c75c4aSTrent Piepho to the KUnit documentation in Documentation/dev-tools/kunit/. 2827b6c75c4aSTrent Piepho 2828b6c75c4aSTrent Piepho If unsure, say N. 2829b6c75c4aSTrent Piepho 2830bb95ebbeSKees Cookconfig MEMCPY_KUNIT_TEST 2831bb95ebbeSKees Cook tristate "Test memcpy(), memmove(), and memset() functions at runtime" if !KUNIT_ALL_TESTS 2832bb95ebbeSKees Cook depends on KUNIT 2833bb95ebbeSKees Cook default KUNIT_ALL_TESTS 2834bb95ebbeSKees Cook help 2835bb95ebbeSKees Cook Builds unit tests for memcpy(), memmove(), and memset() functions. 2836bb95ebbeSKees Cook For more information on KUnit and unit tests in general please refer 2837bb95ebbeSKees Cook to the KUnit documentation in Documentation/dev-tools/kunit/. 2838bb95ebbeSKees Cook 2839bb95ebbeSKees Cook If unsure, say N. 2840bb95ebbeSKees Cook 2841addbeea6SBart Van Asscheconfig IS_SIGNED_TYPE_KUNIT_TEST 2842addbeea6SBart Van Assche tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS 2843addbeea6SBart Van Assche depends on KUNIT 2844addbeea6SBart Van Assche default KUNIT_ALL_TESTS 2845addbeea6SBart Van Assche help 2846addbeea6SBart Van Assche Builds unit tests for the is_signed_type() macro. 2847addbeea6SBart Van Assche 2848addbeea6SBart Van Assche For more information on KUnit and unit tests in general please refer 2849addbeea6SBart Van Assche to the KUnit documentation in Documentation/dev-tools/kunit/. 2850addbeea6SBart Van Assche 2851addbeea6SBart Van Assche If unsure, say N. 2852addbeea6SBart Van Assche 2853617f55e2SKees Cookconfig OVERFLOW_KUNIT_TEST 2854617f55e2SKees Cook tristate "Test check_*_overflow() functions at runtime" if !KUNIT_ALL_TESTS 2855617f55e2SKees Cook depends on KUNIT 2856617f55e2SKees Cook default KUNIT_ALL_TESTS 2857617f55e2SKees Cook help 2858617f55e2SKees Cook Builds unit tests for the check_*_overflow(), size_*(), allocation, and 2859617f55e2SKees Cook related functions. 2860617f55e2SKees Cook 2861617f55e2SKees Cook For more information on KUnit and unit tests in general please refer 2862617f55e2SKees Cook to the KUnit documentation in Documentation/dev-tools/kunit/. 2863617f55e2SKees Cook 2864617f55e2SKees Cook If unsure, say N. 2865617f55e2SKees Cook 286602788ebcSKees Cookconfig STACKINIT_KUNIT_TEST 286702788ebcSKees Cook tristate "Test level of stack variable initialization" if !KUNIT_ALL_TESTS 286802788ebcSKees Cook depends on KUNIT 286902788ebcSKees Cook default KUNIT_ALL_TESTS 287002788ebcSKees Cook help 287102788ebcSKees Cook Test if the kernel is zero-initializing stack variables and 287202788ebcSKees Cook padding. Coverage is controlled by compiler flags, 287302788ebcSKees Cook CONFIG_INIT_STACK_ALL_PATTERN, CONFIG_INIT_STACK_ALL_ZERO, 287402788ebcSKees Cook CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF, 287502788ebcSKees Cook or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL. 287602788ebcSKees Cook 2877875bfd52SKees Cookconfig FORTIFY_KUNIT_TEST 2878875bfd52SKees Cook tristate "Test fortified str*() and mem*() function internals at runtime" if !KUNIT_ALL_TESTS 28791a78f8cbSKees Cook depends on KUNIT 2880875bfd52SKees Cook default KUNIT_ALL_TESTS 2881875bfd52SKees Cook help 2882875bfd52SKees Cook Builds unit tests for checking internals of FORTIFY_SOURCE as used 2883875bfd52SKees Cook by the str*() and mem*() family of functions. For testing runtime 2884875bfd52SKees Cook traps of FORTIFY_SOURCE, see LKDTM's "FORTIFY_*" tests. 2885875bfd52SKees Cook 2886c104c160SSergio González Colladoconfig LONGEST_SYM_KUNIT_TEST 2887c104c160SSergio González Collado tristate "Test the longest symbol possible" if !KUNIT_ALL_TESTS 2888c104c160SSergio González Collado depends on KUNIT && KPROBES 2889c104c160SSergio González Collado default KUNIT_ALL_TESTS 2890c104c160SSergio González Collado help 2891c104c160SSergio González Collado Tests the longest symbol possible 2892c104c160SSergio González Collado 2893c104c160SSergio González Collado If unsure, say N. 2894c104c160SSergio González Collado 2895724c299cSMarco Elverconfig HW_BREAKPOINT_KUNIT_TEST 2896724c299cSMarco Elver bool "Test hw_breakpoint constraints accounting" if !KUNIT_ALL_TESTS 2897724c299cSMarco Elver depends on HAVE_HW_BREAKPOINT 2898724c299cSMarco Elver depends on KUNIT=y 2899724c299cSMarco Elver default KUNIT_ALL_TESTS 2900724c299cSMarco Elver help 2901724c299cSMarco Elver Tests for hw_breakpoint constraints accounting. 2902724c299cSMarco Elver 2903724c299cSMarco Elver If unsure, say N. 2904724c299cSMarco Elver 2905e47d9b1aSEric Biggersconfig CRC_KUNIT_TEST 2906e47d9b1aSEric Biggers tristate "KUnit tests for CRC functions" if !KUNIT_ALL_TESTS 2907e47d9b1aSEric Biggers depends on KUNIT 2908e47d9b1aSEric Biggers default KUNIT_ALL_TESTS 29097715f8cfSEric Biggers select CRC7 2910e47d9b1aSEric Biggers select CRC16 2911e47d9b1aSEric Biggers select CRC_T10DIF 2912e47d9b1aSEric Biggers select CRC32 2913e47d9b1aSEric Biggers select CRC64 2914e47d9b1aSEric Biggers help 2915e47d9b1aSEric Biggers Unit tests for the CRC library functions. 2916e47d9b1aSEric Biggers 2917e47d9b1aSEric Biggers This is intended to help people writing architecture-specific 2918e47d9b1aSEric Biggers optimized versions. If unsure, say N. 2919e47d9b1aSEric Biggers 2920e47d9b1aSEric Biggersconfig CRC_BENCHMARK 2921e47d9b1aSEric Biggers bool "Benchmark for the CRC functions" 2922e47d9b1aSEric Biggers depends on CRC_KUNIT_TEST 2923e47d9b1aSEric Biggers help 2924e47d9b1aSEric Biggers Include benchmarks in the KUnit test suite for the CRC functions. 2925e47d9b1aSEric Biggers 2926fb3d88abSKees Cookconfig SIPHASH_KUNIT_TEST 2927fb3d88abSKees Cook tristate "Perform selftest on siphash functions" if !KUNIT_ALL_TESTS 2928fb3d88abSKees Cook depends on KUNIT 2929fb3d88abSKees Cook default KUNIT_ALL_TESTS 2930fb3d88abSKees Cook help 2931fb3d88abSKees Cook Enable this option to test the kernel's siphash (<linux/siphash.h>) hash 2932fb3d88abSKees Cook functions on boot (or module load). 2933fb3d88abSKees Cook 2934fb3d88abSKees Cook This is intended to help people writing architecture-specific 2935fb3d88abSKees Cook optimized versions. If unsure, say N. 2936fb3d88abSKees Cook 2937cf6219eeSKees Cookconfig USERCOPY_KUNIT_TEST 2938cf6219eeSKees Cook tristate "KUnit Test for user/kernel boundary protections" 2939cf6219eeSKees Cook depends on KUNIT 2940cf6219eeSKees Cook default KUNIT_ALL_TESTS 2941cf6219eeSKees Cook help 2942cf6219eeSKees Cook This builds the "usercopy_kunit" module that runs sanity checks 2943cf6219eeSKees Cook on the copy_to/from_user infrastructure, making sure basic 2944cf6219eeSKees Cook user/kernel boundary testing is working. 2945cf6219eeSKees Cook 2946b341f6fdSTamir Dubersteinconfig BLACKHOLE_DEV_KUNIT_TEST 2947b341f6fdSTamir Duberstein tristate "Test blackhole netdev functionality" if !KUNIT_ALL_TESTS 2948b341f6fdSTamir Duberstein depends on NET 2949b341f6fdSTamir Duberstein depends on KUNIT 2950b341f6fdSTamir Duberstein default KUNIT_ALL_TESTS 2951b341f6fdSTamir Duberstein help 2952b341f6fdSTamir Duberstein This builds the "blackhole_dev_kunit" module that validates the 2953b341f6fdSTamir Duberstein data path through this blackhole netdev. 2954b341f6fdSTamir Duberstein 2955b341f6fdSTamir Duberstein If unsure, say N. 2956b341f6fdSTamir Duberstein 2957e704f93aSDavid Rileyconfig TEST_UDELAY 2958e704f93aSDavid Riley tristate "udelay test driver" 2959e704f93aSDavid Riley help 2960e704f93aSDavid Riley This builds the "udelay_test" module that helps to make sure 2961e704f93aSDavid Riley that udelay() is working properly. 2962e704f93aSDavid Riley 2963e704f93aSDavid Riley If unsure, say N. 2964e704f93aSDavid Riley 29652bf9e0abSIngo Molnarconfig TEST_STATIC_KEYS 29662bf9e0abSIngo Molnar tristate "Test static keys" 2967579e1acbSJason Baron depends on m 2968579e1acbSJason Baron help 29692bf9e0abSIngo Molnar Test the static key interfaces. 2970579e1acbSJason Baron 2971579e1acbSJason Baron If unsure, say N. 2972579e1acbSJason Baron 2973683263a5SJim Cromieconfig TEST_DYNAMIC_DEBUG 2974683263a5SJim Cromie tristate "Test DYNAMIC_DEBUG" 2975683263a5SJim Cromie depends on DYNAMIC_DEBUG 2976683263a5SJim Cromie help 2977683263a5SJim Cromie This module registers a tracer callback to count enabled 2978683263a5SJim Cromie pr_debugs in a 'do_debugging' function, then alters their 2979683263a5SJim Cromie enablements, calls the function, and compares counts. 2980683263a5SJim Cromie 2981683263a5SJim Cromie If unsure, say N. 2982683263a5SJim Cromie 2983d9c6a72dSLuis R. Rodriguezconfig TEST_KMOD 2984d9c6a72dSLuis R. Rodriguez tristate "kmod stress tester" 2985d9c6a72dSLuis R. Rodriguez depends on m 2986d9c6a72dSLuis R. Rodriguez depends on NETDEVICES && NET_CORE && INET # for TUN 2987ae3d6a32SYueHaibing depends on BLOCK 2988bbd2e05fSNathan Chancellor depends on PAGE_SIZE_LESS_THAN_256KB # for BTRFS 2989d9c6a72dSLuis R. Rodriguez select TEST_LKM 2990d9c6a72dSLuis R. Rodriguez select XFS_FS 2991d9c6a72dSLuis R. Rodriguez select TUN 2992d9c6a72dSLuis R. Rodriguez select BTRFS_FS 2993d9c6a72dSLuis R. Rodriguez help 2994d9c6a72dSLuis R. Rodriguez Test the kernel's module loading mechanism: kmod. kmod implements 2995d9c6a72dSLuis R. Rodriguez support to load modules using the Linux kernel's usermode helper. 2996d9c6a72dSLuis R. Rodriguez This test provides a series of tests against kmod. 2997d9c6a72dSLuis R. Rodriguez 2998d9c6a72dSLuis R. Rodriguez Although technically you can either build test_kmod as a module or 2999d9c6a72dSLuis R. Rodriguez into the kernel we disallow building it into the kernel since 3000d9c6a72dSLuis R. Rodriguez it stress tests request_module() and this will very likely cause 3001d9c6a72dSLuis R. Rodriguez some issues by taking over precious threads available from other 3002d9c6a72dSLuis R. Rodriguez module load requests, ultimately this could be fatal. 3003d9c6a72dSLuis R. Rodriguez 3004d9c6a72dSLuis R. Rodriguez To run tests run: 3005d9c6a72dSLuis R. Rodriguez 3006d9c6a72dSLuis R. Rodriguez tools/testing/selftests/kmod/kmod.sh --help 3007d9c6a72dSLuis R. Rodriguez 3008d9c6a72dSLuis R. Rodriguez If unsure, say N. 3009d9c6a72dSLuis R. Rodriguez 301084b4a51fSLuis Chamberlainconfig TEST_RUNTIME 301184b4a51fSLuis Chamberlain bool 301284b4a51fSLuis Chamberlain 301384b4a51fSLuis Chamberlainconfig TEST_RUNTIME_MODULE 301484b4a51fSLuis Chamberlain bool 301584b4a51fSLuis Chamberlain 301684b4a51fSLuis Chamberlainconfig TEST_KALLSYMS 301784b4a51fSLuis Chamberlain tristate "module kallsyms find_symbol() test" 301884b4a51fSLuis Chamberlain depends on m 301984b4a51fSLuis Chamberlain select TEST_RUNTIME 302084b4a51fSLuis Chamberlain select TEST_RUNTIME_MODULE 302184b4a51fSLuis Chamberlain select TEST_KALLSYMS_A 302284b4a51fSLuis Chamberlain select TEST_KALLSYMS_B 302384b4a51fSLuis Chamberlain select TEST_KALLSYMS_C 302484b4a51fSLuis Chamberlain select TEST_KALLSYMS_D 302584b4a51fSLuis Chamberlain help 302684b4a51fSLuis Chamberlain This allows us to stress test find_symbol() through the kallsyms 302784b4a51fSLuis Chamberlain used to place symbols on the kernel ELF kallsyms and modules kallsyms 302884b4a51fSLuis Chamberlain where we place kernel symbols such as exported symbols. 302984b4a51fSLuis Chamberlain 303084b4a51fSLuis Chamberlain We have four test modules: 303184b4a51fSLuis Chamberlain 303284b4a51fSLuis Chamberlain A: has KALLSYSMS_NUMSYMS exported symbols 303384b4a51fSLuis Chamberlain B: uses one of A's symbols 303484b4a51fSLuis Chamberlain C: adds KALLSYMS_SCALE_FACTOR * KALLSYSMS_NUMSYMS exported 303584b4a51fSLuis Chamberlain D: adds 2 * the symbols than C 303684b4a51fSLuis Chamberlain 303784b4a51fSLuis Chamberlain We stress test find_symbol() through two means: 303884b4a51fSLuis Chamberlain 303984b4a51fSLuis Chamberlain 1) Upon load of B it will trigger simplify_symbols() to look for the 304084b4a51fSLuis Chamberlain one symbol it uses from the module A with tons of symbols. This is an 304184b4a51fSLuis Chamberlain indirect way for us to have B call resolve_symbol_wait() upon module 304284b4a51fSLuis Chamberlain load. This will eventually call find_symbol() which will eventually 304384b4a51fSLuis Chamberlain try to find the symbols used with find_exported_symbol_in_section(). 304484b4a51fSLuis Chamberlain find_exported_symbol_in_section() uses bsearch() so a binary search 304584b4a51fSLuis Chamberlain for each symbol. Binary search will at worst be O(log(n)) so the 304684b4a51fSLuis Chamberlain larger TEST_MODULE_KALLSYSMS the worse the search. 304784b4a51fSLuis Chamberlain 304884b4a51fSLuis Chamberlain 2) The selftests should load C first, before B. Upon B's load towards 304984b4a51fSLuis Chamberlain the end right before we call module B's init routine we get 305084b4a51fSLuis Chamberlain complete_formation() called on the module. That will first check 305184b4a51fSLuis Chamberlain for duplicate symbols with the call to verify_exported_symbols(). 305284b4a51fSLuis Chamberlain That is when we'll force iteration on module C's insane symbol list. 305384b4a51fSLuis Chamberlain Since it has 10 * KALLSYMS_NUMSYMS it means we can first test 305484b4a51fSLuis Chamberlain just loading B without C. The amount of time it takes to load C Vs 305584b4a51fSLuis Chamberlain B can give us an idea of the impact growth of the symbol space and 305684b4a51fSLuis Chamberlain give us projection. Module A only uses one symbol from B so to allow 305784b4a51fSLuis Chamberlain this scaling in module C to be proportional, if it used more symbols 305884b4a51fSLuis Chamberlain then the first test would be doing more and increasing just the 305984b4a51fSLuis Chamberlain search space would be slightly different. The last module, module D 306084b4a51fSLuis Chamberlain will just increase the search space by twice the number of symbols in 306184b4a51fSLuis Chamberlain C so to allow for full projects. 306284b4a51fSLuis Chamberlain 306384b4a51fSLuis Chamberlain tools/testing/selftests/module/find_symbol.sh 306484b4a51fSLuis Chamberlain 306584b4a51fSLuis Chamberlain The current defaults will incur a build delay of about 7 minutes 306684b4a51fSLuis Chamberlain on an x86_64 with only 8 cores. Enable this only if you want to 306784b4a51fSLuis Chamberlain stress test find_symbol() with thousands of symbols. At the same 306884b4a51fSLuis Chamberlain time this is also useful to test building modules with thousands of 306984b4a51fSLuis Chamberlain symbols, and if BTF is enabled this also stress tests adding BTF 307084b4a51fSLuis Chamberlain information for each module. Currently enabling many more symbols 307184b4a51fSLuis Chamberlain will segfault the build system. 307284b4a51fSLuis Chamberlain 307384b4a51fSLuis Chamberlain If unsure, say N. 307484b4a51fSLuis Chamberlain 307584b4a51fSLuis Chamberlainif TEST_KALLSYMS 307684b4a51fSLuis Chamberlain 307784b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_A 307884b4a51fSLuis Chamberlain tristate 307984b4a51fSLuis Chamberlain depends on m 308084b4a51fSLuis Chamberlain 308184b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_B 308284b4a51fSLuis Chamberlain tristate 308384b4a51fSLuis Chamberlain depends on m 308484b4a51fSLuis Chamberlain 308584b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_C 308684b4a51fSLuis Chamberlain tristate 308784b4a51fSLuis Chamberlain depends on m 308884b4a51fSLuis Chamberlain 308984b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_D 309084b4a51fSLuis Chamberlain tristate 309184b4a51fSLuis Chamberlain depends on m 309284b4a51fSLuis Chamberlain 30933e1d95b6SLuis Chamberlainchoice 30943e1d95b6SLuis Chamberlain prompt "Kallsym test range" 30953e1d95b6SLuis Chamberlain default TEST_KALLSYMS_LARGE 30963e1d95b6SLuis Chamberlain help 30973e1d95b6SLuis Chamberlain Selecting something other than "Fast" will enable tests which slow 30983e1d95b6SLuis Chamberlain down the build and may crash your build. 30993e1d95b6SLuis Chamberlain 31003e1d95b6SLuis Chamberlainconfig TEST_KALLSYMS_FAST 31013e1d95b6SLuis Chamberlain bool "Fast builds" 31023e1d95b6SLuis Chamberlain help 31033e1d95b6SLuis Chamberlain You won't really be testing kallsysms, so this just helps fast builds 31043e1d95b6SLuis Chamberlain when allmodconfig is used.. 31053e1d95b6SLuis Chamberlain 31063e1d95b6SLuis Chamberlainconfig TEST_KALLSYMS_LARGE 31073e1d95b6SLuis Chamberlain bool "Enable testing kallsyms with large exports" 31083e1d95b6SLuis Chamberlain help 31093e1d95b6SLuis Chamberlain This will enable larger number of symbols. This will slow down 31103e1d95b6SLuis Chamberlain your build considerably. 31113e1d95b6SLuis Chamberlain 31123e1d95b6SLuis Chamberlainconfig TEST_KALLSYMS_MAX 31133e1d95b6SLuis Chamberlain bool "Known kallsysms limits" 31143e1d95b6SLuis Chamberlain help 31153e1d95b6SLuis Chamberlain This will enable exports to the point we know we'll start crashing 31163e1d95b6SLuis Chamberlain builds. 31173e1d95b6SLuis Chamberlain 31183e1d95b6SLuis Chamberlainendchoice 31193e1d95b6SLuis Chamberlain 312084b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_NUMSYMS 312184b4a51fSLuis Chamberlain int "test kallsyms number of symbols" 31223e1d95b6SLuis Chamberlain range 2 10000 31233e1d95b6SLuis Chamberlain default 2 if TEST_KALLSYMS_FAST 31243e1d95b6SLuis Chamberlain default 100 if TEST_KALLSYMS_LARGE 31253e1d95b6SLuis Chamberlain default 10000 if TEST_KALLSYMS_MAX 312684b4a51fSLuis Chamberlain help 312784b4a51fSLuis Chamberlain The number of symbols to create on TEST_KALLSYMS_A, only one of which 312884b4a51fSLuis Chamberlain module TEST_KALLSYMS_B will use. This also will be used 312984b4a51fSLuis Chamberlain for how many symbols TEST_KALLSYMS_C will have, scaled up by 313084b4a51fSLuis Chamberlain TEST_KALLSYMS_SCALE_FACTOR. Note that setting this to 10,000 will 313184b4a51fSLuis Chamberlain trigger a segfault today, don't use anything close to it unless 313284b4a51fSLuis Chamberlain you are aware that this should not be used for automated build tests. 313384b4a51fSLuis Chamberlain 313484b4a51fSLuis Chamberlainconfig TEST_KALLSYMS_SCALE_FACTOR 313584b4a51fSLuis Chamberlain int "test kallsyms scale factor" 313684b4a51fSLuis Chamberlain default 8 313784b4a51fSLuis Chamberlain help 313884b4a51fSLuis Chamberlain How many more unusued symbols will TEST_KALLSYSMS_C have than 313984b4a51fSLuis Chamberlain TEST_KALLSYMS_A. If 8, then module C will have 8 * syms 314084b4a51fSLuis Chamberlain than module A. Then TEST_KALLSYMS_D will have double the amount 314184b4a51fSLuis Chamberlain of symbols than C so to allow projections. 314284b4a51fSLuis Chamberlain 314384b4a51fSLuis Chamberlainendif # TEST_KALLSYMS 314484b4a51fSLuis Chamberlain 3145e4dace36SFlorian Fainelliconfig TEST_DEBUG_VIRTUAL 3146e4dace36SFlorian Fainelli tristate "Test CONFIG_DEBUG_VIRTUAL feature" 3147e4dace36SFlorian Fainelli depends on DEBUG_VIRTUAL 3148e4dace36SFlorian Fainelli help 3149e4dace36SFlorian Fainelli Test the kernel's ability to detect incorrect calls to 3150e4dace36SFlorian Fainelli virt_to_phys() done against the non-linear part of the 3151e4dace36SFlorian Fainelli kernel's virtual address map. 3152e4dace36SFlorian Fainelli 3153e4dace36SFlorian Fainelli If unsure, say N. 3154e4dace36SFlorian Fainelli 3155ce76d938SAlexander Shishkinconfig TEST_MEMCAT_P 3156ce76d938SAlexander Shishkin tristate "Test memcat_p() helper function" 3157ce76d938SAlexander Shishkin help 3158ce76d938SAlexander Shishkin Test the memcat_p() helper for correctly merging two 3159ce76d938SAlexander Shishkin pointer arrays together. 3160ce76d938SAlexander Shishkin 3161ce76d938SAlexander Shishkin If unsure, say N. 3162ce76d938SAlexander Shishkin 31630a020d41SJiri Pirkoconfig TEST_OBJAGG 31640a020d41SJiri Pirko tristate "Perform selftest on object aggreration manager" 31650a020d41SJiri Pirko default n 31660a020d41SJiri Pirko depends on OBJAGG 31670a020d41SJiri Pirko help 31680a020d41SJiri Pirko Enable this option to test object aggregation manager on boot 31690a020d41SJiri Pirko (or module load). 31700a020d41SJiri Pirko 31715015a300SAlexander Potapenkoconfig TEST_MEMINIT 31725015a300SAlexander Potapenko tristate "Test heap/page initialization" 31735015a300SAlexander Potapenko help 31745015a300SAlexander Potapenko Test if the kernel is zero-initializing heap and page allocations. 31755015a300SAlexander Potapenko This can be useful to test init_on_alloc and init_on_free features. 31765015a300SAlexander Potapenko 31775015a300SAlexander Potapenko If unsure, say N. 31785015a300SAlexander Potapenko 3179b2ef9f5aSRalph Campbellconfig TEST_HMM 3180b2ef9f5aSRalph Campbell tristate "Test HMM (Heterogeneous Memory Management)" 3181b2ef9f5aSRalph Campbell depends on TRANSPARENT_HUGEPAGE 3182b2ef9f5aSRalph Campbell depends on DEVICE_PRIVATE 3183b2ef9f5aSRalph Campbell select HMM_MIRROR 3184b2ef9f5aSRalph Campbell select MMU_NOTIFIER 3185b2ef9f5aSRalph Campbell help 3186b2ef9f5aSRalph Campbell This is a pseudo device driver solely for testing HMM. 3187b2ef9f5aSRalph Campbell Say M here if you want to build the HMM test module. 3188b2ef9f5aSRalph Campbell Doing so will allow you to run tools/testing/selftest/vm/hmm-tests. 3189b2ef9f5aSRalph Campbell 3190b2ef9f5aSRalph Campbell If unsure, say N. 3191b2ef9f5aSRalph Campbell 3192e320d301SMatthew Wilcox (Oracle)config TEST_FREE_PAGES 3193e320d301SMatthew Wilcox (Oracle) tristate "Test freeing pages" 3194e320d301SMatthew Wilcox (Oracle) help 3195e320d301SMatthew Wilcox (Oracle) Test that a memory leak does not occur due to a race between 3196e320d301SMatthew Wilcox (Oracle) freeing a block of pages and a speculative page reference. 3197e320d301SMatthew Wilcox (Oracle) Loading this module is safe if your kernel has the bug fixed. 3198e320d301SMatthew Wilcox (Oracle) If the bug is not fixed, it will leak gigabytes of memory and 3199e320d301SMatthew Wilcox (Oracle) probably OOM your system. 3200e320d301SMatthew Wilcox (Oracle) 32014185b3b9SPetteri Aimonenconfig TEST_FPU 32024185b3b9SPetteri Aimonen tristate "Test floating point operations in kernel space" 3203790a4a3dSSamuel Holland depends on ARCH_HAS_KERNEL_FPU_SUPPORT && !KCOV_INSTRUMENT_ALL 32044185b3b9SPetteri Aimonen help 32054185b3b9SPetteri Aimonen Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu 32064185b3b9SPetteri Aimonen which will trigger a sequence of floating point operations. This is used 32074185b3b9SPetteri Aimonen for self-testing floating point control register setting in 32084185b3b9SPetteri Aimonen kernel_fpu_begin(). 32094185b3b9SPetteri Aimonen 32104185b3b9SPetteri Aimonen If unsure, say N. 32114185b3b9SPetteri Aimonen 32121253b9b8SPaul E. McKenneyconfig TEST_CLOCKSOURCE_WATCHDOG 32131253b9b8SPaul E. McKenney tristate "Test clocksource watchdog in kernel space" 32141253b9b8SPaul E. McKenney depends on CLOCKSOURCE_WATCHDOG 32151253b9b8SPaul E. McKenney help 32161253b9b8SPaul E. McKenney Enable this option to create a kernel module that will trigger 32171253b9b8SPaul E. McKenney a test of the clocksource watchdog. This module may be loaded 32181253b9b8SPaul E. McKenney via modprobe or insmod in which case it will run upon being 32191253b9b8SPaul E. McKenney loaded, or it may be built in, in which case it will run 32201253b9b8SPaul E. McKenney shortly after boot. 32211253b9b8SPaul E. McKenney 32221253b9b8SPaul E. McKenney If unsure, say N. 32231253b9b8SPaul E. McKenney 322492f90d3bSwuqiang.mattconfig TEST_OBJPOOL 322592f90d3bSwuqiang.matt tristate "Test module for correctness and stress of objpool" 322692f90d3bSwuqiang.matt default n 322792f90d3bSwuqiang.matt depends on m && DEBUG_KERNEL 322892f90d3bSwuqiang.matt help 322992f90d3bSwuqiang.matt This builds the "test_objpool" module that should be used for 323092f90d3bSwuqiang.matt correctness verification and concurrent testings of objects 323192f90d3bSwuqiang.matt allocation and reclamation. 323292f90d3bSwuqiang.matt 323392f90d3bSwuqiang.matt If unsure, say N. 323492f90d3bSwuqiang.matt 32353e50ba8fSLuis Felipe Hernandezconfig INT_POW_KUNIT_TEST 3236b4216642SKuan-Wei Chiu tristate "Integer exponentiation (int_pow) test" if !KUNIT_ALL_TESTS 3237b4216642SKuan-Wei Chiu depends on KUNIT 3238b4216642SKuan-Wei Chiu default KUNIT_ALL_TESTS 3239b4216642SKuan-Wei Chiu help 3240b4216642SKuan-Wei Chiu This option enables the KUnit test suite for the int_pow function, 3241b4216642SKuan-Wei Chiu which performs integer exponentiation. The test suite is designed to 3242b4216642SKuan-Wei Chiu verify that the implementation of int_pow correctly computes the power 3243b4216642SKuan-Wei Chiu of a given base raised to a given exponent. 3244b4216642SKuan-Wei Chiu 3245b4216642SKuan-Wei Chiu Enabling this option will include tests that check various scenarios 3246b4216642SKuan-Wei Chiu and edge cases to ensure the accuracy and reliability of the exponentiation 3247b4216642SKuan-Wei Chiu function. 3248b4216642SKuan-Wei Chiu 3249b4216642SKuan-Wei Chiu If unsure, say N 3250b4216642SKuan-Wei Chiu 32510fafc9e1SLuis Felipe Hernandezconfig INT_SQRT_KUNIT_TEST 32520fafc9e1SLuis Felipe Hernandez tristate "Integer square root test" if !KUNIT_ALL_TESTS 32530fafc9e1SLuis Felipe Hernandez depends on KUNIT 32540fafc9e1SLuis Felipe Hernandez default KUNIT_ALL_TESTS 32550fafc9e1SLuis Felipe Hernandez help 32560fafc9e1SLuis Felipe Hernandez This option enables the KUnit test suite for the int_sqrt() function, 32570fafc9e1SLuis Felipe Hernandez which performs square root calculation. The test suite checks 32580fafc9e1SLuis Felipe Hernandez various scenarios, including edge cases, to ensure correctness. 32590fafc9e1SLuis Felipe Hernandez 32600fafc9e1SLuis Felipe Hernandez Enabling this option will include tests that check various scenarios 32610fafc9e1SLuis Felipe Hernandez and edge cases to ensure the accuracy and reliability of the square root 32620fafc9e1SLuis Felipe Hernandez function. 32630fafc9e1SLuis Felipe Hernandez 32640fafc9e1SLuis Felipe Hernandez If unsure, say N 32650fafc9e1SLuis Felipe Hernandez 326684ec093fSBruno Sobreira Françaconfig INT_LOG_KUNIT_TEST 326784ec093fSBruno Sobreira França tristate "Integer log (int_log) test" if !KUNIT_ALL_TESTS 326884ec093fSBruno Sobreira França depends on KUNIT 326984ec093fSBruno Sobreira França default KUNIT_ALL_TESTS 327084ec093fSBruno Sobreira França help 327184ec093fSBruno Sobreira França This option enables the KUnit test suite for the int_log library, which 327284ec093fSBruno Sobreira França provides two functions to compute the integer logarithm in base 2 and 327384ec093fSBruno Sobreira França base 10, called respectively as intlog2 and intlog10. 327484ec093fSBruno Sobreira França 327584ec093fSBruno Sobreira França If unsure, say N 327684ec093fSBruno Sobreira França 32779ab61886SYu-Chun Linconfig GCD_KUNIT_TEST 32789ab61886SYu-Chun Lin tristate "Greatest common divisor test" if !KUNIT_ALL_TESTS 32799ab61886SYu-Chun Lin depends on KUNIT 32809ab61886SYu-Chun Lin default KUNIT_ALL_TESTS 32819ab61886SYu-Chun Lin help 32829ab61886SYu-Chun Lin This option enables the KUnit test suite for the gcd() function, 32839ab61886SYu-Chun Lin which computes the greatest common divisor of two numbers. 32849ab61886SYu-Chun Lin 32859ab61886SYu-Chun Lin This test suite verifies the correctness of gcd() across various 32869ab61886SYu-Chun Lin scenarios, including edge cases. 32879ab61886SYu-Chun Lin 32889ab61886SYu-Chun Lin If unsure, say N 32899ab61886SYu-Chun Lin 3290313b38a6STamir Dubersteinconfig PRIME_NUMBERS_KUNIT_TEST 3291313b38a6STamir Duberstein tristate "Prime number generator test" if !KUNIT_ALL_TESTS 3292313b38a6STamir Duberstein depends on KUNIT 3293*3f292517SGeert Uytterhoeven depends on PRIME_NUMBERS 3294313b38a6STamir Duberstein default KUNIT_ALL_TESTS 3295313b38a6STamir Duberstein help 3296313b38a6STamir Duberstein This option enables the KUnit test suite for the {is,next}_prime_number 3297313b38a6STamir Duberstein functions. 3298313b38a6STamir Duberstein 3299313b38a6STamir Duberstein Enabling this option will include tests that compare the prime number 3300313b38a6STamir Duberstein generator functions against a brute force implementation. 3301313b38a6STamir Duberstein 3302313b38a6STamir Duberstein If unsure, say N 3303313b38a6STamir Duberstein 3304d3deafaaSVincent Legollendif # RUNTIME_TESTING_MENU 3305cc3fa840SRandy Dunlap 3306dce44566SAnshuman Khandualconfig ARCH_USE_MEMTEST 3307dce44566SAnshuman Khandual bool 3308dce44566SAnshuman Khandual help 3309dce44566SAnshuman Khandual An architecture should select this when it uses early_memtest() 3310dce44566SAnshuman Khandual during boot process. 3311dce44566SAnshuman Khandual 3312cc3fa840SRandy Dunlapconfig MEMTEST 3313cc3fa840SRandy Dunlap bool "Memtest" 3314dce44566SAnshuman Khandual depends on ARCH_USE_MEMTEST 3315a7f7f624SMasahiro Yamada help 3316cc3fa840SRandy Dunlap This option adds a kernel parameter 'memtest', which allows memtest 3317dce44566SAnshuman Khandual to be set and executed. 3318cc3fa840SRandy Dunlap memtest=0, mean disabled; -- default 3319cc3fa840SRandy Dunlap memtest=1, mean do 1 test pattern; 3320cc3fa840SRandy Dunlap ... 3321cc3fa840SRandy Dunlap memtest=17, mean do 17 test patterns. 3322cc3fa840SRandy Dunlap If you are unsure how to answer this question, answer N. 3323cc3fa840SRandy Dunlap 3324cc3fa840SRandy Dunlap 332506ec64b8SChristoph Hellwig 3326af9ca6f9SBranden Bonabyconfig HYPERV_TESTING 3327af9ca6f9SBranden Bonaby bool "Microsoft Hyper-V driver testing" 3328af9ca6f9SBranden Bonaby default n 3329af9ca6f9SBranden Bonaby depends on HYPERV && DEBUG_FS 3330af9ca6f9SBranden Bonaby help 3331af9ca6f9SBranden Bonaby Select this option to enable Hyper-V vmbus testing. 3332af9ca6f9SBranden Bonaby 3333045f6d79SChangbin Duendmenu # "Kernel Testing and Coverage" 3334045f6d79SChangbin Du 33352f7ab126SMiguel Ojedamenu "Rust hacking" 33362f7ab126SMiguel Ojeda 33372f7ab126SMiguel Ojedaconfig RUST_DEBUG_ASSERTIONS 33382f7ab126SMiguel Ojeda bool "Debug assertions" 33392f7ab126SMiguel Ojeda depends on RUST 33402f7ab126SMiguel Ojeda help 33412f7ab126SMiguel Ojeda Enables rustc's `-Cdebug-assertions` codegen option. 33422f7ab126SMiguel Ojeda 33432f7ab126SMiguel Ojeda This flag lets you turn `cfg(debug_assertions)` conditional 33442f7ab126SMiguel Ojeda compilation on or off. This can be used to enable extra debugging 33452f7ab126SMiguel Ojeda code in development but not in production. For example, it controls 33462f7ab126SMiguel Ojeda the behavior of the standard library's `debug_assert!` macro. 33472f7ab126SMiguel Ojeda 33482f7ab126SMiguel Ojeda Note that this will apply to all Rust code, including `core`. 33492f7ab126SMiguel Ojeda 33502f7ab126SMiguel Ojeda If unsure, say N. 33512f7ab126SMiguel Ojeda 33522f7ab126SMiguel Ojedaconfig RUST_OVERFLOW_CHECKS 33532f7ab126SMiguel Ojeda bool "Overflow checks" 33542f7ab126SMiguel Ojeda default y 33552f7ab126SMiguel Ojeda depends on RUST 33562f7ab126SMiguel Ojeda help 33572f7ab126SMiguel Ojeda Enables rustc's `-Coverflow-checks` codegen option. 33582f7ab126SMiguel Ojeda 33592f7ab126SMiguel Ojeda This flag allows you to control the behavior of runtime integer 33602f7ab126SMiguel Ojeda overflow. When overflow-checks are enabled, a Rust panic will occur 33612f7ab126SMiguel Ojeda on overflow. 33622f7ab126SMiguel Ojeda 33632f7ab126SMiguel Ojeda Note that this will apply to all Rust code, including `core`. 33642f7ab126SMiguel Ojeda 33652f7ab126SMiguel Ojeda If unsure, say Y. 33662f7ab126SMiguel Ojeda 3367ecaa6ddfSGary Guoconfig RUST_BUILD_ASSERT_ALLOW 3368ecaa6ddfSGary Guo bool "Allow unoptimized build-time assertions" 3369ecaa6ddfSGary Guo depends on RUST 3370ecaa6ddfSGary Guo help 3371ab885143STimo Grautstueck Controls how `build_error!` and `build_assert!` are handled during the build. 3372ecaa6ddfSGary Guo 3373ecaa6ddfSGary Guo If calls to them exist in the binary, it may indicate a violated invariant 3374ecaa6ddfSGary Guo or that the optimizer failed to verify the invariant during compilation. 3375ecaa6ddfSGary Guo 3376ecaa6ddfSGary Guo This should not happen, thus by default the build is aborted. However, 3377ecaa6ddfSGary Guo as an escape hatch, you can choose Y here to ignore them during build 3378ecaa6ddfSGary Guo and let the check be carried at runtime (with `panic!` being called if 3379ecaa6ddfSGary Guo the check fails). 3380ecaa6ddfSGary Guo 3381ecaa6ddfSGary Guo If unsure, say N. 3382ecaa6ddfSGary Guo 3383a66d733dSMiguel Ojedaconfig RUST_KERNEL_DOCTESTS 3384a66d733dSMiguel Ojeda bool "Doctests for the `kernel` crate" if !KUNIT_ALL_TESTS 3385a66d733dSMiguel Ojeda depends on RUST && KUNIT=y 3386a66d733dSMiguel Ojeda default KUNIT_ALL_TESTS 3387a66d733dSMiguel Ojeda help 3388a66d733dSMiguel Ojeda This builds the documentation tests of the `kernel` crate 3389a66d733dSMiguel Ojeda as KUnit tests. 3390a66d733dSMiguel Ojeda 3391a66d733dSMiguel Ojeda For more information on KUnit and unit tests in general, 3392a66d733dSMiguel Ojeda please refer to the KUnit documentation in Documentation/dev-tools/kunit/. 3393a66d733dSMiguel Ojeda 3394a66d733dSMiguel Ojeda If unsure, say N. 3395a66d733dSMiguel Ojeda 33962f7ab126SMiguel Ojedaendmenu # "Rust" 33972f7ab126SMiguel Ojeda 339806ec64b8SChristoph Hellwigendmenu # Kernel hacking 3399