18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_cimenu "Kernel hacking" 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_cimenu "printk and dmesg options" 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciconfig PRINTK_TIME 78c2ecf20Sopenharmony_ci bool "Show timing information on printks" 88c2ecf20Sopenharmony_ci depends on PRINTK 98c2ecf20Sopenharmony_ci help 108c2ecf20Sopenharmony_ci Selecting this option causes time stamps of the printk() 118c2ecf20Sopenharmony_ci messages to be added to the output of the syslog() system 128c2ecf20Sopenharmony_ci call and at the console. 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci The timestamp is always recorded internally, and exported 158c2ecf20Sopenharmony_ci to /dev/kmsg. This flag just specifies if the timestamp should 168c2ecf20Sopenharmony_ci be included, not that the timestamp is recorded. 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci The behavior is also controlled by the kernel command line 198c2ecf20Sopenharmony_ci parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciconfig PRINTK_CALLER 228c2ecf20Sopenharmony_ci bool "Show caller information on printks" 238c2ecf20Sopenharmony_ci depends on PRINTK 248c2ecf20Sopenharmony_ci help 258c2ecf20Sopenharmony_ci Selecting this option causes printk() to add a caller "thread id" (if 268c2ecf20Sopenharmony_ci in task context) or a caller "processor id" (if not in task context) 278c2ecf20Sopenharmony_ci to every message. 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci This option is intended for environments where multiple threads 308c2ecf20Sopenharmony_ci concurrently call printk() for many times, for it is difficult to 318c2ecf20Sopenharmony_ci interpret without knowing where these lines (or sometimes individual 328c2ecf20Sopenharmony_ci line which was divided into multiple lines due to race) came from. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci Since toggling after boot makes the code racy, currently there is 358c2ecf20Sopenharmony_ci no option to enable/disable at the kernel command line parameter or 368c2ecf20Sopenharmony_ci sysfs interface. 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciconfig CONSOLE_LOGLEVEL_DEFAULT 398c2ecf20Sopenharmony_ci int "Default console loglevel (1-15)" 408c2ecf20Sopenharmony_ci range 1 15 418c2ecf20Sopenharmony_ci default "7" 428c2ecf20Sopenharmony_ci help 438c2ecf20Sopenharmony_ci Default loglevel to determine what will be printed on the console. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci Setting a default here is equivalent to passing in loglevel=<x> in 468c2ecf20Sopenharmony_ci the kernel bootargs. loglevel=<x> continues to override whatever 478c2ecf20Sopenharmony_ci value is specified here as well. 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci Note: This does not affect the log level of un-prefixed printk() 508c2ecf20Sopenharmony_ci usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT 518c2ecf20Sopenharmony_ci option. 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciconfig CONSOLE_LOGLEVEL_QUIET 548c2ecf20Sopenharmony_ci int "quiet console loglevel (1-15)" 558c2ecf20Sopenharmony_ci range 1 15 568c2ecf20Sopenharmony_ci default "4" 578c2ecf20Sopenharmony_ci help 588c2ecf20Sopenharmony_ci loglevel to use when "quiet" is passed on the kernel commandline. 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci When "quiet" is passed on the kernel commandline this loglevel 618c2ecf20Sopenharmony_ci will be used as the loglevel. IOW passing "quiet" will be the 628c2ecf20Sopenharmony_ci equivalent of passing "loglevel=<CONSOLE_LOGLEVEL_QUIET>" 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ciconfig MESSAGE_LOGLEVEL_DEFAULT 658c2ecf20Sopenharmony_ci int "Default message log level (1-7)" 668c2ecf20Sopenharmony_ci range 1 7 678c2ecf20Sopenharmony_ci default "4" 688c2ecf20Sopenharmony_ci help 698c2ecf20Sopenharmony_ci Default log level for printk statements with no specified priority. 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci This was hard-coded to KERN_WARNING since at least 2.6.10 but folks 728c2ecf20Sopenharmony_ci that are auditing their logs closely may want to set it to a lower 738c2ecf20Sopenharmony_ci priority. 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci Note: This does not affect what message level gets printed on the console 768c2ecf20Sopenharmony_ci by default. To change that, use loglevel=<x> in the kernel bootargs, 778c2ecf20Sopenharmony_ci or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value. 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciconfig BOOT_PRINTK_DELAY 808c2ecf20Sopenharmony_ci bool "Delay each boot printk message by N milliseconds" 818c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY 828c2ecf20Sopenharmony_ci help 838c2ecf20Sopenharmony_ci This build option allows you to read kernel boot messages 848c2ecf20Sopenharmony_ci by inserting a short delay after each one. The delay is 858c2ecf20Sopenharmony_ci specified in milliseconds on the kernel command line, 868c2ecf20Sopenharmony_ci using "boot_delay=N". 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci It is likely that you would also need to use "lpj=M" to preset 898c2ecf20Sopenharmony_ci the "loops per jiffie" value. 908c2ecf20Sopenharmony_ci See a previous boot log for the "lpj" value to use for your 918c2ecf20Sopenharmony_ci system, and then set "lpj=M" before setting "boot_delay=N". 928c2ecf20Sopenharmony_ci NOTE: Using this option may adversely affect SMP systems. 938c2ecf20Sopenharmony_ci I.e., processors other than the first one may not boot up. 948c2ecf20Sopenharmony_ci BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect 958c2ecf20Sopenharmony_ci what it believes to be lockup conditions. 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ciconfig DYNAMIC_DEBUG 988c2ecf20Sopenharmony_ci bool "Enable dynamic printk() support" 998c2ecf20Sopenharmony_ci default n 1008c2ecf20Sopenharmony_ci depends on PRINTK 1018c2ecf20Sopenharmony_ci depends on (DEBUG_FS || PROC_FS) 1028c2ecf20Sopenharmony_ci select DYNAMIC_DEBUG_CORE 1038c2ecf20Sopenharmony_ci help 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci Compiles debug level messages into the kernel, which would not 1068c2ecf20Sopenharmony_ci otherwise be available at runtime. These messages can then be 1078c2ecf20Sopenharmony_ci enabled/disabled based on various levels of scope - per source file, 1088c2ecf20Sopenharmony_ci function, module, format string, and line number. This mechanism 1098c2ecf20Sopenharmony_ci implicitly compiles in all pr_debug() and dev_dbg() calls, which 1108c2ecf20Sopenharmony_ci enlarges the kernel text size by about 2%. 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci If a source file is compiled with DEBUG flag set, any 1138c2ecf20Sopenharmony_ci pr_debug() calls in it are enabled by default, but can be 1148c2ecf20Sopenharmony_ci disabled at runtime as below. Note that DEBUG flag is 1158c2ecf20Sopenharmony_ci turned on by many CONFIG_*DEBUG* options. 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ci Usage: 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci Dynamic debugging is controlled via the 'dynamic_debug/control' file, 1208c2ecf20Sopenharmony_ci which is contained in the 'debugfs' filesystem or procfs. 1218c2ecf20Sopenharmony_ci Thus, the debugfs or procfs filesystem must first be mounted before 1228c2ecf20Sopenharmony_ci making use of this feature. 1238c2ecf20Sopenharmony_ci We refer the control file as: <debugfs>/dynamic_debug/control. This 1248c2ecf20Sopenharmony_ci file contains a list of the debug statements that can be enabled. The 1258c2ecf20Sopenharmony_ci format for each line of the file is: 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci filename:lineno [module]function flags format 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci filename : source file of the debug statement 1308c2ecf20Sopenharmony_ci lineno : line number of the debug statement 1318c2ecf20Sopenharmony_ci module : module that contains the debug statement 1328c2ecf20Sopenharmony_ci function : function that contains the debug statement 1338c2ecf20Sopenharmony_ci flags : '=p' means the line is turned 'on' for printing 1348c2ecf20Sopenharmony_ci format : the format used for the debug statement 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci From a live system: 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ci nullarbor:~ # cat <debugfs>/dynamic_debug/control 1398c2ecf20Sopenharmony_ci # filename:lineno [module]function flags format 1408c2ecf20Sopenharmony_ci fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012" 1418c2ecf20Sopenharmony_ci fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012" 1428c2ecf20Sopenharmony_ci fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012" 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci Example usage: 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci // enable the message at line 1603 of file svcsock.c 1478c2ecf20Sopenharmony_ci nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' > 1488c2ecf20Sopenharmony_ci <debugfs>/dynamic_debug/control 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci // enable all the messages in file svcsock.c 1518c2ecf20Sopenharmony_ci nullarbor:~ # echo -n 'file svcsock.c +p' > 1528c2ecf20Sopenharmony_ci <debugfs>/dynamic_debug/control 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci // enable all the messages in the NFS server module 1558c2ecf20Sopenharmony_ci nullarbor:~ # echo -n 'module nfsd +p' > 1568c2ecf20Sopenharmony_ci <debugfs>/dynamic_debug/control 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci // enable all 12 messages in the function svc_process() 1598c2ecf20Sopenharmony_ci nullarbor:~ # echo -n 'func svc_process +p' > 1608c2ecf20Sopenharmony_ci <debugfs>/dynamic_debug/control 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_ci // disable all 12 messages in the function svc_process() 1638c2ecf20Sopenharmony_ci nullarbor:~ # echo -n 'func svc_process -p' > 1648c2ecf20Sopenharmony_ci <debugfs>/dynamic_debug/control 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci See Documentation/admin-guide/dynamic-debug-howto.rst for additional 1678c2ecf20Sopenharmony_ci information. 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ciconfig DYNAMIC_DEBUG_CORE 1708c2ecf20Sopenharmony_ci bool "Enable core function of dynamic debug support" 1718c2ecf20Sopenharmony_ci depends on PRINTK 1728c2ecf20Sopenharmony_ci depends on (DEBUG_FS || PROC_FS) 1738c2ecf20Sopenharmony_ci help 1748c2ecf20Sopenharmony_ci Enable core functional support of dynamic debug. It is useful 1758c2ecf20Sopenharmony_ci when you want to tie dynamic debug to your kernel modules with 1768c2ecf20Sopenharmony_ci DYNAMIC_DEBUG_MODULE defined for each of them, especially for 1778c2ecf20Sopenharmony_ci the case of embedded system where the kernel image size is 1788c2ecf20Sopenharmony_ci sensitive for people. 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_ciconfig SYMBOLIC_ERRNAME 1818c2ecf20Sopenharmony_ci bool "Support symbolic error names in printf" 1828c2ecf20Sopenharmony_ci default y if PRINTK 1838c2ecf20Sopenharmony_ci help 1848c2ecf20Sopenharmony_ci If you say Y here, the kernel's printf implementation will 1858c2ecf20Sopenharmony_ci be able to print symbolic error names such as ENOSPC instead 1868c2ecf20Sopenharmony_ci of the number 28. It makes the kernel image slightly larger 1878c2ecf20Sopenharmony_ci (about 3KB), but can make the kernel logs easier to read. 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ciconfig DEBUG_BUGVERBOSE 1908c2ecf20Sopenharmony_ci bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT 1918c2ecf20Sopenharmony_ci depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE) 1928c2ecf20Sopenharmony_ci default y 1938c2ecf20Sopenharmony_ci help 1948c2ecf20Sopenharmony_ci Say Y here to make BUG() panics output the file name and line number 1958c2ecf20Sopenharmony_ci of the BUG call as well as the EIP and oops trace. This aids 1968c2ecf20Sopenharmony_ci debugging but costs about 70-100K of memory. 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ciendmenu # "printk and dmesg options" 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_cimenu "Compile-time checks and compiler options" 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ciconfig DEBUG_INFO 2038c2ecf20Sopenharmony_ci bool "Compile the kernel with debug info" 2048c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && !COMPILE_TEST 2058c2ecf20Sopenharmony_ci help 2068c2ecf20Sopenharmony_ci If you say Y here the resulting kernel image will include 2078c2ecf20Sopenharmony_ci debugging info resulting in a larger kernel image. 2088c2ecf20Sopenharmony_ci This adds debug symbols to the kernel and modules (gcc -g), and 2098c2ecf20Sopenharmony_ci is needed if you intend to use kernel crashdump or binary object 2108c2ecf20Sopenharmony_ci tools like crash, kgdb, LKCD, gdb, etc on the kernel. 2118c2ecf20Sopenharmony_ci Say Y here only if you plan to debug the kernel. 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci If unsure, say N. 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ciif DEBUG_INFO 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ciconfig DEBUG_INFO_REDUCED 2188c2ecf20Sopenharmony_ci bool "Reduce debugging information" 2198c2ecf20Sopenharmony_ci help 2208c2ecf20Sopenharmony_ci If you say Y here gcc is instructed to generate less debugging 2218c2ecf20Sopenharmony_ci information for structure types. This means that tools that 2228c2ecf20Sopenharmony_ci need full debugging information (like kgdb or systemtap) won't 2238c2ecf20Sopenharmony_ci be happy. But if you merely need debugging information to 2248c2ecf20Sopenharmony_ci resolve line numbers there is no loss. Advantage is that 2258c2ecf20Sopenharmony_ci build directory object sizes shrink dramatically over a full 2268c2ecf20Sopenharmony_ci DEBUG_INFO build and compile times are reduced too. 2278c2ecf20Sopenharmony_ci Only works with newer gcc versions. 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ciconfig DEBUG_INFO_COMPRESSED 2308c2ecf20Sopenharmony_ci bool "Compressed debugging information" 2318c2ecf20Sopenharmony_ci depends on $(cc-option,-gz=zlib) 2328c2ecf20Sopenharmony_ci depends on $(ld-option,--compress-debug-sections=zlib) 2338c2ecf20Sopenharmony_ci help 2348c2ecf20Sopenharmony_ci Compress the debug information using zlib. Requires GCC 5.0+ or Clang 2358c2ecf20Sopenharmony_ci 5.0+, binutils 2.26+, and zlib. 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_ci Users of dpkg-deb via scripts/package/builddeb may find an increase in 2388c2ecf20Sopenharmony_ci size of their debug .deb packages with this config set, due to the 2398c2ecf20Sopenharmony_ci debug info being compressed with zlib, then the object files being 2408c2ecf20Sopenharmony_ci recompressed with a different compression scheme. But this is still 2418c2ecf20Sopenharmony_ci preferable to setting $KDEB_COMPRESS to "none" which would be even 2428c2ecf20Sopenharmony_ci larger. 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ciconfig DEBUG_INFO_SPLIT 2458c2ecf20Sopenharmony_ci bool "Produce split debuginfo in .dwo files" 2468c2ecf20Sopenharmony_ci depends on $(cc-option,-gsplit-dwarf) 2478c2ecf20Sopenharmony_ci help 2488c2ecf20Sopenharmony_ci Generate debug info into separate .dwo files. This significantly 2498c2ecf20Sopenharmony_ci reduces the build directory size for builds with DEBUG_INFO, 2508c2ecf20Sopenharmony_ci because it stores the information only once on disk in .dwo 2518c2ecf20Sopenharmony_ci files instead of multiple times in object files and executables. 2528c2ecf20Sopenharmony_ci In addition the debug information is also compressed. 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci Requires recent gcc (4.7+) and recent gdb/binutils. 2558c2ecf20Sopenharmony_ci Any tool that packages or reads debug information would need 2568c2ecf20Sopenharmony_ci to know about the .dwo files and include them. 2578c2ecf20Sopenharmony_ci Incompatible with older versions of ccache. 2588c2ecf20Sopenharmony_ci 2598c2ecf20Sopenharmony_ciconfig DEBUG_INFO_DWARF4 2608c2ecf20Sopenharmony_ci bool "Generate dwarf4 debuginfo" 2618c2ecf20Sopenharmony_ci depends on $(cc-option,-gdwarf-4) 2628c2ecf20Sopenharmony_ci help 2638c2ecf20Sopenharmony_ci Generate dwarf4 debug info. This requires recent versions 2648c2ecf20Sopenharmony_ci of gcc and gdb. It makes the debug information larger. 2658c2ecf20Sopenharmony_ci But it significantly improves the success of resolving 2668c2ecf20Sopenharmony_ci variables in gdb on optimized code. 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ciconfig DEBUG_INFO_BTF 2698c2ecf20Sopenharmony_ci bool "Generate BTF typeinfo" 2708c2ecf20Sopenharmony_ci depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED 2718c2ecf20Sopenharmony_ci depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST 2728c2ecf20Sopenharmony_ci help 2738c2ecf20Sopenharmony_ci Generate deduplicated BTF type information from DWARF debug info. 2748c2ecf20Sopenharmony_ci Turning this on expects presence of pahole tool, which will convert 2758c2ecf20Sopenharmony_ci DWARF type info into equivalent deduplicated BTF type info. 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ciconfig GDB_SCRIPTS 2788c2ecf20Sopenharmony_ci bool "Provide GDB scripts for kernel debugging" 2798c2ecf20Sopenharmony_ci help 2808c2ecf20Sopenharmony_ci This creates the required links to GDB helper scripts in the 2818c2ecf20Sopenharmony_ci build directory. If you load vmlinux into gdb, the helper 2828c2ecf20Sopenharmony_ci scripts will be automatically imported by gdb as well, and 2838c2ecf20Sopenharmony_ci additional functions are available to analyze a Linux kernel 2848c2ecf20Sopenharmony_ci instance. See Documentation/dev-tools/gdb-kernel-debugging.rst 2858c2ecf20Sopenharmony_ci for further details. 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ciendif # DEBUG_INFO 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ciconfig ENABLE_MUST_CHECK 2908c2ecf20Sopenharmony_ci bool "Enable __must_check logic" 2918c2ecf20Sopenharmony_ci default y 2928c2ecf20Sopenharmony_ci help 2938c2ecf20Sopenharmony_ci Enable the __must_check logic in the kernel build. Disable this to 2948c2ecf20Sopenharmony_ci suppress the "warning: ignoring return value of 'foo', declared with 2958c2ecf20Sopenharmony_ci attribute warn_unused_result" messages. 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ciconfig FRAME_WARN 2988c2ecf20Sopenharmony_ci int "Warn for stack frames larger than" 2998c2ecf20Sopenharmony_ci range 0 8192 3008c2ecf20Sopenharmony_ci default 2048 if GCC_PLUGIN_LATENT_ENTROPY 3018c2ecf20Sopenharmony_ci default 2048 if PARISC 3028c2ecf20Sopenharmony_ci default 1536 if (!64BIT && XTENSA) 3038c2ecf20Sopenharmony_ci default 1280 if KASAN && !64BIT 3048c2ecf20Sopenharmony_ci default 1024 if !64BIT 3058c2ecf20Sopenharmony_ci default 2048 if 64BIT 3068c2ecf20Sopenharmony_ci help 3078c2ecf20Sopenharmony_ci Tell gcc to warn at build time for stack frames larger than this. 3088c2ecf20Sopenharmony_ci Setting this too low will cause a lot of warnings. 3098c2ecf20Sopenharmony_ci Setting it to 0 disables the warning. 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_ciconfig STRIP_ASM_SYMS 3128c2ecf20Sopenharmony_ci bool "Strip assembler-generated symbols during link" 3138c2ecf20Sopenharmony_ci default n 3148c2ecf20Sopenharmony_ci help 3158c2ecf20Sopenharmony_ci Strip internal assembler-generated symbols during a link (symbols 3168c2ecf20Sopenharmony_ci that look like '.Lxxx') so they don't pollute the output of 3178c2ecf20Sopenharmony_ci get_wchan() and suchlike. 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ciconfig READABLE_ASM 3208c2ecf20Sopenharmony_ci bool "Generate readable assembler code" 3218c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 3228c2ecf20Sopenharmony_ci help 3238c2ecf20Sopenharmony_ci Disable some compiler optimizations that tend to generate human unreadable 3248c2ecf20Sopenharmony_ci assembler output. This may make the kernel slightly slower, but it helps 3258c2ecf20Sopenharmony_ci to keep kernel developers who have to stare a lot at assembler listings 3268c2ecf20Sopenharmony_ci sane. 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ciconfig HEADERS_INSTALL 3298c2ecf20Sopenharmony_ci bool "Install uapi headers to usr/include" 3308c2ecf20Sopenharmony_ci depends on !UML 3318c2ecf20Sopenharmony_ci help 3328c2ecf20Sopenharmony_ci This option will install uapi headers (headers exported to user-space) 3338c2ecf20Sopenharmony_ci into the usr/include directory for use during the kernel build. 3348c2ecf20Sopenharmony_ci This is unneeded for building the kernel itself, but needed for some 3358c2ecf20Sopenharmony_ci user-space program samples. It is also needed by some features such 3368c2ecf20Sopenharmony_ci as uapi header sanity checks. 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_ciconfig DEBUG_SECTION_MISMATCH 3398c2ecf20Sopenharmony_ci bool "Enable full Section mismatch analysis" 3408c2ecf20Sopenharmony_ci help 3418c2ecf20Sopenharmony_ci The section mismatch analysis checks if there are illegal 3428c2ecf20Sopenharmony_ci references from one section to another section. 3438c2ecf20Sopenharmony_ci During linktime or runtime, some sections are dropped; 3448c2ecf20Sopenharmony_ci any use of code/data previously in these sections would 3458c2ecf20Sopenharmony_ci most likely result in an oops. 3468c2ecf20Sopenharmony_ci In the code, functions and variables are annotated with 3478c2ecf20Sopenharmony_ci __init,, etc. (see the full list in include/linux/init.h), 3488c2ecf20Sopenharmony_ci which results in the code/data being placed in specific sections. 3498c2ecf20Sopenharmony_ci The section mismatch analysis is always performed after a full 3508c2ecf20Sopenharmony_ci kernel build, and enabling this option causes the following 3518c2ecf20Sopenharmony_ci additional step to occur: 3528c2ecf20Sopenharmony_ci - Add the option -fno-inline-functions-called-once to gcc commands. 3538c2ecf20Sopenharmony_ci When inlining a function annotated with __init in a non-init 3548c2ecf20Sopenharmony_ci function, we would lose the section information and thus 3558c2ecf20Sopenharmony_ci the analysis would not catch the illegal reference. 3568c2ecf20Sopenharmony_ci This option tells gcc to inline less (but it does result in 3578c2ecf20Sopenharmony_ci a larger kernel). 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ciconfig SECTION_MISMATCH_WARN_ONLY 3608c2ecf20Sopenharmony_ci bool "Make section mismatch errors non-fatal" 3618c2ecf20Sopenharmony_ci default y 3628c2ecf20Sopenharmony_ci help 3638c2ecf20Sopenharmony_ci If you say N here, the build process will fail if there are any 3648c2ecf20Sopenharmony_ci section mismatch, instead of just throwing warnings. 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ci If unsure, say Y. 3678c2ecf20Sopenharmony_ci 3688c2ecf20Sopenharmony_ciconfig DEBUG_FORCE_FUNCTION_ALIGN_32B 3698c2ecf20Sopenharmony_ci bool "Force all function address 32B aligned" if EXPERT 3708c2ecf20Sopenharmony_ci help 3718c2ecf20Sopenharmony_ci There are cases that a commit from one domain changes the function 3728c2ecf20Sopenharmony_ci address alignment of other domains, and cause magic performance 3738c2ecf20Sopenharmony_ci bump (regression or improvement). Enable this option will help to 3748c2ecf20Sopenharmony_ci verify if the bump is caused by function alignment changes, while 3758c2ecf20Sopenharmony_ci it will slightly increase the kernel size and affect icache usage. 3768c2ecf20Sopenharmony_ci 3778c2ecf20Sopenharmony_ci It is mainly for debug and performance tuning use. 3788c2ecf20Sopenharmony_ci 3798c2ecf20Sopenharmony_ci# 3808c2ecf20Sopenharmony_ci# Select this config option from the architecture Kconfig, if it 3818c2ecf20Sopenharmony_ci# is preferred to always offer frame pointers as a config 3828c2ecf20Sopenharmony_ci# option on the architecture (regardless of KERNEL_DEBUG): 3838c2ecf20Sopenharmony_ci# 3848c2ecf20Sopenharmony_ciconfig ARCH_WANT_FRAME_POINTERS 3858c2ecf20Sopenharmony_ci bool 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_ciconfig FRAME_POINTER 3888c2ecf20Sopenharmony_ci bool "Compile the kernel with frame pointers" 3898c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS 3908c2ecf20Sopenharmony_ci default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS 3918c2ecf20Sopenharmony_ci help 3928c2ecf20Sopenharmony_ci If you say Y here the resulting kernel image will be slightly 3938c2ecf20Sopenharmony_ci larger and slower, but it gives very useful debugging information 3948c2ecf20Sopenharmony_ci in case of kernel bugs. (precise oopses/stacktraces/warnings) 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ciconfig STACK_VALIDATION 3978c2ecf20Sopenharmony_ci bool "Compile-time stack metadata validation" 3988c2ecf20Sopenharmony_ci depends on HAVE_STACK_VALIDATION 3998c2ecf20Sopenharmony_ci default n 4008c2ecf20Sopenharmony_ci help 4018c2ecf20Sopenharmony_ci Add compile-time checks to validate stack metadata, including frame 4028c2ecf20Sopenharmony_ci pointers (if CONFIG_FRAME_POINTER is enabled). This helps ensure 4038c2ecf20Sopenharmony_ci that runtime stack traces are more reliable. 4048c2ecf20Sopenharmony_ci 4058c2ecf20Sopenharmony_ci This is also a prerequisite for generation of ORC unwind data, which 4068c2ecf20Sopenharmony_ci is needed for CONFIG_UNWINDER_ORC. 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_ci For more information, see 4098c2ecf20Sopenharmony_ci tools/objtool/Documentation/stack-validation.txt. 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ciconfig VMLINUX_VALIDATION 4128c2ecf20Sopenharmony_ci bool 4138c2ecf20Sopenharmony_ci depends on STACK_VALIDATION && DEBUG_ENTRY && !PARAVIRT 4148c2ecf20Sopenharmony_ci default y 4158c2ecf20Sopenharmony_ci 4168c2ecf20Sopenharmony_ciconfig DEBUG_FORCE_WEAK_PER_CPU 4178c2ecf20Sopenharmony_ci bool "Force weak per-cpu definitions" 4188c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 4198c2ecf20Sopenharmony_ci help 4208c2ecf20Sopenharmony_ci s390 and alpha require percpu variables in modules to be 4218c2ecf20Sopenharmony_ci defined weak to work around addressing range issue which 4228c2ecf20Sopenharmony_ci puts the following two restrictions on percpu variable 4238c2ecf20Sopenharmony_ci definitions. 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci 1. percpu symbols must be unique whether static or not 4268c2ecf20Sopenharmony_ci 2. percpu variables can't be defined inside a function 4278c2ecf20Sopenharmony_ci 4288c2ecf20Sopenharmony_ci To ensure that generic code follows the above rules, this 4298c2ecf20Sopenharmony_ci option forces all percpu variables to be defined as weak. 4308c2ecf20Sopenharmony_ci 4318c2ecf20Sopenharmony_ciendmenu # "Compiler options" 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_cimenu "Generic Kernel Debugging Instruments" 4348c2ecf20Sopenharmony_ci 4358c2ecf20Sopenharmony_ciconfig MAGIC_SYSRQ 4368c2ecf20Sopenharmony_ci bool "Magic SysRq key" 4378c2ecf20Sopenharmony_ci depends on !UML 4388c2ecf20Sopenharmony_ci help 4398c2ecf20Sopenharmony_ci If you say Y here, you will have some control over the system even 4408c2ecf20Sopenharmony_ci if the system crashes for example during kernel debugging (e.g., you 4418c2ecf20Sopenharmony_ci will be able to flush the buffer cache to disk, reboot the system 4428c2ecf20Sopenharmony_ci immediately or dump some status information). This is accomplished 4438c2ecf20Sopenharmony_ci by pressing various keys while holding SysRq (Alt+PrintScreen). It 4448c2ecf20Sopenharmony_ci also works on a serial console (on PC hardware at least), if you 4458c2ecf20Sopenharmony_ci send a BREAK and then within 5 seconds a command keypress. The 4468c2ecf20Sopenharmony_ci keys are documented in <file:Documentation/admin-guide/sysrq.rst>. 4478c2ecf20Sopenharmony_ci Don't say Y unless you really know what this hack does. 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ciconfig MAGIC_SYSRQ_DEFAULT_ENABLE 4508c2ecf20Sopenharmony_ci hex "Enable magic SysRq key functions by default" 4518c2ecf20Sopenharmony_ci depends on MAGIC_SYSRQ 4528c2ecf20Sopenharmony_ci default 0x1 4538c2ecf20Sopenharmony_ci help 4548c2ecf20Sopenharmony_ci Specifies which SysRq key functions are enabled by default. 4558c2ecf20Sopenharmony_ci This may be set to 1 or 0 to enable or disable them all, or 4568c2ecf20Sopenharmony_ci to a bitmask as described in Documentation/admin-guide/sysrq.rst. 4578c2ecf20Sopenharmony_ci 4588c2ecf20Sopenharmony_ciconfig MAGIC_SYSRQ_SERIAL 4598c2ecf20Sopenharmony_ci bool "Enable magic SysRq key over serial" 4608c2ecf20Sopenharmony_ci depends on MAGIC_SYSRQ 4618c2ecf20Sopenharmony_ci default y 4628c2ecf20Sopenharmony_ci help 4638c2ecf20Sopenharmony_ci Many embedded boards have a disconnected TTL level serial which can 4648c2ecf20Sopenharmony_ci generate some garbage that can lead to spurious false sysrq detects. 4658c2ecf20Sopenharmony_ci This option allows you to decide whether you want to enable the 4668c2ecf20Sopenharmony_ci magic SysRq key. 4678c2ecf20Sopenharmony_ci 4688c2ecf20Sopenharmony_ciconfig MAGIC_SYSRQ_SERIAL_SEQUENCE 4698c2ecf20Sopenharmony_ci string "Char sequence that enables magic SysRq over serial" 4708c2ecf20Sopenharmony_ci depends on MAGIC_SYSRQ_SERIAL 4718c2ecf20Sopenharmony_ci default "" 4728c2ecf20Sopenharmony_ci help 4738c2ecf20Sopenharmony_ci Specifies a sequence of characters that can follow BREAK to enable 4748c2ecf20Sopenharmony_ci SysRq on a serial console. 4758c2ecf20Sopenharmony_ci 4768c2ecf20Sopenharmony_ci If unsure, leave an empty string and the option will not be enabled. 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_ciconfig DEBUG_FS 4798c2ecf20Sopenharmony_ci bool "Debug Filesystem" 4808c2ecf20Sopenharmony_ci help 4818c2ecf20Sopenharmony_ci debugfs is a virtual file system that kernel developers use to put 4828c2ecf20Sopenharmony_ci debugging files into. Enable this option to be able to read and 4838c2ecf20Sopenharmony_ci write to these files. 4848c2ecf20Sopenharmony_ci 4858c2ecf20Sopenharmony_ci For detailed documentation on the debugfs API, see 4868c2ecf20Sopenharmony_ci Documentation/filesystems/. 4878c2ecf20Sopenharmony_ci 4888c2ecf20Sopenharmony_ci If unsure, say N. 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_cichoice 4918c2ecf20Sopenharmony_ci prompt "Debugfs default access" 4928c2ecf20Sopenharmony_ci depends on DEBUG_FS 4938c2ecf20Sopenharmony_ci default DEBUG_FS_ALLOW_ALL 4948c2ecf20Sopenharmony_ci help 4958c2ecf20Sopenharmony_ci This selects the default access restrictions for debugfs. 4968c2ecf20Sopenharmony_ci It can be overridden with kernel command line option 4978c2ecf20Sopenharmony_ci debugfs=[on,no-mount,off]. The restrictions apply for API access 4988c2ecf20Sopenharmony_ci and filesystem registration. 4998c2ecf20Sopenharmony_ci 5008c2ecf20Sopenharmony_ciconfig DEBUG_FS_ALLOW_ALL 5018c2ecf20Sopenharmony_ci bool "Access normal" 5028c2ecf20Sopenharmony_ci help 5038c2ecf20Sopenharmony_ci No restrictions apply. Both API and filesystem registration 5048c2ecf20Sopenharmony_ci is on. This is the normal default operation. 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_ciconfig DEBUG_FS_DISALLOW_MOUNT 5078c2ecf20Sopenharmony_ci bool "Do not register debugfs as filesystem" 5088c2ecf20Sopenharmony_ci help 5098c2ecf20Sopenharmony_ci The API is open but filesystem is not loaded. Clients can still do 5108c2ecf20Sopenharmony_ci their work and read with debug tools that do not need 5118c2ecf20Sopenharmony_ci debugfs filesystem. 5128c2ecf20Sopenharmony_ci 5138c2ecf20Sopenharmony_ciconfig DEBUG_FS_ALLOW_NONE 5148c2ecf20Sopenharmony_ci bool "No access" 5158c2ecf20Sopenharmony_ci help 5168c2ecf20Sopenharmony_ci Access is off. Clients get -PERM when trying to create nodes in 5178c2ecf20Sopenharmony_ci debugfs tree and debugfs is not registered as a filesystem. 5188c2ecf20Sopenharmony_ci Client can then back-off or continue without debugfs access. 5198c2ecf20Sopenharmony_ci 5208c2ecf20Sopenharmony_ciendchoice 5218c2ecf20Sopenharmony_ci 5228c2ecf20Sopenharmony_cisource "lib/Kconfig.kgdb" 5238c2ecf20Sopenharmony_cisource "lib/Kconfig.ubsan" 5248c2ecf20Sopenharmony_cisource "lib/Kconfig.kcsan" 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ciendmenu 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ciconfig DEBUG_KERNEL 5298c2ecf20Sopenharmony_ci bool "Kernel debugging" 5308c2ecf20Sopenharmony_ci help 5318c2ecf20Sopenharmony_ci Say Y here if you are developing drivers or trying to debug and 5328c2ecf20Sopenharmony_ci identify kernel problems. 5338c2ecf20Sopenharmony_ci 5348c2ecf20Sopenharmony_ciconfig DEBUG_MISC 5358c2ecf20Sopenharmony_ci bool "Miscellaneous debug code" 5368c2ecf20Sopenharmony_ci default DEBUG_KERNEL 5378c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 5388c2ecf20Sopenharmony_ci help 5398c2ecf20Sopenharmony_ci Say Y here if you need to enable miscellaneous debug code that should 5408c2ecf20Sopenharmony_ci be under a more specific debug option but isn't. 5418c2ecf20Sopenharmony_ci 5428c2ecf20Sopenharmony_ci 5438c2ecf20Sopenharmony_cimenu "Memory Debugging" 5448c2ecf20Sopenharmony_ci 5458c2ecf20Sopenharmony_cisource "mm/Kconfig.debug" 5468c2ecf20Sopenharmony_ci 5478c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS 5488c2ecf20Sopenharmony_ci bool "Debug object operations" 5498c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 5508c2ecf20Sopenharmony_ci help 5518c2ecf20Sopenharmony_ci If you say Y here, additional code will be inserted into the 5528c2ecf20Sopenharmony_ci kernel to track the life time of various objects and validate 5538c2ecf20Sopenharmony_ci the operations on those objects. 5548c2ecf20Sopenharmony_ci 5558c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_SELFTEST 5568c2ecf20Sopenharmony_ci bool "Debug objects selftest" 5578c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5588c2ecf20Sopenharmony_ci help 5598c2ecf20Sopenharmony_ci This enables the selftest of the object debug code. 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_FREE 5628c2ecf20Sopenharmony_ci bool "Debug objects in freed memory" 5638c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5648c2ecf20Sopenharmony_ci help 5658c2ecf20Sopenharmony_ci This enables checks whether a k/v free operation frees an area 5668c2ecf20Sopenharmony_ci which contains an object which has not been deactivated 5678c2ecf20Sopenharmony_ci properly. This can make kmalloc/kfree-intensive workloads 5688c2ecf20Sopenharmony_ci much slower. 5698c2ecf20Sopenharmony_ci 5708c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_TIMERS 5718c2ecf20Sopenharmony_ci bool "Debug timer objects" 5728c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5738c2ecf20Sopenharmony_ci help 5748c2ecf20Sopenharmony_ci If you say Y here, additional code will be inserted into the 5758c2ecf20Sopenharmony_ci timer routines to track the life time of timer objects and 5768c2ecf20Sopenharmony_ci validate the timer operations. 5778c2ecf20Sopenharmony_ci 5788c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_WORK 5798c2ecf20Sopenharmony_ci bool "Debug work objects" 5808c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5818c2ecf20Sopenharmony_ci help 5828c2ecf20Sopenharmony_ci If you say Y here, additional code will be inserted into the 5838c2ecf20Sopenharmony_ci work queue routines to track the life time of work objects and 5848c2ecf20Sopenharmony_ci validate the work operations. 5858c2ecf20Sopenharmony_ci 5868c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_RCU_HEAD 5878c2ecf20Sopenharmony_ci bool "Debug RCU callbacks objects" 5888c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5898c2ecf20Sopenharmony_ci help 5908c2ecf20Sopenharmony_ci Enable this to turn on debugging of RCU list heads (call_rcu() usage). 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_PERCPU_COUNTER 5938c2ecf20Sopenharmony_ci bool "Debug percpu counter objects" 5948c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 5958c2ecf20Sopenharmony_ci help 5968c2ecf20Sopenharmony_ci If you say Y here, additional code will be inserted into the 5978c2ecf20Sopenharmony_ci percpu counter routines to track the life time of percpu counter 5988c2ecf20Sopenharmony_ci objects and validate the percpu counter operations. 5998c2ecf20Sopenharmony_ci 6008c2ecf20Sopenharmony_ciconfig DEBUG_OBJECTS_ENABLE_DEFAULT 6018c2ecf20Sopenharmony_ci int "debug_objects bootup default value (0-1)" 6028c2ecf20Sopenharmony_ci range 0 1 6038c2ecf20Sopenharmony_ci default "1" 6048c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS 6058c2ecf20Sopenharmony_ci help 6068c2ecf20Sopenharmony_ci Debug objects boot parameter default value 6078c2ecf20Sopenharmony_ci 6088c2ecf20Sopenharmony_ciconfig DEBUG_SLAB 6098c2ecf20Sopenharmony_ci bool "Debug slab memory allocations" 6108c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && SLAB 6118c2ecf20Sopenharmony_ci help 6128c2ecf20Sopenharmony_ci Say Y here to have the kernel do limited verification on memory 6138c2ecf20Sopenharmony_ci allocation as well as poisoning memory on free to catch use of freed 6148c2ecf20Sopenharmony_ci memory. This can make kmalloc/kfree-intensive workloads much slower. 6158c2ecf20Sopenharmony_ci 6168c2ecf20Sopenharmony_ciconfig SLUB_DEBUG_ON 6178c2ecf20Sopenharmony_ci bool "SLUB debugging on by default" 6188c2ecf20Sopenharmony_ci depends on SLUB && SLUB_DEBUG 6198c2ecf20Sopenharmony_ci default n 6208c2ecf20Sopenharmony_ci help 6218c2ecf20Sopenharmony_ci Boot with debugging on by default. SLUB boots by default with 6228c2ecf20Sopenharmony_ci the runtime debug capabilities switched off. Enabling this is 6238c2ecf20Sopenharmony_ci equivalent to specifying the "slub_debug" parameter on boot. 6248c2ecf20Sopenharmony_ci There is no support for more fine grained debug control like 6258c2ecf20Sopenharmony_ci possible with slub_debug=xxx. SLUB debugging may be switched 6268c2ecf20Sopenharmony_ci off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying 6278c2ecf20Sopenharmony_ci "slub_debug=-". 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ciconfig SLUB_STATS 6308c2ecf20Sopenharmony_ci default n 6318c2ecf20Sopenharmony_ci bool "Enable SLUB performance statistics" 6328c2ecf20Sopenharmony_ci depends on SLUB && SYSFS 6338c2ecf20Sopenharmony_ci help 6348c2ecf20Sopenharmony_ci SLUB statistics are useful to debug SLUBs allocation behavior in 6358c2ecf20Sopenharmony_ci order find ways to optimize the allocator. This should never be 6368c2ecf20Sopenharmony_ci enabled for production use since keeping statistics slows down 6378c2ecf20Sopenharmony_ci the allocator by a few percentage points. The slabinfo command 6388c2ecf20Sopenharmony_ci supports the determination of the most active slabs to figure 6398c2ecf20Sopenharmony_ci out which slabs are relevant to a particular load. 6408c2ecf20Sopenharmony_ci Try running: slabinfo -DA 6418c2ecf20Sopenharmony_ci 6428c2ecf20Sopenharmony_ciconfig HAVE_DEBUG_KMEMLEAK 6438c2ecf20Sopenharmony_ci bool 6448c2ecf20Sopenharmony_ci 6458c2ecf20Sopenharmony_ciconfig DEBUG_KMEMLEAK 6468c2ecf20Sopenharmony_ci bool "Kernel memory leak detector" 6478c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK 6488c2ecf20Sopenharmony_ci select DEBUG_FS 6498c2ecf20Sopenharmony_ci select STACKTRACE if STACKTRACE_SUPPORT 6508c2ecf20Sopenharmony_ci select KALLSYMS 6518c2ecf20Sopenharmony_ci select CRC32 6528c2ecf20Sopenharmony_ci help 6538c2ecf20Sopenharmony_ci Say Y here if you want to enable the memory leak 6548c2ecf20Sopenharmony_ci detector. The memory allocation/freeing is traced in a way 6558c2ecf20Sopenharmony_ci similar to the Boehm's conservative garbage collector, the 6568c2ecf20Sopenharmony_ci difference being that the orphan objects are not freed but 6578c2ecf20Sopenharmony_ci only shown in /sys/kernel/debug/kmemleak. Enabling this 6588c2ecf20Sopenharmony_ci feature will introduce an overhead to memory 6598c2ecf20Sopenharmony_ci allocations. See Documentation/dev-tools/kmemleak.rst for more 6608c2ecf20Sopenharmony_ci details. 6618c2ecf20Sopenharmony_ci 6628c2ecf20Sopenharmony_ci Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances 6638c2ecf20Sopenharmony_ci of finding leaks due to the slab objects poisoning. 6648c2ecf20Sopenharmony_ci 6658c2ecf20Sopenharmony_ci In order to access the kmemleak file, debugfs needs to be 6668c2ecf20Sopenharmony_ci mounted (usually at /sys/kernel/debug). 6678c2ecf20Sopenharmony_ci 6688c2ecf20Sopenharmony_ciconfig DEBUG_KMEMLEAK_MEM_POOL_SIZE 6698c2ecf20Sopenharmony_ci int "Kmemleak memory pool size" 6708c2ecf20Sopenharmony_ci depends on DEBUG_KMEMLEAK 6718c2ecf20Sopenharmony_ci range 200 1000000 6728c2ecf20Sopenharmony_ci default 16000 6738c2ecf20Sopenharmony_ci help 6748c2ecf20Sopenharmony_ci Kmemleak must track all the memory allocations to avoid 6758c2ecf20Sopenharmony_ci reporting false positives. Since memory may be allocated or 6768c2ecf20Sopenharmony_ci freed before kmemleak is fully initialised, use a static pool 6778c2ecf20Sopenharmony_ci of metadata objects to track such callbacks. After kmemleak is 6788c2ecf20Sopenharmony_ci fully initialised, this memory pool acts as an emergency one 6798c2ecf20Sopenharmony_ci if slab allocations fail. 6808c2ecf20Sopenharmony_ci 6818c2ecf20Sopenharmony_ciconfig DEBUG_KMEMLEAK_TEST 6828c2ecf20Sopenharmony_ci tristate "Simple test for the kernel memory leak detector" 6838c2ecf20Sopenharmony_ci depends on DEBUG_KMEMLEAK && m 6848c2ecf20Sopenharmony_ci help 6858c2ecf20Sopenharmony_ci This option enables a module that explicitly leaks memory. 6868c2ecf20Sopenharmony_ci 6878c2ecf20Sopenharmony_ci If unsure, say N. 6888c2ecf20Sopenharmony_ci 6898c2ecf20Sopenharmony_ciconfig DEBUG_KMEMLEAK_DEFAULT_OFF 6908c2ecf20Sopenharmony_ci bool "Default kmemleak to off" 6918c2ecf20Sopenharmony_ci depends on DEBUG_KMEMLEAK 6928c2ecf20Sopenharmony_ci help 6938c2ecf20Sopenharmony_ci Say Y here to disable kmemleak by default. It can then be enabled 6948c2ecf20Sopenharmony_ci on the command line via kmemleak=on. 6958c2ecf20Sopenharmony_ci 6968c2ecf20Sopenharmony_ciconfig DEBUG_KMEMLEAK_AUTO_SCAN 6978c2ecf20Sopenharmony_ci bool "Enable kmemleak auto scan thread on boot up" 6988c2ecf20Sopenharmony_ci default y 6998c2ecf20Sopenharmony_ci depends on DEBUG_KMEMLEAK 7008c2ecf20Sopenharmony_ci help 7018c2ecf20Sopenharmony_ci Depending on the cpu, kmemleak scan may be cpu intensive and can 7028c2ecf20Sopenharmony_ci stall user tasks at times. This option enables/disables automatic 7038c2ecf20Sopenharmony_ci kmemleak scan at boot up. 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci Say N here to disable kmemleak auto scan thread to stop automatic 7068c2ecf20Sopenharmony_ci scanning. Disabling this option disables automatic reporting of 7078c2ecf20Sopenharmony_ci memory leaks. 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_ci If unsure, say Y. 7108c2ecf20Sopenharmony_ci 7118c2ecf20Sopenharmony_ciconfig DEBUG_STACK_USAGE 7128c2ecf20Sopenharmony_ci bool "Stack utilization instrumentation" 7138c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && !IA64 7148c2ecf20Sopenharmony_ci help 7158c2ecf20Sopenharmony_ci Enables the display of the minimum amount of free stack which each 7168c2ecf20Sopenharmony_ci task has ever had available in the sysrq-T and sysrq-P debug output. 7178c2ecf20Sopenharmony_ci 7188c2ecf20Sopenharmony_ci This option will slow down process creation somewhat. 7198c2ecf20Sopenharmony_ci 7208c2ecf20Sopenharmony_ciconfig SCHED_STACK_END_CHECK 7218c2ecf20Sopenharmony_ci bool "Detect stack corruption on calls to schedule()" 7228c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 7238c2ecf20Sopenharmony_ci default n 7248c2ecf20Sopenharmony_ci help 7258c2ecf20Sopenharmony_ci This option checks for a stack overrun on calls to schedule(). 7268c2ecf20Sopenharmony_ci If the stack end location is found to be over written always panic as 7278c2ecf20Sopenharmony_ci the content of the corrupted region can no longer be trusted. 7288c2ecf20Sopenharmony_ci This is to ensure no erroneous behaviour occurs which could result in 7298c2ecf20Sopenharmony_ci data corruption or a sporadic crash at a later stage once the region 7308c2ecf20Sopenharmony_ci is examined. The runtime overhead introduced is minimal. 7318c2ecf20Sopenharmony_ci 7328c2ecf20Sopenharmony_ciconfig ARCH_HAS_DEBUG_VM_PGTABLE 7338c2ecf20Sopenharmony_ci bool 7348c2ecf20Sopenharmony_ci help 7358c2ecf20Sopenharmony_ci An architecture should select this when it can successfully 7368c2ecf20Sopenharmony_ci build and run DEBUG_VM_PGTABLE. 7378c2ecf20Sopenharmony_ci 7388c2ecf20Sopenharmony_ciconfig DEBUG_VM 7398c2ecf20Sopenharmony_ci bool "Debug VM" 7408c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 7418c2ecf20Sopenharmony_ci help 7428c2ecf20Sopenharmony_ci Enable this to turn on extended checks in the virtual-memory system 7438c2ecf20Sopenharmony_ci that may impact performance. 7448c2ecf20Sopenharmony_ci 7458c2ecf20Sopenharmony_ci If unsure, say N. 7468c2ecf20Sopenharmony_ci 7478c2ecf20Sopenharmony_ciconfig DEBUG_VM_VMACACHE 7488c2ecf20Sopenharmony_ci bool "Debug VMA caching" 7498c2ecf20Sopenharmony_ci depends on DEBUG_VM 7508c2ecf20Sopenharmony_ci help 7518c2ecf20Sopenharmony_ci Enable this to turn on VMA caching debug information. Doing so 7528c2ecf20Sopenharmony_ci can cause significant overhead, so only enable it in non-production 7538c2ecf20Sopenharmony_ci environments. 7548c2ecf20Sopenharmony_ci 7558c2ecf20Sopenharmony_ci If unsure, say N. 7568c2ecf20Sopenharmony_ci 7578c2ecf20Sopenharmony_ciconfig DEBUG_VM_RB 7588c2ecf20Sopenharmony_ci bool "Debug VM red-black trees" 7598c2ecf20Sopenharmony_ci depends on DEBUG_VM 7608c2ecf20Sopenharmony_ci help 7618c2ecf20Sopenharmony_ci Enable VM red-black tree debugging information and extra validations. 7628c2ecf20Sopenharmony_ci 7638c2ecf20Sopenharmony_ci If unsure, say N. 7648c2ecf20Sopenharmony_ci 7658c2ecf20Sopenharmony_ciconfig DEBUG_VM_PGFLAGS 7668c2ecf20Sopenharmony_ci bool "Debug page-flags operations" 7678c2ecf20Sopenharmony_ci depends on DEBUG_VM 7688c2ecf20Sopenharmony_ci help 7698c2ecf20Sopenharmony_ci Enables extra validation on page flags operations. 7708c2ecf20Sopenharmony_ci 7718c2ecf20Sopenharmony_ci If unsure, say N. 7728c2ecf20Sopenharmony_ci 7738c2ecf20Sopenharmony_ciconfig DEBUG_VM_PGTABLE 7748c2ecf20Sopenharmony_ci bool "Debug arch page table for semantics compliance" 7758c2ecf20Sopenharmony_ci depends on MMU 7768c2ecf20Sopenharmony_ci depends on ARCH_HAS_DEBUG_VM_PGTABLE 7778c2ecf20Sopenharmony_ci default y if DEBUG_VM 7788c2ecf20Sopenharmony_ci help 7798c2ecf20Sopenharmony_ci This option provides a debug method which can be used to test 7808c2ecf20Sopenharmony_ci architecture page table helper functions on various platforms in 7818c2ecf20Sopenharmony_ci verifying if they comply with expected generic MM semantics. This 7828c2ecf20Sopenharmony_ci will help architecture code in making sure that any changes or 7838c2ecf20Sopenharmony_ci new additions of these helpers still conform to expected 7848c2ecf20Sopenharmony_ci semantics of the generic MM. Platforms will have to opt in for 7858c2ecf20Sopenharmony_ci this through ARCH_HAS_DEBUG_VM_PGTABLE. 7868c2ecf20Sopenharmony_ci 7878c2ecf20Sopenharmony_ci If unsure, say N. 7888c2ecf20Sopenharmony_ci 7898c2ecf20Sopenharmony_ciconfig ARCH_HAS_DEBUG_VIRTUAL 7908c2ecf20Sopenharmony_ci bool 7918c2ecf20Sopenharmony_ci 7928c2ecf20Sopenharmony_ciconfig DEBUG_VIRTUAL 7938c2ecf20Sopenharmony_ci bool "Debug VM translations" 7948c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && ARCH_HAS_DEBUG_VIRTUAL 7958c2ecf20Sopenharmony_ci help 7968c2ecf20Sopenharmony_ci Enable some costly sanity checks in virtual to page code. This can 7978c2ecf20Sopenharmony_ci catch mistakes with virt_to_page() and friends. 7988c2ecf20Sopenharmony_ci 7998c2ecf20Sopenharmony_ci If unsure, say N. 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ciconfig DEBUG_NOMMU_REGIONS 8028c2ecf20Sopenharmony_ci bool "Debug the global anon/private NOMMU mapping region tree" 8038c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && !MMU 8048c2ecf20Sopenharmony_ci help 8058c2ecf20Sopenharmony_ci This option causes the global tree of anonymous and private mapping 8068c2ecf20Sopenharmony_ci regions to be regularly checked for invalid topology. 8078c2ecf20Sopenharmony_ci 8088c2ecf20Sopenharmony_ciconfig DEBUG_MEMORY_INIT 8098c2ecf20Sopenharmony_ci bool "Debug memory initialisation" if EXPERT 8108c2ecf20Sopenharmony_ci default !EXPERT 8118c2ecf20Sopenharmony_ci help 8128c2ecf20Sopenharmony_ci Enable this for additional checks during memory initialisation. 8138c2ecf20Sopenharmony_ci The sanity checks verify aspects of the VM such as the memory model 8148c2ecf20Sopenharmony_ci and other information provided by the architecture. Verbose 8158c2ecf20Sopenharmony_ci information will be printed at KERN_DEBUG loglevel depending 8168c2ecf20Sopenharmony_ci on the mminit_loglevel= command-line option. 8178c2ecf20Sopenharmony_ci 8188c2ecf20Sopenharmony_ci If unsure, say Y 8198c2ecf20Sopenharmony_ci 8208c2ecf20Sopenharmony_ciconfig MEMORY_NOTIFIER_ERROR_INJECT 8218c2ecf20Sopenharmony_ci tristate "Memory hotplug notifier error injection module" 8228c2ecf20Sopenharmony_ci depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION 8238c2ecf20Sopenharmony_ci help 8248c2ecf20Sopenharmony_ci This option provides the ability to inject artificial errors to 8258c2ecf20Sopenharmony_ci memory hotplug notifier chain callbacks. It is controlled through 8268c2ecf20Sopenharmony_ci debugfs interface under /sys/kernel/debug/notifier-error-inject/memory 8278c2ecf20Sopenharmony_ci 8288c2ecf20Sopenharmony_ci If the notifier call chain should be failed with some events 8298c2ecf20Sopenharmony_ci notified, write the error code to "actions/<notifier event>/error". 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_ci Example: Inject memory hotplug offline error (-12 == -ENOMEM) 8328c2ecf20Sopenharmony_ci 8338c2ecf20Sopenharmony_ci # cd /sys/kernel/debug/notifier-error-inject/memory 8348c2ecf20Sopenharmony_ci # echo -12 > actions/MEM_GOING_OFFLINE/error 8358c2ecf20Sopenharmony_ci # echo offline > /sys/devices/system/memory/memoryXXX/state 8368c2ecf20Sopenharmony_ci bash: echo: write error: Cannot allocate memory 8378c2ecf20Sopenharmony_ci 8388c2ecf20Sopenharmony_ci To compile this code as a module, choose M here: the module will 8398c2ecf20Sopenharmony_ci be called memory-notifier-error-inject. 8408c2ecf20Sopenharmony_ci 8418c2ecf20Sopenharmony_ci If unsure, say N. 8428c2ecf20Sopenharmony_ci 8438c2ecf20Sopenharmony_ciconfig DEBUG_PER_CPU_MAPS 8448c2ecf20Sopenharmony_ci bool "Debug access to per_cpu maps" 8458c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 8468c2ecf20Sopenharmony_ci depends on SMP 8478c2ecf20Sopenharmony_ci help 8488c2ecf20Sopenharmony_ci Say Y to verify that the per_cpu map being accessed has 8498c2ecf20Sopenharmony_ci been set up. This adds a fair amount of code to kernel memory 8508c2ecf20Sopenharmony_ci and decreases performance. 8518c2ecf20Sopenharmony_ci 8528c2ecf20Sopenharmony_ci Say N if unsure. 8538c2ecf20Sopenharmony_ci 8548c2ecf20Sopenharmony_ciconfig DEBUG_HIGHMEM 8558c2ecf20Sopenharmony_ci bool "Highmem debugging" 8568c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && HIGHMEM 8578c2ecf20Sopenharmony_ci help 8588c2ecf20Sopenharmony_ci This option enables additional error checking for high memory 8598c2ecf20Sopenharmony_ci systems. Disable for production systems. 8608c2ecf20Sopenharmony_ci 8618c2ecf20Sopenharmony_ciconfig HAVE_DEBUG_STACKOVERFLOW 8628c2ecf20Sopenharmony_ci bool 8638c2ecf20Sopenharmony_ci 8648c2ecf20Sopenharmony_ciconfig DEBUG_STACKOVERFLOW 8658c2ecf20Sopenharmony_ci bool "Check for stack overflows" 8668c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW 8678c2ecf20Sopenharmony_ci help 8688c2ecf20Sopenharmony_ci Say Y here if you want to check for overflows of kernel, IRQ 8698c2ecf20Sopenharmony_ci and exception stacks (if your architecture uses them). This 8708c2ecf20Sopenharmony_ci option will show detailed messages if free stack space drops 8718c2ecf20Sopenharmony_ci below a certain limit. 8728c2ecf20Sopenharmony_ci 8738c2ecf20Sopenharmony_ci These kinds of bugs usually occur when call-chains in the 8748c2ecf20Sopenharmony_ci kernel get too deep, especially when interrupts are 8758c2ecf20Sopenharmony_ci involved. 8768c2ecf20Sopenharmony_ci 8778c2ecf20Sopenharmony_ci Use this in cases where you see apparently random memory 8788c2ecf20Sopenharmony_ci corruption, especially if it appears in 'struct thread_info' 8798c2ecf20Sopenharmony_ci 8808c2ecf20Sopenharmony_ci If in doubt, say "N". 8818c2ecf20Sopenharmony_ci 8828c2ecf20Sopenharmony_cisource "lib/Kconfig.kasan" 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_ciendmenu # "Memory Debugging" 8858c2ecf20Sopenharmony_ci 8868c2ecf20Sopenharmony_ciconfig DEBUG_SHIRQ 8878c2ecf20Sopenharmony_ci bool "Debug shared IRQ handlers" 8888c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 8898c2ecf20Sopenharmony_ci help 8908c2ecf20Sopenharmony_ci Enable this to generate a spurious interrupt just before a shared 8918c2ecf20Sopenharmony_ci interrupt handler is deregistered (generating one when registering 8928c2ecf20Sopenharmony_ci is currently disabled). Drivers need to handle this correctly. Some 8938c2ecf20Sopenharmony_ci don't and need to be caught. 8948c2ecf20Sopenharmony_ci 8958c2ecf20Sopenharmony_cimenu "Debug Oops, Lockups and Hangs" 8968c2ecf20Sopenharmony_ci 8978c2ecf20Sopenharmony_ciconfig PANIC_ON_OOPS 8988c2ecf20Sopenharmony_ci bool "Panic on Oops" 8998c2ecf20Sopenharmony_ci help 9008c2ecf20Sopenharmony_ci Say Y here to enable the kernel to panic when it oopses. This 9018c2ecf20Sopenharmony_ci has the same effect as setting oops=panic on the kernel command 9028c2ecf20Sopenharmony_ci line. 9038c2ecf20Sopenharmony_ci 9048c2ecf20Sopenharmony_ci This feature is useful to ensure that the kernel does not do 9058c2ecf20Sopenharmony_ci anything erroneous after an oops which could result in data 9068c2ecf20Sopenharmony_ci corruption or other issues. 9078c2ecf20Sopenharmony_ci 9088c2ecf20Sopenharmony_ci Say N if unsure. 9098c2ecf20Sopenharmony_ci 9108c2ecf20Sopenharmony_ciconfig PANIC_ON_OOPS_VALUE 9118c2ecf20Sopenharmony_ci int 9128c2ecf20Sopenharmony_ci range 0 1 9138c2ecf20Sopenharmony_ci default 0 if !PANIC_ON_OOPS 9148c2ecf20Sopenharmony_ci default 1 if PANIC_ON_OOPS 9158c2ecf20Sopenharmony_ci 9168c2ecf20Sopenharmony_ciconfig PANIC_TIMEOUT 9178c2ecf20Sopenharmony_ci int "panic timeout" 9188c2ecf20Sopenharmony_ci default 0 9198c2ecf20Sopenharmony_ci help 9208c2ecf20Sopenharmony_ci Set the timeout value (in seconds) until a reboot occurs when 9218c2ecf20Sopenharmony_ci the kernel panics. If n = 0, then we wait forever. A timeout 9228c2ecf20Sopenharmony_ci value n > 0 will wait n seconds before rebooting, while a timeout 9238c2ecf20Sopenharmony_ci value n < 0 will reboot immediately. 9248c2ecf20Sopenharmony_ci 9258c2ecf20Sopenharmony_ciconfig LOCKUP_DETECTOR 9268c2ecf20Sopenharmony_ci bool 9278c2ecf20Sopenharmony_ci 9288c2ecf20Sopenharmony_ciconfig SOFTLOCKUP_DETECTOR 9298c2ecf20Sopenharmony_ci bool "Detect Soft Lockups" 9308c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && !S390 9318c2ecf20Sopenharmony_ci select LOCKUP_DETECTOR 9328c2ecf20Sopenharmony_ci help 9338c2ecf20Sopenharmony_ci Say Y here to enable the kernel to act as a watchdog to detect 9348c2ecf20Sopenharmony_ci soft lockups. 9358c2ecf20Sopenharmony_ci 9368c2ecf20Sopenharmony_ci Softlockups are bugs that cause the kernel to loop in kernel 9378c2ecf20Sopenharmony_ci mode for more than 20 seconds, without giving other tasks a 9388c2ecf20Sopenharmony_ci chance to run. The current stack trace is displayed upon 9398c2ecf20Sopenharmony_ci detection and the system will stay locked up. 9408c2ecf20Sopenharmony_ci 9418c2ecf20Sopenharmony_ciconfig BOOTPARAM_SOFTLOCKUP_PANIC 9428c2ecf20Sopenharmony_ci bool "Panic (Reboot) On Soft Lockups" 9438c2ecf20Sopenharmony_ci depends on SOFTLOCKUP_DETECTOR 9448c2ecf20Sopenharmony_ci help 9458c2ecf20Sopenharmony_ci Say Y here to enable the kernel to panic on "soft lockups", 9468c2ecf20Sopenharmony_ci which are bugs that cause the kernel to loop in kernel 9478c2ecf20Sopenharmony_ci mode for more than 20 seconds (configurable using the watchdog_thresh 9488c2ecf20Sopenharmony_ci sysctl), without giving other tasks a chance to run. 9498c2ecf20Sopenharmony_ci 9508c2ecf20Sopenharmony_ci The panic can be used in combination with panic_timeout, 9518c2ecf20Sopenharmony_ci to cause the system to reboot automatically after a 9528c2ecf20Sopenharmony_ci lockup has been detected. This feature is useful for 9538c2ecf20Sopenharmony_ci high-availability systems that have uptime guarantees and 9548c2ecf20Sopenharmony_ci where a lockup must be resolved ASAP. 9558c2ecf20Sopenharmony_ci 9568c2ecf20Sopenharmony_ci Say N if unsure. 9578c2ecf20Sopenharmony_ci 9588c2ecf20Sopenharmony_ciconfig BOOTPARAM_SOFTLOCKUP_PANIC_VALUE 9598c2ecf20Sopenharmony_ci int 9608c2ecf20Sopenharmony_ci depends on SOFTLOCKUP_DETECTOR 9618c2ecf20Sopenharmony_ci range 0 1 9628c2ecf20Sopenharmony_ci default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC 9638c2ecf20Sopenharmony_ci default 1 if BOOTPARAM_SOFTLOCKUP_PANIC 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ciconfig HARDLOCKUP_DETECTOR_PERF 9668c2ecf20Sopenharmony_ci bool 9678c2ecf20Sopenharmony_ci select SOFTLOCKUP_DETECTOR 9688c2ecf20Sopenharmony_ci 9698c2ecf20Sopenharmony_ci# 9708c2ecf20Sopenharmony_ci# Enables a timestamp based low pass filter to compensate for perf based 9718c2ecf20Sopenharmony_ci# hard lockup detection which runs too fast due to turbo modes. 9728c2ecf20Sopenharmony_ci# 9738c2ecf20Sopenharmony_ciconfig HARDLOCKUP_CHECK_TIMESTAMP 9748c2ecf20Sopenharmony_ci bool 9758c2ecf20Sopenharmony_ci 9768c2ecf20Sopenharmony_ci# 9778c2ecf20Sopenharmony_ci# arch/ can define HAVE_HARDLOCKUP_DETECTOR_ARCH to provide their own hard 9788c2ecf20Sopenharmony_ci# lockup detector rather than the perf based detector. 9798c2ecf20Sopenharmony_ci# 9808c2ecf20Sopenharmony_ciconfig HARDLOCKUP_DETECTOR 9818c2ecf20Sopenharmony_ci bool "Detect Hard Lockups" 9828c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && !S390 9838c2ecf20Sopenharmony_ci depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_ARCH 9848c2ecf20Sopenharmony_ci select LOCKUP_DETECTOR 9858c2ecf20Sopenharmony_ci select HARDLOCKUP_DETECTOR_PERF if HAVE_HARDLOCKUP_DETECTOR_PERF 9868c2ecf20Sopenharmony_ci help 9878c2ecf20Sopenharmony_ci Say Y here to enable the kernel to act as a watchdog to detect 9888c2ecf20Sopenharmony_ci hard lockups. 9898c2ecf20Sopenharmony_ci 9908c2ecf20Sopenharmony_ci Hardlockups are bugs that cause the CPU to loop in kernel mode 9918c2ecf20Sopenharmony_ci for more than 10 seconds, without letting other interrupts have a 9928c2ecf20Sopenharmony_ci chance to run. The current stack trace is displayed upon detection 9938c2ecf20Sopenharmony_ci and the system will stay locked up. 9948c2ecf20Sopenharmony_ci 9958c2ecf20Sopenharmony_ciconfig BOOTPARAM_HARDLOCKUP_PANIC 9968c2ecf20Sopenharmony_ci bool "Panic (Reboot) On Hard Lockups" 9978c2ecf20Sopenharmony_ci depends on HARDLOCKUP_DETECTOR 9988c2ecf20Sopenharmony_ci help 9998c2ecf20Sopenharmony_ci Say Y here to enable the kernel to panic on "hard lockups", 10008c2ecf20Sopenharmony_ci which are bugs that cause the kernel to loop in kernel 10018c2ecf20Sopenharmony_ci mode with interrupts disabled for more than 10 seconds (configurable 10028c2ecf20Sopenharmony_ci using the watchdog_thresh sysctl). 10038c2ecf20Sopenharmony_ci 10048c2ecf20Sopenharmony_ci Say N if unsure. 10058c2ecf20Sopenharmony_ci 10068c2ecf20Sopenharmony_ciconfig BOOTPARAM_HARDLOCKUP_PANIC_VALUE 10078c2ecf20Sopenharmony_ci int 10088c2ecf20Sopenharmony_ci depends on HARDLOCKUP_DETECTOR 10098c2ecf20Sopenharmony_ci range 0 1 10108c2ecf20Sopenharmony_ci default 0 if !BOOTPARAM_HARDLOCKUP_PANIC 10118c2ecf20Sopenharmony_ci default 1 if BOOTPARAM_HARDLOCKUP_PANIC 10128c2ecf20Sopenharmony_ci 10138c2ecf20Sopenharmony_ciconfig DETECT_HUNG_TASK 10148c2ecf20Sopenharmony_ci bool "Detect Hung Tasks" 10158c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 10168c2ecf20Sopenharmony_ci default SOFTLOCKUP_DETECTOR 10178c2ecf20Sopenharmony_ci help 10188c2ecf20Sopenharmony_ci Say Y here to enable the kernel to detect "hung tasks", 10198c2ecf20Sopenharmony_ci which are bugs that cause the task to be stuck in 10208c2ecf20Sopenharmony_ci uninterruptible "D" state indefinitely. 10218c2ecf20Sopenharmony_ci 10228c2ecf20Sopenharmony_ci When a hung task is detected, the kernel will print the 10238c2ecf20Sopenharmony_ci current stack trace (which you should report), but the 10248c2ecf20Sopenharmony_ci task will stay in uninterruptible state. If lockdep is 10258c2ecf20Sopenharmony_ci enabled then all held locks will also be reported. This 10268c2ecf20Sopenharmony_ci feature has negligible overhead. 10278c2ecf20Sopenharmony_ci 10288c2ecf20Sopenharmony_ciconfig DEFAULT_HUNG_TASK_TIMEOUT 10298c2ecf20Sopenharmony_ci int "Default timeout for hung task detection (in seconds)" 10308c2ecf20Sopenharmony_ci depends on DETECT_HUNG_TASK 10318c2ecf20Sopenharmony_ci default 120 10328c2ecf20Sopenharmony_ci help 10338c2ecf20Sopenharmony_ci This option controls the default timeout (in seconds) used 10348c2ecf20Sopenharmony_ci to determine when a task has become non-responsive and should 10358c2ecf20Sopenharmony_ci be considered hung. 10368c2ecf20Sopenharmony_ci 10378c2ecf20Sopenharmony_ci It can be adjusted at runtime via the kernel.hung_task_timeout_secs 10388c2ecf20Sopenharmony_ci sysctl or by writing a value to 10398c2ecf20Sopenharmony_ci /proc/sys/kernel/hung_task_timeout_secs. 10408c2ecf20Sopenharmony_ci 10418c2ecf20Sopenharmony_ci A timeout of 0 disables the check. The default is two minutes. 10428c2ecf20Sopenharmony_ci Keeping the default should be fine in most cases. 10438c2ecf20Sopenharmony_ci 10448c2ecf20Sopenharmony_ciconfig BOOTPARAM_HUNG_TASK_PANIC 10458c2ecf20Sopenharmony_ci bool "Panic (Reboot) On Hung Tasks" 10468c2ecf20Sopenharmony_ci depends on DETECT_HUNG_TASK 10478c2ecf20Sopenharmony_ci help 10488c2ecf20Sopenharmony_ci Say Y here to enable the kernel to panic on "hung tasks", 10498c2ecf20Sopenharmony_ci which are bugs that cause the kernel to leave a task stuck 10508c2ecf20Sopenharmony_ci in uninterruptible "D" state. 10518c2ecf20Sopenharmony_ci 10528c2ecf20Sopenharmony_ci The panic can be used in combination with panic_timeout, 10538c2ecf20Sopenharmony_ci to cause the system to reboot automatically after a 10548c2ecf20Sopenharmony_ci hung task has been detected. This feature is useful for 10558c2ecf20Sopenharmony_ci high-availability systems that have uptime guarantees and 10568c2ecf20Sopenharmony_ci where a hung tasks must be resolved ASAP. 10578c2ecf20Sopenharmony_ci 10588c2ecf20Sopenharmony_ci Say N if unsure. 10598c2ecf20Sopenharmony_ci 10608c2ecf20Sopenharmony_ciconfig BOOTPARAM_HUNG_TASK_PANIC_VALUE 10618c2ecf20Sopenharmony_ci int 10628c2ecf20Sopenharmony_ci depends on DETECT_HUNG_TASK 10638c2ecf20Sopenharmony_ci range 0 1 10648c2ecf20Sopenharmony_ci default 0 if !BOOTPARAM_HUNG_TASK_PANIC 10658c2ecf20Sopenharmony_ci default 1 if BOOTPARAM_HUNG_TASK_PANIC 10668c2ecf20Sopenharmony_ci 10678c2ecf20Sopenharmony_ciconfig WQ_WATCHDOG 10688c2ecf20Sopenharmony_ci bool "Detect Workqueue Stalls" 10698c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 10708c2ecf20Sopenharmony_ci help 10718c2ecf20Sopenharmony_ci Say Y here to enable stall detection on workqueues. If a 10728c2ecf20Sopenharmony_ci worker pool doesn't make forward progress on a pending work 10738c2ecf20Sopenharmony_ci item for over a given amount of time, 30s by default, a 10748c2ecf20Sopenharmony_ci warning message is printed along with dump of workqueue 10758c2ecf20Sopenharmony_ci state. This can be configured through kernel parameter 10768c2ecf20Sopenharmony_ci "workqueue.watchdog_thresh" and its sysfs counterpart. 10778c2ecf20Sopenharmony_ci 10788c2ecf20Sopenharmony_ciconfig TEST_LOCKUP 10798c2ecf20Sopenharmony_ci tristate "Test module to generate lockups" 10808c2ecf20Sopenharmony_ci depends on m 10818c2ecf20Sopenharmony_ci help 10828c2ecf20Sopenharmony_ci This builds the "test_lockup" module that helps to make sure 10838c2ecf20Sopenharmony_ci that watchdogs and lockup detectors are working properly. 10848c2ecf20Sopenharmony_ci 10858c2ecf20Sopenharmony_ci Depending on module parameters it could emulate soft or hard 10868c2ecf20Sopenharmony_ci lockup, "hung task", or locking arbitrary lock for a long time. 10878c2ecf20Sopenharmony_ci Also it could generate series of lockups with cooling-down periods. 10888c2ecf20Sopenharmony_ci 10898c2ecf20Sopenharmony_ci If unsure, say N. 10908c2ecf20Sopenharmony_ci 10918c2ecf20Sopenharmony_ciendmenu # "Debug lockups and hangs" 10928c2ecf20Sopenharmony_ci 10938c2ecf20Sopenharmony_cimenu "Scheduler Debugging" 10948c2ecf20Sopenharmony_ci 10958c2ecf20Sopenharmony_ciconfig SCHED_DEBUG 10968c2ecf20Sopenharmony_ci bool "Collect scheduler debugging info" 10978c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && PROC_FS 10988c2ecf20Sopenharmony_ci default y 10998c2ecf20Sopenharmony_ci help 11008c2ecf20Sopenharmony_ci If you say Y here, the /proc/sched_debug file will be provided 11018c2ecf20Sopenharmony_ci that can help debug the scheduler. The runtime overhead of this 11028c2ecf20Sopenharmony_ci option is minimal. 11038c2ecf20Sopenharmony_ci 11048c2ecf20Sopenharmony_ciconfig SCHED_INFO 11058c2ecf20Sopenharmony_ci bool 11068c2ecf20Sopenharmony_ci default n 11078c2ecf20Sopenharmony_ci 11088c2ecf20Sopenharmony_ciconfig SCHEDSTATS 11098c2ecf20Sopenharmony_ci bool "Collect scheduler statistics" 11108c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && PROC_FS 11118c2ecf20Sopenharmony_ci select SCHED_INFO 11128c2ecf20Sopenharmony_ci help 11138c2ecf20Sopenharmony_ci If you say Y here, additional code will be inserted into the 11148c2ecf20Sopenharmony_ci scheduler and related routines to collect statistics about 11158c2ecf20Sopenharmony_ci scheduler behavior and provide them in /proc/schedstat. These 11168c2ecf20Sopenharmony_ci stats may be useful for both tuning and debugging the scheduler 11178c2ecf20Sopenharmony_ci If you aren't debugging the scheduler or trying to tune a specific 11188c2ecf20Sopenharmony_ci application, you can say N to avoid the very slight overhead 11198c2ecf20Sopenharmony_ci this adds. 11208c2ecf20Sopenharmony_ci 11218c2ecf20Sopenharmony_ciendmenu 11228c2ecf20Sopenharmony_ci 11238c2ecf20Sopenharmony_ciconfig DEBUG_TIMEKEEPING 11248c2ecf20Sopenharmony_ci bool "Enable extra timekeeping sanity checking" 11258c2ecf20Sopenharmony_ci help 11268c2ecf20Sopenharmony_ci This option will enable additional timekeeping sanity checks 11278c2ecf20Sopenharmony_ci which may be helpful when diagnosing issues where timekeeping 11288c2ecf20Sopenharmony_ci problems are suspected. 11298c2ecf20Sopenharmony_ci 11308c2ecf20Sopenharmony_ci This may include checks in the timekeeping hotpaths, so this 11318c2ecf20Sopenharmony_ci option may have a (very small) performance impact to some 11328c2ecf20Sopenharmony_ci workloads. 11338c2ecf20Sopenharmony_ci 11348c2ecf20Sopenharmony_ci If unsure, say N. 11358c2ecf20Sopenharmony_ci 11368c2ecf20Sopenharmony_ciconfig DEBUG_PREEMPT 11378c2ecf20Sopenharmony_ci bool "Debug preemptible kernel" 11388c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT 11398c2ecf20Sopenharmony_ci help 11408c2ecf20Sopenharmony_ci If you say Y here then the kernel will use a debug variant of the 11418c2ecf20Sopenharmony_ci commonly used smp_processor_id() function and will print warnings 11428c2ecf20Sopenharmony_ci if kernel code uses it in a preemption-unsafe way. Also, the kernel 11438c2ecf20Sopenharmony_ci will detect preemption count underflows. 11448c2ecf20Sopenharmony_ci 11458c2ecf20Sopenharmony_ci This option has potential to introduce high runtime overhead, 11468c2ecf20Sopenharmony_ci depending on workload as it triggers debugging routines for each 11478c2ecf20Sopenharmony_ci this_cpu operation. It should only be used for debugging purposes. 11488c2ecf20Sopenharmony_ci 11498c2ecf20Sopenharmony_cimenu "Lock Debugging (spinlocks, mutexes, etc...)" 11508c2ecf20Sopenharmony_ci 11518c2ecf20Sopenharmony_ciconfig LOCK_DEBUGGING_SUPPORT 11528c2ecf20Sopenharmony_ci bool 11538c2ecf20Sopenharmony_ci depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 11548c2ecf20Sopenharmony_ci default y 11558c2ecf20Sopenharmony_ci 11568c2ecf20Sopenharmony_ciconfig PROVE_LOCKING 11578c2ecf20Sopenharmony_ci bool "Lock debugging: prove locking correctness" 11588c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 11598c2ecf20Sopenharmony_ci select LOCKDEP 11608c2ecf20Sopenharmony_ci select DEBUG_SPINLOCK 11618c2ecf20Sopenharmony_ci select DEBUG_MUTEXES 11628c2ecf20Sopenharmony_ci select DEBUG_RT_MUTEXES if RT_MUTEXES 11638c2ecf20Sopenharmony_ci select DEBUG_RWSEMS 11648c2ecf20Sopenharmony_ci select DEBUG_WW_MUTEX_SLOWPATH 11658c2ecf20Sopenharmony_ci select DEBUG_LOCK_ALLOC 11668c2ecf20Sopenharmony_ci select PREEMPT_COUNT if !ARCH_NO_PREEMPT 11678c2ecf20Sopenharmony_ci select TRACE_IRQFLAGS 11688c2ecf20Sopenharmony_ci default n 11698c2ecf20Sopenharmony_ci help 11708c2ecf20Sopenharmony_ci This feature enables the kernel to prove that all locking 11718c2ecf20Sopenharmony_ci that occurs in the kernel runtime is mathematically 11728c2ecf20Sopenharmony_ci correct: that under no circumstance could an arbitrary (and 11738c2ecf20Sopenharmony_ci not yet triggered) combination of observed locking 11748c2ecf20Sopenharmony_ci sequences (on an arbitrary number of CPUs, running an 11758c2ecf20Sopenharmony_ci arbitrary number of tasks and interrupt contexts) cause a 11768c2ecf20Sopenharmony_ci deadlock. 11778c2ecf20Sopenharmony_ci 11788c2ecf20Sopenharmony_ci In short, this feature enables the kernel to report locking 11798c2ecf20Sopenharmony_ci related deadlocks before they actually occur. 11808c2ecf20Sopenharmony_ci 11818c2ecf20Sopenharmony_ci The proof does not depend on how hard and complex a 11828c2ecf20Sopenharmony_ci deadlock scenario would be to trigger: how many 11838c2ecf20Sopenharmony_ci participant CPUs, tasks and irq-contexts would be needed 11848c2ecf20Sopenharmony_ci for it to trigger. The proof also does not depend on 11858c2ecf20Sopenharmony_ci timing: if a race and a resulting deadlock is possible 11868c2ecf20Sopenharmony_ci theoretically (no matter how unlikely the race scenario 11878c2ecf20Sopenharmony_ci is), it will be proven so and will immediately be 11888c2ecf20Sopenharmony_ci reported by the kernel (once the event is observed that 11898c2ecf20Sopenharmony_ci makes the deadlock theoretically possible). 11908c2ecf20Sopenharmony_ci 11918c2ecf20Sopenharmony_ci If a deadlock is impossible (i.e. the locking rules, as 11928c2ecf20Sopenharmony_ci observed by the kernel, are mathematically correct), the 11938c2ecf20Sopenharmony_ci kernel reports nothing. 11948c2ecf20Sopenharmony_ci 11958c2ecf20Sopenharmony_ci NOTE: this feature can also be enabled for rwlocks, mutexes 11968c2ecf20Sopenharmony_ci and rwsems - in which case all dependencies between these 11978c2ecf20Sopenharmony_ci different locking variants are observed and mapped too, and 11988c2ecf20Sopenharmony_ci the proof of observed correctness is also maintained for an 11998c2ecf20Sopenharmony_ci arbitrary combination of these separate locking variants. 12008c2ecf20Sopenharmony_ci 12018c2ecf20Sopenharmony_ci For more details, see Documentation/locking/lockdep-design.rst. 12028c2ecf20Sopenharmony_ci 12038c2ecf20Sopenharmony_ciconfig PROVE_RAW_LOCK_NESTING 12048c2ecf20Sopenharmony_ci bool "Enable raw_spinlock - spinlock nesting checks" 12058c2ecf20Sopenharmony_ci depends on PROVE_LOCKING 12068c2ecf20Sopenharmony_ci default n 12078c2ecf20Sopenharmony_ci help 12088c2ecf20Sopenharmony_ci Enable the raw_spinlock vs. spinlock nesting checks which ensure 12098c2ecf20Sopenharmony_ci that the lock nesting rules for PREEMPT_RT enabled kernels are 12108c2ecf20Sopenharmony_ci not violated. 12118c2ecf20Sopenharmony_ci 12128c2ecf20Sopenharmony_ci NOTE: There are known nesting problems. So if you enable this 12138c2ecf20Sopenharmony_ci option expect lockdep splats until these problems have been fully 12148c2ecf20Sopenharmony_ci addressed which is work in progress. This config switch allows to 12158c2ecf20Sopenharmony_ci identify and analyze these problems. It will be removed and the 12168c2ecf20Sopenharmony_ci check permanentely enabled once the main issues have been fixed. 12178c2ecf20Sopenharmony_ci 12188c2ecf20Sopenharmony_ci If unsure, select N. 12198c2ecf20Sopenharmony_ci 12208c2ecf20Sopenharmony_ciconfig LOCK_STAT 12218c2ecf20Sopenharmony_ci bool "Lock usage statistics" 12228c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 12238c2ecf20Sopenharmony_ci select LOCKDEP 12248c2ecf20Sopenharmony_ci select DEBUG_SPINLOCK 12258c2ecf20Sopenharmony_ci select DEBUG_MUTEXES 12268c2ecf20Sopenharmony_ci select DEBUG_RT_MUTEXES if RT_MUTEXES 12278c2ecf20Sopenharmony_ci select DEBUG_LOCK_ALLOC 12288c2ecf20Sopenharmony_ci default n 12298c2ecf20Sopenharmony_ci help 12308c2ecf20Sopenharmony_ci This feature enables tracking lock contention points 12318c2ecf20Sopenharmony_ci 12328c2ecf20Sopenharmony_ci For more details, see Documentation/locking/lockstat.rst 12338c2ecf20Sopenharmony_ci 12348c2ecf20Sopenharmony_ci This also enables lock events required by "perf lock", 12358c2ecf20Sopenharmony_ci subcommand of perf. 12368c2ecf20Sopenharmony_ci If you want to use "perf lock", you also need to turn on 12378c2ecf20Sopenharmony_ci CONFIG_EVENT_TRACING. 12388c2ecf20Sopenharmony_ci 12398c2ecf20Sopenharmony_ci CONFIG_LOCK_STAT defines "contended" and "acquired" lock events. 12408c2ecf20Sopenharmony_ci (CONFIG_LOCKDEP defines "acquire" and "release" events.) 12418c2ecf20Sopenharmony_ci 12428c2ecf20Sopenharmony_ciconfig DEBUG_RT_MUTEXES 12438c2ecf20Sopenharmony_ci bool "RT Mutex debugging, deadlock detection" 12448c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && RT_MUTEXES 12458c2ecf20Sopenharmony_ci help 12468c2ecf20Sopenharmony_ci This allows rt mutex semantics violations and rt mutex related 12478c2ecf20Sopenharmony_ci deadlocks (lockups) to be detected and reported automatically. 12488c2ecf20Sopenharmony_ci 12498c2ecf20Sopenharmony_ciconfig DEBUG_SPINLOCK 12508c2ecf20Sopenharmony_ci bool "Spinlock and rw-lock debugging: basic checks" 12518c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 12528c2ecf20Sopenharmony_ci select UNINLINE_SPIN_UNLOCK 12538c2ecf20Sopenharmony_ci help 12548c2ecf20Sopenharmony_ci Say Y here and build SMP to catch missing spinlock initialization 12558c2ecf20Sopenharmony_ci and certain other kinds of spinlock errors commonly made. This is 12568c2ecf20Sopenharmony_ci best used in conjunction with the NMI watchdog so that spinlock 12578c2ecf20Sopenharmony_ci deadlocks are also debuggable. 12588c2ecf20Sopenharmony_ci 12598c2ecf20Sopenharmony_ciconfig DEBUG_MUTEXES 12608c2ecf20Sopenharmony_ci bool "Mutex debugging: basic checks" 12618c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 12628c2ecf20Sopenharmony_ci help 12638c2ecf20Sopenharmony_ci This feature allows mutex semantics violations to be detected and 12648c2ecf20Sopenharmony_ci reported. 12658c2ecf20Sopenharmony_ci 12668c2ecf20Sopenharmony_ciconfig DEBUG_WW_MUTEX_SLOWPATH 12678c2ecf20Sopenharmony_ci bool "Wait/wound mutex debugging: Slowpath testing" 12688c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 12698c2ecf20Sopenharmony_ci select DEBUG_LOCK_ALLOC 12708c2ecf20Sopenharmony_ci select DEBUG_SPINLOCK 12718c2ecf20Sopenharmony_ci select DEBUG_MUTEXES 12728c2ecf20Sopenharmony_ci help 12738c2ecf20Sopenharmony_ci This feature enables slowpath testing for w/w mutex users by 12748c2ecf20Sopenharmony_ci injecting additional -EDEADLK wound/backoff cases. Together with 12758c2ecf20Sopenharmony_ci the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this 12768c2ecf20Sopenharmony_ci will test all possible w/w mutex interface abuse with the 12778c2ecf20Sopenharmony_ci exception of simply not acquiring all the required locks. 12788c2ecf20Sopenharmony_ci Note that this feature can introduce significant overhead, so 12798c2ecf20Sopenharmony_ci it really should not be enabled in a production or distro kernel, 12808c2ecf20Sopenharmony_ci even a debug kernel. If you are a driver writer, enable it. If 12818c2ecf20Sopenharmony_ci you are a distro, do not. 12828c2ecf20Sopenharmony_ci 12838c2ecf20Sopenharmony_ciconfig DEBUG_RWSEMS 12848c2ecf20Sopenharmony_ci bool "RW Semaphore debugging: basic checks" 12858c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 12868c2ecf20Sopenharmony_ci help 12878c2ecf20Sopenharmony_ci This debugging feature allows mismatched rw semaphore locks 12888c2ecf20Sopenharmony_ci and unlocks to be detected and reported. 12898c2ecf20Sopenharmony_ci 12908c2ecf20Sopenharmony_ciconfig DEBUG_LOCK_ALLOC 12918c2ecf20Sopenharmony_ci bool "Lock debugging: detect incorrect freeing of live locks" 12928c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 12938c2ecf20Sopenharmony_ci select DEBUG_SPINLOCK 12948c2ecf20Sopenharmony_ci select DEBUG_MUTEXES 12958c2ecf20Sopenharmony_ci select DEBUG_RT_MUTEXES if RT_MUTEXES 12968c2ecf20Sopenharmony_ci select LOCKDEP 12978c2ecf20Sopenharmony_ci help 12988c2ecf20Sopenharmony_ci This feature will check whether any held lock (spinlock, rwlock, 12998c2ecf20Sopenharmony_ci mutex or rwsem) is incorrectly freed by the kernel, via any of the 13008c2ecf20Sopenharmony_ci memory-freeing routines (kfree(), kmem_cache_free(), free_pages(), 13018c2ecf20Sopenharmony_ci vfree(), etc.), whether a live lock is incorrectly reinitialized via 13028c2ecf20Sopenharmony_ci spin_lock_init()/mutex_init()/etc., or whether there is any lock 13038c2ecf20Sopenharmony_ci held during task exit. 13048c2ecf20Sopenharmony_ci 13058c2ecf20Sopenharmony_ciconfig LOCKDEP 13068c2ecf20Sopenharmony_ci bool 13078c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT 13088c2ecf20Sopenharmony_ci select STACKTRACE 13098c2ecf20Sopenharmony_ci select KALLSYMS 13108c2ecf20Sopenharmony_ci select KALLSYMS_ALL 13118c2ecf20Sopenharmony_ci 13128c2ecf20Sopenharmony_ciconfig LOCKDEP_SMALL 13138c2ecf20Sopenharmony_ci bool 13148c2ecf20Sopenharmony_ci 13158c2ecf20Sopenharmony_ciconfig LOCKDEP_BITS 13168c2ecf20Sopenharmony_ci int "Bitsize for MAX_LOCKDEP_ENTRIES" 13178c2ecf20Sopenharmony_ci depends on LOCKDEP && !LOCKDEP_SMALL 13188c2ecf20Sopenharmony_ci range 10 30 13198c2ecf20Sopenharmony_ci default 15 13208c2ecf20Sopenharmony_ci help 13218c2ecf20Sopenharmony_ci Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message. 13228c2ecf20Sopenharmony_ci 13238c2ecf20Sopenharmony_ciconfig LOCKDEP_CHAINS_BITS 13248c2ecf20Sopenharmony_ci int "Bitsize for MAX_LOCKDEP_CHAINS" 13258c2ecf20Sopenharmony_ci depends on LOCKDEP && !LOCKDEP_SMALL 13268c2ecf20Sopenharmony_ci range 10 30 13278c2ecf20Sopenharmony_ci default 16 13288c2ecf20Sopenharmony_ci help 13298c2ecf20Sopenharmony_ci Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message. 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_ciconfig LOCKDEP_STACK_TRACE_BITS 13328c2ecf20Sopenharmony_ci int "Bitsize for MAX_STACK_TRACE_ENTRIES" 13338c2ecf20Sopenharmony_ci depends on LOCKDEP && !LOCKDEP_SMALL 13348c2ecf20Sopenharmony_ci range 10 30 13358c2ecf20Sopenharmony_ci default 19 13368c2ecf20Sopenharmony_ci help 13378c2ecf20Sopenharmony_ci Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message. 13388c2ecf20Sopenharmony_ci 13398c2ecf20Sopenharmony_ciconfig LOCKDEP_STACK_TRACE_HASH_BITS 13408c2ecf20Sopenharmony_ci int "Bitsize for STACK_TRACE_HASH_SIZE" 13418c2ecf20Sopenharmony_ci depends on LOCKDEP && !LOCKDEP_SMALL 13428c2ecf20Sopenharmony_ci range 10 30 13438c2ecf20Sopenharmony_ci default 14 13448c2ecf20Sopenharmony_ci help 13458c2ecf20Sopenharmony_ci Try increasing this value if you need large MAX_STACK_TRACE_ENTRIES. 13468c2ecf20Sopenharmony_ci 13478c2ecf20Sopenharmony_ciconfig LOCKDEP_CIRCULAR_QUEUE_BITS 13488c2ecf20Sopenharmony_ci int "Bitsize for elements in circular_queue struct" 13498c2ecf20Sopenharmony_ci depends on LOCKDEP 13508c2ecf20Sopenharmony_ci range 10 30 13518c2ecf20Sopenharmony_ci default 12 13528c2ecf20Sopenharmony_ci help 13538c2ecf20Sopenharmony_ci Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure. 13548c2ecf20Sopenharmony_ci 13558c2ecf20Sopenharmony_ciconfig DEBUG_LOCKDEP 13568c2ecf20Sopenharmony_ci bool "Lock dependency engine debugging" 13578c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL && LOCKDEP 13588c2ecf20Sopenharmony_ci help 13598c2ecf20Sopenharmony_ci If you say Y here, the lock dependency engine will do 13608c2ecf20Sopenharmony_ci additional runtime checks to debug itself, at the price 13618c2ecf20Sopenharmony_ci of more runtime overhead. 13628c2ecf20Sopenharmony_ci 13638c2ecf20Sopenharmony_ciconfig DEBUG_ATOMIC_SLEEP 13648c2ecf20Sopenharmony_ci bool "Sleep inside atomic section checking" 13658c2ecf20Sopenharmony_ci select PREEMPT_COUNT 13668c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 13678c2ecf20Sopenharmony_ci depends on !ARCH_NO_PREEMPT 13688c2ecf20Sopenharmony_ci help 13698c2ecf20Sopenharmony_ci If you say Y here, various routines which may sleep will become very 13708c2ecf20Sopenharmony_ci noisy if they are called inside atomic sections: when a spinlock is 13718c2ecf20Sopenharmony_ci held, inside an rcu read side critical section, inside preempt disabled 13728c2ecf20Sopenharmony_ci sections, inside an interrupt, etc... 13738c2ecf20Sopenharmony_ci 13748c2ecf20Sopenharmony_ciconfig DEBUG_LOCKING_API_SELFTESTS 13758c2ecf20Sopenharmony_ci bool "Locking API boot-time self-tests" 13768c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 13778c2ecf20Sopenharmony_ci help 13788c2ecf20Sopenharmony_ci Say Y here if you want the kernel to run a short self-test during 13798c2ecf20Sopenharmony_ci bootup. The self-test checks whether common types of locking bugs 13808c2ecf20Sopenharmony_ci are detected by debugging mechanisms or not. (if you disable 13818c2ecf20Sopenharmony_ci lock debugging then those bugs wont be detected of course.) 13828c2ecf20Sopenharmony_ci The following locking APIs are covered: spinlocks, rwlocks, 13838c2ecf20Sopenharmony_ci mutexes and rwsems. 13848c2ecf20Sopenharmony_ci 13858c2ecf20Sopenharmony_ciconfig LOCK_TORTURE_TEST 13868c2ecf20Sopenharmony_ci tristate "torture tests for locking" 13878c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 13888c2ecf20Sopenharmony_ci select TORTURE_TEST 13898c2ecf20Sopenharmony_ci help 13908c2ecf20Sopenharmony_ci This option provides a kernel module that runs torture tests 13918c2ecf20Sopenharmony_ci on kernel locking primitives. The kernel module may be built 13928c2ecf20Sopenharmony_ci after the fact on the running kernel to be tested, if desired. 13938c2ecf20Sopenharmony_ci 13948c2ecf20Sopenharmony_ci Say Y here if you want kernel locking-primitive torture tests 13958c2ecf20Sopenharmony_ci to be built into the kernel. 13968c2ecf20Sopenharmony_ci Say M if you want these torture tests to build as a module. 13978c2ecf20Sopenharmony_ci Say N if you are unsure. 13988c2ecf20Sopenharmony_ci 13998c2ecf20Sopenharmony_ciconfig WW_MUTEX_SELFTEST 14008c2ecf20Sopenharmony_ci tristate "Wait/wound mutex selftests" 14018c2ecf20Sopenharmony_ci help 14028c2ecf20Sopenharmony_ci This option provides a kernel module that runs tests on the 14038c2ecf20Sopenharmony_ci on the struct ww_mutex locking API. 14048c2ecf20Sopenharmony_ci 14058c2ecf20Sopenharmony_ci It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction 14068c2ecf20Sopenharmony_ci with this test harness. 14078c2ecf20Sopenharmony_ci 14088c2ecf20Sopenharmony_ci Say M if you want these self tests to build as a module. 14098c2ecf20Sopenharmony_ci Say N if you are unsure. 14108c2ecf20Sopenharmony_ci 14118c2ecf20Sopenharmony_ciconfig SCF_TORTURE_TEST 14128c2ecf20Sopenharmony_ci tristate "torture tests for smp_call_function*()" 14138c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 14148c2ecf20Sopenharmony_ci select TORTURE_TEST 14158c2ecf20Sopenharmony_ci help 14168c2ecf20Sopenharmony_ci This option provides a kernel module that runs torture tests 14178c2ecf20Sopenharmony_ci on the smp_call_function() family of primitives. The kernel 14188c2ecf20Sopenharmony_ci module may be built after the fact on the running kernel to 14198c2ecf20Sopenharmony_ci be tested, if desired. 14208c2ecf20Sopenharmony_ci 14218c2ecf20Sopenharmony_ciconfig CSD_LOCK_WAIT_DEBUG 14228c2ecf20Sopenharmony_ci bool "Debugging for csd_lock_wait(), called from smp_call_function*()" 14238c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 14248c2ecf20Sopenharmony_ci depends on 64BIT 14258c2ecf20Sopenharmony_ci default n 14268c2ecf20Sopenharmony_ci help 14278c2ecf20Sopenharmony_ci This option enables debug prints when CPUs are slow to respond 14288c2ecf20Sopenharmony_ci to the smp_call_function*() IPI wrappers. These debug prints 14298c2ecf20Sopenharmony_ci include the IPI handler function currently executing (if any) 14308c2ecf20Sopenharmony_ci and relevant stack traces. 14318c2ecf20Sopenharmony_ci 14328c2ecf20Sopenharmony_ciendmenu # lock debugging 14338c2ecf20Sopenharmony_ci 14348c2ecf20Sopenharmony_ciconfig TRACE_IRQFLAGS 14358c2ecf20Sopenharmony_ci depends on TRACE_IRQFLAGS_SUPPORT 14368c2ecf20Sopenharmony_ci bool 14378c2ecf20Sopenharmony_ci help 14388c2ecf20Sopenharmony_ci Enables hooks to interrupt enabling and disabling for 14398c2ecf20Sopenharmony_ci either tracing or lock debugging. 14408c2ecf20Sopenharmony_ci 14418c2ecf20Sopenharmony_ciconfig TRACE_IRQFLAGS_NMI 14428c2ecf20Sopenharmony_ci def_bool y 14438c2ecf20Sopenharmony_ci depends on TRACE_IRQFLAGS 14448c2ecf20Sopenharmony_ci depends on TRACE_IRQFLAGS_NMI_SUPPORT 14458c2ecf20Sopenharmony_ci 14468c2ecf20Sopenharmony_ciconfig STACKTRACE 14478c2ecf20Sopenharmony_ci bool "Stack backtrace support" 14488c2ecf20Sopenharmony_ci depends on STACKTRACE_SUPPORT 14498c2ecf20Sopenharmony_ci help 14508c2ecf20Sopenharmony_ci This option causes the kernel to create a /proc/pid/stack for 14518c2ecf20Sopenharmony_ci every process, showing its current stack trace. 14528c2ecf20Sopenharmony_ci It is also used by various kernel debugging features that require 14538c2ecf20Sopenharmony_ci stack trace generation. 14548c2ecf20Sopenharmony_ci 14558c2ecf20Sopenharmony_ciconfig WARN_ALL_UNSEEDED_RANDOM 14568c2ecf20Sopenharmony_ci bool "Warn for all uses of unseeded randomness" 14578c2ecf20Sopenharmony_ci default n 14588c2ecf20Sopenharmony_ci help 14598c2ecf20Sopenharmony_ci Some parts of the kernel contain bugs relating to their use of 14608c2ecf20Sopenharmony_ci cryptographically secure random numbers before it's actually possible 14618c2ecf20Sopenharmony_ci to generate those numbers securely. This setting ensures that these 14628c2ecf20Sopenharmony_ci flaws don't go unnoticed, by enabling a message, should this ever 14638c2ecf20Sopenharmony_ci occur. This will allow people with obscure setups to know when things 14648c2ecf20Sopenharmony_ci are going wrong, so that they might contact developers about fixing 14658c2ecf20Sopenharmony_ci it. 14668c2ecf20Sopenharmony_ci 14678c2ecf20Sopenharmony_ci Unfortunately, on some models of some architectures getting 14688c2ecf20Sopenharmony_ci a fully seeded CRNG is extremely difficult, and so this can 14698c2ecf20Sopenharmony_ci result in dmesg getting spammed for a surprisingly long 14708c2ecf20Sopenharmony_ci time. This is really bad from a security perspective, and 14718c2ecf20Sopenharmony_ci so architecture maintainers really need to do what they can 14728c2ecf20Sopenharmony_ci to get the CRNG seeded sooner after the system is booted. 14738c2ecf20Sopenharmony_ci However, since users cannot do anything actionable to 14748c2ecf20Sopenharmony_ci address this, by default this option is disabled. 14758c2ecf20Sopenharmony_ci 14768c2ecf20Sopenharmony_ci Say Y here if you want to receive warnings for all uses of 14778c2ecf20Sopenharmony_ci unseeded randomness. This will be of use primarily for 14788c2ecf20Sopenharmony_ci those developers interested in improving the security of 14798c2ecf20Sopenharmony_ci Linux kernels running on their architecture (or 14808c2ecf20Sopenharmony_ci subarchitecture). 14818c2ecf20Sopenharmony_ci 14828c2ecf20Sopenharmony_ciconfig DEBUG_KOBJECT 14838c2ecf20Sopenharmony_ci bool "kobject debugging" 14848c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 14858c2ecf20Sopenharmony_ci help 14868c2ecf20Sopenharmony_ci If you say Y here, some extra kobject debugging messages will be sent 14878c2ecf20Sopenharmony_ci to the syslog. 14888c2ecf20Sopenharmony_ci 14898c2ecf20Sopenharmony_ciconfig DEBUG_KOBJECT_RELEASE 14908c2ecf20Sopenharmony_ci bool "kobject release debugging" 14918c2ecf20Sopenharmony_ci depends on DEBUG_OBJECTS_TIMERS 14928c2ecf20Sopenharmony_ci help 14938c2ecf20Sopenharmony_ci kobjects are reference counted objects. This means that their 14948c2ecf20Sopenharmony_ci last reference count put is not predictable, and the kobject can 14958c2ecf20Sopenharmony_ci live on past the point at which a driver decides to drop it's 14968c2ecf20Sopenharmony_ci initial reference to the kobject gained on allocation. An 14978c2ecf20Sopenharmony_ci example of this would be a struct device which has just been 14988c2ecf20Sopenharmony_ci unregistered. 14998c2ecf20Sopenharmony_ci 15008c2ecf20Sopenharmony_ci However, some buggy drivers assume that after such an operation, 15018c2ecf20Sopenharmony_ci the memory backing the kobject can be immediately freed. This 15028c2ecf20Sopenharmony_ci goes completely against the principles of a refcounted object. 15038c2ecf20Sopenharmony_ci 15048c2ecf20Sopenharmony_ci If you say Y here, the kernel will delay the release of kobjects 15058c2ecf20Sopenharmony_ci on the last reference count to improve the visibility of this 15068c2ecf20Sopenharmony_ci kind of kobject release bug. 15078c2ecf20Sopenharmony_ci 15088c2ecf20Sopenharmony_ciconfig HAVE_DEBUG_BUGVERBOSE 15098c2ecf20Sopenharmony_ci bool 15108c2ecf20Sopenharmony_ci 15118c2ecf20Sopenharmony_cimenu "Debug kernel data structures" 15128c2ecf20Sopenharmony_ci 15138c2ecf20Sopenharmony_ciconfig DEBUG_LIST 15148c2ecf20Sopenharmony_ci bool "Debug linked list manipulation" 15158c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL || BUG_ON_DATA_CORRUPTION 15168c2ecf20Sopenharmony_ci help 15178c2ecf20Sopenharmony_ci Enable this to turn on extended checks in the linked-list 15188c2ecf20Sopenharmony_ci walking routines. 15198c2ecf20Sopenharmony_ci 15208c2ecf20Sopenharmony_ci If unsure, say N. 15218c2ecf20Sopenharmony_ci 15228c2ecf20Sopenharmony_ciconfig DEBUG_PLIST 15238c2ecf20Sopenharmony_ci bool "Debug priority linked list manipulation" 15248c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15258c2ecf20Sopenharmony_ci help 15268c2ecf20Sopenharmony_ci Enable this to turn on extended checks in the priority-ordered 15278c2ecf20Sopenharmony_ci linked-list (plist) walking routines. This checks the entire 15288c2ecf20Sopenharmony_ci list multiple times during each manipulation. 15298c2ecf20Sopenharmony_ci 15308c2ecf20Sopenharmony_ci If unsure, say N. 15318c2ecf20Sopenharmony_ci 15328c2ecf20Sopenharmony_ciconfig DEBUG_SG 15338c2ecf20Sopenharmony_ci bool "Debug SG table operations" 15348c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15358c2ecf20Sopenharmony_ci help 15368c2ecf20Sopenharmony_ci Enable this to turn on checks on scatter-gather tables. This can 15378c2ecf20Sopenharmony_ci help find problems with drivers that do not properly initialize 15388c2ecf20Sopenharmony_ci their sg tables. 15398c2ecf20Sopenharmony_ci 15408c2ecf20Sopenharmony_ci If unsure, say N. 15418c2ecf20Sopenharmony_ci 15428c2ecf20Sopenharmony_ciconfig DEBUG_NOTIFIERS 15438c2ecf20Sopenharmony_ci bool "Debug notifier call chains" 15448c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15458c2ecf20Sopenharmony_ci help 15468c2ecf20Sopenharmony_ci Enable this to turn on sanity checking for notifier call chains. 15478c2ecf20Sopenharmony_ci This is most useful for kernel developers to make sure that 15488c2ecf20Sopenharmony_ci modules properly unregister themselves from notifier chains. 15498c2ecf20Sopenharmony_ci This is a relatively cheap check but if you care about maximum 15508c2ecf20Sopenharmony_ci performance, say N. 15518c2ecf20Sopenharmony_ci 15528c2ecf20Sopenharmony_ciconfig BUG_ON_DATA_CORRUPTION 15538c2ecf20Sopenharmony_ci bool "Trigger a BUG when data corruption is detected" 15548c2ecf20Sopenharmony_ci select DEBUG_LIST 15558c2ecf20Sopenharmony_ci help 15568c2ecf20Sopenharmony_ci Select this option if the kernel should BUG when it encounters 15578c2ecf20Sopenharmony_ci data corruption in kernel memory structures when they get checked 15588c2ecf20Sopenharmony_ci for validity. 15598c2ecf20Sopenharmony_ci 15608c2ecf20Sopenharmony_ci If unsure, say N. 15618c2ecf20Sopenharmony_ci 15628c2ecf20Sopenharmony_ciendmenu 15638c2ecf20Sopenharmony_ci 15648c2ecf20Sopenharmony_ciconfig DEBUG_CREDENTIALS 15658c2ecf20Sopenharmony_ci bool "Debug credential management" 15668c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15678c2ecf20Sopenharmony_ci help 15688c2ecf20Sopenharmony_ci Enable this to turn on some debug checking for credential 15698c2ecf20Sopenharmony_ci management. The additional code keeps track of the number of 15708c2ecf20Sopenharmony_ci pointers from task_structs to any given cred struct, and checks to 15718c2ecf20Sopenharmony_ci see that this number never exceeds the usage count of the cred 15728c2ecf20Sopenharmony_ci struct. 15738c2ecf20Sopenharmony_ci 15748c2ecf20Sopenharmony_ci Furthermore, if SELinux is enabled, this also checks that the 15758c2ecf20Sopenharmony_ci security pointer in the cred struct is never seen to be invalid. 15768c2ecf20Sopenharmony_ci 15778c2ecf20Sopenharmony_ci If unsure, say N. 15788c2ecf20Sopenharmony_ci 15798c2ecf20Sopenharmony_cisource "kernel/rcu/Kconfig.debug" 15808c2ecf20Sopenharmony_ci 15818c2ecf20Sopenharmony_ciconfig DEBUG_WQ_FORCE_RR_CPU 15828c2ecf20Sopenharmony_ci bool "Force round-robin CPU selection for unbound work items" 15838c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15848c2ecf20Sopenharmony_ci default n 15858c2ecf20Sopenharmony_ci help 15868c2ecf20Sopenharmony_ci Workqueue used to implicitly guarantee that work items queued 15878c2ecf20Sopenharmony_ci without explicit CPU specified are put on the local CPU. This 15888c2ecf20Sopenharmony_ci guarantee is no longer true and while local CPU is still 15898c2ecf20Sopenharmony_ci preferred work items may be put on foreign CPUs. Kernel 15908c2ecf20Sopenharmony_ci parameter "workqueue.debug_force_rr_cpu" is added to force 15918c2ecf20Sopenharmony_ci round-robin CPU selection to flush out usages which depend on the 15928c2ecf20Sopenharmony_ci now broken guarantee. This config option enables the debug 15938c2ecf20Sopenharmony_ci feature by default. When enabled, memory and cache locality will 15948c2ecf20Sopenharmony_ci be impacted. 15958c2ecf20Sopenharmony_ci 15968c2ecf20Sopenharmony_ciconfig DEBUG_BLOCK_EXT_DEVT 15978c2ecf20Sopenharmony_ci bool "Force extended block device numbers and spread them" 15988c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 15998c2ecf20Sopenharmony_ci depends on BLOCK 16008c2ecf20Sopenharmony_ci default n 16018c2ecf20Sopenharmony_ci help 16028c2ecf20Sopenharmony_ci BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON 16038c2ecf20Sopenharmony_ci SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT 16048c2ecf20Sopenharmony_ci YOU ARE DOING. Distros, please enable this and fix whatever 16058c2ecf20Sopenharmony_ci is broken. 16068c2ecf20Sopenharmony_ci 16078c2ecf20Sopenharmony_ci Conventionally, block device numbers are allocated from 16088c2ecf20Sopenharmony_ci predetermined contiguous area. However, extended block area 16098c2ecf20Sopenharmony_ci may introduce non-contiguous block device numbers. This 16108c2ecf20Sopenharmony_ci option forces most block device numbers to be allocated from 16118c2ecf20Sopenharmony_ci the extended space and spreads them to discover kernel or 16128c2ecf20Sopenharmony_ci userland code paths which assume predetermined contiguous 16138c2ecf20Sopenharmony_ci device number allocation. 16148c2ecf20Sopenharmony_ci 16158c2ecf20Sopenharmony_ci Note that turning on this debug option shuffles all the 16168c2ecf20Sopenharmony_ci device numbers for all IDE and SCSI devices including libata 16178c2ecf20Sopenharmony_ci ones, so root partition specified using device number 16188c2ecf20Sopenharmony_ci directly (via rdev or root=MAJ:MIN) won't work anymore. 16198c2ecf20Sopenharmony_ci Textual device names (root=/dev/sdXn) will continue to work. 16208c2ecf20Sopenharmony_ci 16218c2ecf20Sopenharmony_ci Say N if you are unsure. 16228c2ecf20Sopenharmony_ci 16238c2ecf20Sopenharmony_ciconfig CPU_HOTPLUG_STATE_CONTROL 16248c2ecf20Sopenharmony_ci bool "Enable CPU hotplug state control" 16258c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 16268c2ecf20Sopenharmony_ci depends on HOTPLUG_CPU 16278c2ecf20Sopenharmony_ci default n 16288c2ecf20Sopenharmony_ci help 16298c2ecf20Sopenharmony_ci Allows to write steps between "offline" and "online" to the CPUs 16308c2ecf20Sopenharmony_ci sysfs target file so states can be stepped granular. This is a debug 16318c2ecf20Sopenharmony_ci option for now as the hotplug machinery cannot be stopped and 16328c2ecf20Sopenharmony_ci restarted at arbitrary points yet. 16338c2ecf20Sopenharmony_ci 16348c2ecf20Sopenharmony_ci Say N if your are unsure. 16358c2ecf20Sopenharmony_ci 16368c2ecf20Sopenharmony_ciconfig LATENCYTOP 16378c2ecf20Sopenharmony_ci bool "Latency measuring infrastructure" 16388c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 16398c2ecf20Sopenharmony_ci depends on STACKTRACE_SUPPORT 16408c2ecf20Sopenharmony_ci depends on PROC_FS 16418c2ecf20Sopenharmony_ci depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 16428c2ecf20Sopenharmony_ci select KALLSYMS 16438c2ecf20Sopenharmony_ci select KALLSYMS_ALL 16448c2ecf20Sopenharmony_ci select STACKTRACE 16458c2ecf20Sopenharmony_ci select SCHEDSTATS 16468c2ecf20Sopenharmony_ci select SCHED_DEBUG 16478c2ecf20Sopenharmony_ci help 16488c2ecf20Sopenharmony_ci Enable this option if you want to use the LatencyTOP tool 16498c2ecf20Sopenharmony_ci to find out which userspace is blocking on what kernel operations. 16508c2ecf20Sopenharmony_ci 16518c2ecf20Sopenharmony_cisource "kernel/trace/Kconfig" 16528c2ecf20Sopenharmony_ci 16538c2ecf20Sopenharmony_ciconfig PROVIDE_OHCI1394_DMA_INIT 16548c2ecf20Sopenharmony_ci bool "Remote debugging over FireWire early on boot" 16558c2ecf20Sopenharmony_ci depends on PCI && X86 16568c2ecf20Sopenharmony_ci help 16578c2ecf20Sopenharmony_ci If you want to debug problems which hang or crash the kernel early 16588c2ecf20Sopenharmony_ci on boot and the crashing machine has a FireWire port, you can use 16598c2ecf20Sopenharmony_ci this feature to remotely access the memory of the crashed machine 16608c2ecf20Sopenharmony_ci over FireWire. This employs remote DMA as part of the OHCI1394 16618c2ecf20Sopenharmony_ci specification which is now the standard for FireWire controllers. 16628c2ecf20Sopenharmony_ci 16638c2ecf20Sopenharmony_ci With remote DMA, you can monitor the printk buffer remotely using 16648c2ecf20Sopenharmony_ci firescope and access all memory below 4GB using fireproxy from gdb. 16658c2ecf20Sopenharmony_ci Even controlling a kernel debugger is possible using remote DMA. 16668c2ecf20Sopenharmony_ci 16678c2ecf20Sopenharmony_ci Usage: 16688c2ecf20Sopenharmony_ci 16698c2ecf20Sopenharmony_ci If ohci1394_dma=early is used as boot parameter, it will initialize 16708c2ecf20Sopenharmony_ci all OHCI1394 controllers which are found in the PCI config space. 16718c2ecf20Sopenharmony_ci 16728c2ecf20Sopenharmony_ci As all changes to the FireWire bus such as enabling and disabling 16738c2ecf20Sopenharmony_ci devices cause a bus reset and thereby disable remote DMA for all 16748c2ecf20Sopenharmony_ci devices, be sure to have the cable plugged and FireWire enabled on 16758c2ecf20Sopenharmony_ci the debugging host before booting the debug target for debugging. 16768c2ecf20Sopenharmony_ci 16778c2ecf20Sopenharmony_ci This code (~1k) is freed after boot. By then, the firewire stack 16788c2ecf20Sopenharmony_ci in charge of the OHCI-1394 controllers should be used instead. 16798c2ecf20Sopenharmony_ci 16808c2ecf20Sopenharmony_ci See Documentation/core-api/debugging-via-ohci1394.rst for more information. 16818c2ecf20Sopenharmony_ci 16828c2ecf20Sopenharmony_cisource "samples/Kconfig" 16838c2ecf20Sopenharmony_ci 16848c2ecf20Sopenharmony_ciconfig ARCH_HAS_DEVMEM_IS_ALLOWED 16858c2ecf20Sopenharmony_ci bool 16868c2ecf20Sopenharmony_ci 16878c2ecf20Sopenharmony_ciconfig STRICT_DEVMEM 16888c2ecf20Sopenharmony_ci bool "Filter access to /dev/mem" 16898c2ecf20Sopenharmony_ci depends on MMU && DEVMEM 16908c2ecf20Sopenharmony_ci depends on ARCH_HAS_DEVMEM_IS_ALLOWED 16918c2ecf20Sopenharmony_ci default y if PPC || X86 || ARM64 16928c2ecf20Sopenharmony_ci help 16938c2ecf20Sopenharmony_ci If this option is disabled, you allow userspace (root) access to all 16948c2ecf20Sopenharmony_ci of memory, including kernel and userspace memory. Accidental 16958c2ecf20Sopenharmony_ci access to this is obviously disastrous, but specific access can 16968c2ecf20Sopenharmony_ci be used by people debugging the kernel. Note that with PAT support 16978c2ecf20Sopenharmony_ci enabled, even in this case there are restrictions on /dev/mem 16988c2ecf20Sopenharmony_ci use due to the cache aliasing requirements. 16998c2ecf20Sopenharmony_ci 17008c2ecf20Sopenharmony_ci If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem 17018c2ecf20Sopenharmony_ci file only allows userspace access to PCI space and the BIOS code and 17028c2ecf20Sopenharmony_ci data regions. This is sufficient for dosemu and X and all common 17038c2ecf20Sopenharmony_ci users of /dev/mem. 17048c2ecf20Sopenharmony_ci 17058c2ecf20Sopenharmony_ci If in doubt, say Y. 17068c2ecf20Sopenharmony_ci 17078c2ecf20Sopenharmony_ciconfig IO_STRICT_DEVMEM 17088c2ecf20Sopenharmony_ci bool "Filter I/O access to /dev/mem" 17098c2ecf20Sopenharmony_ci depends on STRICT_DEVMEM 17108c2ecf20Sopenharmony_ci help 17118c2ecf20Sopenharmony_ci If this option is disabled, you allow userspace (root) access to all 17128c2ecf20Sopenharmony_ci io-memory regardless of whether a driver is actively using that 17138c2ecf20Sopenharmony_ci range. Accidental access to this is obviously disastrous, but 17148c2ecf20Sopenharmony_ci specific access can be used by people debugging kernel drivers. 17158c2ecf20Sopenharmony_ci 17168c2ecf20Sopenharmony_ci If this option is switched on, the /dev/mem file only allows 17178c2ecf20Sopenharmony_ci userspace access to *idle* io-memory ranges (see /proc/iomem) This 17188c2ecf20Sopenharmony_ci may break traditional users of /dev/mem (dosemu, legacy X, etc...) 17198c2ecf20Sopenharmony_ci if the driver using a given range cannot be disabled. 17208c2ecf20Sopenharmony_ci 17218c2ecf20Sopenharmony_ci If in doubt, say Y. 17228c2ecf20Sopenharmony_ci 17238c2ecf20Sopenharmony_cimenu "$(SRCARCH) Debugging" 17248c2ecf20Sopenharmony_ci 17258c2ecf20Sopenharmony_cisource "arch/$(SRCARCH)/Kconfig.debug" 17268c2ecf20Sopenharmony_ci 17278c2ecf20Sopenharmony_ciendmenu 17288c2ecf20Sopenharmony_ci 17298c2ecf20Sopenharmony_cimenu "Kernel Testing and Coverage" 17308c2ecf20Sopenharmony_ci 17318c2ecf20Sopenharmony_cisource "lib/kunit/Kconfig" 17328c2ecf20Sopenharmony_ci 17338c2ecf20Sopenharmony_ciconfig NOTIFIER_ERROR_INJECTION 17348c2ecf20Sopenharmony_ci tristate "Notifier error injection" 17358c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 17368c2ecf20Sopenharmony_ci select DEBUG_FS 17378c2ecf20Sopenharmony_ci help 17388c2ecf20Sopenharmony_ci This option provides the ability to inject artificial errors to 17398c2ecf20Sopenharmony_ci specified notifier chain callbacks. It is useful to test the error 17408c2ecf20Sopenharmony_ci handling of notifier call chain failures. 17418c2ecf20Sopenharmony_ci 17428c2ecf20Sopenharmony_ci Say N if unsure. 17438c2ecf20Sopenharmony_ci 17448c2ecf20Sopenharmony_ciconfig PM_NOTIFIER_ERROR_INJECT 17458c2ecf20Sopenharmony_ci tristate "PM notifier error injection module" 17468c2ecf20Sopenharmony_ci depends on PM && NOTIFIER_ERROR_INJECTION 17478c2ecf20Sopenharmony_ci default m if PM_DEBUG 17488c2ecf20Sopenharmony_ci help 17498c2ecf20Sopenharmony_ci This option provides the ability to inject artificial errors to 17508c2ecf20Sopenharmony_ci PM notifier chain callbacks. It is controlled through debugfs 17518c2ecf20Sopenharmony_ci interface /sys/kernel/debug/notifier-error-inject/pm 17528c2ecf20Sopenharmony_ci 17538c2ecf20Sopenharmony_ci If the notifier call chain should be failed with some events 17548c2ecf20Sopenharmony_ci notified, write the error code to "actions/<notifier event>/error". 17558c2ecf20Sopenharmony_ci 17568c2ecf20Sopenharmony_ci Example: Inject PM suspend error (-12 = -ENOMEM) 17578c2ecf20Sopenharmony_ci 17588c2ecf20Sopenharmony_ci # cd /sys/kernel/debug/notifier-error-inject/pm/ 17598c2ecf20Sopenharmony_ci # echo -12 > actions/PM_SUSPEND_PREPARE/error 17608c2ecf20Sopenharmony_ci # echo mem > /sys/power/state 17618c2ecf20Sopenharmony_ci bash: echo: write error: Cannot allocate memory 17628c2ecf20Sopenharmony_ci 17638c2ecf20Sopenharmony_ci To compile this code as a module, choose M here: the module will 17648c2ecf20Sopenharmony_ci be called pm-notifier-error-inject. 17658c2ecf20Sopenharmony_ci 17668c2ecf20Sopenharmony_ci If unsure, say N. 17678c2ecf20Sopenharmony_ci 17688c2ecf20Sopenharmony_ciconfig OF_RECONFIG_NOTIFIER_ERROR_INJECT 17698c2ecf20Sopenharmony_ci tristate "OF reconfig notifier error injection module" 17708c2ecf20Sopenharmony_ci depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION 17718c2ecf20Sopenharmony_ci help 17728c2ecf20Sopenharmony_ci This option provides the ability to inject artificial errors to 17738c2ecf20Sopenharmony_ci OF reconfig notifier chain callbacks. It is controlled 17748c2ecf20Sopenharmony_ci through debugfs interface under 17758c2ecf20Sopenharmony_ci /sys/kernel/debug/notifier-error-inject/OF-reconfig/ 17768c2ecf20Sopenharmony_ci 17778c2ecf20Sopenharmony_ci If the notifier call chain should be failed with some events 17788c2ecf20Sopenharmony_ci notified, write the error code to "actions/<notifier event>/error". 17798c2ecf20Sopenharmony_ci 17808c2ecf20Sopenharmony_ci To compile this code as a module, choose M here: the module will 17818c2ecf20Sopenharmony_ci be called of-reconfig-notifier-error-inject. 17828c2ecf20Sopenharmony_ci 17838c2ecf20Sopenharmony_ci If unsure, say N. 17848c2ecf20Sopenharmony_ci 17858c2ecf20Sopenharmony_ciconfig NETDEV_NOTIFIER_ERROR_INJECT 17868c2ecf20Sopenharmony_ci tristate "Netdev notifier error injection module" 17878c2ecf20Sopenharmony_ci depends on NET && NOTIFIER_ERROR_INJECTION 17888c2ecf20Sopenharmony_ci help 17898c2ecf20Sopenharmony_ci This option provides the ability to inject artificial errors to 17908c2ecf20Sopenharmony_ci netdevice notifier chain callbacks. It is controlled through debugfs 17918c2ecf20Sopenharmony_ci interface /sys/kernel/debug/notifier-error-inject/netdev 17928c2ecf20Sopenharmony_ci 17938c2ecf20Sopenharmony_ci If the notifier call chain should be failed with some events 17948c2ecf20Sopenharmony_ci notified, write the error code to "actions/<notifier event>/error". 17958c2ecf20Sopenharmony_ci 17968c2ecf20Sopenharmony_ci Example: Inject netdevice mtu change error (-22 = -EINVAL) 17978c2ecf20Sopenharmony_ci 17988c2ecf20Sopenharmony_ci # cd /sys/kernel/debug/notifier-error-inject/netdev 17998c2ecf20Sopenharmony_ci # echo -22 > actions/NETDEV_CHANGEMTU/error 18008c2ecf20Sopenharmony_ci # ip link set eth0 mtu 1024 18018c2ecf20Sopenharmony_ci RTNETLINK answers: Invalid argument 18028c2ecf20Sopenharmony_ci 18038c2ecf20Sopenharmony_ci To compile this code as a module, choose M here: the module will 18048c2ecf20Sopenharmony_ci be called netdev-notifier-error-inject. 18058c2ecf20Sopenharmony_ci 18068c2ecf20Sopenharmony_ci If unsure, say N. 18078c2ecf20Sopenharmony_ci 18088c2ecf20Sopenharmony_ciconfig FUNCTION_ERROR_INJECTION 18098c2ecf20Sopenharmony_ci bool "Fault-injections of functions" 18108c2ecf20Sopenharmony_ci depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES 18118c2ecf20Sopenharmony_ci help 18128c2ecf20Sopenharmony_ci Add fault injections into various functions that are annotated with 18138c2ecf20Sopenharmony_ci ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return 18148c2ecf20Sopenharmony_ci value of theses functions. This is useful to test error paths of code. 18158c2ecf20Sopenharmony_ci 18168c2ecf20Sopenharmony_ci If unsure, say N 18178c2ecf20Sopenharmony_ci 18188c2ecf20Sopenharmony_ciconfig FAULT_INJECTION 18198c2ecf20Sopenharmony_ci bool "Fault-injection framework" 18208c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 18218c2ecf20Sopenharmony_ci help 18228c2ecf20Sopenharmony_ci Provide fault-injection framework. 18238c2ecf20Sopenharmony_ci For more details, see Documentation/fault-injection/. 18248c2ecf20Sopenharmony_ci 18258c2ecf20Sopenharmony_ciconfig FAILSLAB 18268c2ecf20Sopenharmony_ci bool "Fault-injection capability for kmalloc" 18278c2ecf20Sopenharmony_ci depends on FAULT_INJECTION 18288c2ecf20Sopenharmony_ci depends on SLAB || SLUB 18298c2ecf20Sopenharmony_ci help 18308c2ecf20Sopenharmony_ci Provide fault-injection capability for kmalloc. 18318c2ecf20Sopenharmony_ci 18328c2ecf20Sopenharmony_ciconfig FAIL_PAGE_ALLOC 18338c2ecf20Sopenharmony_ci bool "Fault-injection capability for alloc_pages()" 18348c2ecf20Sopenharmony_ci depends on FAULT_INJECTION 18358c2ecf20Sopenharmony_ci help 18368c2ecf20Sopenharmony_ci Provide fault-injection capability for alloc_pages(). 18378c2ecf20Sopenharmony_ci 18388c2ecf20Sopenharmony_ciconfig FAULT_INJECTION_USERCOPY 18398c2ecf20Sopenharmony_ci bool "Fault injection capability for usercopy functions" 18408c2ecf20Sopenharmony_ci depends on FAULT_INJECTION 18418c2ecf20Sopenharmony_ci help 18428c2ecf20Sopenharmony_ci Provides fault-injection capability to inject failures 18438c2ecf20Sopenharmony_ci in usercopy functions (copy_from_user(), get_user(), ...). 18448c2ecf20Sopenharmony_ci 18458c2ecf20Sopenharmony_ciconfig FAIL_MAKE_REQUEST 18468c2ecf20Sopenharmony_ci bool "Fault-injection capability for disk IO" 18478c2ecf20Sopenharmony_ci depends on FAULT_INJECTION && BLOCK 18488c2ecf20Sopenharmony_ci help 18498c2ecf20Sopenharmony_ci Provide fault-injection capability for disk IO. 18508c2ecf20Sopenharmony_ci 18518c2ecf20Sopenharmony_ciconfig FAIL_IO_TIMEOUT 18528c2ecf20Sopenharmony_ci bool "Fault-injection capability for faking disk interrupts" 18538c2ecf20Sopenharmony_ci depends on FAULT_INJECTION && BLOCK 18548c2ecf20Sopenharmony_ci help 18558c2ecf20Sopenharmony_ci Provide fault-injection capability on end IO handling. This 18568c2ecf20Sopenharmony_ci will make the block layer "forget" an interrupt as configured, 18578c2ecf20Sopenharmony_ci thus exercising the error handling. 18588c2ecf20Sopenharmony_ci 18598c2ecf20Sopenharmony_ci Only works with drivers that use the generic timeout handling, 18608c2ecf20Sopenharmony_ci for others it wont do anything. 18618c2ecf20Sopenharmony_ci 18628c2ecf20Sopenharmony_ciconfig FAIL_FUTEX 18638c2ecf20Sopenharmony_ci bool "Fault-injection capability for futexes" 18648c2ecf20Sopenharmony_ci select DEBUG_FS 18658c2ecf20Sopenharmony_ci depends on FAULT_INJECTION && FUTEX 18668c2ecf20Sopenharmony_ci help 18678c2ecf20Sopenharmony_ci Provide fault-injection capability for futexes. 18688c2ecf20Sopenharmony_ci 18698c2ecf20Sopenharmony_ciconfig FAULT_INJECTION_DEBUG_FS 18708c2ecf20Sopenharmony_ci bool "Debugfs entries for fault-injection capabilities" 18718c2ecf20Sopenharmony_ci depends on FAULT_INJECTION && SYSFS && DEBUG_FS 18728c2ecf20Sopenharmony_ci help 18738c2ecf20Sopenharmony_ci Enable configuration of fault-injection capabilities via debugfs. 18748c2ecf20Sopenharmony_ci 18758c2ecf20Sopenharmony_ciconfig FAIL_FUNCTION 18768c2ecf20Sopenharmony_ci bool "Fault-injection capability for functions" 18778c2ecf20Sopenharmony_ci depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION 18788c2ecf20Sopenharmony_ci help 18798c2ecf20Sopenharmony_ci Provide function-based fault-injection capability. 18808c2ecf20Sopenharmony_ci This will allow you to override a specific function with a return 18818c2ecf20Sopenharmony_ci with given return value. As a result, function caller will see 18828c2ecf20Sopenharmony_ci an error value and have to handle it. This is useful to test the 18838c2ecf20Sopenharmony_ci error handling in various subsystems. 18848c2ecf20Sopenharmony_ci 18858c2ecf20Sopenharmony_ciconfig FAIL_MMC_REQUEST 18868c2ecf20Sopenharmony_ci bool "Fault-injection capability for MMC IO" 18878c2ecf20Sopenharmony_ci depends on FAULT_INJECTION_DEBUG_FS && MMC 18888c2ecf20Sopenharmony_ci help 18898c2ecf20Sopenharmony_ci Provide fault-injection capability for MMC IO. 18908c2ecf20Sopenharmony_ci This will make the mmc core return data errors. This is 18918c2ecf20Sopenharmony_ci useful to test the error handling in the mmc block device 18928c2ecf20Sopenharmony_ci and to test how the mmc host driver handles retries from 18938c2ecf20Sopenharmony_ci the block device. 18948c2ecf20Sopenharmony_ci 18958c2ecf20Sopenharmony_ciconfig FAULT_INJECTION_STACKTRACE_FILTER 18968c2ecf20Sopenharmony_ci bool "stacktrace filter for fault-injection capabilities" 18978c2ecf20Sopenharmony_ci depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT 18988c2ecf20Sopenharmony_ci depends on !X86_64 18998c2ecf20Sopenharmony_ci select STACKTRACE 19008c2ecf20Sopenharmony_ci depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86 19018c2ecf20Sopenharmony_ci help 19028c2ecf20Sopenharmony_ci Provide stacktrace filter for fault-injection capabilities 19038c2ecf20Sopenharmony_ci 19048c2ecf20Sopenharmony_ciconfig ARCH_HAS_KCOV 19058c2ecf20Sopenharmony_ci bool 19068c2ecf20Sopenharmony_ci help 19078c2ecf20Sopenharmony_ci An architecture should select this when it can successfully 19088c2ecf20Sopenharmony_ci build and run with CONFIG_KCOV. This typically requires 19098c2ecf20Sopenharmony_ci disabling instrumentation for some early boot code. 19108c2ecf20Sopenharmony_ci 19118c2ecf20Sopenharmony_ciconfig CC_HAS_SANCOV_TRACE_PC 19128c2ecf20Sopenharmony_ci def_bool $(cc-option,-fsanitize-coverage=trace-pc) 19138c2ecf20Sopenharmony_ci 19148c2ecf20Sopenharmony_ci 19158c2ecf20Sopenharmony_ciconfig KCOV 19168c2ecf20Sopenharmony_ci bool "Code coverage for fuzzing" 19178c2ecf20Sopenharmony_ci depends on ARCH_HAS_KCOV 19188c2ecf20Sopenharmony_ci depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS 19198c2ecf20Sopenharmony_ci select DEBUG_FS 19208c2ecf20Sopenharmony_ci select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC 19218c2ecf20Sopenharmony_ci help 19228c2ecf20Sopenharmony_ci KCOV exposes kernel code coverage information in a form suitable 19238c2ecf20Sopenharmony_ci for coverage-guided fuzzing (randomized testing). 19248c2ecf20Sopenharmony_ci 19258c2ecf20Sopenharmony_ci If RANDOMIZE_BASE is enabled, PC values will not be stable across 19268c2ecf20Sopenharmony_ci different machines and across reboots. If you need stable PC values, 19278c2ecf20Sopenharmony_ci disable RANDOMIZE_BASE. 19288c2ecf20Sopenharmony_ci 19298c2ecf20Sopenharmony_ci For more details, see Documentation/dev-tools/kcov.rst. 19308c2ecf20Sopenharmony_ci 19318c2ecf20Sopenharmony_ciconfig KCOV_ENABLE_COMPARISONS 19328c2ecf20Sopenharmony_ci bool "Enable comparison operands collection by KCOV" 19338c2ecf20Sopenharmony_ci depends on KCOV 19348c2ecf20Sopenharmony_ci depends on $(cc-option,-fsanitize-coverage=trace-cmp) 19358c2ecf20Sopenharmony_ci help 19368c2ecf20Sopenharmony_ci KCOV also exposes operands of every comparison in the instrumented 19378c2ecf20Sopenharmony_ci code along with operand sizes and PCs of the comparison instructions. 19388c2ecf20Sopenharmony_ci These operands can be used by fuzzing engines to improve the quality 19398c2ecf20Sopenharmony_ci of fuzzing coverage. 19408c2ecf20Sopenharmony_ci 19418c2ecf20Sopenharmony_ciconfig KCOV_INSTRUMENT_ALL 19428c2ecf20Sopenharmony_ci bool "Instrument all code by default" 19438c2ecf20Sopenharmony_ci depends on KCOV 19448c2ecf20Sopenharmony_ci default y 19458c2ecf20Sopenharmony_ci help 19468c2ecf20Sopenharmony_ci If you are doing generic system call fuzzing (like e.g. syzkaller), 19478c2ecf20Sopenharmony_ci then you will want to instrument the whole kernel and you should 19488c2ecf20Sopenharmony_ci say y here. If you are doing more targeted fuzzing (like e.g. 19498c2ecf20Sopenharmony_ci filesystem fuzzing with AFL) then you will want to enable coverage 19508c2ecf20Sopenharmony_ci for more specific subsets of files, and should say n here. 19518c2ecf20Sopenharmony_ci 19528c2ecf20Sopenharmony_ciconfig KCOV_IRQ_AREA_SIZE 19538c2ecf20Sopenharmony_ci hex "Size of interrupt coverage collection area in words" 19548c2ecf20Sopenharmony_ci depends on KCOV 19558c2ecf20Sopenharmony_ci default 0x40000 19568c2ecf20Sopenharmony_ci help 19578c2ecf20Sopenharmony_ci KCOV uses preallocated per-cpu areas to collect coverage from 19588c2ecf20Sopenharmony_ci soft interrupts. This specifies the size of those areas in the 19598c2ecf20Sopenharmony_ci number of unsigned long words. 19608c2ecf20Sopenharmony_ci 19618c2ecf20Sopenharmony_cimenuconfig RUNTIME_TESTING_MENU 19628c2ecf20Sopenharmony_ci bool "Runtime Testing" 19638c2ecf20Sopenharmony_ci def_bool y 19648c2ecf20Sopenharmony_ci 19658c2ecf20Sopenharmony_ciif RUNTIME_TESTING_MENU 19668c2ecf20Sopenharmony_ci 19678c2ecf20Sopenharmony_ciconfig LKDTM 19688c2ecf20Sopenharmony_ci tristate "Linux Kernel Dump Test Tool Module" 19698c2ecf20Sopenharmony_ci depends on DEBUG_FS 19708c2ecf20Sopenharmony_ci help 19718c2ecf20Sopenharmony_ci This module enables testing of the different dumping mechanisms by 19728c2ecf20Sopenharmony_ci inducing system failures at predefined crash points. 19738c2ecf20Sopenharmony_ci If you don't need it: say N 19748c2ecf20Sopenharmony_ci Choose M here to compile this code as a module. The module will be 19758c2ecf20Sopenharmony_ci called lkdtm. 19768c2ecf20Sopenharmony_ci 19778c2ecf20Sopenharmony_ci Documentation on how to use the module can be found in 19788c2ecf20Sopenharmony_ci Documentation/fault-injection/provoke-crashes.rst 19798c2ecf20Sopenharmony_ci 19808c2ecf20Sopenharmony_ciconfig TEST_LIST_SORT 19818c2ecf20Sopenharmony_ci tristate "Linked list sorting test" 19828c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL || m 19838c2ecf20Sopenharmony_ci help 19848c2ecf20Sopenharmony_ci Enable this to turn on 'list_sort()' function test. This test is 19858c2ecf20Sopenharmony_ci executed only once during system boot (so affects only boot time), 19868c2ecf20Sopenharmony_ci or at module load time. 19878c2ecf20Sopenharmony_ci 19888c2ecf20Sopenharmony_ci If unsure, say N. 19898c2ecf20Sopenharmony_ci 19908c2ecf20Sopenharmony_ciconfig TEST_MIN_HEAP 19918c2ecf20Sopenharmony_ci tristate "Min heap test" 19928c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL || m 19938c2ecf20Sopenharmony_ci help 19948c2ecf20Sopenharmony_ci Enable this to turn on min heap function tests. This test is 19958c2ecf20Sopenharmony_ci executed only once during system boot (so affects only boot time), 19968c2ecf20Sopenharmony_ci or at module load time. 19978c2ecf20Sopenharmony_ci 19988c2ecf20Sopenharmony_ci If unsure, say N. 19998c2ecf20Sopenharmony_ci 20008c2ecf20Sopenharmony_ciconfig TEST_SORT 20018c2ecf20Sopenharmony_ci tristate "Array-based sort test" 20028c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL || m 20038c2ecf20Sopenharmony_ci help 20048c2ecf20Sopenharmony_ci This option enables the self-test function of 'sort()' at boot, 20058c2ecf20Sopenharmony_ci or at module load time. 20068c2ecf20Sopenharmony_ci 20078c2ecf20Sopenharmony_ci If unsure, say N. 20088c2ecf20Sopenharmony_ci 20098c2ecf20Sopenharmony_ciconfig KPROBES_SANITY_TEST 20108c2ecf20Sopenharmony_ci bool "Kprobes sanity tests" 20118c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 20128c2ecf20Sopenharmony_ci depends on KPROBES 20138c2ecf20Sopenharmony_ci help 20148c2ecf20Sopenharmony_ci This option provides for testing basic kprobes functionality on 20158c2ecf20Sopenharmony_ci boot. Samples of kprobe and kretprobe are inserted and 20168c2ecf20Sopenharmony_ci verified for functionality. 20178c2ecf20Sopenharmony_ci 20188c2ecf20Sopenharmony_ci Say N if you are unsure. 20198c2ecf20Sopenharmony_ci 20208c2ecf20Sopenharmony_ciconfig BACKTRACE_SELF_TEST 20218c2ecf20Sopenharmony_ci tristate "Self test for the backtrace code" 20228c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 20238c2ecf20Sopenharmony_ci help 20248c2ecf20Sopenharmony_ci This option provides a kernel module that can be used to test 20258c2ecf20Sopenharmony_ci the kernel stack backtrace code. This option is not useful 20268c2ecf20Sopenharmony_ci for distributions or general kernels, but only for kernel 20278c2ecf20Sopenharmony_ci developers working on architecture code. 20288c2ecf20Sopenharmony_ci 20298c2ecf20Sopenharmony_ci Note that if you want to also test saved backtraces, you will 20308c2ecf20Sopenharmony_ci have to enable STACKTRACE as well. 20318c2ecf20Sopenharmony_ci 20328c2ecf20Sopenharmony_ci Say N if you are unsure. 20338c2ecf20Sopenharmony_ci 20348c2ecf20Sopenharmony_ciconfig RBTREE_TEST 20358c2ecf20Sopenharmony_ci tristate "Red-Black tree test" 20368c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 20378c2ecf20Sopenharmony_ci help 20388c2ecf20Sopenharmony_ci A benchmark measuring the performance of the rbtree library. 20398c2ecf20Sopenharmony_ci Also includes rbtree invariant checks. 20408c2ecf20Sopenharmony_ci 20418c2ecf20Sopenharmony_ciconfig REED_SOLOMON_TEST 20428c2ecf20Sopenharmony_ci tristate "Reed-Solomon library test" 20438c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL || m 20448c2ecf20Sopenharmony_ci select REED_SOLOMON 20458c2ecf20Sopenharmony_ci select REED_SOLOMON_ENC16 20468c2ecf20Sopenharmony_ci select REED_SOLOMON_DEC16 20478c2ecf20Sopenharmony_ci help 20488c2ecf20Sopenharmony_ci This option enables the self-test function of rslib at boot, 20498c2ecf20Sopenharmony_ci or at module load time. 20508c2ecf20Sopenharmony_ci 20518c2ecf20Sopenharmony_ci If unsure, say N. 20528c2ecf20Sopenharmony_ci 20538c2ecf20Sopenharmony_ciconfig INTERVAL_TREE_TEST 20548c2ecf20Sopenharmony_ci tristate "Interval tree test" 20558c2ecf20Sopenharmony_ci depends on DEBUG_KERNEL 20568c2ecf20Sopenharmony_ci select INTERVAL_TREE 20578c2ecf20Sopenharmony_ci help 20588c2ecf20Sopenharmony_ci A benchmark measuring the performance of the interval tree library 20598c2ecf20Sopenharmony_ci 20608c2ecf20Sopenharmony_ciconfig PERCPU_TEST 20618c2ecf20Sopenharmony_ci tristate "Per cpu operations test" 20628c2ecf20Sopenharmony_ci depends on m && DEBUG_KERNEL 20638c2ecf20Sopenharmony_ci help 20648c2ecf20Sopenharmony_ci Enable this option to build test module which validates per-cpu 20658c2ecf20Sopenharmony_ci operations. 20668c2ecf20Sopenharmony_ci 20678c2ecf20Sopenharmony_ci If unsure, say N. 20688c2ecf20Sopenharmony_ci 20698c2ecf20Sopenharmony_ciconfig ATOMIC64_SELFTEST 20708c2ecf20Sopenharmony_ci tristate "Perform an atomic64_t self-test" 20718c2ecf20Sopenharmony_ci help 20728c2ecf20Sopenharmony_ci Enable this option to test the atomic64_t functions at boot or 20738c2ecf20Sopenharmony_ci at module load time. 20748c2ecf20Sopenharmony_ci 20758c2ecf20Sopenharmony_ci If unsure, say N. 20768c2ecf20Sopenharmony_ci 20778c2ecf20Sopenharmony_ciconfig ASYNC_RAID6_TEST 20788c2ecf20Sopenharmony_ci tristate "Self test for hardware accelerated raid6 recovery" 20798c2ecf20Sopenharmony_ci depends on ASYNC_RAID6_RECOV 20808c2ecf20Sopenharmony_ci select ASYNC_MEMCPY 20818c2ecf20Sopenharmony_ci help 20828c2ecf20Sopenharmony_ci This is a one-shot self test that permutes through the 20838c2ecf20Sopenharmony_ci recovery of all the possible two disk failure scenarios for a 20848c2ecf20Sopenharmony_ci N-disk array. Recovery is performed with the asynchronous 20858c2ecf20Sopenharmony_ci raid6 recovery routines, and will optionally use an offload 20868c2ecf20Sopenharmony_ci engine if one is available. 20878c2ecf20Sopenharmony_ci 20888c2ecf20Sopenharmony_ci If unsure, say N. 20898c2ecf20Sopenharmony_ci 20908c2ecf20Sopenharmony_ciconfig TEST_HEXDUMP 20918c2ecf20Sopenharmony_ci tristate "Test functions located in the hexdump module at runtime" 20928c2ecf20Sopenharmony_ci 20938c2ecf20Sopenharmony_ciconfig TEST_STRING_HELPERS 20948c2ecf20Sopenharmony_ci tristate "Test functions located in the string_helpers module at runtime" 20958c2ecf20Sopenharmony_ci 20968c2ecf20Sopenharmony_ciconfig TEST_STRSCPY 20978c2ecf20Sopenharmony_ci tristate "Test strscpy*() family of functions at runtime" 20988c2ecf20Sopenharmony_ci 20998c2ecf20Sopenharmony_ciconfig TEST_KSTRTOX 21008c2ecf20Sopenharmony_ci tristate "Test kstrto*() family of functions at runtime" 21018c2ecf20Sopenharmony_ci 21028c2ecf20Sopenharmony_ciconfig TEST_PRINTF 21038c2ecf20Sopenharmony_ci tristate "Test printf() family of functions at runtime" 21048c2ecf20Sopenharmony_ci 21058c2ecf20Sopenharmony_ciconfig TEST_BITMAP 21068c2ecf20Sopenharmony_ci tristate "Test bitmap_*() family of functions at runtime" 21078c2ecf20Sopenharmony_ci help 21088c2ecf20Sopenharmony_ci Enable this option to test the bitmap functions at boot. 21098c2ecf20Sopenharmony_ci 21108c2ecf20Sopenharmony_ci If unsure, say N. 21118c2ecf20Sopenharmony_ci 21128c2ecf20Sopenharmony_ciconfig TEST_UUID 21138c2ecf20Sopenharmony_ci tristate "Test functions located in the uuid module at runtime" 21148c2ecf20Sopenharmony_ci 21158c2ecf20Sopenharmony_ciconfig TEST_XARRAY 21168c2ecf20Sopenharmony_ci tristate "Test the XArray code at runtime" 21178c2ecf20Sopenharmony_ci 21188c2ecf20Sopenharmony_ciconfig TEST_OVERFLOW 21198c2ecf20Sopenharmony_ci tristate "Test check_*_overflow() functions at runtime" 21208c2ecf20Sopenharmony_ci 21218c2ecf20Sopenharmony_ciconfig TEST_RHASHTABLE 21228c2ecf20Sopenharmony_ci tristate "Perform selftest on resizable hash table" 21238c2ecf20Sopenharmony_ci help 21248c2ecf20Sopenharmony_ci Enable this option to test the rhashtable functions at boot. 21258c2ecf20Sopenharmony_ci 21268c2ecf20Sopenharmony_ci If unsure, say N. 21278c2ecf20Sopenharmony_ci 21288c2ecf20Sopenharmony_ciconfig TEST_HASH 21298c2ecf20Sopenharmony_ci tristate "Perform selftest on hash functions" 21308c2ecf20Sopenharmony_ci help 21318c2ecf20Sopenharmony_ci Enable this option to test the kernel's integer (<linux/hash.h>), 21328c2ecf20Sopenharmony_ci string (<linux/stringhash.h>), and siphash (<linux/siphash.h>) 21338c2ecf20Sopenharmony_ci hash functions on boot (or module load). 21348c2ecf20Sopenharmony_ci 21358c2ecf20Sopenharmony_ci This is intended to help people writing architecture-specific 21368c2ecf20Sopenharmony_ci optimized versions. If unsure, say N. 21378c2ecf20Sopenharmony_ci 21388c2ecf20Sopenharmony_ciconfig TEST_IDA 21398c2ecf20Sopenharmony_ci tristate "Perform selftest on IDA functions" 21408c2ecf20Sopenharmony_ci 21418c2ecf20Sopenharmony_ciconfig TEST_PARMAN 21428c2ecf20Sopenharmony_ci tristate "Perform selftest on priority array manager" 21438c2ecf20Sopenharmony_ci depends on PARMAN 21448c2ecf20Sopenharmony_ci help 21458c2ecf20Sopenharmony_ci Enable this option to test priority array manager on boot 21468c2ecf20Sopenharmony_ci (or module load). 21478c2ecf20Sopenharmony_ci 21488c2ecf20Sopenharmony_ci If unsure, say N. 21498c2ecf20Sopenharmony_ci 21508c2ecf20Sopenharmony_ciconfig TEST_IRQ_TIMINGS 21518c2ecf20Sopenharmony_ci bool "IRQ timings selftest" 21528c2ecf20Sopenharmony_ci depends on IRQ_TIMINGS 21538c2ecf20Sopenharmony_ci help 21548c2ecf20Sopenharmony_ci Enable this option to test the irq timings code on boot. 21558c2ecf20Sopenharmony_ci 21568c2ecf20Sopenharmony_ci If unsure, say N. 21578c2ecf20Sopenharmony_ci 21588c2ecf20Sopenharmony_ciconfig TEST_LKM 21598c2ecf20Sopenharmony_ci tristate "Test module loading with 'hello world' module" 21608c2ecf20Sopenharmony_ci depends on m 21618c2ecf20Sopenharmony_ci help 21628c2ecf20Sopenharmony_ci This builds the "test_module" module that emits "Hello, world" 21638c2ecf20Sopenharmony_ci on printk when loaded. It is designed to be used for basic 21648c2ecf20Sopenharmony_ci evaluation of the module loading subsystem (for example when 21658c2ecf20Sopenharmony_ci validating module verification). It lacks any extra dependencies, 21668c2ecf20Sopenharmony_ci and will not normally be loaded by the system unless explicitly 21678c2ecf20Sopenharmony_ci requested by name. 21688c2ecf20Sopenharmony_ci 21698c2ecf20Sopenharmony_ci If unsure, say N. 21708c2ecf20Sopenharmony_ci 21718c2ecf20Sopenharmony_ciconfig TEST_BITOPS 21728c2ecf20Sopenharmony_ci tristate "Test module for compilation of bitops operations" 21738c2ecf20Sopenharmony_ci depends on m 21748c2ecf20Sopenharmony_ci help 21758c2ecf20Sopenharmony_ci This builds the "test_bitops" module that is much like the 21768c2ecf20Sopenharmony_ci TEST_LKM module except that it does a basic exercise of the 21778c2ecf20Sopenharmony_ci set/clear_bit macros and get_count_order/long to make sure there are 21788c2ecf20Sopenharmony_ci no compiler warnings from C=1 sparse checker or -Wextra 21798c2ecf20Sopenharmony_ci compilations. It has no dependencies and doesn't run or load unless 21808c2ecf20Sopenharmony_ci explicitly requested by name. for example: modprobe test_bitops. 21818c2ecf20Sopenharmony_ci 21828c2ecf20Sopenharmony_ci If unsure, say N. 21838c2ecf20Sopenharmony_ci 21848c2ecf20Sopenharmony_ciconfig TEST_VMALLOC 21858c2ecf20Sopenharmony_ci tristate "Test module for stress/performance analysis of vmalloc allocator" 21868c2ecf20Sopenharmony_ci default n 21878c2ecf20Sopenharmony_ci depends on MMU 21888c2ecf20Sopenharmony_ci depends on m 21898c2ecf20Sopenharmony_ci help 21908c2ecf20Sopenharmony_ci This builds the "test_vmalloc" module that should be used for 21918c2ecf20Sopenharmony_ci stress and performance analysis. So, any new change for vmalloc 21928c2ecf20Sopenharmony_ci subsystem can be evaluated from performance and stability point 21938c2ecf20Sopenharmony_ci of view. 21948c2ecf20Sopenharmony_ci 21958c2ecf20Sopenharmony_ci If unsure, say N. 21968c2ecf20Sopenharmony_ci 21978c2ecf20Sopenharmony_ciconfig TEST_USER_COPY 21988c2ecf20Sopenharmony_ci tristate "Test user/kernel boundary protections" 21998c2ecf20Sopenharmony_ci depends on m 22008c2ecf20Sopenharmony_ci help 22018c2ecf20Sopenharmony_ci This builds the "test_user_copy" module that runs sanity checks 22028c2ecf20Sopenharmony_ci on the copy_to/from_user infrastructure, making sure basic 22038c2ecf20Sopenharmony_ci user/kernel boundary testing is working. If it fails to load, 22048c2ecf20Sopenharmony_ci a regression has been detected in the user/kernel memory boundary 22058c2ecf20Sopenharmony_ci protections. 22068c2ecf20Sopenharmony_ci 22078c2ecf20Sopenharmony_ci If unsure, say N. 22088c2ecf20Sopenharmony_ci 22098c2ecf20Sopenharmony_ciconfig TEST_BPF 22108c2ecf20Sopenharmony_ci tristate "Test BPF filter functionality" 22118c2ecf20Sopenharmony_ci depends on m && NET 22128c2ecf20Sopenharmony_ci help 22138c2ecf20Sopenharmony_ci This builds the "test_bpf" module that runs various test vectors 22148c2ecf20Sopenharmony_ci against the BPF interpreter or BPF JIT compiler depending on the 22158c2ecf20Sopenharmony_ci current setting. This is in particular useful for BPF JIT compiler 22168c2ecf20Sopenharmony_ci development, but also to run regression tests against changes in 22178c2ecf20Sopenharmony_ci the interpreter code. It also enables test stubs for eBPF maps and 22188c2ecf20Sopenharmony_ci verifier used by user space verifier testsuite. 22198c2ecf20Sopenharmony_ci 22208c2ecf20Sopenharmony_ci If unsure, say N. 22218c2ecf20Sopenharmony_ci 22228c2ecf20Sopenharmony_ciconfig TEST_BLACKHOLE_DEV 22238c2ecf20Sopenharmony_ci tristate "Test blackhole netdev functionality" 22248c2ecf20Sopenharmony_ci depends on m && NET 22258c2ecf20Sopenharmony_ci help 22268c2ecf20Sopenharmony_ci This builds the "test_blackhole_dev" module that validates the 22278c2ecf20Sopenharmony_ci data path through this blackhole netdev. 22288c2ecf20Sopenharmony_ci 22298c2ecf20Sopenharmony_ci If unsure, say N. 22308c2ecf20Sopenharmony_ci 22318c2ecf20Sopenharmony_ciconfig FIND_BIT_BENCHMARK 22328c2ecf20Sopenharmony_ci tristate "Test find_bit functions" 22338c2ecf20Sopenharmony_ci help 22348c2ecf20Sopenharmony_ci This builds the "test_find_bit" module that measure find_*_bit() 22358c2ecf20Sopenharmony_ci functions performance. 22368c2ecf20Sopenharmony_ci 22378c2ecf20Sopenharmony_ci If unsure, say N. 22388c2ecf20Sopenharmony_ci 22398c2ecf20Sopenharmony_ciconfig TEST_FIRMWARE 22408c2ecf20Sopenharmony_ci tristate "Test firmware loading via userspace interface" 22418c2ecf20Sopenharmony_ci depends on FW_LOADER 22428c2ecf20Sopenharmony_ci help 22438c2ecf20Sopenharmony_ci This builds the "test_firmware" module that creates a userspace 22448c2ecf20Sopenharmony_ci interface for testing firmware loading. This can be used to 22458c2ecf20Sopenharmony_ci control the triggering of firmware loading without needing an 22468c2ecf20Sopenharmony_ci actual firmware-using device. The contents can be rechecked by 22478c2ecf20Sopenharmony_ci userspace. 22488c2ecf20Sopenharmony_ci 22498c2ecf20Sopenharmony_ci If unsure, say N. 22508c2ecf20Sopenharmony_ci 22518c2ecf20Sopenharmony_ciconfig TEST_SYSCTL 22528c2ecf20Sopenharmony_ci tristate "sysctl test driver" 22538c2ecf20Sopenharmony_ci depends on PROC_SYSCTL 22548c2ecf20Sopenharmony_ci help 22558c2ecf20Sopenharmony_ci This builds the "test_sysctl" module. This driver enables to test the 22568c2ecf20Sopenharmony_ci proc sysctl interfaces available to drivers safely without affecting 22578c2ecf20Sopenharmony_ci production knobs which might alter system functionality. 22588c2ecf20Sopenharmony_ci 22598c2ecf20Sopenharmony_ci If unsure, say N. 22608c2ecf20Sopenharmony_ci 22618c2ecf20Sopenharmony_ciconfig BITFIELD_KUNIT 22628c2ecf20Sopenharmony_ci tristate "KUnit test bitfield functions at runtime" 22638c2ecf20Sopenharmony_ci depends on KUNIT 22648c2ecf20Sopenharmony_ci help 22658c2ecf20Sopenharmony_ci Enable this option to test the bitfield functions at boot. 22668c2ecf20Sopenharmony_ci 22678c2ecf20Sopenharmony_ci KUnit tests run during boot and output the results to the debug log 22688c2ecf20Sopenharmony_ci in TAP format (http://testanything.org/). Only useful for kernel devs 22698c2ecf20Sopenharmony_ci running the KUnit test harness, and not intended for inclusion into a 22708c2ecf20Sopenharmony_ci production build. 22718c2ecf20Sopenharmony_ci 22728c2ecf20Sopenharmony_ci For more information on KUnit and unit tests in general please refer 22738c2ecf20Sopenharmony_ci to the KUnit documentation in Documentation/dev-tools/kunit/. 22748c2ecf20Sopenharmony_ci 22758c2ecf20Sopenharmony_ci If unsure, say N. 22768c2ecf20Sopenharmony_ci 22778c2ecf20Sopenharmony_ciconfig SYSCTL_KUNIT_TEST 22788c2ecf20Sopenharmony_ci tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS 22798c2ecf20Sopenharmony_ci depends on KUNIT 22808c2ecf20Sopenharmony_ci default KUNIT_ALL_TESTS 22818c2ecf20Sopenharmony_ci help 22828c2ecf20Sopenharmony_ci This builds the proc sysctl unit test, which runs on boot. 22838c2ecf20Sopenharmony_ci Tests the API contract and implementation correctness of sysctl. 22848c2ecf20Sopenharmony_ci For more information on KUnit and unit tests in general please refer 22858c2ecf20Sopenharmony_ci to the KUnit documentation in Documentation/dev-tools/kunit/. 22868c2ecf20Sopenharmony_ci 22878c2ecf20Sopenharmony_ci If unsure, say N. 22888c2ecf20Sopenharmony_ci 22898c2ecf20Sopenharmony_ciconfig LIST_KUNIT_TEST 22908c2ecf20Sopenharmony_ci tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS 22918c2ecf20Sopenharmony_ci depends on KUNIT 22928c2ecf20Sopenharmony_ci default KUNIT_ALL_TESTS 22938c2ecf20Sopenharmony_ci help 22948c2ecf20Sopenharmony_ci This builds the linked list KUnit test suite. 22958c2ecf20Sopenharmony_ci It tests that the API and basic functionality of the list_head type 22968c2ecf20Sopenharmony_ci and associated macros. 22978c2ecf20Sopenharmony_ci 22988c2ecf20Sopenharmony_ci KUnit tests run during boot and output the results to the debug log 22998c2ecf20Sopenharmony_ci in TAP format (https://testanything.org/). Only useful for kernel devs 23008c2ecf20Sopenharmony_ci running the KUnit test harness, and not intended for inclusion into a 23018c2ecf20Sopenharmony_ci production build. 23028c2ecf20Sopenharmony_ci 23038c2ecf20Sopenharmony_ci For more information on KUnit and unit tests in general please refer 23048c2ecf20Sopenharmony_ci to the KUnit documentation in Documentation/dev-tools/kunit/. 23058c2ecf20Sopenharmony_ci 23068c2ecf20Sopenharmony_ci If unsure, say N. 23078c2ecf20Sopenharmony_ci 23088c2ecf20Sopenharmony_ciconfig LINEAR_RANGES_TEST 23098c2ecf20Sopenharmony_ci tristate "KUnit test for linear_ranges" 23108c2ecf20Sopenharmony_ci depends on KUNIT 23118c2ecf20Sopenharmony_ci select LINEAR_RANGES 23128c2ecf20Sopenharmony_ci help 23138c2ecf20Sopenharmony_ci This builds the linear_ranges unit test, which runs on boot. 23148c2ecf20Sopenharmony_ci Tests the linear_ranges logic correctness. 23158c2ecf20Sopenharmony_ci For more information on KUnit and unit tests in general please refer 23168c2ecf20Sopenharmony_ci to the KUnit documentation in Documentation/dev-tools/kunit/. 23178c2ecf20Sopenharmony_ci 23188c2ecf20Sopenharmony_ci If unsure, say N. 23198c2ecf20Sopenharmony_ci 23208c2ecf20Sopenharmony_ciconfig BITS_TEST 23218c2ecf20Sopenharmony_ci tristate "KUnit test for bits.h" 23228c2ecf20Sopenharmony_ci depends on KUNIT 23238c2ecf20Sopenharmony_ci help 23248c2ecf20Sopenharmony_ci This builds the bits unit test. 23258c2ecf20Sopenharmony_ci Tests the logic of macros defined in bits.h. 23268c2ecf20Sopenharmony_ci For more information on KUnit and unit tests in general please refer 23278c2ecf20Sopenharmony_ci to the KUnit documentation in Documentation/dev-tools/kunit/. 23288c2ecf20Sopenharmony_ci 23298c2ecf20Sopenharmony_ci If unsure, say N. 23308c2ecf20Sopenharmony_ci 23318c2ecf20Sopenharmony_ciconfig TEST_UDELAY 23328c2ecf20Sopenharmony_ci tristate "udelay test driver" 23338c2ecf20Sopenharmony_ci help 23348c2ecf20Sopenharmony_ci This builds the "udelay_test" module that helps to make sure 23358c2ecf20Sopenharmony_ci that udelay() is working properly. 23368c2ecf20Sopenharmony_ci 23378c2ecf20Sopenharmony_ci If unsure, say N. 23388c2ecf20Sopenharmony_ci 23398c2ecf20Sopenharmony_ciconfig TEST_STATIC_KEYS 23408c2ecf20Sopenharmony_ci tristate "Test static keys" 23418c2ecf20Sopenharmony_ci depends on m 23428c2ecf20Sopenharmony_ci help 23438c2ecf20Sopenharmony_ci Test the static key interfaces. 23448c2ecf20Sopenharmony_ci 23458c2ecf20Sopenharmony_ci If unsure, say N. 23468c2ecf20Sopenharmony_ci 23478c2ecf20Sopenharmony_ciconfig TEST_KMOD 23488c2ecf20Sopenharmony_ci tristate "kmod stress tester" 23498c2ecf20Sopenharmony_ci depends on m 23508c2ecf20Sopenharmony_ci depends on NETDEVICES && NET_CORE && INET # for TUN 23518c2ecf20Sopenharmony_ci depends on BLOCK 23528c2ecf20Sopenharmony_ci select TEST_LKM 23538c2ecf20Sopenharmony_ci select XFS_FS 23548c2ecf20Sopenharmony_ci select TUN 23558c2ecf20Sopenharmony_ci select BTRFS_FS 23568c2ecf20Sopenharmony_ci help 23578c2ecf20Sopenharmony_ci Test the kernel's module loading mechanism: kmod. kmod implements 23588c2ecf20Sopenharmony_ci support to load modules using the Linux kernel's usermode helper. 23598c2ecf20Sopenharmony_ci This test provides a series of tests against kmod. 23608c2ecf20Sopenharmony_ci 23618c2ecf20Sopenharmony_ci Although technically you can either build test_kmod as a module or 23628c2ecf20Sopenharmony_ci into the kernel we disallow building it into the kernel since 23638c2ecf20Sopenharmony_ci it stress tests request_module() and this will very likely cause 23648c2ecf20Sopenharmony_ci some issues by taking over precious threads available from other 23658c2ecf20Sopenharmony_ci module load requests, ultimately this could be fatal. 23668c2ecf20Sopenharmony_ci 23678c2ecf20Sopenharmony_ci To run tests run: 23688c2ecf20Sopenharmony_ci 23698c2ecf20Sopenharmony_ci tools/testing/selftests/kmod/kmod.sh --help 23708c2ecf20Sopenharmony_ci 23718c2ecf20Sopenharmony_ci If unsure, say N. 23728c2ecf20Sopenharmony_ci 23738c2ecf20Sopenharmony_ciconfig TEST_DEBUG_VIRTUAL 23748c2ecf20Sopenharmony_ci tristate "Test CONFIG_DEBUG_VIRTUAL feature" 23758c2ecf20Sopenharmony_ci depends on DEBUG_VIRTUAL 23768c2ecf20Sopenharmony_ci help 23778c2ecf20Sopenharmony_ci Test the kernel's ability to detect incorrect calls to 23788c2ecf20Sopenharmony_ci virt_to_phys() done against the non-linear part of the 23798c2ecf20Sopenharmony_ci kernel's virtual address map. 23808c2ecf20Sopenharmony_ci 23818c2ecf20Sopenharmony_ci If unsure, say N. 23828c2ecf20Sopenharmony_ci 23838c2ecf20Sopenharmony_ciconfig TEST_MEMCAT_P 23848c2ecf20Sopenharmony_ci tristate "Test memcat_p() helper function" 23858c2ecf20Sopenharmony_ci help 23868c2ecf20Sopenharmony_ci Test the memcat_p() helper for correctly merging two 23878c2ecf20Sopenharmony_ci pointer arrays together. 23888c2ecf20Sopenharmony_ci 23898c2ecf20Sopenharmony_ci If unsure, say N. 23908c2ecf20Sopenharmony_ci 23918c2ecf20Sopenharmony_ciconfig TEST_LIVEPATCH 23928c2ecf20Sopenharmony_ci tristate "Test livepatching" 23938c2ecf20Sopenharmony_ci default n 23948c2ecf20Sopenharmony_ci depends on DYNAMIC_DEBUG 23958c2ecf20Sopenharmony_ci depends on LIVEPATCH 23968c2ecf20Sopenharmony_ci depends on m 23978c2ecf20Sopenharmony_ci help 23988c2ecf20Sopenharmony_ci Test kernel livepatching features for correctness. The tests will 23998c2ecf20Sopenharmony_ci load test modules that will be livepatched in various scenarios. 24008c2ecf20Sopenharmony_ci 24018c2ecf20Sopenharmony_ci To run all the livepatching tests: 24028c2ecf20Sopenharmony_ci 24038c2ecf20Sopenharmony_ci make -C tools/testing/selftests TARGETS=livepatch run_tests 24048c2ecf20Sopenharmony_ci 24058c2ecf20Sopenharmony_ci Alternatively, individual tests may be invoked: 24068c2ecf20Sopenharmony_ci 24078c2ecf20Sopenharmony_ci tools/testing/selftests/livepatch/test-callbacks.sh 24088c2ecf20Sopenharmony_ci tools/testing/selftests/livepatch/test-livepatch.sh 24098c2ecf20Sopenharmony_ci tools/testing/selftests/livepatch/test-shadow-vars.sh 24108c2ecf20Sopenharmony_ci 24118c2ecf20Sopenharmony_ci If unsure, say N. 24128c2ecf20Sopenharmony_ci 24138c2ecf20Sopenharmony_ciconfig TEST_OBJAGG 24148c2ecf20Sopenharmony_ci tristate "Perform selftest on object aggreration manager" 24158c2ecf20Sopenharmony_ci default n 24168c2ecf20Sopenharmony_ci depends on OBJAGG 24178c2ecf20Sopenharmony_ci help 24188c2ecf20Sopenharmony_ci Enable this option to test object aggregation manager on boot 24198c2ecf20Sopenharmony_ci (or module load). 24208c2ecf20Sopenharmony_ci 24218c2ecf20Sopenharmony_ci 24228c2ecf20Sopenharmony_ciconfig TEST_STACKINIT 24238c2ecf20Sopenharmony_ci tristate "Test level of stack variable initialization" 24248c2ecf20Sopenharmony_ci help 24258c2ecf20Sopenharmony_ci Test if the kernel is zero-initializing stack variables and 24268c2ecf20Sopenharmony_ci padding. Coverage is controlled by compiler flags, 24278c2ecf20Sopenharmony_ci CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF, 24288c2ecf20Sopenharmony_ci or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL. 24298c2ecf20Sopenharmony_ci 24308c2ecf20Sopenharmony_ci If unsure, say N. 24318c2ecf20Sopenharmony_ci 24328c2ecf20Sopenharmony_ciconfig TEST_MEMINIT 24338c2ecf20Sopenharmony_ci tristate "Test heap/page initialization" 24348c2ecf20Sopenharmony_ci help 24358c2ecf20Sopenharmony_ci Test if the kernel is zero-initializing heap and page allocations. 24368c2ecf20Sopenharmony_ci This can be useful to test init_on_alloc and init_on_free features. 24378c2ecf20Sopenharmony_ci 24388c2ecf20Sopenharmony_ci If unsure, say N. 24398c2ecf20Sopenharmony_ci 24408c2ecf20Sopenharmony_ciconfig TEST_HMM 24418c2ecf20Sopenharmony_ci tristate "Test HMM (Heterogeneous Memory Management)" 24428c2ecf20Sopenharmony_ci depends on TRANSPARENT_HUGEPAGE 24438c2ecf20Sopenharmony_ci depends on DEVICE_PRIVATE 24448c2ecf20Sopenharmony_ci select HMM_MIRROR 24458c2ecf20Sopenharmony_ci select MMU_NOTIFIER 24468c2ecf20Sopenharmony_ci help 24478c2ecf20Sopenharmony_ci This is a pseudo device driver solely for testing HMM. 24488c2ecf20Sopenharmony_ci Say M here if you want to build the HMM test module. 24498c2ecf20Sopenharmony_ci Doing so will allow you to run tools/testing/selftest/vm/hmm-tests. 24508c2ecf20Sopenharmony_ci 24518c2ecf20Sopenharmony_ci If unsure, say N. 24528c2ecf20Sopenharmony_ci 24538c2ecf20Sopenharmony_ciconfig TEST_FREE_PAGES 24548c2ecf20Sopenharmony_ci tristate "Test freeing pages" 24558c2ecf20Sopenharmony_ci help 24568c2ecf20Sopenharmony_ci Test that a memory leak does not occur due to a race between 24578c2ecf20Sopenharmony_ci freeing a block of pages and a speculative page reference. 24588c2ecf20Sopenharmony_ci Loading this module is safe if your kernel has the bug fixed. 24598c2ecf20Sopenharmony_ci If the bug is not fixed, it will leak gigabytes of memory and 24608c2ecf20Sopenharmony_ci probably OOM your system. 24618c2ecf20Sopenharmony_ci 24628c2ecf20Sopenharmony_ciconfig TEST_FPU 24638c2ecf20Sopenharmony_ci tristate "Test floating point operations in kernel space" 24648c2ecf20Sopenharmony_ci depends on X86 && !KCOV_INSTRUMENT_ALL 24658c2ecf20Sopenharmony_ci help 24668c2ecf20Sopenharmony_ci Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu 24678c2ecf20Sopenharmony_ci which will trigger a sequence of floating point operations. This is used 24688c2ecf20Sopenharmony_ci for self-testing floating point control register setting in 24698c2ecf20Sopenharmony_ci kernel_fpu_begin(). 24708c2ecf20Sopenharmony_ci 24718c2ecf20Sopenharmony_ci If unsure, say N. 24728c2ecf20Sopenharmony_ci 24738c2ecf20Sopenharmony_ciendif # RUNTIME_TESTING_MENU 24748c2ecf20Sopenharmony_ci 24758c2ecf20Sopenharmony_ciconfig MEMTEST 24768c2ecf20Sopenharmony_ci bool "Memtest" 24778c2ecf20Sopenharmony_ci help 24788c2ecf20Sopenharmony_ci This option adds a kernel parameter 'memtest', which allows memtest 24798c2ecf20Sopenharmony_ci to be set. 24808c2ecf20Sopenharmony_ci memtest=0, mean disabled; -- default 24818c2ecf20Sopenharmony_ci memtest=1, mean do 1 test pattern; 24828c2ecf20Sopenharmony_ci ... 24838c2ecf20Sopenharmony_ci memtest=17, mean do 17 test patterns. 24848c2ecf20Sopenharmony_ci If you are unsure how to answer this question, answer N. 24858c2ecf20Sopenharmony_ci 24868c2ecf20Sopenharmony_ci 24878c2ecf20Sopenharmony_ci 24888c2ecf20Sopenharmony_ciconfig HYPERV_TESTING 24898c2ecf20Sopenharmony_ci bool "Microsoft Hyper-V driver testing" 24908c2ecf20Sopenharmony_ci default n 24918c2ecf20Sopenharmony_ci depends on HYPERV && DEBUG_FS 24928c2ecf20Sopenharmony_ci help 24938c2ecf20Sopenharmony_ci Select this option to enable Hyper-V vmbus testing. 24948c2ecf20Sopenharmony_ci 24958c2ecf20Sopenharmony_ciendmenu # "Kernel Testing and Coverage" 24968c2ecf20Sopenharmony_ci 24978c2ecf20Sopenharmony_cisource "Documentation/Kconfig" 24988c2ecf20Sopenharmony_ci 24998c2ecf20Sopenharmony_ciendmenu # Kernel hacking 2500