xref: /openbmc/linux/lib/Kconfig.debug (revision 2166cb2e)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
206ec64b8SChristoph Hellwigmenu "Kernel hacking"
306ec64b8SChristoph Hellwig
4604ff0dcSDave Hansenmenu "printk and dmesg options"
51da177e4SLinus Torvalds
61da177e4SLinus Torvaldsconfig PRINTK_TIME
71da177e4SLinus Torvalds	bool "Show timing information on printks"
8d3b8b6e5SRandy Dunlap	depends on PRINTK
91da177e4SLinus Torvalds	help
10649e6ee3SKay Sievers	  Selecting this option causes time stamps of the printk()
11649e6ee3SKay Sievers	  messages to be added to the output of the syslog() system
12649e6ee3SKay Sievers	  call and at the console.
13649e6ee3SKay Sievers
14649e6ee3SKay Sievers	  The timestamp is always recorded internally, and exported
15649e6ee3SKay Sievers	  to /dev/kmsg. This flag just specifies if the timestamp should
16649e6ee3SKay Sievers	  be included, not that the timestamp is recorded.
17649e6ee3SKay Sievers
18649e6ee3SKay Sievers	  The behavior is also controlled by the kernel command line
198c27ceffSMauro Carvalho Chehab	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
201da177e4SLinus Torvalds
2115ff2069STetsuo Handaconfig PRINTK_CALLER
2215ff2069STetsuo Handa	bool "Show caller information on printks"
2315ff2069STetsuo Handa	depends on PRINTK
2415ff2069STetsuo Handa	help
2515ff2069STetsuo Handa	  Selecting this option causes printk() to add a caller "thread id" (if
2615ff2069STetsuo Handa	  in task context) or a caller "processor id" (if not in task context)
2715ff2069STetsuo Handa	  to every message.
2815ff2069STetsuo Handa
2915ff2069STetsuo Handa	  This option is intended for environments where multiple threads
3015ff2069STetsuo Handa	  concurrently call printk() for many times, for it is difficult to
3115ff2069STetsuo Handa	  interpret without knowing where these lines (or sometimes individual
3215ff2069STetsuo Handa	  line which was divided into multiple lines due to race) came from.
3315ff2069STetsuo Handa
3415ff2069STetsuo Handa	  Since toggling after boot makes the code racy, currently there is
3515ff2069STetsuo Handa	  no option to enable/disable at the kernel command line parameter or
3615ff2069STetsuo Handa	  sysfs interface.
3715ff2069STetsuo Handa
3822f4e66dSStephen Boydconfig STACKTRACE_BUILD_ID
3922f4e66dSStephen Boyd	bool "Show build ID information in stacktraces"
4022f4e66dSStephen Boyd	depends on PRINTK
4122f4e66dSStephen Boyd	help
4222f4e66dSStephen Boyd	  Selecting this option adds build ID information for symbols in
4322f4e66dSStephen Boyd	  stacktraces printed with the printk format '%p[SR]b'.
4422f4e66dSStephen Boyd
4522f4e66dSStephen Boyd	  This option is intended for distros where debuginfo is not easily
4622f4e66dSStephen Boyd	  accessible but can be downloaded given the build ID of the vmlinux or
4722f4e66dSStephen Boyd	  kernel module where the function is located.
4822f4e66dSStephen Boyd
49a8cfdc68SOlof Johanssonconfig CONSOLE_LOGLEVEL_DEFAULT
50a8cfdc68SOlof Johansson	int "Default console loglevel (1-15)"
51a8cfdc68SOlof Johansson	range 1 15
52a8cfdc68SOlof Johansson	default "7"
53a8cfdc68SOlof Johansson	help
54a8cfdc68SOlof Johansson	  Default loglevel to determine what will be printed on the console.
55a8cfdc68SOlof Johansson
56a8cfdc68SOlof Johansson	  Setting a default here is equivalent to passing in loglevel=<x> in
57a8cfdc68SOlof Johansson	  the kernel bootargs. loglevel=<x> continues to override whatever
58a8cfdc68SOlof Johansson	  value is specified here as well.
59a8cfdc68SOlof Johansson
6050f4d9bdSBorislav Petkov	  Note: This does not affect the log level of un-prefixed printk()
61a8cfdc68SOlof Johansson	  usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT
62a8cfdc68SOlof Johansson	  option.
63a8cfdc68SOlof Johansson
6422eceb8bSHans de Goedeconfig CONSOLE_LOGLEVEL_QUIET
6522eceb8bSHans de Goede	int "quiet console loglevel (1-15)"
6622eceb8bSHans de Goede	range 1 15
6722eceb8bSHans de Goede	default "4"
6822eceb8bSHans de Goede	help
6922eceb8bSHans de Goede	  loglevel to use when "quiet" is passed on the kernel commandline.
7022eceb8bSHans de Goede
7122eceb8bSHans de Goede	  When "quiet" is passed on the kernel commandline this loglevel
7222eceb8bSHans de Goede	  will be used as the loglevel. IOW passing "quiet" will be the
7322eceb8bSHans de Goede	  equivalent of passing "loglevel=<CONSOLE_LOGLEVEL_QUIET>"
7422eceb8bSHans de Goede
7542a9dc0bSAlex Elderconfig MESSAGE_LOGLEVEL_DEFAULT
765af5bcb8SMandeep Singh Baines	int "Default message log level (1-7)"
775af5bcb8SMandeep Singh Baines	range 1 7
785af5bcb8SMandeep Singh Baines	default "4"
795af5bcb8SMandeep Singh Baines	help
805af5bcb8SMandeep Singh Baines	  Default log level for printk statements with no specified priority.
815af5bcb8SMandeep Singh Baines
825af5bcb8SMandeep Singh Baines	  This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
835af5bcb8SMandeep Singh Baines	  that are auditing their logs closely may want to set it to a lower
845af5bcb8SMandeep Singh Baines	  priority.
855af5bcb8SMandeep Singh Baines
86a8cfdc68SOlof Johansson	  Note: This does not affect what message level gets printed on the console
87a8cfdc68SOlof Johansson	  by default. To change that, use loglevel=<x> in the kernel bootargs,
88a8cfdc68SOlof Johansson	  or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value.
89a8cfdc68SOlof Johansson
90604ff0dcSDave Hansenconfig BOOT_PRINTK_DELAY
91604ff0dcSDave Hansen	bool "Delay each boot printk message by N milliseconds"
92604ff0dcSDave Hansen	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
93604ff0dcSDave Hansen	help
94604ff0dcSDave Hansen	  This build option allows you to read kernel boot messages
95604ff0dcSDave Hansen	  by inserting a short delay after each one.  The delay is
96604ff0dcSDave Hansen	  specified in milliseconds on the kernel command line,
97604ff0dcSDave Hansen	  using "boot_delay=N".
98604ff0dcSDave Hansen
99604ff0dcSDave Hansen	  It is likely that you would also need to use "lpj=M" to preset
100604ff0dcSDave Hansen	  the "loops per jiffie" value.
101604ff0dcSDave Hansen	  See a previous boot log for the "lpj" value to use for your
102604ff0dcSDave Hansen	  system, and then set "lpj=M" before setting "boot_delay=N".
103604ff0dcSDave Hansen	  NOTE:  Using this option may adversely affect SMP systems.
104604ff0dcSDave Hansen	  I.e., processors other than the first one may not boot up.
105604ff0dcSDave Hansen	  BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
106604ff0dcSDave Hansen	  what it believes to be lockup conditions.
107604ff0dcSDave Hansen
108604ff0dcSDave Hansenconfig DYNAMIC_DEBUG
109604ff0dcSDave Hansen	bool "Enable dynamic printk() support"
110604ff0dcSDave Hansen	default n
111604ff0dcSDave Hansen	depends on PRINTK
112239a5791SGreg Kroah-Hartman	depends on (DEBUG_FS || PROC_FS)
113ceabef7dSOrson Zhai	select DYNAMIC_DEBUG_CORE
114604ff0dcSDave Hansen	help
115604ff0dcSDave Hansen
116604ff0dcSDave Hansen	  Compiles debug level messages into the kernel, which would not
117604ff0dcSDave Hansen	  otherwise be available at runtime. These messages can then be
118604ff0dcSDave Hansen	  enabled/disabled based on various levels of scope - per source file,
119604ff0dcSDave Hansen	  function, module, format string, and line number. This mechanism
120604ff0dcSDave Hansen	  implicitly compiles in all pr_debug() and dev_dbg() calls, which
121604ff0dcSDave Hansen	  enlarges the kernel text size by about 2%.
122604ff0dcSDave Hansen
123604ff0dcSDave Hansen	  If a source file is compiled with DEBUG flag set, any
124604ff0dcSDave Hansen	  pr_debug() calls in it are enabled by default, but can be
125604ff0dcSDave Hansen	  disabled at runtime as below.  Note that DEBUG flag is
126604ff0dcSDave Hansen	  turned on by many CONFIG_*DEBUG* options.
127604ff0dcSDave Hansen
128604ff0dcSDave Hansen	  Usage:
129604ff0dcSDave Hansen
130604ff0dcSDave Hansen	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
131239a5791SGreg Kroah-Hartman	  which is contained in the 'debugfs' filesystem or procfs.
132239a5791SGreg Kroah-Hartman	  Thus, the debugfs or procfs filesystem must first be mounted before
133239a5791SGreg Kroah-Hartman	  making use of this feature.
134604ff0dcSDave Hansen	  We refer the control file as: <debugfs>/dynamic_debug/control. This
135604ff0dcSDave Hansen	  file contains a list of the debug statements that can be enabled. The
136604ff0dcSDave Hansen	  format for each line of the file is:
137604ff0dcSDave Hansen
138604ff0dcSDave Hansen		filename:lineno [module]function flags format
139604ff0dcSDave Hansen
140604ff0dcSDave Hansen	  filename : source file of the debug statement
141604ff0dcSDave Hansen	  lineno : line number of the debug statement
142604ff0dcSDave Hansen	  module : module that contains the debug statement
143604ff0dcSDave Hansen	  function : function that contains the debug statement
144604ff0dcSDave Hansen	  flags : '=p' means the line is turned 'on' for printing
145604ff0dcSDave Hansen	  format : the format used for the debug statement
146604ff0dcSDave Hansen
147604ff0dcSDave Hansen	  From a live system:
148604ff0dcSDave Hansen
149604ff0dcSDave Hansen		nullarbor:~ # cat <debugfs>/dynamic_debug/control
150604ff0dcSDave Hansen		# filename:lineno [module]function flags format
151604ff0dcSDave Hansen		fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
152604ff0dcSDave Hansen		fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
153604ff0dcSDave Hansen		fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
154604ff0dcSDave Hansen
155604ff0dcSDave Hansen	  Example usage:
156604ff0dcSDave Hansen
157604ff0dcSDave Hansen		// enable the message at line 1603 of file svcsock.c
158604ff0dcSDave Hansen		nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
159604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
160604ff0dcSDave Hansen
161604ff0dcSDave Hansen		// enable all the messages in file svcsock.c
162604ff0dcSDave Hansen		nullarbor:~ # echo -n 'file svcsock.c +p' >
163604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
164604ff0dcSDave Hansen
165604ff0dcSDave Hansen		// enable all the messages in the NFS server module
166604ff0dcSDave Hansen		nullarbor:~ # echo -n 'module nfsd +p' >
167604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
168604ff0dcSDave Hansen
169604ff0dcSDave Hansen		// enable all 12 messages in the function svc_process()
170604ff0dcSDave Hansen		nullarbor:~ # echo -n 'func svc_process +p' >
171604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
172604ff0dcSDave Hansen
173604ff0dcSDave Hansen		// disable all 12 messages in the function svc_process()
174604ff0dcSDave Hansen		nullarbor:~ # echo -n 'func svc_process -p' >
175604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
176604ff0dcSDave Hansen
177f8998c22SHans Holmberg	  See Documentation/admin-guide/dynamic-debug-howto.rst for additional
178f8998c22SHans Holmberg	  information.
179604ff0dcSDave Hansen
180ceabef7dSOrson Zhaiconfig DYNAMIC_DEBUG_CORE
181ceabef7dSOrson Zhai	bool "Enable core function of dynamic debug support"
182ceabef7dSOrson Zhai	depends on PRINTK
183ceabef7dSOrson Zhai	depends on (DEBUG_FS || PROC_FS)
184ceabef7dSOrson Zhai	help
185ceabef7dSOrson Zhai	  Enable core functional support of dynamic debug. It is useful
186ceabef7dSOrson Zhai	  when you want to tie dynamic debug to your kernel modules with
187ceabef7dSOrson Zhai	  DYNAMIC_DEBUG_MODULE defined for each of them, especially for
188ceabef7dSOrson Zhai	  the case of embedded system where the kernel image size is
189ceabef7dSOrson Zhai	  sensitive for people.
190ceabef7dSOrson Zhai
19157f5677eSRasmus Villemoesconfig SYMBOLIC_ERRNAME
19257f5677eSRasmus Villemoes	bool "Support symbolic error names in printf"
19357f5677eSRasmus Villemoes	default y if PRINTK
19457f5677eSRasmus Villemoes	help
19557f5677eSRasmus Villemoes	  If you say Y here, the kernel's printf implementation will
19657f5677eSRasmus Villemoes	  be able to print symbolic error names such as ENOSPC instead
19757f5677eSRasmus Villemoes	  of the number 28. It makes the kernel image slightly larger
19857f5677eSRasmus Villemoes	  (about 3KB), but can make the kernel logs easier to read.
19957f5677eSRasmus Villemoes
2002b05bb75SChangbin Duconfig DEBUG_BUGVERBOSE
2012b05bb75SChangbin Du	bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
2022b05bb75SChangbin Du	depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
2032b05bb75SChangbin Du	default y
2042b05bb75SChangbin Du	help
2052b05bb75SChangbin Du	  Say Y here to make BUG() panics output the file name and line number
2062b05bb75SChangbin Du	  of the BUG call as well as the EIP and oops trace.  This aids
2072b05bb75SChangbin Du	  debugging but costs about 70-100K of memory.
2082b05bb75SChangbin Du
209604ff0dcSDave Hansenendmenu # "printk and dmesg options"
210604ff0dcSDave Hansen
211f9b3cd24SKees Cookconfig DEBUG_KERNEL
212f9b3cd24SKees Cook	bool "Kernel debugging"
213f9b3cd24SKees Cook	help
214f9b3cd24SKees Cook	  Say Y here if you are developing drivers or trying to debug and
215f9b3cd24SKees Cook	  identify kernel problems.
216f9b3cd24SKees Cook
217f9b3cd24SKees Cookconfig DEBUG_MISC
218f9b3cd24SKees Cook	bool "Miscellaneous debug code"
219f9b3cd24SKees Cook	default DEBUG_KERNEL
220f9b3cd24SKees Cook	depends on DEBUG_KERNEL
221f9b3cd24SKees Cook	help
222f9b3cd24SKees Cook	  Say Y here if you need to enable miscellaneous debug code that should
223f9b3cd24SKees Cook	  be under a more specific debug option but isn't.
224f9b3cd24SKees Cook
2256dfc0665SDave Hansenmenu "Compile-time checks and compiler options"
2266dfc0665SDave Hansen
2276dfc0665SDave Hansenconfig DEBUG_INFO
228f9b3cd24SKees Cook	bool
2296dfc0665SDave Hansen	help
230f9b3cd24SKees Cook	  A kernel debug info option other than "None" has been selected
231f9b3cd24SKees Cook	  in the "Debug information" choice below, indicating that debug
232f9b3cd24SKees Cook	  information will be generated for build targets.
233f9b3cd24SKees Cook
2340a6de78cSNathan Chancellor# Clang is known to generate .{s,u}leb128 with symbol deltas with DWARF5, which
2350a6de78cSNathan Chancellor# some targets may not support: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
2360a6de78cSNathan Chancellorconfig AS_HAS_NON_CONST_LEB128
2370a6de78cSNathan Chancellor	def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:)
2380a6de78cSNathan Chancellor
239f9b3cd24SKees Cookchoice
240f9b3cd24SKees Cook	prompt "Debug information"
241f9b3cd24SKees Cook	depends on DEBUG_KERNEL
242f9b3cd24SKees Cook	help
243f9b3cd24SKees Cook	  Selecting something other than "None" results in a kernel image
244f9b3cd24SKees Cook	  that will include debugging info resulting in a larger kernel image.
2456dfc0665SDave Hansen	  This adds debug symbols to the kernel and modules (gcc -g), and
2466dfc0665SDave Hansen	  is needed if you intend to use kernel crashdump or binary object
2476dfc0665SDave Hansen	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
2486dfc0665SDave Hansen
249f9b3cd24SKees Cook	  Choose which version of DWARF debug info to emit. If unsure,
250f9b3cd24SKees Cook	  select "Toolchain default".
251f9b3cd24SKees Cook
252f9b3cd24SKees Cookconfig DEBUG_INFO_NONE
253f9b3cd24SKees Cook	bool "Disable debug information"
254f9b3cd24SKees Cook	help
255f9b3cd24SKees Cook	  Do not build the kernel with debugging information, which will
256f9b3cd24SKees Cook	  result in a faster and smaller build.
257f9b3cd24SKees Cook
258f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
259f9b3cd24SKees Cook	bool "Rely on the toolchain's implicit default DWARF version"
260f9b3cd24SKees Cook	select DEBUG_INFO
2610a6de78cSNathan Chancellor	depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
262f9b3cd24SKees Cook	help
263f9b3cd24SKees Cook	  The implicit default version of DWARF debug info produced by a
264f9b3cd24SKees Cook	  toolchain changes over time.
265f9b3cd24SKees Cook
266f9b3cd24SKees Cook	  This can break consumers of the debug info that haven't upgraded to
267f9b3cd24SKees Cook	  support newer revisions, and prevent testing newer versions, but
268f9b3cd24SKees Cook	  those should be less common scenarios.
269f9b3cd24SKees Cook
270f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF4
271f9b3cd24SKees Cook	bool "Generate DWARF Version 4 debuginfo"
272f9b3cd24SKees Cook	select DEBUG_INFO
2734f001a21SMasahiro Yamada	depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)
274f9b3cd24SKees Cook	help
27532ef9e50SNick Desaulniers	  Generate DWARF v4 debug info. This requires gcc 4.5+, binutils 2.35.2
27632ef9e50SNick Desaulniers	  if using clang without clang's integrated assembler, and gdb 7.0+.
277f9b3cd24SKees Cook
278f9b3cd24SKees Cook	  If you have consumers of DWARF debug info that are not ready for
279f9b3cd24SKees Cook	  newer revisions of DWARF, you may wish to choose this or have your
280f9b3cd24SKees Cook	  config select this.
281f9b3cd24SKees Cook
282f9b3cd24SKees Cookconfig DEBUG_INFO_DWARF5
283f9b3cd24SKees Cook	bool "Generate DWARF Version 5 debuginfo"
284f9b3cd24SKees Cook	select DEBUG_INFO
2850a6de78cSNathan Chancellor	depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
286f9b3cd24SKees Cook	help
287f9b3cd24SKees Cook	  Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
288f9b3cd24SKees Cook	  5.0+ accepts the -gdwarf-5 flag but only had partial support for some
289f9b3cd24SKees Cook	  draft features until 7.0), and gdb 8.0+.
290f9b3cd24SKees Cook
291f9b3cd24SKees Cook	  Changes to the structure of debug info in Version 5 allow for around
292f9b3cd24SKees Cook	  15-18% savings in resulting image and debug info section sizes as
293f9b3cd24SKees Cook	  compared to DWARF Version 4. DWARF Version 5 standardizes previous
294f9b3cd24SKees Cook	  extensions such as accelerators for symbol indexing and the format
295f9b3cd24SKees Cook	  for fission (.dwo/.dwp) files. Users may not want to select this
296f9b3cd24SKees Cook	  config if they rely on tooling that has not yet been updated to
297f9b3cd24SKees Cook	  support DWARF Version 5.
298f9b3cd24SKees Cook
299f9b3cd24SKees Cookendchoice # "Debug information"
3006dfc0665SDave Hansen
301695afd3dSSedat Dilekif DEBUG_INFO
302695afd3dSSedat Dilek
3036dfc0665SDave Hansenconfig DEBUG_INFO_REDUCED
3046dfc0665SDave Hansen	bool "Reduce debugging information"
3056dfc0665SDave Hansen	help
3066dfc0665SDave Hansen	  If you say Y here gcc is instructed to generate less debugging
3076dfc0665SDave Hansen	  information for structure types. This means that tools that
3086dfc0665SDave Hansen	  need full debugging information (like kgdb or systemtap) won't
3096dfc0665SDave Hansen	  be happy. But if you merely need debugging information to
3106dfc0665SDave Hansen	  resolve line numbers there is no loss. Advantage is that
3116dfc0665SDave Hansen	  build directory object sizes shrink dramatically over a full
3126dfc0665SDave Hansen	  DEBUG_INFO build and compile times are reduced too.
3136dfc0665SDave Hansen	  Only works with newer gcc versions.
3146dfc0665SDave Hansen
3159f8fe647SNick Desaulnierschoice
3169f8fe647SNick Desaulniers	prompt "Compressed Debug information"
3179f8fe647SNick Desaulniers	help
3189f8fe647SNick Desaulniers	  Compress the resulting debug info. Results in smaller debug info sections,
3199f8fe647SNick Desaulniers	  but requires that consumers are able to decompress the results.
3209f8fe647SNick Desaulniers
3219f8fe647SNick Desaulniers	  If unsure, choose DEBUG_INFO_COMPRESSED_NONE.
3229f8fe647SNick Desaulniers
3239f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_NONE
3249f8fe647SNick Desaulniers	bool "Don't compress debug information"
3259f8fe647SNick Desaulniers	help
3269f8fe647SNick Desaulniers	  Don't compress debug info sections.
3279f8fe647SNick Desaulniers
3289f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_ZLIB
3299f8fe647SNick Desaulniers	bool "Compress debugging information with zlib"
33010e68b02SNick Desaulniers	depends on $(cc-option,-gz=zlib)
33110e68b02SNick Desaulniers	depends on $(ld-option,--compress-debug-sections=zlib)
33210e68b02SNick Desaulniers	help
33310e68b02SNick Desaulniers	  Compress the debug information using zlib.  Requires GCC 5.0+ or Clang
33410e68b02SNick Desaulniers	  5.0+, binutils 2.26+, and zlib.
33510e68b02SNick Desaulniers
33610e68b02SNick Desaulniers	  Users of dpkg-deb via scripts/package/builddeb may find an increase in
33710e68b02SNick Desaulniers	  size of their debug .deb packages with this config set, due to the
33810e68b02SNick Desaulniers	  debug info being compressed with zlib, then the object files being
33910e68b02SNick Desaulniers	  recompressed with a different compression scheme. But this is still
34010e68b02SNick Desaulniers	  preferable to setting $KDEB_COMPRESS to "none" which would be even
34110e68b02SNick Desaulniers	  larger.
34210e68b02SNick Desaulniers
3439f8fe647SNick Desaulniersconfig DEBUG_INFO_COMPRESSED_ZSTD
3449f8fe647SNick Desaulniers	bool "Compress debugging information with zstd"
3459f8fe647SNick Desaulniers	depends on $(cc-option,-gz=zstd)
3469f8fe647SNick Desaulniers	depends on $(ld-option,--compress-debug-sections=zstd)
3479f8fe647SNick Desaulniers	help
3489f8fe647SNick Desaulniers	  Compress the debug information using zstd.  This may provide better
3499f8fe647SNick Desaulniers	  compression than zlib, for about the same time costs, but requires newer
3509f8fe647SNick Desaulniers	  toolchain support.  Requires GCC 13.0+ or Clang 16.0+, binutils 2.40+, and
3519f8fe647SNick Desaulniers	  zstd.
3529f8fe647SNick Desaulniers
3539f8fe647SNick Desaulniersendchoice # "Compressed Debug information"
3549f8fe647SNick Desaulniers
355866ced95SAndi Kleenconfig DEBUG_INFO_SPLIT
356866ced95SAndi Kleen	bool "Produce split debuginfo in .dwo files"
3579d937444SMasahiro Yamada	depends on $(cc-option,-gsplit-dwarf)
35889775a27SNathan Chancellor	# RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
35989775a27SNathan Chancellor	# prior to 12.x:
36089775a27SNathan Chancellor	# https://github.com/llvm/llvm-project/issues/56642
36189775a27SNathan Chancellor	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
36289775a27SNathan Chancellor	depends on !RISCV || GCC_VERSION >= 120000
363866ced95SAndi Kleen	help
364866ced95SAndi Kleen	  Generate debug info into separate .dwo files. This significantly
365866ced95SAndi Kleen	  reduces the build directory size for builds with DEBUG_INFO,
366866ced95SAndi Kleen	  because it stores the information only once on disk in .dwo
367866ced95SAndi Kleen	  files instead of multiple times in object files and executables.
368866ced95SAndi Kleen	  In addition the debug information is also compressed.
369866ced95SAndi Kleen
370866ced95SAndi Kleen	  Requires recent gcc (4.7+) and recent gdb/binutils.
371866ced95SAndi Kleen	  Any tool that packages or reads debug information would need
372866ced95SAndi Kleen	  to know about the .dwo files and include them.
373866ced95SAndi Kleen	  Incompatible with older versions of ccache.
374866ced95SAndi Kleen
375e83b9f55SAndrii Nakryikoconfig DEBUG_INFO_BTF
3762166cb2eSAndrii Nakryiko	bool "Generate BTF type information"
3777d32e693SSlava Bacherikov	depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED
3787d32e693SSlava Bacherikov	depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST
379d9847eb8SKumar Kartikeya Dwivedi	depends on BPF_SYSCALL
38052deda95SLinus Torvalds	depends on !DEBUG_INFO_DWARF5 || PAHOLE_VERSION >= 121
381e83b9f55SAndrii Nakryiko	help
382e83b9f55SAndrii Nakryiko	  Generate deduplicated BTF type information from DWARF debug info.
383e83b9f55SAndrii Nakryiko	  Turning this on expects presence of pahole tool, which will convert
384e83b9f55SAndrii Nakryiko	  DWARF type info into equivalent deduplicated BTF type info.
385e83b9f55SAndrii Nakryiko
3865f9ae91fSAndrii Nakryikoconfig PAHOLE_HAS_SPLIT_BTF
3876323c813SNathan Chancellor	def_bool PAHOLE_VERSION >= 119
3885f9ae91fSAndrii Nakryiko
3897472d5a6SYonghong Songconfig PAHOLE_HAS_BTF_TAG
3906323c813SNathan Chancellor	def_bool PAHOLE_VERSION >= 123
3917472d5a6SYonghong Song	depends on CC_IS_CLANG
3927472d5a6SYonghong Song	help
3937472d5a6SYonghong Song	  Decide whether pahole emits btf_tag attributes (btf_type_tag and
3947472d5a6SYonghong Song	  btf_decl_tag) or not. Currently only clang compiler implements
3957472d5a6SYonghong Song	  these attributes, so make the config depend on CC_IS_CLANG.
3965f9ae91fSAndrii Nakryiko
397c1177979SMartin Rodriguez Reboredoconfig PAHOLE_HAS_LANG_EXCLUDE
398c1177979SMartin Rodriguez Reboredo	def_bool PAHOLE_VERSION >= 124
399c1177979SMartin Rodriguez Reboredo	help
400c1177979SMartin Rodriguez Reboredo	  Support for the --lang_exclude flag which makes pahole exclude
401c1177979SMartin Rodriguez Reboredo	  compilation units from the supplied language. Used in Kbuild to
402c1177979SMartin Rodriguez Reboredo	  omit Rust CUs which are not supported in version 1.24 of pahole,
403c1177979SMartin Rodriguez Reboredo	  otherwise it would emit malformed kernel and module binaries when
404c1177979SMartin Rodriguez Reboredo	  using DEBUG_INFO_BTF_MODULES.
405c1177979SMartin Rodriguez Reboredo
4065f9ae91fSAndrii Nakryikoconfig DEBUG_INFO_BTF_MODULES
4072166cb2eSAndrii Nakryiko	bool "Generate BTF type information for kernel modules"
4082166cb2eSAndrii Nakryiko	default y
4095f9ae91fSAndrii Nakryiko	depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF
4105f9ae91fSAndrii Nakryiko	help
4115f9ae91fSAndrii Nakryiko	  Generate compact split BTF type information for kernel modules.
4125f9ae91fSAndrii Nakryiko
4135e214f2eSConnor O'Brienconfig MODULE_ALLOW_BTF_MISMATCH
4145e214f2eSConnor O'Brien	bool "Allow loading modules with non-matching BTF type info"
4155e214f2eSConnor O'Brien	depends on DEBUG_INFO_BTF_MODULES
4165e214f2eSConnor O'Brien	help
4175e214f2eSConnor O'Brien	  For modules whose split BTF does not match vmlinux, load without
4185e214f2eSConnor O'Brien	  BTF rather than refusing to load. The default behavior with
4195e214f2eSConnor O'Brien	  module BTF enabled is to reject modules with such mismatches;
4205e214f2eSConnor O'Brien	  this option will still load module BTF where possible but ignore
4215e214f2eSConnor O'Brien	  it when a mismatch is found.
4225e214f2eSConnor O'Brien
4233ee7b3faSJan Kiszkaconfig GDB_SCRIPTS
4243ee7b3faSJan Kiszka	bool "Provide GDB scripts for kernel debugging"
4253ee7b3faSJan Kiszka	help
4263ee7b3faSJan Kiszka	  This creates the required links to GDB helper scripts in the
4273ee7b3faSJan Kiszka	  build directory. If you load vmlinux into gdb, the helper
4283ee7b3faSJan Kiszka	  scripts will be automatically imported by gdb as well, and
4293ee7b3faSJan Kiszka	  additional functions are available to analyze a Linux kernel
430700199b0SAndreas Platschek	  instance. See Documentation/dev-tools/gdb-kernel-debugging.rst
431700199b0SAndreas Platschek	  for further details.
4323ee7b3faSJan Kiszka
433695afd3dSSedat Dilekendif # DEBUG_INFO
434695afd3dSSedat Dilek
43535bb5b1eSAndi Kleenconfig FRAME_WARN
436a83e4ca2SMasahiro Yamada	int "Warn for stack frames larger than"
43735bb5b1eSAndi Kleen	range 0 8192
438ac66998dSAlexander Potapenko	default 0 if KMSAN
4390e07f663SKees Cook	default 2048 if GCC_PLUGIN_LATENT_ENTROPY
4408d192becSHelge Deller	default 2048 if PARISC
4418d192becSHelge Deller	default 1536 if (!64BIT && XTENSA)
442152fe65fSLee Jones	default 1280 if KASAN && !64BIT
4438d192becSHelge Deller	default 1024 if !64BIT
44435bb5b1eSAndi Kleen	default 2048 if 64BIT
44535bb5b1eSAndi Kleen	help
446921757bcSAlexander Potapenko	  Tell the compiler to warn at build time for stack frames larger than this.
44735bb5b1eSAndi Kleen	  Setting this too low will cause a lot of warnings.
44835bb5b1eSAndi Kleen	  Setting it to 0 disables the warning.
44935bb5b1eSAndi Kleen
45099657c78SRandy Dunlapconfig STRIP_ASM_SYMS
45199657c78SRandy Dunlap	bool "Strip assembler-generated symbols during link"
45299657c78SRandy Dunlap	default n
45399657c78SRandy Dunlap	help
45499657c78SRandy Dunlap	  Strip internal assembler-generated symbols during a link (symbols
45599657c78SRandy Dunlap	  that look like '.Lxxx') so they don't pollute the output of
45699657c78SRandy Dunlap	  get_wchan() and suchlike.
45799657c78SRandy Dunlap
4581873e870SAndi Kleenconfig READABLE_ASM
4591873e870SAndi Kleen	bool "Generate readable assembler code"
4601873e870SAndi Kleen	depends on DEBUG_KERNEL
4617d73c3e9SNick Desaulniers	depends on CC_IS_GCC
4621873e870SAndi Kleen	help
4631873e870SAndi Kleen	  Disable some compiler optimizations that tend to generate human unreadable
4641873e870SAndi Kleen	  assembler output. This may make the kernel slightly slower, but it helps
4651873e870SAndi Kleen	  to keep kernel developers who have to stare a lot at assembler listings
4661873e870SAndi Kleen	  sane.
4671873e870SAndi Kleen
468e949f4c2SMasahiro Yamadaconfig HEADERS_INSTALL
469e949f4c2SMasahiro Yamada	bool "Install uapi headers to usr/include"
470bf4735a4SDon Mullis	depends on !UML
471bf4735a4SDon Mullis	help
472e949f4c2SMasahiro Yamada	  This option will install uapi headers (headers exported to user-space)
473e949f4c2SMasahiro Yamada	  into the usr/include directory for use during the kernel build.
474e949f4c2SMasahiro Yamada	  This is unneeded for building the kernel itself, but needed for some
475e949f4c2SMasahiro Yamada	  user-space program samples. It is also needed by some features such
476e949f4c2SMasahiro Yamada	  as uapi header sanity checks.
477e949f4c2SMasahiro Yamada
47891341d4bSSam Ravnborgconfig DEBUG_SECTION_MISMATCH
47991341d4bSSam Ravnborg	bool "Enable full Section mismatch analysis"
4807d73c3e9SNick Desaulniers	depends on CC_IS_GCC
48191341d4bSSam Ravnborg	help
48291341d4bSSam Ravnborg	  The section mismatch analysis checks if there are illegal
48391341d4bSSam Ravnborg	  references from one section to another section.
484e809ab01SMichael Witten	  During linktime or runtime, some sections are dropped;
485e809ab01SMichael Witten	  any use of code/data previously in these sections would
48691341d4bSSam Ravnborg	  most likely result in an oops.
487e809ab01SMichael Witten	  In the code, functions and variables are annotated with
4880db0628dSPaul Gortmaker	  __init,, etc. (see the full list in include/linux/init.h),
489d6fbfa4fSGeert Uytterhoeven	  which results in the code/data being placed in specific sections.
490e809ab01SMichael Witten	  The section mismatch analysis is always performed after a full
491e809ab01SMichael Witten	  kernel build, and enabling this option causes the following
492b7dca6ddSMasahiro Yamada	  additional step to occur:
493e809ab01SMichael Witten	  - Add the option -fno-inline-functions-called-once to gcc commands.
494e809ab01SMichael Witten	    When inlining a function annotated with __init in a non-init
495e809ab01SMichael Witten	    function, we would lose the section information and thus
49691341d4bSSam Ravnborg	    the analysis would not catch the illegal reference.
497e809ab01SMichael Witten	    This option tells gcc to inline less (but it does result in
498e809ab01SMichael Witten	    a larger kernel).
49991341d4bSSam Ravnborg
50047490ec1SNicolas Boichatconfig SECTION_MISMATCH_WARN_ONLY
50147490ec1SNicolas Boichat	bool "Make section mismatch errors non-fatal"
50247490ec1SNicolas Boichat	default y
50347490ec1SNicolas Boichat	help
50447490ec1SNicolas Boichat	  If you say N here, the build process will fail if there are any
50547490ec1SNicolas Boichat	  section mismatch, instead of just throwing warnings.
50647490ec1SNicolas Boichat
50747490ec1SNicolas Boichat	  If unsure, say Y.
50847490ec1SNicolas Boichat
509cf536e18SFeng Tangconfig DEBUG_FORCE_FUNCTION_ALIGN_64B
5101bf18da6SFeng Tang	bool "Force all function address 64B aligned"
5113ed8513cSJisheng Zhang	depends on EXPERT && (X86_64 || ARM64 || PPC32 || PPC64 || ARC || RISCV || S390)
512d49a0626SPeter Zijlstra	select FUNCTION_ALIGNMENT_64B
51309c60546SFeng Tang	help
51409c60546SFeng Tang	  There are cases that a commit from one domain changes the function
51509c60546SFeng Tang	  address alignment of other domains, and cause magic performance
51609c60546SFeng Tang	  bump (regression or improvement). Enable this option will help to
51709c60546SFeng Tang	  verify if the bump is caused by function alignment changes, while
51809c60546SFeng Tang	  it will slightly increase the kernel size and affect icache usage.
51909c60546SFeng Tang
52009c60546SFeng Tang	  It is mainly for debug and performance tuning use.
52109c60546SFeng Tang
5226dfc0665SDave Hansen#
5236dfc0665SDave Hansen# Select this config option from the architecture Kconfig, if it
5246dfc0665SDave Hansen# is preferred to always offer frame pointers as a config
5256dfc0665SDave Hansen# option on the architecture (regardless of KERNEL_DEBUG):
5266dfc0665SDave Hansen#
5276dfc0665SDave Hansenconfig ARCH_WANT_FRAME_POINTERS
5286dfc0665SDave Hansen	bool
5296dfc0665SDave Hansen
5306dfc0665SDave Hansenconfig FRAME_POINTER
5316dfc0665SDave Hansen	bool "Compile the kernel with frame pointers"
532a687a533SArnd Bergmann	depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
5336dfc0665SDave Hansen	default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
5346dfc0665SDave Hansen	help
5356dfc0665SDave Hansen	  If you say Y here the resulting kernel image will be slightly
5366dfc0665SDave Hansen	  larger and slower, but it gives very useful debugging information
5376dfc0665SDave Hansen	  in case of kernel bugs. (precise oopses/stacktraces/warnings)
5386dfc0665SDave Hansen
53903f16cd0SJosh Poimboeufconfig OBJTOOL
54003f16cd0SJosh Poimboeuf	bool
54103f16cd0SJosh Poimboeuf
542b9ab5ebbSJosh Poimboeufconfig STACK_VALIDATION
543b9ab5ebbSJosh Poimboeuf	bool "Compile-time stack metadata validation"
54403f16cd0SJosh Poimboeuf	depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER
54503f16cd0SJosh Poimboeuf	select OBJTOOL
546b9ab5ebbSJosh Poimboeuf	default n
547b9ab5ebbSJosh Poimboeuf	help
54803f16cd0SJosh Poimboeuf	  Validate frame pointer rules at compile-time.  This helps ensure that
54903f16cd0SJosh Poimboeuf	  runtime stack traces are more reliable.
550ee9f8fceSJosh Poimboeuf
551b9ab5ebbSJosh Poimboeuf	  For more information, see
552d6a21f2dSMauro Carvalho Chehab	  tools/objtool/Documentation/objtool.txt.
553b9ab5ebbSJosh Poimboeuf
5540f620cefSJosh Poimboeufconfig NOINSTR_VALIDATION
5556804c1afSPeter Zijlstra	bool
556489e355bSJosh Poimboeuf	depends on HAVE_NOINSTR_VALIDATION && DEBUG_ENTRY
55703f16cd0SJosh Poimboeuf	select OBJTOOL
5586804c1afSPeter Zijlstra	default y
5596804c1afSPeter Zijlstra
5605cc12472SRasmus Villemoesconfig VMLINUX_MAP
5615cc12472SRasmus Villemoes	bool "Generate vmlinux.map file when linking"
5625cc12472SRasmus Villemoes	depends on EXPERT
5635cc12472SRasmus Villemoes	help
5645cc12472SRasmus Villemoes	  Selecting this option will pass "-Map=vmlinux.map" to ld
5655cc12472SRasmus Villemoes	  when linking vmlinux. That file can be useful for verifying
5665cc12472SRasmus Villemoes	  and debugging magic section games, and for seeing which
5675cc12472SRasmus Villemoes	  pieces of code get eliminated with
5685cc12472SRasmus Villemoes	  CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.
5695cc12472SRasmus Villemoes
5706dfc0665SDave Hansenconfig DEBUG_FORCE_WEAK_PER_CPU
5716dfc0665SDave Hansen	bool "Force weak per-cpu definitions"
5726dfc0665SDave Hansen	depends on DEBUG_KERNEL
5736dfc0665SDave Hansen	help
5746dfc0665SDave Hansen	  s390 and alpha require percpu variables in modules to be
5756dfc0665SDave Hansen	  defined weak to work around addressing range issue which
5766dfc0665SDave Hansen	  puts the following two restrictions on percpu variable
5776dfc0665SDave Hansen	  definitions.
5786dfc0665SDave Hansen
5796dfc0665SDave Hansen	  1. percpu symbols must be unique whether static or not
5806dfc0665SDave Hansen	  2. percpu variables can't be defined inside a function
5816dfc0665SDave Hansen
5826dfc0665SDave Hansen	  To ensure that generic code follows the above rules, this
5836dfc0665SDave Hansen	  option forces all percpu variables to be defined as weak.
5846dfc0665SDave Hansen
5856dfc0665SDave Hansenendmenu # "Compiler options"
5866dfc0665SDave Hansen
5876210b640SChangbin Dumenu "Generic Kernel Debugging Instruments"
5886210b640SChangbin Du
5896dfc0665SDave Hansenconfig MAGIC_SYSRQ
5906dfc0665SDave Hansen	bool "Magic SysRq key"
5916dfc0665SDave Hansen	depends on !UML
5926dfc0665SDave Hansen	help
5936dfc0665SDave Hansen	  If you say Y here, you will have some control over the system even
5946dfc0665SDave Hansen	  if the system crashes for example during kernel debugging (e.g., you
5956dfc0665SDave Hansen	  will be able to flush the buffer cache to disk, reboot the system
5966dfc0665SDave Hansen	  immediately or dump some status information). This is accomplished
5976dfc0665SDave Hansen	  by pressing various keys while holding SysRq (Alt+PrintScreen). It
5986dfc0665SDave Hansen	  also works on a serial console (on PC hardware at least), if you
5996dfc0665SDave Hansen	  send a BREAK and then within 5 seconds a command keypress. The
600f8998c22SHans Holmberg	  keys are documented in <file:Documentation/admin-guide/sysrq.rst>.
601f8998c22SHans Holmberg	  Don't say Y unless you really know what this hack does.
6026dfc0665SDave Hansen
6038eaede49SBen Hutchingsconfig MAGIC_SYSRQ_DEFAULT_ENABLE
6048eaede49SBen Hutchings	hex "Enable magic SysRq key functions by default"
6058eaede49SBen Hutchings	depends on MAGIC_SYSRQ
6068eaede49SBen Hutchings	default 0x1
6078eaede49SBen Hutchings	help
6088eaede49SBen Hutchings	  Specifies which SysRq key functions are enabled by default.
6098eaede49SBen Hutchings	  This may be set to 1 or 0 to enable or disable them all, or
610f8998c22SHans Holmberg	  to a bitmask as described in Documentation/admin-guide/sysrq.rst.
6118eaede49SBen Hutchings
612732dbf3aSFelix Fietkauconfig MAGIC_SYSRQ_SERIAL
613732dbf3aSFelix Fietkau	bool "Enable magic SysRq key over serial"
614732dbf3aSFelix Fietkau	depends on MAGIC_SYSRQ
615732dbf3aSFelix Fietkau	default y
616732dbf3aSFelix Fietkau	help
617732dbf3aSFelix Fietkau	  Many embedded boards have a disconnected TTL level serial which can
618732dbf3aSFelix Fietkau	  generate some garbage that can lead to spurious false sysrq detects.
619732dbf3aSFelix Fietkau	  This option allows you to decide whether you want to enable the
620732dbf3aSFelix Fietkau	  magic SysRq key.
621732dbf3aSFelix Fietkau
62268af4317SDmitry Safonovconfig MAGIC_SYSRQ_SERIAL_SEQUENCE
62368af4317SDmitry Safonov	string "Char sequence that enables magic SysRq over serial"
62468af4317SDmitry Safonov	depends on MAGIC_SYSRQ_SERIAL
62568af4317SDmitry Safonov	default ""
62668af4317SDmitry Safonov	help
62768af4317SDmitry Safonov	  Specifies a sequence of characters that can follow BREAK to enable
62868af4317SDmitry Safonov	  SysRq on a serial console.
62968af4317SDmitry Safonov
630d3394b3dSDmitry Safonov	  If unsure, leave an empty string and the option will not be enabled.
631d3394b3dSDmitry Safonov
632ec29a5c1SChangbin Duconfig DEBUG_FS
633ec29a5c1SChangbin Du	bool "Debug Filesystem"
634ec29a5c1SChangbin Du	help
635ec29a5c1SChangbin Du	  debugfs is a virtual file system that kernel developers use to put
636ec29a5c1SChangbin Du	  debugging files into.  Enable this option to be able to read and
637ec29a5c1SChangbin Du	  write to these files.
638ec29a5c1SChangbin Du
639ec29a5c1SChangbin Du	  For detailed documentation on the debugfs API, see
640ec29a5c1SChangbin Du	  Documentation/filesystems/.
641ec29a5c1SChangbin Du
642ec29a5c1SChangbin Du	  If unsure, say N.
643ec29a5c1SChangbin Du
644a24c6f7bSPeter Enderborgchoice
645a24c6f7bSPeter Enderborg	prompt "Debugfs default access"
646a24c6f7bSPeter Enderborg	depends on DEBUG_FS
647a24c6f7bSPeter Enderborg	default DEBUG_FS_ALLOW_ALL
648a24c6f7bSPeter Enderborg	help
649a24c6f7bSPeter Enderborg	  This selects the default access restrictions for debugfs.
650a24c6f7bSPeter Enderborg	  It can be overridden with kernel command line option
651a24c6f7bSPeter Enderborg	  debugfs=[on,no-mount,off]. The restrictions apply for API access
652a24c6f7bSPeter Enderborg	  and filesystem registration.
653a24c6f7bSPeter Enderborg
654a24c6f7bSPeter Enderborgconfig DEBUG_FS_ALLOW_ALL
655a24c6f7bSPeter Enderborg	bool "Access normal"
656a24c6f7bSPeter Enderborg	help
657a24c6f7bSPeter Enderborg	  No restrictions apply. Both API and filesystem registration
658a24c6f7bSPeter Enderborg	  is on. This is the normal default operation.
659a24c6f7bSPeter Enderborg
660a24c6f7bSPeter Enderborgconfig DEBUG_FS_DISALLOW_MOUNT
661a24c6f7bSPeter Enderborg	bool "Do not register debugfs as filesystem"
662a24c6f7bSPeter Enderborg	help
663a24c6f7bSPeter Enderborg	  The API is open but filesystem is not loaded. Clients can still do
664a24c6f7bSPeter Enderborg	  their work and read with debug tools that do not need
665a24c6f7bSPeter Enderborg	  debugfs filesystem.
666a24c6f7bSPeter Enderborg
667a24c6f7bSPeter Enderborgconfig DEBUG_FS_ALLOW_NONE
668a24c6f7bSPeter Enderborg	bool "No access"
669a24c6f7bSPeter Enderborg	help
670a24c6f7bSPeter Enderborg	  Access is off. Clients get -PERM when trying to create nodes in
671a24c6f7bSPeter Enderborg	  debugfs tree and debugfs is not registered as a filesystem.
672a24c6f7bSPeter Enderborg	  Client can then back-off or continue without debugfs access.
673a24c6f7bSPeter Enderborg
674a24c6f7bSPeter Enderborgendchoice
675a24c6f7bSPeter Enderborg
6766210b640SChangbin Dusource "lib/Kconfig.kgdb"
6776210b640SChangbin Dusource "lib/Kconfig.ubsan"
6782645d432SChangbin Dusource "lib/Kconfig.kcsan"
6796210b640SChangbin Du
6806210b640SChangbin Duendmenu
6816210b640SChangbin Du
6824d92b95fSEric Dumazetmenu "Networking Debugging"
6834d92b95fSEric Dumazet
6844d92b95fSEric Dumazetsource "net/Kconfig.debug"
6854d92b95fSEric Dumazet
6864d92b95fSEric Dumazetendmenu # "Networking Debugging"
687c66d7a27SSinan Kaya
6880610c8a8SDave Hansenmenu "Memory Debugging"
689a304e1b8SDavid Woodhouse
6908636a1f9SMasahiro Yamadasource "mm/Kconfig.debug"
69182f67cd9SIngo Molnar
6923ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS
6933ac7fe5aSThomas Gleixner	bool "Debug object operations"
6943ac7fe5aSThomas Gleixner	depends on DEBUG_KERNEL
6953ac7fe5aSThomas Gleixner	help
6963ac7fe5aSThomas Gleixner	  If you say Y here, additional code will be inserted into the
6973ac7fe5aSThomas Gleixner	  kernel to track the life time of various objects and validate
6983ac7fe5aSThomas Gleixner	  the operations on those objects.
6993ac7fe5aSThomas Gleixner
7003ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_SELFTEST
7013ac7fe5aSThomas Gleixner	bool "Debug objects selftest"
7023ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
7033ac7fe5aSThomas Gleixner	help
7043ac7fe5aSThomas Gleixner	  This enables the selftest of the object debug code.
7053ac7fe5aSThomas Gleixner
7063ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_FREE
7073ac7fe5aSThomas Gleixner	bool "Debug objects in freed memory"
7083ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
7093ac7fe5aSThomas Gleixner	help
7103ac7fe5aSThomas Gleixner	  This enables checks whether a k/v free operation frees an area
7113ac7fe5aSThomas Gleixner	  which contains an object which has not been deactivated
7123ac7fe5aSThomas Gleixner	  properly. This can make kmalloc/kfree-intensive workloads
7133ac7fe5aSThomas Gleixner	  much slower.
7143ac7fe5aSThomas Gleixner
715c6f3a97fSThomas Gleixnerconfig DEBUG_OBJECTS_TIMERS
716c6f3a97fSThomas Gleixner	bool "Debug timer objects"
717c6f3a97fSThomas Gleixner	depends on DEBUG_OBJECTS
718c6f3a97fSThomas Gleixner	help
719c6f3a97fSThomas Gleixner	  If you say Y here, additional code will be inserted into the
720c6f3a97fSThomas Gleixner	  timer routines to track the life time of timer objects and
721c6f3a97fSThomas Gleixner	  validate the timer operations.
722c6f3a97fSThomas Gleixner
723dc186ad7SThomas Gleixnerconfig DEBUG_OBJECTS_WORK
724dc186ad7SThomas Gleixner	bool "Debug work objects"
725dc186ad7SThomas Gleixner	depends on DEBUG_OBJECTS
726dc186ad7SThomas Gleixner	help
727dc186ad7SThomas Gleixner	  If you say Y here, additional code will be inserted into the
728dc186ad7SThomas Gleixner	  work queue routines to track the life time of work objects and
729dc186ad7SThomas Gleixner	  validate the work operations.
730dc186ad7SThomas Gleixner
731551d55a9SMathieu Desnoyersconfig DEBUG_OBJECTS_RCU_HEAD
732551d55a9SMathieu Desnoyers	bool "Debug RCU callbacks objects"
733fc2ecf7eSMathieu Desnoyers	depends on DEBUG_OBJECTS
734551d55a9SMathieu Desnoyers	help
735551d55a9SMathieu Desnoyers	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
736551d55a9SMathieu Desnoyers
737e2852ae8STejun Heoconfig DEBUG_OBJECTS_PERCPU_COUNTER
738e2852ae8STejun Heo	bool "Debug percpu counter objects"
739e2852ae8STejun Heo	depends on DEBUG_OBJECTS
740e2852ae8STejun Heo	help
741e2852ae8STejun Heo	  If you say Y here, additional code will be inserted into the
742e2852ae8STejun Heo	  percpu counter routines to track the life time of percpu counter
743e2852ae8STejun Heo	  objects and validate the percpu counter operations.
744e2852ae8STejun Heo
7453ae70205SIngo Molnarconfig DEBUG_OBJECTS_ENABLE_DEFAULT
7463ae70205SIngo Molnar	int "debug_objects bootup default value (0-1)"
7473ae70205SIngo Molnar	range 0 1
7483ae70205SIngo Molnar	default "1"
7493ae70205SIngo Molnar	depends on DEBUG_OBJECTS
7503ae70205SIngo Molnar	help
7513ae70205SIngo Molnar	  Debug objects boot parameter default value
7523ae70205SIngo Molnar
7535035ebc6SRoman Gushchinconfig SHRINKER_DEBUG
7545035ebc6SRoman Gushchin	bool "Enable shrinker debugging support"
7555035ebc6SRoman Gushchin	depends on DEBUG_FS
7565035ebc6SRoman Gushchin	help
7575035ebc6SRoman Gushchin	  Say Y to enable the shrinker debugfs interface which provides
7585035ebc6SRoman Gushchin	  visibility into the kernel memory shrinkers subsystem.
7595035ebc6SRoman Gushchin	  Disable it to avoid an extra memory footprint.
7605035ebc6SRoman Gushchin
7610610c8a8SDave Hansenconfig DEBUG_STACK_USAGE
7620610c8a8SDave Hansen	bool "Stack utilization instrumentation"
7636c31da34SHelge Deller	depends on DEBUG_KERNEL && !IA64
7640610c8a8SDave Hansen	help
7650610c8a8SDave Hansen	  Enables the display of the minimum amount of free stack which each
7660610c8a8SDave Hansen	  task has ever had available in the sysrq-T and sysrq-P debug output.
7670610c8a8SDave Hansen
7680610c8a8SDave Hansen	  This option will slow down process creation somewhat.
7690610c8a8SDave Hansen
770dc9b9638SChangbin Duconfig SCHED_STACK_END_CHECK
771dc9b9638SChangbin Du	bool "Detect stack corruption on calls to schedule()"
772dc9b9638SChangbin Du	depends on DEBUG_KERNEL
773dc9b9638SChangbin Du	default n
774dc9b9638SChangbin Du	help
775dc9b9638SChangbin Du	  This option checks for a stack overrun on calls to schedule().
776dc9b9638SChangbin Du	  If the stack end location is found to be over written always panic as
777dc9b9638SChangbin Du	  the content of the corrupted region can no longer be trusted.
778dc9b9638SChangbin Du	  This is to ensure no erroneous behaviour occurs which could result in
779dc9b9638SChangbin Du	  data corruption or a sporadic crash at a later stage once the region
780dc9b9638SChangbin Du	  is examined. The runtime overhead introduced is minimal.
781dc9b9638SChangbin Du
782399145f9SAnshuman Khandualconfig ARCH_HAS_DEBUG_VM_PGTABLE
783399145f9SAnshuman Khandual	bool
784399145f9SAnshuman Khandual	help
785399145f9SAnshuman Khandual	  An architecture should select this when it can successfully
786399145f9SAnshuman Khandual	  build and run DEBUG_VM_PGTABLE.
787399145f9SAnshuman Khandual
788a738e9baSThomas Gleixnerconfig DEBUG_VM_IRQSOFF
789a738e9baSThomas Gleixner	def_bool DEBUG_VM && !PREEMPT_RT
790a738e9baSThomas Gleixner
7910610c8a8SDave Hansenconfig DEBUG_VM
7920610c8a8SDave Hansen	bool "Debug VM"
7930610c8a8SDave Hansen	depends on DEBUG_KERNEL
7940610c8a8SDave Hansen	help
7950610c8a8SDave Hansen	  Enable this to turn on extended checks in the virtual-memory system
7960610c8a8SDave Hansen	  that may impact performance.
7970610c8a8SDave Hansen
7980610c8a8SDave Hansen	  If unsure, say N.
7990610c8a8SDave Hansen
8002655421aSNicholas Pigginconfig DEBUG_VM_SHOOT_LAZIES
8012655421aSNicholas Piggin	bool "Debug MMU_LAZY_TLB_SHOOTDOWN implementation"
8022655421aSNicholas Piggin	depends on DEBUG_VM
8032655421aSNicholas Piggin	depends on MMU_LAZY_TLB_SHOOTDOWN
8042655421aSNicholas Piggin	help
8052655421aSNicholas Piggin	  Enable additional IPIs that ensure lazy tlb mm references are removed
8062655421aSNicholas Piggin	  before the mm is freed.
8072655421aSNicholas Piggin
8082655421aSNicholas Piggin	  If unsure, say N.
8092655421aSNicholas Piggin
81054a611b6SLiam R. Howlettconfig DEBUG_VM_MAPLE_TREE
81154a611b6SLiam R. Howlett	bool "Debug VM maple trees"
8124f115147SDavidlohr Bueso	depends on DEBUG_VM
81354a611b6SLiam R. Howlett	select DEBUG_MAPLE_TREE
8144f115147SDavidlohr Bueso	help
81554a611b6SLiam R. Howlett	  Enable VM maple tree debugging information and extra validations.
8164f115147SDavidlohr Bueso
8174f115147SDavidlohr Bueso	  If unsure, say N.
8184f115147SDavidlohr Bueso
8190610c8a8SDave Hansenconfig DEBUG_VM_RB
8200610c8a8SDave Hansen	bool "Debug VM red-black trees"
8210610c8a8SDave Hansen	depends on DEBUG_VM
8220610c8a8SDave Hansen	help
823a663dad6SDavidlohr Bueso	  Enable VM red-black tree debugging information and extra validations.
8240610c8a8SDave Hansen
8250610c8a8SDave Hansen	  If unsure, say N.
8260610c8a8SDave Hansen
82795ad9755SKirill A. Shutemovconfig DEBUG_VM_PGFLAGS
82895ad9755SKirill A. Shutemov	bool "Debug page-flags operations"
82995ad9755SKirill A. Shutemov	depends on DEBUG_VM
83095ad9755SKirill A. Shutemov	help
83195ad9755SKirill A. Shutemov	  Enables extra validation on page flags operations.
83295ad9755SKirill A. Shutemov
83395ad9755SKirill A. Shutemov	  If unsure, say N.
83495ad9755SKirill A. Shutemov
835399145f9SAnshuman Khandualconfig DEBUG_VM_PGTABLE
836399145f9SAnshuman Khandual	bool "Debug arch page table for semantics compliance"
837399145f9SAnshuman Khandual	depends on MMU
838399145f9SAnshuman Khandual	depends on ARCH_HAS_DEBUG_VM_PGTABLE
839399145f9SAnshuman Khandual	default y if DEBUG_VM
840399145f9SAnshuman Khandual	help
841399145f9SAnshuman Khandual	  This option provides a debug method which can be used to test
842399145f9SAnshuman Khandual	  architecture page table helper functions on various platforms in
843399145f9SAnshuman Khandual	  verifying if they comply with expected generic MM semantics. This
844399145f9SAnshuman Khandual	  will help architecture code in making sure that any changes or
845399145f9SAnshuman Khandual	  new additions of these helpers still conform to expected
846399145f9SAnshuman Khandual	  semantics of the generic MM. Platforms will have to opt in for
847399145f9SAnshuman Khandual	  this through ARCH_HAS_DEBUG_VM_PGTABLE.
848399145f9SAnshuman Khandual
849399145f9SAnshuman Khandual	  If unsure, say N.
850399145f9SAnshuman Khandual
851fa5b6ec9SLaura Abbottconfig ARCH_HAS_DEBUG_VIRTUAL
852fa5b6ec9SLaura Abbott	bool
853fa5b6ec9SLaura Abbott
8540610c8a8SDave Hansenconfig DEBUG_VIRTUAL
8550610c8a8SDave Hansen	bool "Debug VM translations"
856fa5b6ec9SLaura Abbott	depends on DEBUG_KERNEL && ARCH_HAS_DEBUG_VIRTUAL
8570610c8a8SDave Hansen	help
8580610c8a8SDave Hansen	  Enable some costly sanity checks in virtual to page code. This can
8590610c8a8SDave Hansen	  catch mistakes with virt_to_page() and friends.
8600610c8a8SDave Hansen
8610610c8a8SDave Hansen	  If unsure, say N.
8620610c8a8SDave Hansen
8630610c8a8SDave Hansenconfig DEBUG_NOMMU_REGIONS
8640610c8a8SDave Hansen	bool "Debug the global anon/private NOMMU mapping region tree"
8650610c8a8SDave Hansen	depends on DEBUG_KERNEL && !MMU
8660610c8a8SDave Hansen	help
8670610c8a8SDave Hansen	  This option causes the global tree of anonymous and private mapping
8680610c8a8SDave Hansen	  regions to be regularly checked for invalid topology.
8690610c8a8SDave Hansen
8700610c8a8SDave Hansenconfig DEBUG_MEMORY_INIT
8710610c8a8SDave Hansen	bool "Debug memory initialisation" if EXPERT
8720610c8a8SDave Hansen	default !EXPERT
8730610c8a8SDave Hansen	help
8740610c8a8SDave Hansen	  Enable this for additional checks during memory initialisation.
8750610c8a8SDave Hansen	  The sanity checks verify aspects of the VM such as the memory model
8760610c8a8SDave Hansen	  and other information provided by the architecture. Verbose
8770610c8a8SDave Hansen	  information will be printed at KERN_DEBUG loglevel depending
8780610c8a8SDave Hansen	  on the mminit_loglevel= command-line option.
8790610c8a8SDave Hansen
8800610c8a8SDave Hansen	  If unsure, say Y
8810610c8a8SDave Hansen
8820610c8a8SDave Hansenconfig MEMORY_NOTIFIER_ERROR_INJECT
8830610c8a8SDave Hansen	tristate "Memory hotplug notifier error injection module"
88450f9481eSDavid Hildenbrand	depends on MEMORY_HOTPLUG && NOTIFIER_ERROR_INJECTION
8850610c8a8SDave Hansen	help
8860610c8a8SDave Hansen	  This option provides the ability to inject artificial errors to
8870610c8a8SDave Hansen	  memory hotplug notifier chain callbacks.  It is controlled through
8880610c8a8SDave Hansen	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
8890610c8a8SDave Hansen
8900610c8a8SDave Hansen	  If the notifier call chain should be failed with some events
8910610c8a8SDave Hansen	  notified, write the error code to "actions/<notifier event>/error".
8920610c8a8SDave Hansen
8930610c8a8SDave Hansen	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
8940610c8a8SDave Hansen
8950610c8a8SDave Hansen	  # cd /sys/kernel/debug/notifier-error-inject/memory
8960610c8a8SDave Hansen	  # echo -12 > actions/MEM_GOING_OFFLINE/error
8970610c8a8SDave Hansen	  # echo offline > /sys/devices/system/memory/memoryXXX/state
8980610c8a8SDave Hansen	  bash: echo: write error: Cannot allocate memory
8990610c8a8SDave Hansen
9000610c8a8SDave Hansen	  To compile this code as a module, choose M here: the module will
9010610c8a8SDave Hansen	  be called memory-notifier-error-inject.
9020610c8a8SDave Hansen
9030610c8a8SDave Hansen	  If unsure, say N.
9040610c8a8SDave Hansen
9050610c8a8SDave Hansenconfig DEBUG_PER_CPU_MAPS
9060610c8a8SDave Hansen	bool "Debug access to per_cpu maps"
9070610c8a8SDave Hansen	depends on DEBUG_KERNEL
9080610c8a8SDave Hansen	depends on SMP
9090610c8a8SDave Hansen	help
9100610c8a8SDave Hansen	  Say Y to verify that the per_cpu map being accessed has
9110610c8a8SDave Hansen	  been set up. This adds a fair amount of code to kernel memory
9120610c8a8SDave Hansen	  and decreases performance.
9130610c8a8SDave Hansen
9140610c8a8SDave Hansen	  Say N if unsure.
9150610c8a8SDave Hansen
9166e799cb6SThomas Gleixnerconfig DEBUG_KMAP_LOCAL
9176e799cb6SThomas Gleixner	bool "Debug kmap_local temporary mappings"
9186e799cb6SThomas Gleixner	depends on DEBUG_KERNEL && KMAP_LOCAL
9196e799cb6SThomas Gleixner	help
9206e799cb6SThomas Gleixner	  This option enables additional error checking for the kmap_local
9216e799cb6SThomas Gleixner	  infrastructure.  Disable for production use.
9226e799cb6SThomas Gleixner
9230e91a0c6SThomas Gleixnerconfig ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
9240e91a0c6SThomas Gleixner	bool
9250e91a0c6SThomas Gleixner
9260e91a0c6SThomas Gleixnerconfig DEBUG_KMAP_LOCAL_FORCE_MAP
9270e91a0c6SThomas Gleixner	bool "Enforce kmap_local temporary mappings"
9280e91a0c6SThomas Gleixner	depends on DEBUG_KERNEL && ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
9290e91a0c6SThomas Gleixner	select KMAP_LOCAL
9300e91a0c6SThomas Gleixner	select DEBUG_KMAP_LOCAL
9310e91a0c6SThomas Gleixner	help
9320e91a0c6SThomas Gleixner	  This option enforces temporary mappings through the kmap_local
9330e91a0c6SThomas Gleixner	  mechanism for non-highmem pages and on non-highmem systems.
9340e91a0c6SThomas Gleixner	  Disable this for production systems!
9350e91a0c6SThomas Gleixner
9360610c8a8SDave Hansenconfig DEBUG_HIGHMEM
9370610c8a8SDave Hansen	bool "Highmem debugging"
9380610c8a8SDave Hansen	depends on DEBUG_KERNEL && HIGHMEM
9390e91a0c6SThomas Gleixner	select DEBUG_KMAP_LOCAL_FORCE_MAP if ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
9406e799cb6SThomas Gleixner	select DEBUG_KMAP_LOCAL
9410610c8a8SDave Hansen	help
942b1357c9fSGeert Uytterhoeven	  This option enables additional error checking for high memory
943b1357c9fSGeert Uytterhoeven	  systems.  Disable for production systems.
9440610c8a8SDave Hansen
9450610c8a8SDave Hansenconfig HAVE_DEBUG_STACKOVERFLOW
9460610c8a8SDave Hansen	bool
9470610c8a8SDave Hansen
9480610c8a8SDave Hansenconfig DEBUG_STACKOVERFLOW
9490610c8a8SDave Hansen	bool "Check for stack overflows"
9500610c8a8SDave Hansen	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
951a7f7f624SMasahiro Yamada	help
9520610c8a8SDave Hansen	  Say Y here if you want to check for overflows of kernel, IRQ
953edb0ec07SBorislav Petkov	  and exception stacks (if your architecture uses them). This
9540610c8a8SDave Hansen	  option will show detailed messages if free stack space drops
9550610c8a8SDave Hansen	  below a certain limit.
9560610c8a8SDave Hansen
9570610c8a8SDave Hansen	  These kinds of bugs usually occur when call-chains in the
9580610c8a8SDave Hansen	  kernel get too deep, especially when interrupts are
9590610c8a8SDave Hansen	  involved.
9600610c8a8SDave Hansen
9610610c8a8SDave Hansen	  Use this in cases where you see apparently random memory
9620610c8a8SDave Hansen	  corruption, especially if it appears in 'struct thread_info'
9630610c8a8SDave Hansen
9640610c8a8SDave Hansen	  If in doubt, say "N".
9650610c8a8SDave Hansen
9660b24beccSAndrey Ryabininsource "lib/Kconfig.kasan"
9670ce20dd8SAlexander Potapenkosource "lib/Kconfig.kfence"
968f80be457SAlexander Potapenkosource "lib/Kconfig.kmsan"
9690b24beccSAndrey Ryabinin
9700610c8a8SDave Hansenendmenu # "Memory Debugging"
9710610c8a8SDave Hansen
972f346f4b3SAdrian Bunkconfig DEBUG_SHIRQ
973f346f4b3SAdrian Bunk	bool "Debug shared IRQ handlers"
9740244ad00SMartin Schwidefsky	depends on DEBUG_KERNEL
975f346f4b3SAdrian Bunk	help
9760a2fae2aSWolfram Sang	  Enable this to generate a spurious interrupt just before a shared
9770a2fae2aSWolfram Sang	  interrupt handler is deregistered (generating one when registering
9780a2fae2aSWolfram Sang	  is currently disabled). Drivers need to handle this correctly. Some
9790a2fae2aSWolfram Sang	  don't and need to be caught.
9801da177e4SLinus Torvalds
981f43a289dSChangbin Dumenu "Debug Oops, Lockups and Hangs"
982f43a289dSChangbin Du
983f43a289dSChangbin Duconfig PANIC_ON_OOPS
984f43a289dSChangbin Du	bool "Panic on Oops"
985f43a289dSChangbin Du	help
986f43a289dSChangbin Du	  Say Y here to enable the kernel to panic when it oopses. This
987f43a289dSChangbin Du	  has the same effect as setting oops=panic on the kernel command
988f43a289dSChangbin Du	  line.
989f43a289dSChangbin Du
990f43a289dSChangbin Du	  This feature is useful to ensure that the kernel does not do
991f43a289dSChangbin Du	  anything erroneous after an oops which could result in data
992f43a289dSChangbin Du	  corruption or other issues.
993f43a289dSChangbin Du
994f43a289dSChangbin Du	  Say N if unsure.
995f43a289dSChangbin Du
996f43a289dSChangbin Duconfig PANIC_ON_OOPS_VALUE
997f43a289dSChangbin Du	int
998f43a289dSChangbin Du	range 0 1
999f43a289dSChangbin Du	default 0 if !PANIC_ON_OOPS
1000f43a289dSChangbin Du	default 1 if PANIC_ON_OOPS
1001f43a289dSChangbin Du
1002f43a289dSChangbin Duconfig PANIC_TIMEOUT
1003f43a289dSChangbin Du	int "panic timeout"
1004f43a289dSChangbin Du	default 0
1005f43a289dSChangbin Du	help
10069d5b134fSTiezhu Yang	  Set the timeout value (in seconds) until a reboot occurs when
1007f43a289dSChangbin Du	  the kernel panics. If n = 0, then we wait forever. A timeout
1008f43a289dSChangbin Du	  value n > 0 will wait n seconds before rebooting, while a timeout
1009f43a289dSChangbin Du	  value n < 0 will reboot immediately.
101092aef8fbSDave Hansen
10111da177e4SLinus Torvaldsconfig LOCKUP_DETECTOR
101205a4a952SNicholas Piggin	bool
101305a4a952SNicholas Piggin
101405a4a952SNicholas Pigginconfig SOFTLOCKUP_DETECTOR
101505a4a952SNicholas Piggin	bool "Detect Soft Lockups"
1016fbb9ce95SIngo Molnar	depends on DEBUG_KERNEL && !S390
101705a4a952SNicholas Piggin	select LOCKUP_DETECTOR
10181da177e4SLinus Torvalds	help
10191da177e4SLinus Torvalds	  Say Y here to enable the kernel to act as a watchdog to detect
102005a4a952SNicholas Piggin	  soft lockups.
10211da177e4SLinus Torvalds
10221da177e4SLinus Torvalds	  Softlockups are bugs that cause the kernel to loop in kernel
10231da177e4SLinus Torvalds	  mode for more than 20 seconds, without giving other tasks a
10241da177e4SLinus Torvalds	  chance to run.  The current stack trace is displayed upon
10251da177e4SLinus Torvalds	  detection and the system will stay locked up.
10261da177e4SLinus Torvalds
10275f00ae0dSRandy Dunlapconfig BOOTPARAM_SOFTLOCKUP_PANIC
10285f00ae0dSRandy Dunlap	bool "Panic (Reboot) On Soft Lockups"
10295f00ae0dSRandy Dunlap	depends on SOFTLOCKUP_DETECTOR
10305f00ae0dSRandy Dunlap	help
10315f00ae0dSRandy Dunlap	  Say Y here to enable the kernel to panic on "soft lockups",
10325f00ae0dSRandy Dunlap	  which are bugs that cause the kernel to loop in kernel
10335f00ae0dSRandy Dunlap	  mode for more than 20 seconds (configurable using the watchdog_thresh
10345f00ae0dSRandy Dunlap	  sysctl), without giving other tasks a chance to run.
10355f00ae0dSRandy Dunlap
10365f00ae0dSRandy Dunlap	  The panic can be used in combination with panic_timeout,
10375f00ae0dSRandy Dunlap	  to cause the system to reboot automatically after a
10385f00ae0dSRandy Dunlap	  lockup has been detected. This feature is useful for
10395f00ae0dSRandy Dunlap	  high-availability systems that have uptime guarantees and
10405f00ae0dSRandy Dunlap	  where a lockup must be resolved ASAP.
10415f00ae0dSRandy Dunlap
10425f00ae0dSRandy Dunlap	  Say N if unsure.
10435f00ae0dSRandy Dunlap
10441356d0b9SPetr Mladekconfig HAVE_HARDLOCKUP_DETECTOR_BUDDY
10451356d0b9SPetr Mladek	bool
10461356d0b9SPetr Mladek	depends on SMP
10471356d0b9SPetr Mladek	default y
10481356d0b9SPetr Mladek
10497edaeb68SThomas Gleixner#
10501356d0b9SPetr Mladek# Global switch whether to build a hardlockup detector at all. It is available
10511356d0b9SPetr Mladek# only when the architecture supports at least one implementation. There are
10521356d0b9SPetr Mladek# two exceptions. The hardlockup detector is never enabled on:
10531356d0b9SPetr Mladek#
10541356d0b9SPetr Mladek#	s390: it reported many false positives there
10551356d0b9SPetr Mladek#
10561356d0b9SPetr Mladek#	sparc64: has a custom implementation which is not using the common
10571356d0b9SPetr Mladek#		hardlockup command line options and sysctl interface.
10581356d0b9SPetr Mladek#
105905a4a952SNicholas Pigginconfig HARDLOCKUP_DETECTOR
106005a4a952SNicholas Piggin	bool "Detect Hard Lockups"
106147f4cb43SPetr Mladek	depends on DEBUG_KERNEL && !S390 && !HARDLOCKUP_DETECTOR_SPARC64
1062a5fcc236SPetr Mladek	depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_BUDDY || HAVE_HARDLOCKUP_DETECTOR_ARCH
10631356d0b9SPetr Mladek	imply HARDLOCKUP_DETECTOR_PERF
10641356d0b9SPetr Mladek	imply HARDLOCKUP_DETECTOR_BUDDY
10657ca8fe94SPetr Mladek	imply HARDLOCKUP_DETECTOR_ARCH
106605a4a952SNicholas Piggin	select LOCKUP_DETECTOR
10671f423c90SDouglas Anderson
106805a4a952SNicholas Piggin	help
106905a4a952SNicholas Piggin	  Say Y here to enable the kernel to act as a watchdog to detect
107005a4a952SNicholas Piggin	  hard lockups.
107105a4a952SNicholas Piggin
10728446f1d3SIngo Molnar	  Hardlockups are bugs that cause the CPU to loop in kernel mode
10738446f1d3SIngo Molnar	  for more than 10 seconds, without letting other interrupts have a
10748446f1d3SIngo Molnar	  chance to run.  The current stack trace is displayed upon detection
10758446f1d3SIngo Molnar	  and the system will stay locked up.
10768446f1d3SIngo Molnar
10771356d0b9SPetr Mladek#
10781356d0b9SPetr Mladek# Note that arch-specific variants are always preferred.
10791356d0b9SPetr Mladek#
10804917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_PREFER_BUDDY
10814917a25fSPetr Mladek	bool "Prefer the buddy CPU hardlockup detector"
10821356d0b9SPetr Mladek	depends on HARDLOCKUP_DETECTOR
10831356d0b9SPetr Mladek	depends on HAVE_HARDLOCKUP_DETECTOR_PERF && HAVE_HARDLOCKUP_DETECTOR_BUDDY
1084a8992d8aSLukas Bulwahn	depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
10854917a25fSPetr Mladek	help
10864917a25fSPetr Mladek	  Say Y here to prefer the buddy hardlockup detector over the perf one.
10874917a25fSPetr Mladek
10884917a25fSPetr Mladek	  With the buddy detector, each CPU uses its softlockup hrtimer
10894917a25fSPetr Mladek	  to check that the next CPU is processing hrtimer interrupts by
10904917a25fSPetr Mladek	  verifying that a counter is increasing.
10914917a25fSPetr Mladek
10924917a25fSPetr Mladek	  This hardlockup detector is useful on systems that don't have
10934917a25fSPetr Mladek	  an arch-specific hardlockup detector or if resources needed
10944917a25fSPetr Mladek	  for the hardlockup detector are better used for other things.
10954917a25fSPetr Mladek
10961da177e4SLinus Torvaldsconfig HARDLOCKUP_DETECTOR_PERF
10971da177e4SLinus Torvalds	bool
10981356d0b9SPetr Mladek	depends on HARDLOCKUP_DETECTOR
10991356d0b9SPetr Mladek	depends on HAVE_HARDLOCKUP_DETECTOR_PERF && !HARDLOCKUP_DETECTOR_PREFER_BUDDY
1100a5fcc236SPetr Mladek	depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
11014917a25fSPetr Mladek	select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
11024917a25fSPetr Mladek
11034917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_BUDDY
11044917a25fSPetr Mladek	bool
11051356d0b9SPetr Mladek	depends on HARDLOCKUP_DETECTOR
11061356d0b9SPetr Mladek	depends on HAVE_HARDLOCKUP_DETECTOR_BUDDY
11071356d0b9SPetr Mladek	depends on !HAVE_HARDLOCKUP_DETECTOR_PERF || HARDLOCKUP_DETECTOR_PREFER_BUDDY
1108a5fcc236SPetr Mladek	depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
11094917a25fSPetr Mladek	select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
11104917a25fSPetr Mladek
11117ca8fe94SPetr Mladekconfig HARDLOCKUP_DETECTOR_ARCH
11127ca8fe94SPetr Mladek	bool
11137ca8fe94SPetr Mladek	depends on HARDLOCKUP_DETECTOR
11147ca8fe94SPetr Mladek	depends on HAVE_HARDLOCKUP_DETECTOR_ARCH
11157ca8fe94SPetr Mladek	help
11167ca8fe94SPetr Mladek	  The arch-specific implementation of the hardlockup detector will
11177ca8fe94SPetr Mladek	  be used.
11187ca8fe94SPetr Mladek
11191356d0b9SPetr Mladek#
11204917a25fSPetr Mladek# Both the "perf" and "buddy" hardlockup detectors count hrtimer
11214917a25fSPetr Mladek# interrupts. This config enables functions managing this common code.
11221356d0b9SPetr Mladek#
11234917a25fSPetr Mladekconfig HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
11244917a25fSPetr Mladek	bool
11251da177e4SLinus Torvalds	select SOFTLOCKUP_DETECTOR
11261da177e4SLinus Torvalds
11271da177e4SLinus Torvalds#
11281da177e4SLinus Torvalds# Enables a timestamp based low pass filter to compensate for perf based
11291da177e4SLinus Torvalds# hard lockup detection which runs too fast due to turbo modes.
11301da177e4SLinus Torvalds#
11311da177e4SLinus Torvaldsconfig HARDLOCKUP_CHECK_TIMESTAMP
11321da177e4SLinus Torvalds	bool
11331da177e4SLinus Torvalds
11341da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC
11351da177e4SLinus Torvalds	bool "Panic (Reboot) On Hard Lockups"
11361da177e4SLinus Torvalds	depends on HARDLOCKUP_DETECTOR
11371da177e4SLinus Torvalds	help
11381da177e4SLinus Torvalds	  Say Y here to enable the kernel to panic on "hard lockups",
11391da177e4SLinus Torvalds	  which are bugs that cause the kernel to loop in kernel
11401da177e4SLinus Torvalds	  mode with interrupts disabled for more than 10 seconds (configurable
11411da177e4SLinus Torvalds	  using the watchdog_thresh sysctl).
11421da177e4SLinus Torvalds
11431da177e4SLinus Torvalds	  Say N if unsure.
11441da177e4SLinus Torvalds
11451da177e4SLinus Torvaldsconfig DETECT_HUNG_TASK
11461da177e4SLinus Torvalds	bool "Detect Hung Tasks"
11471da177e4SLinus Torvalds	depends on DEBUG_KERNEL
114805a4a952SNicholas Piggin	default SOFTLOCKUP_DETECTOR
11491da177e4SLinus Torvalds	help
11501da177e4SLinus Torvalds	  Say Y here to enable the kernel to detect "hung tasks",
11514a2f0acfSAndrew Morton	  which are bugs that cause the task to be stuck in
115296b03ab8SVivien Didelot	  uninterruptible "D" state indefinitely.
11531da177e4SLinus Torvalds
11541da177e4SLinus Torvalds	  When a hung task is detected, the kernel will print the
11551da177e4SLinus Torvalds	  current stack trace (which you should report), but the
11561da177e4SLinus Torvalds	  task will stay in uninterruptible state. If lockdep is
11571da177e4SLinus Torvalds	  enabled then all held locks will also be reported. This
11581da177e4SLinus Torvalds	  feature has negligible overhead.
11591da177e4SLinus Torvalds
11601da177e4SLinus Torvaldsconfig DEFAULT_HUNG_TASK_TIMEOUT
11611da177e4SLinus Torvalds	int "Default timeout for hung task detection (in seconds)"
11621da177e4SLinus Torvalds	depends on DETECT_HUNG_TASK
11631da177e4SLinus Torvalds	default 120
11641da177e4SLinus Torvalds	help
11651da177e4SLinus Torvalds	  This option controls the default timeout (in seconds) used
11661da177e4SLinus Torvalds	  to determine when a task has become non-responsive and should
116750dd26baSIngo Molnar	  be considered hung.
11681da177e4SLinus Torvalds
11691da177e4SLinus Torvalds	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
11701da177e4SLinus Torvalds	  sysctl or by writing a value to
11711da177e4SLinus Torvalds	  /proc/sys/kernel/hung_task_timeout_secs.
11721da177e4SLinus Torvalds
1173871751e2SAl Viro	  A timeout of 0 disables the check.  The default is two minutes.
1174871751e2SAl Viro	  Keeping the default should be fine in most cases.
1175871751e2SAl Viro
1176871751e2SAl Viroconfig BOOTPARAM_HUNG_TASK_PANIC
11771da177e4SLinus Torvalds	bool "Panic (Reboot) On Hung Tasks"
11781da177e4SLinus Torvalds	depends on DETECT_HUNG_TASK
11798637c099SIngo Molnar	help
11801da177e4SLinus Torvalds	  Say Y here to enable the kernel to panic on "hung tasks",
11811da177e4SLinus Torvalds	  which are bugs that cause the kernel to leave a task stuck
11821da177e4SLinus Torvalds	  in uninterruptible "D" state.
11831da177e4SLinus Torvalds
11841da177e4SLinus Torvalds	  The panic can be used in combination with panic_timeout,
11851da177e4SLinus Torvalds	  to cause the system to reboot automatically after a
11861da177e4SLinus Torvalds	  hung task has been detected. This feature is useful for
1187e7eebaf6SIngo Molnar	  high-availability systems that have uptime guarantees and
1188e7eebaf6SIngo Molnar	  where a hung tasks must be resolved ASAP.
1189e7eebaf6SIngo Molnar
1190e7eebaf6SIngo Molnar	  Say N if unsure.
1191e7eebaf6SIngo Molnar
119282607adcSTejun Heoconfig WQ_WATCHDOG
119382607adcSTejun Heo	bool "Detect Workqueue Stalls"
119482607adcSTejun Heo	depends on DEBUG_KERNEL
119582607adcSTejun Heo	help
119682607adcSTejun Heo	  Say Y here to enable stall detection on workqueues.  If a
119782607adcSTejun Heo	  worker pool doesn't make forward progress on a pending work
119882607adcSTejun Heo	  item for over a given amount of time, 30s by default, a
119982607adcSTejun Heo	  warning message is printed along with dump of workqueue
120082607adcSTejun Heo	  state.  This can be configured through kernel parameter
120182607adcSTejun Heo	  "workqueue.watchdog_thresh" and its sysfs counterpart.
120282607adcSTejun Heo
120363638450STejun Heoconfig WQ_CPU_INTENSIVE_REPORT
120463638450STejun Heo	bool "Report per-cpu work items which hog CPU for too long"
120563638450STejun Heo	depends on DEBUG_KERNEL
120663638450STejun Heo	help
120763638450STejun Heo	  Say Y here to enable reporting of concurrency-managed per-cpu work
120863638450STejun Heo	  items that hog CPUs for longer than
1209b2ec116aSGeert Uytterhoeven	  workqueue.cpu_intensive_thresh_us. Workqueue automatically
121063638450STejun Heo	  detects and excludes them from concurrency management to prevent
121163638450STejun Heo	  them from stalling other per-cpu work items. Occassional
121263638450STejun Heo	  triggering may not necessarily indicate a problem. Repeated
121363638450STejun Heo	  triggering likely indicates that the work item should be switched
121463638450STejun Heo	  to use an unbound workqueue.
121563638450STejun Heo
121630428ef5SKonstantin Khlebnikovconfig TEST_LOCKUP
121730428ef5SKonstantin Khlebnikov	tristate "Test module to generate lockups"
121863646bc9STiezhu Yang	depends on m
121930428ef5SKonstantin Khlebnikov	help
122030428ef5SKonstantin Khlebnikov	  This builds the "test_lockup" module that helps to make sure
122130428ef5SKonstantin Khlebnikov	  that watchdogs and lockup detectors are working properly.
122230428ef5SKonstantin Khlebnikov
122330428ef5SKonstantin Khlebnikov	  Depending on module parameters it could emulate soft or hard
122430428ef5SKonstantin Khlebnikov	  lockup, "hung task", or locking arbitrary lock for a long time.
122530428ef5SKonstantin Khlebnikov	  Also it could generate series of lockups with cooling-down periods.
122630428ef5SKonstantin Khlebnikov
122730428ef5SKonstantin Khlebnikov	  If unsure, say N.
122830428ef5SKonstantin Khlebnikov
122992aef8fbSDave Hansenendmenu # "Debug lockups and hangs"
123092aef8fbSDave Hansen
1231ebebdd09SChangbin Dumenu "Scheduler Debugging"
12325800dc3cSJason Baron
12331da177e4SLinus Torvaldsconfig SCHED_DEBUG
12341da177e4SLinus Torvalds	bool "Collect scheduler debugging info"
123535260cf5Sye xingchen	depends on DEBUG_KERNEL && DEBUG_FS
12361da177e4SLinus Torvalds	default y
12371da177e4SLinus Torvalds	help
12381e90e35bSye xingchen	  If you say Y here, the /sys/kernel/debug/sched file will be provided
12391da177e4SLinus Torvalds	  that can help debug the scheduler. The runtime overhead of this
12401da177e4SLinus Torvalds	  option is minimal.
12411da177e4SLinus Torvalds
1242f6db8347SNaveen N. Raoconfig SCHED_INFO
1243f6db8347SNaveen N. Rao	bool
1244f6db8347SNaveen N. Rao	default n
1245f6db8347SNaveen N. Rao
12461da177e4SLinus Torvaldsconfig SCHEDSTATS
12471da177e4SLinus Torvalds	bool "Collect scheduler statistics"
12481da177e4SLinus Torvalds	depends on DEBUG_KERNEL && PROC_FS
1249f6db8347SNaveen N. Rao	select SCHED_INFO
12501da177e4SLinus Torvalds	help
12511da177e4SLinus Torvalds	  If you say Y here, additional code will be inserted into the
12521da177e4SLinus Torvalds	  scheduler and related routines to collect statistics about
12531da177e4SLinus Torvalds	  scheduler behavior and provide them in /proc/schedstat.  These
12541da177e4SLinus Torvalds	  stats may be useful for both tuning and debugging the scheduler
12551da177e4SLinus Torvalds	  If you aren't debugging the scheduler or trying to tune a specific
12561da177e4SLinus Torvalds	  application, you can say N to avoid the very slight overhead
12571da177e4SLinus Torvalds	  this adds.
12581da177e4SLinus Torvalds
1259ebebdd09SChangbin Duendmenu
12600d9e2632SAaron Tomlin
12613c17ad19SJohn Stultzconfig DEBUG_TIMEKEEPING
12623c17ad19SJohn Stultz	bool "Enable extra timekeeping sanity checking"
12633c17ad19SJohn Stultz	help
12643c17ad19SJohn Stultz	  This option will enable additional timekeeping sanity checks
12653c17ad19SJohn Stultz	  which may be helpful when diagnosing issues where timekeeping
12663c17ad19SJohn Stultz	  problems are suspected.
12673c17ad19SJohn Stultz
12683c17ad19SJohn Stultz	  This may include checks in the timekeeping hotpaths, so this
12693c17ad19SJohn Stultz	  option may have a (very small) performance impact to some
12703c17ad19SJohn Stultz	  workloads.
12713c17ad19SJohn Stultz
12723c17ad19SJohn Stultz	  If unsure, say N.
12733c17ad19SJohn Stultz
12741da177e4SLinus Torvaldsconfig DEBUG_PREEMPT
12751da177e4SLinus Torvalds	bool "Debug preemptible kernel"
12769f472869SSebastian Andrzej Siewior	depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
12771da177e4SLinus Torvalds	help
12781da177e4SLinus Torvalds	  If you say Y here then the kernel will use a debug variant of the
12791da177e4SLinus Torvalds	  commonly used smp_processor_id() function and will print warnings
12801da177e4SLinus Torvalds	  if kernel code uses it in a preemption-unsafe way. Also, the kernel
12811da177e4SLinus Torvalds	  will detect preemption count underflows.
1282408894eeSIngo Molnar
1283cc600391SHyeonggon Yoo	  This option has potential to introduce high runtime overhead,
1284cc600391SHyeonggon Yoo	  depending on workload as it triggers debugging routines for each
1285cc600391SHyeonggon Yoo	  this_cpu operation. It should only be used for debugging purposes.
1286cc600391SHyeonggon Yoo
12879eade16bSDave Hansenmenu "Lock Debugging (spinlocks, mutexes, etc...)"
12889eade16bSDave Hansen
1289f07cbebbSWaiman Longconfig LOCK_DEBUGGING_SUPPORT
1290f07cbebbSWaiman Long	bool
1291f07cbebbSWaiman Long	depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
1292f07cbebbSWaiman Long	default y
1293f07cbebbSWaiman Long
129419193bcaSWaiman Longconfig PROVE_LOCKING
129519193bcaSWaiman Long	bool "Lock debugging: prove locking correctness"
129619193bcaSWaiman Long	depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
129719193bcaSWaiman Long	select LOCKDEP
129819193bcaSWaiman Long	select DEBUG_SPINLOCK
1299bb630f9fSThomas Gleixner	select DEBUG_MUTEXES if !PREEMPT_RT
130019193bcaSWaiman Long	select DEBUG_RT_MUTEXES if RT_MUTEXES
1301c71fd893SWaiman Long	select DEBUG_RWSEMS
130219193bcaSWaiman Long	select DEBUG_WW_MUTEX_SLOWPATH
130319193bcaSWaiman Long	select DEBUG_LOCK_ALLOC
13048fd8ad5cSAhmed S. Darwish	select PREEMPT_COUNT if !ARCH_NO_PREEMPT
130519193bcaSWaiman Long	select TRACE_IRQFLAGS
130619193bcaSWaiman Long	default n
130719193bcaSWaiman Long	help
130819193bcaSWaiman Long	 This feature enables the kernel to prove that all locking
130919193bcaSWaiman Long	 that occurs in the kernel runtime is mathematically
131019193bcaSWaiman Long	 correct: that under no circumstance could an arbitrary (and
131119193bcaSWaiman Long	 not yet triggered) combination of observed locking
131219193bcaSWaiman Long	 sequences (on an arbitrary number of CPUs, running an
131319193bcaSWaiman Long	 arbitrary number of tasks and interrupt contexts) cause a
131419193bcaSWaiman Long	 deadlock.
131519193bcaSWaiman Long
131619193bcaSWaiman Long	 In short, this feature enables the kernel to report locking
131719193bcaSWaiman Long	 related deadlocks before they actually occur.
131819193bcaSWaiman Long
131919193bcaSWaiman Long	 The proof does not depend on how hard and complex a
132019193bcaSWaiman Long	 deadlock scenario would be to trigger: how many
132119193bcaSWaiman Long	 participant CPUs, tasks and irq-contexts would be needed
132219193bcaSWaiman Long	 for it to trigger. The proof also does not depend on
132319193bcaSWaiman Long	 timing: if a race and a resulting deadlock is possible
132419193bcaSWaiman Long	 theoretically (no matter how unlikely the race scenario
132519193bcaSWaiman Long	 is), it will be proven so and will immediately be
132619193bcaSWaiman Long	 reported by the kernel (once the event is observed that
132719193bcaSWaiman Long	 makes the deadlock theoretically possible).
132819193bcaSWaiman Long
132919193bcaSWaiman Long	 If a deadlock is impossible (i.e. the locking rules, as
133019193bcaSWaiman Long	 observed by the kernel, are mathematically correct), the
133119193bcaSWaiman Long	 kernel reports nothing.
133219193bcaSWaiman Long
133319193bcaSWaiman Long	 NOTE: this feature can also be enabled for rwlocks, mutexes
133419193bcaSWaiman Long	 and rwsems - in which case all dependencies between these
133519193bcaSWaiman Long	 different locking variants are observed and mapped too, and
133619193bcaSWaiman Long	 the proof of observed correctness is also maintained for an
133719193bcaSWaiman Long	 arbitrary combination of these separate locking variants.
133819193bcaSWaiman Long
1339387b1468SMauro Carvalho Chehab	 For more details, see Documentation/locking/lockdep-design.rst.
134019193bcaSWaiman Long
1341de8f5e4fSPeter Zijlstraconfig PROVE_RAW_LOCK_NESTING
1342de8f5e4fSPeter Zijlstra	bool "Enable raw_spinlock - spinlock nesting checks"
1343de8f5e4fSPeter Zijlstra	depends on PROVE_LOCKING
1344de8f5e4fSPeter Zijlstra	default n
1345de8f5e4fSPeter Zijlstra	help
1346de8f5e4fSPeter Zijlstra	 Enable the raw_spinlock vs. spinlock nesting checks which ensure
1347de8f5e4fSPeter Zijlstra	 that the lock nesting rules for PREEMPT_RT enabled kernels are
1348de8f5e4fSPeter Zijlstra	 not violated.
1349de8f5e4fSPeter Zijlstra
1350de8f5e4fSPeter Zijlstra	 NOTE: There are known nesting problems. So if you enable this
1351de8f5e4fSPeter Zijlstra	 option expect lockdep splats until these problems have been fully
1352de8f5e4fSPeter Zijlstra	 addressed which is work in progress. This config switch allows to
1353de8f5e4fSPeter Zijlstra	 identify and analyze these problems. It will be removed and the
13549dbbc3b9SZhen Lei	 check permanently enabled once the main issues have been fixed.
1355de8f5e4fSPeter Zijlstra
1356de8f5e4fSPeter Zijlstra	 If unsure, select N.
1357de8f5e4fSPeter Zijlstra
135819193bcaSWaiman Longconfig LOCK_STAT
135919193bcaSWaiman Long	bool "Lock usage statistics"
136019193bcaSWaiman Long	depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
136119193bcaSWaiman Long	select LOCKDEP
136219193bcaSWaiman Long	select DEBUG_SPINLOCK
1363bb630f9fSThomas Gleixner	select DEBUG_MUTEXES if !PREEMPT_RT
136419193bcaSWaiman Long	select DEBUG_RT_MUTEXES if RT_MUTEXES
136519193bcaSWaiman Long	select DEBUG_LOCK_ALLOC
136619193bcaSWaiman Long	default n
136719193bcaSWaiman Long	help
136819193bcaSWaiman Long	 This feature enables tracking lock contention points
136919193bcaSWaiman Long
1370387b1468SMauro Carvalho Chehab	 For more details, see Documentation/locking/lockstat.rst
137119193bcaSWaiman Long
137219193bcaSWaiman Long	 This also enables lock events required by "perf lock",
137319193bcaSWaiman Long	 subcommand of perf.
137419193bcaSWaiman Long	 If you want to use "perf lock", you also need to turn on
137519193bcaSWaiman Long	 CONFIG_EVENT_TRACING.
137619193bcaSWaiman Long
137719193bcaSWaiman Long	 CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
137819193bcaSWaiman Long	 (CONFIG_LOCKDEP defines "acquire" and "release" events.)
137919193bcaSWaiman Long
1380e7eebaf6SIngo Molnarconfig DEBUG_RT_MUTEXES
1381e7eebaf6SIngo Molnar	bool "RT Mutex debugging, deadlock detection"
1382e7eebaf6SIngo Molnar	depends on DEBUG_KERNEL && RT_MUTEXES
1383e7eebaf6SIngo Molnar	help
1384e7eebaf6SIngo Molnar	 This allows rt mutex semantics violations and rt mutex related
1385e7eebaf6SIngo Molnar	 deadlocks (lockups) to be detected and reported automatically.
1386e7eebaf6SIngo Molnar
13871da177e4SLinus Torvaldsconfig DEBUG_SPINLOCK
13884d9f34adSIngo Molnar	bool "Spinlock and rw-lock debugging: basic checks"
13891da177e4SLinus Torvalds	depends on DEBUG_KERNEL
1390e335e3ebSRaghavendra K T	select UNINLINE_SPIN_UNLOCK
13911da177e4SLinus Torvalds	help
13921da177e4SLinus Torvalds	  Say Y here and build SMP to catch missing spinlock initialization
13931da177e4SLinus Torvalds	  and certain other kinds of spinlock errors commonly made.  This is
13941da177e4SLinus Torvalds	  best used in conjunction with the NMI watchdog so that spinlock
13951da177e4SLinus Torvalds	  deadlocks are also debuggable.
13961da177e4SLinus Torvalds
13974d9f34adSIngo Molnarconfig DEBUG_MUTEXES
13984d9f34adSIngo Molnar	bool "Mutex debugging: basic checks"
1399bb630f9fSThomas Gleixner	depends on DEBUG_KERNEL && !PREEMPT_RT
14004d9f34adSIngo Molnar	help
14014d9f34adSIngo Molnar	 This feature allows mutex semantics violations to be detected and
14024d9f34adSIngo Molnar	 reported.
14034d9f34adSIngo Molnar
140423010027SDaniel Vetterconfig DEBUG_WW_MUTEX_SLOWPATH
140523010027SDaniel Vetter	bool "Wait/wound mutex debugging: Slowpath testing"
1406f07cbebbSWaiman Long	depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
140723010027SDaniel Vetter	select DEBUG_LOCK_ALLOC
140823010027SDaniel Vetter	select DEBUG_SPINLOCK
1409bb630f9fSThomas Gleixner	select DEBUG_MUTEXES if !PREEMPT_RT
1410bb630f9fSThomas Gleixner	select DEBUG_RT_MUTEXES if PREEMPT_RT
141123010027SDaniel Vetter	help
141223010027SDaniel Vetter	 This feature enables slowpath testing for w/w mutex users by
141323010027SDaniel Vetter	 injecting additional -EDEADLK wound/backoff cases. Together with
141423010027SDaniel Vetter	 the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
141523010027SDaniel Vetter	 will test all possible w/w mutex interface abuse with the
141623010027SDaniel Vetter	 exception of simply not acquiring all the required locks.
14174d692373SRob Clark	 Note that this feature can introduce significant overhead, so
14184d692373SRob Clark	 it really should not be enabled in a production or distro kernel,
14194d692373SRob Clark	 even a debug kernel.  If you are a driver writer, enable it.  If
14204d692373SRob Clark	 you are a distro, do not.
142123010027SDaniel Vetter
14225149cbacSWaiman Longconfig DEBUG_RWSEMS
14235149cbacSWaiman Long	bool "RW Semaphore debugging: basic checks"
1424c71fd893SWaiman Long	depends on DEBUG_KERNEL
14255149cbacSWaiman Long	help
1426c71fd893SWaiman Long	  This debugging feature allows mismatched rw semaphore locks
1427c71fd893SWaiman Long	  and unlocks to be detected and reported.
14285149cbacSWaiman Long
14294d9f34adSIngo Molnarconfig DEBUG_LOCK_ALLOC
14304d9f34adSIngo Molnar	bool "Lock debugging: detect incorrect freeing of live locks"
1431f07cbebbSWaiman Long	depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
14324d9f34adSIngo Molnar	select DEBUG_SPINLOCK
1433bb630f9fSThomas Gleixner	select DEBUG_MUTEXES if !PREEMPT_RT
1434f5694788SPeter Zijlstra	select DEBUG_RT_MUTEXES if RT_MUTEXES
14354d9f34adSIngo Molnar	select LOCKDEP
14364d9f34adSIngo Molnar	help
14374d9f34adSIngo Molnar	 This feature will check whether any held lock (spinlock, rwlock,
14384d9f34adSIngo Molnar	 mutex or rwsem) is incorrectly freed by the kernel, via any of the
14394d9f34adSIngo Molnar	 memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
14404d9f34adSIngo Molnar	 vfree(), etc.), whether a live lock is incorrectly reinitialized via
14414d9f34adSIngo Molnar	 spin_lock_init()/mutex_init()/etc., or whether there is any lock
14424d9f34adSIngo Molnar	 held during task exit.
14434d9f34adSIngo Molnar
14444d9f34adSIngo Molnarconfig LOCKDEP
14454d9f34adSIngo Molnar	bool
1446f07cbebbSWaiman Long	depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
14474d9f34adSIngo Molnar	select STACKTRACE
14484d9f34adSIngo Molnar	select KALLSYMS
14494d9f34adSIngo Molnar	select KALLSYMS_ALL
14504d9f34adSIngo Molnar
1451395102dbSDaniel Jordanconfig LOCKDEP_SMALL
1452395102dbSDaniel Jordan	bool
1453395102dbSDaniel Jordan
14545dc33592STetsuo Handaconfig LOCKDEP_BITS
14555dc33592STetsuo Handa	int "Bitsize for MAX_LOCKDEP_ENTRIES"
14565dc33592STetsuo Handa	depends on LOCKDEP && !LOCKDEP_SMALL
14575dc33592STetsuo Handa	range 10 30
14585dc33592STetsuo Handa	default 15
14595dc33592STetsuo Handa	help
14605dc33592STetsuo Handa	  Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.
14615dc33592STetsuo Handa
14625dc33592STetsuo Handaconfig LOCKDEP_CHAINS_BITS
14635dc33592STetsuo Handa	int "Bitsize for MAX_LOCKDEP_CHAINS"
14645dc33592STetsuo Handa	depends on LOCKDEP && !LOCKDEP_SMALL
14655dc33592STetsuo Handa	range 10 30
14665dc33592STetsuo Handa	default 16
14675dc33592STetsuo Handa	help
14685dc33592STetsuo Handa	  Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message.
14695dc33592STetsuo Handa
14705dc33592STetsuo Handaconfig LOCKDEP_STACK_TRACE_BITS
14715dc33592STetsuo Handa	int "Bitsize for MAX_STACK_TRACE_ENTRIES"
14725dc33592STetsuo Handa	depends on LOCKDEP && !LOCKDEP_SMALL
14735dc33592STetsuo Handa	range 10 30
14745dc33592STetsuo Handa	default 19
14755dc33592STetsuo Handa	help
14765dc33592STetsuo Handa	  Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message.
14775dc33592STetsuo Handa
14785dc33592STetsuo Handaconfig LOCKDEP_STACK_TRACE_HASH_BITS
14795dc33592STetsuo Handa	int "Bitsize for STACK_TRACE_HASH_SIZE"
14805dc33592STetsuo Handa	depends on LOCKDEP && !LOCKDEP_SMALL
14815dc33592STetsuo Handa	range 10 30
14825dc33592STetsuo Handa	default 14
14835dc33592STetsuo Handa	help
1484f478b998STiezhu Yang	  Try increasing this value if you need large STACK_TRACE_HASH_SIZE.
14855dc33592STetsuo Handa
14865dc33592STetsuo Handaconfig LOCKDEP_CIRCULAR_QUEUE_BITS
14875dc33592STetsuo Handa	int "Bitsize for elements in circular_queue struct"
14885dc33592STetsuo Handa	depends on LOCKDEP
14895dc33592STetsuo Handa	range 10 30
14905dc33592STetsuo Handa	default 12
14915dc33592STetsuo Handa	help
14925dc33592STetsuo Handa	  Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
14935dc33592STetsuo Handa
14944d9f34adSIngo Molnarconfig DEBUG_LOCKDEP
14954d9f34adSIngo Molnar	bool "Lock dependency engine debugging"
1496517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && LOCKDEP
1497997acaf6SMark Rutland	select DEBUG_IRQFLAGS
14984d9f34adSIngo Molnar	help
14994d9f34adSIngo Molnar	  If you say Y here, the lock dependency engine will do
15004d9f34adSIngo Molnar	  additional runtime checks to debug itself, at the price
15014d9f34adSIngo Molnar	  of more runtime overhead.
15024d9f34adSIngo Molnar
1503d902db1eSFrederic Weisbeckerconfig DEBUG_ATOMIC_SLEEP
1504d902db1eSFrederic Weisbecker	bool "Sleep inside atomic section checking"
1505e8f7c70fSFrederic Weisbecker	select PREEMPT_COUNT
15061da177e4SLinus Torvalds	depends on DEBUG_KERNEL
150787a4c375SChristoph Hellwig	depends on !ARCH_NO_PREEMPT
15081da177e4SLinus Torvalds	help
15091da177e4SLinus Torvalds	  If you say Y here, various routines which may sleep will become very
1510d902db1eSFrederic Weisbecker	  noisy if they are called inside atomic sections: when a spinlock is
1511d902db1eSFrederic Weisbecker	  held, inside an rcu read side critical section, inside preempt disabled
1512d902db1eSFrederic Weisbecker	  sections, inside an interrupt, etc...
15131da177e4SLinus Torvalds
1514cae2ed9aSIngo Molnarconfig DEBUG_LOCKING_API_SELFTESTS
1515cae2ed9aSIngo Molnar	bool "Locking API boot-time self-tests"
1516cae2ed9aSIngo Molnar	depends on DEBUG_KERNEL
1517cae2ed9aSIngo Molnar	help
1518cae2ed9aSIngo Molnar	  Say Y here if you want the kernel to run a short self-test during
1519cae2ed9aSIngo Molnar	  bootup. The self-test checks whether common types of locking bugs
1520cae2ed9aSIngo Molnar	  are detected by debugging mechanisms or not. (if you disable
15219dbbc3b9SZhen Lei	  lock debugging then those bugs won't be detected of course.)
1522cae2ed9aSIngo Molnar	  The following locking APIs are covered: spinlocks, rwlocks,
1523cae2ed9aSIngo Molnar	  mutexes and rwsems.
1524cae2ed9aSIngo Molnar
15250af3fe1eSPaul E. McKenneyconfig LOCK_TORTURE_TEST
15260af3fe1eSPaul E. McKenney	tristate "torture tests for locking"
15270af3fe1eSPaul E. McKenney	depends on DEBUG_KERNEL
15280af3fe1eSPaul E. McKenney	select TORTURE_TEST
15290af3fe1eSPaul E. McKenney	help
15300af3fe1eSPaul E. McKenney	  This option provides a kernel module that runs torture tests
15310af3fe1eSPaul E. McKenney	  on kernel locking primitives.  The kernel module may be built
15320af3fe1eSPaul E. McKenney	  after the fact on the running kernel to be tested, if desired.
15330af3fe1eSPaul E. McKenney
15340af3fe1eSPaul E. McKenney	  Say Y here if you want kernel locking-primitive torture tests
15350af3fe1eSPaul E. McKenney	  to be built into the kernel.
15360af3fe1eSPaul E. McKenney	  Say M if you want these torture tests to build as a module.
15370af3fe1eSPaul E. McKenney	  Say N if you are unsure.
15380af3fe1eSPaul E. McKenney
1539f2a5fec1SChris Wilsonconfig WW_MUTEX_SELFTEST
1540f2a5fec1SChris Wilson	tristate "Wait/wound mutex selftests"
1541f2a5fec1SChris Wilson	help
1542f2a5fec1SChris Wilson	  This option provides a kernel module that runs tests on the
1543f2a5fec1SChris Wilson	  on the struct ww_mutex locking API.
1544f2a5fec1SChris Wilson
1545f2a5fec1SChris Wilson	  It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction
1546f2a5fec1SChris Wilson	  with this test harness.
1547f2a5fec1SChris Wilson
1548f2a5fec1SChris Wilson	  Say M if you want these self tests to build as a module.
1549f2a5fec1SChris Wilson	  Say N if you are unsure.
1550f2a5fec1SChris Wilson
1551e9d338a0SPaul E. McKenneyconfig SCF_TORTURE_TEST
1552e9d338a0SPaul E. McKenney	tristate "torture tests for smp_call_function*()"
1553e9d338a0SPaul E. McKenney	depends on DEBUG_KERNEL
1554e9d338a0SPaul E. McKenney	select TORTURE_TEST
1555e9d338a0SPaul E. McKenney	help
1556e9d338a0SPaul E. McKenney	  This option provides a kernel module that runs torture tests
1557e9d338a0SPaul E. McKenney	  on the smp_call_function() family of primitives.  The kernel
1558e9d338a0SPaul E. McKenney	  module may be built after the fact on the running kernel to
1559e9d338a0SPaul E. McKenney	  be tested, if desired.
1560e9d338a0SPaul E. McKenney
156135feb604SPaul E. McKenneyconfig CSD_LOCK_WAIT_DEBUG
156235feb604SPaul E. McKenney	bool "Debugging for csd_lock_wait(), called from smp_call_function*()"
156335feb604SPaul E. McKenney	depends on DEBUG_KERNEL
156435feb604SPaul E. McKenney	depends on 64BIT
156535feb604SPaul E. McKenney	default n
156635feb604SPaul E. McKenney	help
156735feb604SPaul E. McKenney	  This option enables debug prints when CPUs are slow to respond
156835feb604SPaul E. McKenney	  to the smp_call_function*() IPI wrappers.  These debug prints
156935feb604SPaul E. McKenney	  include the IPI handler function currently executing (if any)
157035feb604SPaul E. McKenney	  and relevant stack traces.
157135feb604SPaul E. McKenney
1572c5219860SPaul E. McKenneyconfig CSD_LOCK_WAIT_DEBUG_DEFAULT
1573c5219860SPaul E. McKenney	bool "Default csd_lock_wait() debugging on at boot time"
1574c5219860SPaul E. McKenney	depends on CSD_LOCK_WAIT_DEBUG
1575c5219860SPaul E. McKenney	depends on 64BIT
1576c5219860SPaul E. McKenney	default n
1577c5219860SPaul E. McKenney	help
1578c5219860SPaul E. McKenney	  This option causes the csdlock_debug= kernel boot parameter to
1579c5219860SPaul E. McKenney	  default to 1 (basic debugging) instead of 0 (no debugging).
1580c5219860SPaul E. McKenney
15819eade16bSDave Hansenendmenu # lock debugging
15829eade16bSDave Hansen
15839eade16bSDave Hansenconfig TRACE_IRQFLAGS
1584ed004953Speterz@infradead.org	depends on TRACE_IRQFLAGS_SUPPORT
15859eade16bSDave Hansen	bool
15869eade16bSDave Hansen	help
15879eade16bSDave Hansen	  Enables hooks to interrupt enabling and disabling for
15889eade16bSDave Hansen	  either tracing or lock debugging.
15899eade16bSDave Hansen
1590ed004953Speterz@infradead.orgconfig TRACE_IRQFLAGS_NMI
1591ed004953Speterz@infradead.org	def_bool y
1592ed004953Speterz@infradead.org	depends on TRACE_IRQFLAGS
1593ed004953Speterz@infradead.org	depends on TRACE_IRQFLAGS_NMI_SUPPORT
1594ed004953Speterz@infradead.org
15951a3ea611SPaul E. McKenneyconfig NMI_CHECK_CPU
15961a3ea611SPaul E. McKenney	bool "Debugging for CPUs failing to respond to backtrace requests"
15971a3ea611SPaul E. McKenney	depends on DEBUG_KERNEL
15981a3ea611SPaul E. McKenney	depends on X86
15991a3ea611SPaul E. McKenney	default n
16001a3ea611SPaul E. McKenney	help
16011a3ea611SPaul E. McKenney	  Enables debug prints when a CPU fails to respond to a given
16021a3ea611SPaul E. McKenney	  backtrace NMI.  These prints provide some reasons why a CPU
16031a3ea611SPaul E. McKenney	  might legitimately be failing to respond, for example, if it
16041a3ea611SPaul E. McKenney	  is offline of if ignore_nmis is set.
16051a3ea611SPaul E. McKenney
1606997acaf6SMark Rutlandconfig DEBUG_IRQFLAGS
1607997acaf6SMark Rutland	bool "Debug IRQ flag manipulation"
1608997acaf6SMark Rutland	help
1609997acaf6SMark Rutland	  Enables checks for potentially unsafe enabling or disabling of
1610997acaf6SMark Rutland	  interrupts, such as calling raw_local_irq_restore() when interrupts
1611997acaf6SMark Rutland	  are enabled.
1612997acaf6SMark Rutland
16138637c099SIngo Molnarconfig STACKTRACE
16140c38e1feSDave Jones	bool "Stack backtrace support"
16158637c099SIngo Molnar	depends on STACKTRACE_SUPPORT
16160c38e1feSDave Jones	help
16170c38e1feSDave Jones	  This option causes the kernel to create a /proc/pid/stack for
16180c38e1feSDave Jones	  every process, showing its current stack trace.
16190c38e1feSDave Jones	  It is also used by various kernel debugging features that require
16200c38e1feSDave Jones	  stack trace generation.
16218637c099SIngo Molnar
1622eecabf56STheodore Ts'oconfig WARN_ALL_UNSEEDED_RANDOM
1623eecabf56STheodore Ts'o	bool "Warn for all uses of unseeded randomness"
1624eecabf56STheodore Ts'o	default n
1625d06bfd19SJason A. Donenfeld	help
1626d06bfd19SJason A. Donenfeld	  Some parts of the kernel contain bugs relating to their use of
1627d06bfd19SJason A. Donenfeld	  cryptographically secure random numbers before it's actually possible
1628d06bfd19SJason A. Donenfeld	  to generate those numbers securely. This setting ensures that these
1629d06bfd19SJason A. Donenfeld	  flaws don't go unnoticed, by enabling a message, should this ever
1630d06bfd19SJason A. Donenfeld	  occur. This will allow people with obscure setups to know when things
1631d06bfd19SJason A. Donenfeld	  are going wrong, so that they might contact developers about fixing
1632d06bfd19SJason A. Donenfeld	  it.
1633d06bfd19SJason A. Donenfeld
1634eecabf56STheodore Ts'o	  Unfortunately, on some models of some architectures getting
1635eecabf56STheodore Ts'o	  a fully seeded CRNG is extremely difficult, and so this can
1636eecabf56STheodore Ts'o	  result in dmesg getting spammed for a surprisingly long
1637eecabf56STheodore Ts'o	  time.  This is really bad from a security perspective, and
1638eecabf56STheodore Ts'o	  so architecture maintainers really need to do what they can
1639eecabf56STheodore Ts'o	  to get the CRNG seeded sooner after the system is booted.
16404c5d114eSThibaut Sautereau	  However, since users cannot do anything actionable to
1641cc1e127bSJason A. Donenfeld	  address this, by default this option is disabled.
1642eecabf56STheodore Ts'o
1643eecabf56STheodore Ts'o	  Say Y here if you want to receive warnings for all uses of
1644eecabf56STheodore Ts'o	  unseeded randomness.  This will be of use primarily for
16454c5d114eSThibaut Sautereau	  those developers interested in improving the security of
1646eecabf56STheodore Ts'o	  Linux kernels running on their architecture (or
1647eecabf56STheodore Ts'o	  subarchitecture).
1648d06bfd19SJason A. Donenfeld
16491da177e4SLinus Torvaldsconfig DEBUG_KOBJECT
16501da177e4SLinus Torvalds	bool "kobject debugging"
16511da177e4SLinus Torvalds	depends on DEBUG_KERNEL
16521da177e4SLinus Torvalds	help
16531da177e4SLinus Torvalds	  If you say Y here, some extra kobject debugging messages will be sent
16541da177e4SLinus Torvalds	  to the syslog.
16551da177e4SLinus Torvalds
1656c817a67eSRussell Kingconfig DEBUG_KOBJECT_RELEASE
1657c817a67eSRussell King	bool "kobject release debugging"
16582a999aa0SLinus Torvalds	depends on DEBUG_OBJECTS_TIMERS
1659c817a67eSRussell King	help
1660c817a67eSRussell King	  kobjects are reference counted objects.  This means that their
1661c817a67eSRussell King	  last reference count put is not predictable, and the kobject can
1662b6c69474SRandy Dunlap	  live on past the point at which a driver decides to drop its
1663c817a67eSRussell King	  initial reference to the kobject gained on allocation.  An
1664c817a67eSRussell King	  example of this would be a struct device which has just been
1665c817a67eSRussell King	  unregistered.
1666c817a67eSRussell King
1667c817a67eSRussell King	  However, some buggy drivers assume that after such an operation,
1668c817a67eSRussell King	  the memory backing the kobject can be immediately freed.  This
1669c817a67eSRussell King	  goes completely against the principles of a refcounted object.
1670c817a67eSRussell King
1671c817a67eSRussell King	  If you say Y here, the kernel will delay the release of kobjects
1672c817a67eSRussell King	  on the last reference count to improve the visibility of this
1673c817a67eSRussell King	  kind of kobject release bug.
1674c817a67eSRussell King
16759b2a60c4SCatalin Marinasconfig HAVE_DEBUG_BUGVERBOSE
16769b2a60c4SCatalin Marinas	bool
16779b2a60c4SCatalin Marinas
16783be5cbcdSChangbin Dumenu "Debug kernel data structures"
16791da177e4SLinus Torvalds
1680199a9afcSDave Jonesconfig DEBUG_LIST
1681199a9afcSDave Jones	bool "Debug linked list manipulation"
1682aa9f10d5SMarco Elver	depends on DEBUG_KERNEL
1683aebc7b0dSMarco Elver	select LIST_HARDENED
1684199a9afcSDave Jones	help
1685aebc7b0dSMarco Elver	  Enable this to turn on extended checks in the linked-list walking
1686aebc7b0dSMarco Elver	  routines.
1687aebc7b0dSMarco Elver
1688aebc7b0dSMarco Elver	  This option trades better quality error reports for performance, and
1689aebc7b0dSMarco Elver	  is more suitable for kernel debugging. If you care about performance,
1690aebc7b0dSMarco Elver	  you should only enable CONFIG_LIST_HARDENED instead.
1691199a9afcSDave Jones
1692199a9afcSDave Jones	  If unsure, say N.
1693199a9afcSDave Jones
16948e18faeaSDavidlohr Buesoconfig DEBUG_PLIST
1695b8cfff68SDan Streetman	bool "Debug priority linked list manipulation"
1696b8cfff68SDan Streetman	depends on DEBUG_KERNEL
1697b8cfff68SDan Streetman	help
1698b8cfff68SDan Streetman	  Enable this to turn on extended checks in the priority-ordered
1699b8cfff68SDan Streetman	  linked-list (plist) walking routines.  This checks the entire
1700b8cfff68SDan Streetman	  list multiple times during each manipulation.
1701b8cfff68SDan Streetman
1702b8cfff68SDan Streetman	  If unsure, say N.
1703b8cfff68SDan Streetman
1704d6ec0842SJens Axboeconfig DEBUG_SG
1705d6ec0842SJens Axboe	bool "Debug SG table operations"
1706d6ec0842SJens Axboe	depends on DEBUG_KERNEL
1707d6ec0842SJens Axboe	help
1708d6ec0842SJens Axboe	  Enable this to turn on checks on scatter-gather tables. This can
1709d6ec0842SJens Axboe	  help find problems with drivers that do not properly initialize
1710d6ec0842SJens Axboe	  their sg tables.
1711d6ec0842SJens Axboe
1712d6ec0842SJens Axboe	  If unsure, say N.
1713d6ec0842SJens Axboe
17141b2439dbSArjan van de Venconfig DEBUG_NOTIFIERS
17151b2439dbSArjan van de Ven	bool "Debug notifier call chains"
17161b2439dbSArjan van de Ven	depends on DEBUG_KERNEL
17171b2439dbSArjan van de Ven	help
17181b2439dbSArjan van de Ven	  Enable this to turn on sanity checking for notifier call chains.
17191b2439dbSArjan van de Ven	  This is most useful for kernel developers to make sure that
17201b2439dbSArjan van de Ven	  modules properly unregister themselves from notifier chains.
17211b2439dbSArjan van de Ven	  This is a relatively cheap check but if you care about maximum
17221b2439dbSArjan van de Ven	  performance, say N.
17231b2439dbSArjan van de Ven
172454a611b6SLiam R. Howlettconfig DEBUG_MAPLE_TREE
172554a611b6SLiam R. Howlett	bool "Debug maple trees"
172654a611b6SLiam R. Howlett	depends on DEBUG_KERNEL
172754a611b6SLiam R. Howlett	help
172854a611b6SLiam R. Howlett	  Enable maple tree debugging information and extra validations.
172954a611b6SLiam R. Howlett
173054a611b6SLiam R. Howlett	  If unsure, say N.
173154a611b6SLiam R. Howlett
17323be5cbcdSChangbin Duendmenu
17333be5cbcdSChangbin Du
173443a0a2a7SPaul E. McKenneysource "kernel/rcu/Kconfig.debug"
17352f03e3caSDave Hansen
1736f303fccbSTejun Heoconfig DEBUG_WQ_FORCE_RR_CPU
1737f303fccbSTejun Heo	bool "Force round-robin CPU selection for unbound work items"
1738f303fccbSTejun Heo	depends on DEBUG_KERNEL
1739f303fccbSTejun Heo	default n
1740f303fccbSTejun Heo	help
1741f303fccbSTejun Heo	  Workqueue used to implicitly guarantee that work items queued
1742f303fccbSTejun Heo	  without explicit CPU specified are put on the local CPU.  This
1743f303fccbSTejun Heo	  guarantee is no longer true and while local CPU is still
1744f303fccbSTejun Heo	  preferred work items may be put on foreign CPUs.  Kernel
1745f303fccbSTejun Heo	  parameter "workqueue.debug_force_rr_cpu" is added to force
1746f303fccbSTejun Heo	  round-robin CPU selection to flush out usages which depend on the
1747f303fccbSTejun Heo	  now broken guarantee.  This config option enables the debug
1748f303fccbSTejun Heo	  feature by default.  When enabled, memory and cache locality will
1749f303fccbSTejun Heo	  be impacted.
1750f303fccbSTejun Heo
1751757c989bSThomas Gleixnerconfig CPU_HOTPLUG_STATE_CONTROL
1752757c989bSThomas Gleixner	bool "Enable CPU hotplug state control"
1753757c989bSThomas Gleixner	depends on DEBUG_KERNEL
1754757c989bSThomas Gleixner	depends on HOTPLUG_CPU
1755757c989bSThomas Gleixner	default n
1756757c989bSThomas Gleixner	help
1757757c989bSThomas Gleixner	  Allows to write steps between "offline" and "online" to the CPUs
1758757c989bSThomas Gleixner	  sysfs target file so states can be stepped granular. This is a debug
1759757c989bSThomas Gleixner	  option for now as the hotplug machinery cannot be stopped and
1760757c989bSThomas Gleixner	  restarted at arbitrary points yet.
1761757c989bSThomas Gleixner
1762757c989bSThomas Gleixner	  Say N if your are unsure.
1763757c989bSThomas Gleixner
176409a74952SChangbin Duconfig LATENCYTOP
176509a74952SChangbin Du	bool "Latency measuring infrastructure"
176609a74952SChangbin Du	depends on DEBUG_KERNEL
176709a74952SChangbin Du	depends on STACKTRACE_SUPPORT
176809a74952SChangbin Du	depends on PROC_FS
17697d37cb2cSJulian Braha	depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
177009a74952SChangbin Du	select KALLSYMS
177109a74952SChangbin Du	select KALLSYMS_ALL
177209a74952SChangbin Du	select STACKTRACE
177309a74952SChangbin Du	select SCHEDSTATS
177409a74952SChangbin Du	help
177509a74952SChangbin Du	  Enable this option if you want to use the LatencyTOP tool
177609a74952SChangbin Du	  to find out which userspace is blocking on what kernel operations.
177709a74952SChangbin Du
17786ab42860STejun Heoconfig DEBUG_CGROUP_REF
17796ab42860STejun Heo	bool "Disable inlining of cgroup css reference count functions"
17806ab42860STejun Heo	depends on DEBUG_KERNEL
17816ab42860STejun Heo	depends on CGROUPS
17826ab42860STejun Heo	depends on KPROBES
17836ab42860STejun Heo	default n
17846ab42860STejun Heo	help
17856ab42860STejun Heo	  Force cgroup css reference count functions to not be inlined so
17866ab42860STejun Heo	  that they can be kprobed for debugging.
17876ab42860STejun Heo
178809a74952SChangbin Dusource "kernel/trace/Kconfig"
178909a74952SChangbin Du
179009a74952SChangbin Duconfig PROVIDE_OHCI1394_DMA_INIT
179109a74952SChangbin Du	bool "Remote debugging over FireWire early on boot"
179209a74952SChangbin Du	depends on PCI && X86
179309a74952SChangbin Du	help
179409a74952SChangbin Du	  If you want to debug problems which hang or crash the kernel early
179509a74952SChangbin Du	  on boot and the crashing machine has a FireWire port, you can use
179609a74952SChangbin Du	  this feature to remotely access the memory of the crashed machine
179709a74952SChangbin Du	  over FireWire. This employs remote DMA as part of the OHCI1394
179809a74952SChangbin Du	  specification which is now the standard for FireWire controllers.
179909a74952SChangbin Du
180009a74952SChangbin Du	  With remote DMA, you can monitor the printk buffer remotely using
180109a74952SChangbin Du	  firescope and access all memory below 4GB using fireproxy from gdb.
180209a74952SChangbin Du	  Even controlling a kernel debugger is possible using remote DMA.
180309a74952SChangbin Du
180409a74952SChangbin Du	  Usage:
180509a74952SChangbin Du
180609a74952SChangbin Du	  If ohci1394_dma=early is used as boot parameter, it will initialize
180709a74952SChangbin Du	  all OHCI1394 controllers which are found in the PCI config space.
180809a74952SChangbin Du
180909a74952SChangbin Du	  As all changes to the FireWire bus such as enabling and disabling
181009a74952SChangbin Du	  devices cause a bus reset and thereby disable remote DMA for all
181109a74952SChangbin Du	  devices, be sure to have the cable plugged and FireWire enabled on
181209a74952SChangbin Du	  the debugging host before booting the debug target for debugging.
181309a74952SChangbin Du
181409a74952SChangbin Du	  This code (~1k) is freed after boot. By then, the firewire stack
181509a74952SChangbin Du	  in charge of the OHCI-1394 controllers should be used instead.
181609a74952SChangbin Du
1817a74e2a22SMauro Carvalho Chehab	  See Documentation/core-api/debugging-via-ohci1394.rst for more information.
181809a74952SChangbin Du
1819045f6d79SChangbin Dusource "samples/Kconfig"
1820045f6d79SChangbin Du
1821045f6d79SChangbin Duconfig ARCH_HAS_DEVMEM_IS_ALLOWED
1822045f6d79SChangbin Du	bool
1823045f6d79SChangbin Du
1824045f6d79SChangbin Duconfig STRICT_DEVMEM
1825045f6d79SChangbin Du	bool "Filter access to /dev/mem"
1826045f6d79SChangbin Du	depends on MMU && DEVMEM
1827527701edSPalmer Dabbelt	depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED
1828045f6d79SChangbin Du	default y if PPC || X86 || ARM64
1829045f6d79SChangbin Du	help
1830045f6d79SChangbin Du	  If this option is disabled, you allow userspace (root) access to all
1831045f6d79SChangbin Du	  of memory, including kernel and userspace memory. Accidental
1832045f6d79SChangbin Du	  access to this is obviously disastrous, but specific access can
1833045f6d79SChangbin Du	  be used by people debugging the kernel. Note that with PAT support
1834045f6d79SChangbin Du	  enabled, even in this case there are restrictions on /dev/mem
1835045f6d79SChangbin Du	  use due to the cache aliasing requirements.
1836045f6d79SChangbin Du
1837045f6d79SChangbin Du	  If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
1838045f6d79SChangbin Du	  file only allows userspace access to PCI space and the BIOS code and
1839045f6d79SChangbin Du	  data regions.  This is sufficient for dosemu and X and all common
1840045f6d79SChangbin Du	  users of /dev/mem.
1841045f6d79SChangbin Du
1842045f6d79SChangbin Du	  If in doubt, say Y.
1843045f6d79SChangbin Du
1844045f6d79SChangbin Duconfig IO_STRICT_DEVMEM
1845045f6d79SChangbin Du	bool "Filter I/O access to /dev/mem"
1846045f6d79SChangbin Du	depends on STRICT_DEVMEM
1847045f6d79SChangbin Du	help
1848045f6d79SChangbin Du	  If this option is disabled, you allow userspace (root) access to all
1849045f6d79SChangbin Du	  io-memory regardless of whether a driver is actively using that
1850045f6d79SChangbin Du	  range.  Accidental access to this is obviously disastrous, but
1851045f6d79SChangbin Du	  specific access can be used by people debugging kernel drivers.
1852045f6d79SChangbin Du
1853045f6d79SChangbin Du	  If this option is switched on, the /dev/mem file only allows
1854045f6d79SChangbin Du	  userspace access to *idle* io-memory ranges (see /proc/iomem) This
1855045f6d79SChangbin Du	  may break traditional users of /dev/mem (dosemu, legacy X, etc...)
1856045f6d79SChangbin Du	  if the driver using a given range cannot be disabled.
1857045f6d79SChangbin Du
1858045f6d79SChangbin Du	  If in doubt, say Y.
1859045f6d79SChangbin Du
1860045f6d79SChangbin Dumenu "$(SRCARCH) Debugging"
1861045f6d79SChangbin Du
1862045f6d79SChangbin Dusource "arch/$(SRCARCH)/Kconfig.debug"
1863045f6d79SChangbin Du
1864045f6d79SChangbin Duendmenu
1865045f6d79SChangbin Du
1866045f6d79SChangbin Dumenu "Kernel Testing and Coverage"
1867045f6d79SChangbin Du
186809a74952SChangbin Dusource "lib/kunit/Kconfig"
186909a74952SChangbin Du
18708d438288SAkinobu Mitaconfig NOTIFIER_ERROR_INJECTION
18718d438288SAkinobu Mita	tristate "Notifier error injection"
18728d438288SAkinobu Mita	depends on DEBUG_KERNEL
18738d438288SAkinobu Mita	select DEBUG_FS
18748d438288SAkinobu Mita	help
1875e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
18768d438288SAkinobu Mita	  specified notifier chain callbacks. It is useful to test the error
18778d438288SAkinobu Mita	  handling of notifier call chain failures.
18788d438288SAkinobu Mita
18798d438288SAkinobu Mita	  Say N if unsure.
18808d438288SAkinobu Mita
1881048b9c35SAkinobu Mitaconfig PM_NOTIFIER_ERROR_INJECT
1882048b9c35SAkinobu Mita	tristate "PM notifier error injection module"
1883048b9c35SAkinobu Mita	depends on PM && NOTIFIER_ERROR_INJECTION
1884048b9c35SAkinobu Mita	default m if PM_DEBUG
1885048b9c35SAkinobu Mita	help
1886e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
1887048b9c35SAkinobu Mita	  PM notifier chain callbacks.  It is controlled through debugfs
1888048b9c35SAkinobu Mita	  interface /sys/kernel/debug/notifier-error-inject/pm
1889048b9c35SAkinobu Mita
1890048b9c35SAkinobu Mita	  If the notifier call chain should be failed with some events
1891048b9c35SAkinobu Mita	  notified, write the error code to "actions/<notifier event>/error".
1892048b9c35SAkinobu Mita
1893048b9c35SAkinobu Mita	  Example: Inject PM suspend error (-12 = -ENOMEM)
1894048b9c35SAkinobu Mita
1895048b9c35SAkinobu Mita	  # cd /sys/kernel/debug/notifier-error-inject/pm/
1896048b9c35SAkinobu Mita	  # echo -12 > actions/PM_SUSPEND_PREPARE/error
1897048b9c35SAkinobu Mita	  # echo mem > /sys/power/state
1898048b9c35SAkinobu Mita	  bash: echo: write error: Cannot allocate memory
1899048b9c35SAkinobu Mita
1900048b9c35SAkinobu Mita	  To compile this code as a module, choose M here: the module will
1901048b9c35SAkinobu Mita	  be called pm-notifier-error-inject.
1902048b9c35SAkinobu Mita
1903048b9c35SAkinobu Mita	  If unsure, say N.
1904048b9c35SAkinobu Mita
1905d526e85fSBenjamin Herrenschmidtconfig OF_RECONFIG_NOTIFIER_ERROR_INJECT
1906d526e85fSBenjamin Herrenschmidt	tristate "OF reconfig notifier error injection module"
1907d526e85fSBenjamin Herrenschmidt	depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
190808dfb4ddSAkinobu Mita	help
1909e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
1910d526e85fSBenjamin Herrenschmidt	  OF reconfig notifier chain callbacks.  It is controlled
191108dfb4ddSAkinobu Mita	  through debugfs interface under
1912d526e85fSBenjamin Herrenschmidt	  /sys/kernel/debug/notifier-error-inject/OF-reconfig/
191308dfb4ddSAkinobu Mita
191408dfb4ddSAkinobu Mita	  If the notifier call chain should be failed with some events
191508dfb4ddSAkinobu Mita	  notified, write the error code to "actions/<notifier event>/error".
191608dfb4ddSAkinobu Mita
191708dfb4ddSAkinobu Mita	  To compile this code as a module, choose M here: the module will
1918e12a95f4SAkinobu Mita	  be called of-reconfig-notifier-error-inject.
191908dfb4ddSAkinobu Mita
192008dfb4ddSAkinobu Mita	  If unsure, say N.
192108dfb4ddSAkinobu Mita
192202fff96aSNikolay Aleksandrovconfig NETDEV_NOTIFIER_ERROR_INJECT
192302fff96aSNikolay Aleksandrov	tristate "Netdev notifier error injection module"
192402fff96aSNikolay Aleksandrov	depends on NET && NOTIFIER_ERROR_INJECTION
192502fff96aSNikolay Aleksandrov	help
192602fff96aSNikolay Aleksandrov	  This option provides the ability to inject artificial errors to
192702fff96aSNikolay Aleksandrov	  netdevice notifier chain callbacks.  It is controlled through debugfs
192802fff96aSNikolay Aleksandrov	  interface /sys/kernel/debug/notifier-error-inject/netdev
192902fff96aSNikolay Aleksandrov
193002fff96aSNikolay Aleksandrov	  If the notifier call chain should be failed with some events
193102fff96aSNikolay Aleksandrov	  notified, write the error code to "actions/<notifier event>/error".
193202fff96aSNikolay Aleksandrov
193302fff96aSNikolay Aleksandrov	  Example: Inject netdevice mtu change error (-22 = -EINVAL)
193402fff96aSNikolay Aleksandrov
193502fff96aSNikolay Aleksandrov	  # cd /sys/kernel/debug/notifier-error-inject/netdev
193602fff96aSNikolay Aleksandrov	  # echo -22 > actions/NETDEV_CHANGEMTU/error
193702fff96aSNikolay Aleksandrov	  # ip link set eth0 mtu 1024
193802fff96aSNikolay Aleksandrov	  RTNETLINK answers: Invalid argument
193902fff96aSNikolay Aleksandrov
194002fff96aSNikolay Aleksandrov	  To compile this code as a module, choose M here: the module will
194102fff96aSNikolay Aleksandrov	  be called netdev-notifier-error-inject.
194202fff96aSNikolay Aleksandrov
194302fff96aSNikolay Aleksandrov	  If unsure, say N.
194402fff96aSNikolay Aleksandrov
1945f1b4bd06SMikulas Patockaconfig FUNCTION_ERROR_INJECTION
1946a4412fddSSteven Rostedt (Google)	bool "Fault-injections of functions"
1947f1b4bd06SMikulas Patocka	depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
1948a4412fddSSteven Rostedt (Google)	help
1949a4412fddSSteven Rostedt (Google)	  Add fault injections into various functions that are annotated with
1950a4412fddSSteven Rostedt (Google)	  ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return
1951ca0f2cfcSRandy Dunlap	  value of these functions. This is useful to test error paths of code.
1952a4412fddSSteven Rostedt (Google)
1953a4412fddSSteven Rostedt (Google)	  If unsure, say N
1954f1b4bd06SMikulas Patocka
19556ff1cb35SAkinobu Mitaconfig FAULT_INJECTION
19561ab8509aSAndrew Morton	bool "Fault-injection framework"
19571ab8509aSAndrew Morton	depends on DEBUG_KERNEL
1958329409aeSAkinobu Mita	help
1959329409aeSAkinobu Mita	  Provide fault-injection framework.
1960329409aeSAkinobu Mita	  For more details, see Documentation/fault-injection/.
19616ff1cb35SAkinobu Mita
19628a8b6502SAkinobu Mitaconfig FAILSLAB
19631ab8509aSAndrew Morton	bool "Fault-injection capability for kmalloc"
19641ab8509aSAndrew Morton	depends on FAULT_INJECTION
1965773ff60eSAkinobu Mita	depends on SLAB || SLUB
19668a8b6502SAkinobu Mita	help
19671ab8509aSAndrew Morton	  Provide fault-injection capability for kmalloc.
19688a8b6502SAkinobu Mita
1969933e312eSAkinobu Mitaconfig FAIL_PAGE_ALLOC
197029b46fa3SQiujun Huang	bool "Fault-injection capability for alloc_pages()"
19711ab8509aSAndrew Morton	depends on FAULT_INJECTION
1972933e312eSAkinobu Mita	help
19731ab8509aSAndrew Morton	  Provide fault-injection capability for alloc_pages().
1974933e312eSAkinobu Mita
19752c739cedSAlbert van der Lindeconfig FAULT_INJECTION_USERCOPY
19762c739cedSAlbert van der Linde	bool "Fault injection capability for usercopy functions"
19772c739cedSAlbert van der Linde	depends on FAULT_INJECTION
19782c739cedSAlbert van der Linde	help
19792c739cedSAlbert van der Linde	  Provides fault-injection capability to inject failures
19802c739cedSAlbert van der Linde	  in usercopy functions (copy_from_user(), get_user(), ...).
19812c739cedSAlbert van der Linde
1982c17bb495SAkinobu Mitaconfig FAIL_MAKE_REQUEST
198386327d19SDave Jones	bool "Fault-injection capability for disk IO"
1984581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1985c17bb495SAkinobu Mita	help
19861ab8509aSAndrew Morton	  Provide fault-injection capability for disk IO.
1987c17bb495SAkinobu Mita
1988581d4e28SJens Axboeconfig FAIL_IO_TIMEOUT
1989f4d01439STakuya Yoshikawa	bool "Fault-injection capability for faking disk interrupts"
1990581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1991581d4e28SJens Axboe	help
1992581d4e28SJens Axboe	  Provide fault-injection capability on end IO handling. This
1993581d4e28SJens Axboe	  will make the block layer "forget" an interrupt as configured,
1994581d4e28SJens Axboe	  thus exercising the error handling.
1995581d4e28SJens Axboe
1996581d4e28SJens Axboe	  Only works with drivers that use the generic timeout handling,
19979dbbc3b9SZhen Lei	  for others it won't do anything.
1998581d4e28SJens Axboe
1999ab51fbabSDavidlohr Buesoconfig FAIL_FUTEX
2000ab51fbabSDavidlohr Bueso	bool "Fault-injection capability for futexes"
2001ab51fbabSDavidlohr Bueso	select DEBUG_FS
2002ab51fbabSDavidlohr Bueso	depends on FAULT_INJECTION && FUTEX
2003ab51fbabSDavidlohr Bueso	help
2004ab51fbabSDavidlohr Bueso	  Provide fault-injection capability for futexes.
2005ab51fbabSDavidlohr Bueso
2006f1b4bd06SMikulas Patockaconfig FAULT_INJECTION_DEBUG_FS
2007f1b4bd06SMikulas Patocka	bool "Debugfs entries for fault-injection capabilities"
2008f1b4bd06SMikulas Patocka	depends on FAULT_INJECTION && SYSFS && DEBUG_FS
2009f1b4bd06SMikulas Patocka	help
2010f1b4bd06SMikulas Patocka	  Enable configuration of fault-injection capabilities via debugfs.
2011f1b4bd06SMikulas Patocka
20124b1a29a7SMasami Hiramatsuconfig FAIL_FUNCTION
20134b1a29a7SMasami Hiramatsu	bool "Fault-injection capability for functions"
20144b1a29a7SMasami Hiramatsu	depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION
20154b1a29a7SMasami Hiramatsu	help
20164b1a29a7SMasami Hiramatsu	  Provide function-based fault-injection capability.
20174b1a29a7SMasami Hiramatsu	  This will allow you to override a specific function with a return
20184b1a29a7SMasami Hiramatsu	  with given return value. As a result, function caller will see
20194b1a29a7SMasami Hiramatsu	  an error value and have to handle it. This is useful to test the
20204b1a29a7SMasami Hiramatsu	  error handling in various subsystems.
20214b1a29a7SMasami Hiramatsu
2022f1b4bd06SMikulas Patockaconfig FAIL_MMC_REQUEST
2023f1b4bd06SMikulas Patocka	bool "Fault-injection capability for MMC IO"
2024f1b4bd06SMikulas Patocka	depends on FAULT_INJECTION_DEBUG_FS && MMC
20256ff1cb35SAkinobu Mita	help
2026f1b4bd06SMikulas Patocka	  Provide fault-injection capability for MMC IO.
2027f1b4bd06SMikulas Patocka	  This will make the mmc core return data errors. This is
2028f1b4bd06SMikulas Patocka	  useful to test the error handling in the mmc block device
2029f1b4bd06SMikulas Patocka	  and to test how the mmc host driver handles retries from
2030f1b4bd06SMikulas Patocka	  the block device.
20311df49008SAkinobu Mita
2032c782af25SChuck Leverconfig FAIL_SUNRPC
2033c782af25SChuck Lever	bool "Fault-injection capability for SunRPC"
2034c782af25SChuck Lever	depends on FAULT_INJECTION_DEBUG_FS && SUNRPC_DEBUG
2035c782af25SChuck Lever	help
2036c782af25SChuck Lever	  Provide fault-injection capability for SunRPC and
2037c782af25SChuck Lever	  its consumers.
2038c782af25SChuck Lever
20394668c7a2SAkinobu Mitaconfig FAULT_INJECTION_CONFIGFS
20404668c7a2SAkinobu Mita	bool "Configfs interface for fault-injection capabilities"
2041d325c162SAkinobu Mita	depends on FAULT_INJECTION
2042d325c162SAkinobu Mita	select CONFIGFS_FS
20434668c7a2SAkinobu Mita	help
20444668c7a2SAkinobu Mita	  This option allows configfs-based drivers to dynamically configure
20454668c7a2SAkinobu Mita	  fault-injection via configfs.  Each parameter for driver-specific
20464668c7a2SAkinobu Mita	  fault-injection can be made visible as a configfs attribute in a
20474668c7a2SAkinobu Mita	  configfs group.
20484668c7a2SAkinobu Mita
20494668c7a2SAkinobu Mita
20501df49008SAkinobu Mitaconfig FAULT_INJECTION_STACKTRACE_FILTER
20511df49008SAkinobu Mita	bool "stacktrace filter for fault-injection capabilities"
20524668c7a2SAkinobu Mita	depends on FAULT_INJECTION
20534668c7a2SAkinobu Mita	depends on (FAULT_INJECTION_DEBUG_FS || FAULT_INJECTION_CONFIGFS) && STACKTRACE_SUPPORT
20541df49008SAkinobu Mita	select STACKTRACE
20557d37cb2cSJulian Braha	depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
20561df49008SAkinobu Mita	help
20571df49008SAkinobu Mita	  Provide stacktrace filter for fault-injection capabilities
2058267c4025SMathieu Desnoyers
205909a74952SChangbin Duconfig ARCH_HAS_KCOV
206009a74952SChangbin Du	bool
20619745512cSArjan van de Ven	help
206209a74952SChangbin Du	  An architecture should select this when it can successfully
206309a74952SChangbin Du	  build and run with CONFIG_KCOV. This typically requires
206409a74952SChangbin Du	  disabling instrumentation for some early boot code.
20659745512cSArjan van de Ven
206609a74952SChangbin Duconfig CC_HAS_SANCOV_TRACE_PC
206709a74952SChangbin Du	def_bool $(cc-option,-fsanitize-coverage=trace-pc)
206816444a8aSArnaldo Carvalho de Melo
206909a74952SChangbin Du
207009a74952SChangbin Duconfig KCOV
207109a74952SChangbin Du	bool "Code coverage for fuzzing"
207209a74952SChangbin Du	depends on ARCH_HAS_KCOV
207309a74952SChangbin Du	depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS
207422102f45SJosh Poimboeuf	depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \
2075bece04b5SMarco Elver		   GCC_VERSION >= 120000 || CLANG_VERSION >= 130000
207609a74952SChangbin Du	select DEBUG_FS
207709a74952SChangbin Du	select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC
207822102f45SJosh Poimboeuf	select OBJTOOL if HAVE_NOINSTR_HACK
2079cc3fa840SRandy Dunlap	help
208009a74952SChangbin Du	  KCOV exposes kernel code coverage information in a form suitable
208109a74952SChangbin Du	  for coverage-guided fuzzing (randomized testing).
2082cc3fa840SRandy Dunlap
208309a74952SChangbin Du	  If RANDOMIZE_BASE is enabled, PC values will not be stable across
208409a74952SChangbin Du	  different machines and across reboots. If you need stable PC values,
208509a74952SChangbin Du	  disable RANDOMIZE_BASE.
2086cc3fa840SRandy Dunlap
208709a74952SChangbin Du	  For more details, see Documentation/dev-tools/kcov.rst.
2088cc3fa840SRandy Dunlap
208909a74952SChangbin Duconfig KCOV_ENABLE_COMPARISONS
209009a74952SChangbin Du	bool "Enable comparison operands collection by KCOV"
209109a74952SChangbin Du	depends on KCOV
209209a74952SChangbin Du	depends on $(cc-option,-fsanitize-coverage=trace-cmp)
209309a74952SChangbin Du	help
209409a74952SChangbin Du	  KCOV also exposes operands of every comparison in the instrumented
209509a74952SChangbin Du	  code along with operand sizes and PCs of the comparison instructions.
209609a74952SChangbin Du	  These operands can be used by fuzzing engines to improve the quality
209709a74952SChangbin Du	  of fuzzing coverage.
2098cc3fa840SRandy Dunlap
209909a74952SChangbin Duconfig KCOV_INSTRUMENT_ALL
210009a74952SChangbin Du	bool "Instrument all code by default"
210109a74952SChangbin Du	depends on KCOV
210209a74952SChangbin Du	default y
210309a74952SChangbin Du	help
210409a74952SChangbin Du	  If you are doing generic system call fuzzing (like e.g. syzkaller),
210509a74952SChangbin Du	  then you will want to instrument the whole kernel and you should
210609a74952SChangbin Du	  say y here. If you are doing more targeted fuzzing (like e.g.
210709a74952SChangbin Du	  filesystem fuzzing with AFL) then you will want to enable coverage
210809a74952SChangbin Du	  for more specific subsets of files, and should say n here.
210984bc809eSBrendan Higgins
21105ff3b30aSAndrey Konovalovconfig KCOV_IRQ_AREA_SIZE
21115ff3b30aSAndrey Konovalov	hex "Size of interrupt coverage collection area in words"
21125ff3b30aSAndrey Konovalov	depends on KCOV
21135ff3b30aSAndrey Konovalov	default 0x40000
21145ff3b30aSAndrey Konovalov	help
21155ff3b30aSAndrey Konovalov	  KCOV uses preallocated per-cpu areas to collect coverage from
21165ff3b30aSAndrey Konovalov	  soft interrupts. This specifies the size of those areas in the
21175ff3b30aSAndrey Konovalov	  number of unsigned long words.
21185ff3b30aSAndrey Konovalov
2119d3deafaaSVincent Legollmenuconfig RUNTIME_TESTING_MENU
2120d3deafaaSVincent Legoll	bool "Runtime Testing"
2121908009e8SAnders Roxell	def_bool y
2122d3deafaaSVincent Legoll
2123d3deafaaSVincent Legollif RUNTIME_TESTING_MENU
2124881c5149SDave Hansen
2125d5528cc1SGeert Uytterhoevenconfig TEST_DHRY
2126d5528cc1SGeert Uytterhoeven	tristate "Dhrystone benchmark test"
2127d5528cc1SGeert Uytterhoeven	help
2128d5528cc1SGeert Uytterhoeven	  Enable this to include the Dhrystone 2.1 benchmark.  This test
2129d5528cc1SGeert Uytterhoeven	  calculates the number of Dhrystones per second, and the number of
2130d5528cc1SGeert Uytterhoeven	  DMIPS (Dhrystone MIPS) obtained when the Dhrystone score is divided
2131d5528cc1SGeert Uytterhoeven	  by 1757 (the number of Dhrystones per second obtained on the VAX
2132d5528cc1SGeert Uytterhoeven	  11/780, nominally a 1 MIPS machine).
2133d5528cc1SGeert Uytterhoeven
2134d5528cc1SGeert Uytterhoeven	  To run the benchmark, it needs to be enabled explicitly, either from
2135d5528cc1SGeert Uytterhoeven	  the kernel command line (when built-in), or from userspace (when
2136d5528cc1SGeert Uytterhoeven	  built-in or modular.
2137d5528cc1SGeert Uytterhoeven
2138d5528cc1SGeert Uytterhoeven	  Run once during kernel boot:
2139d5528cc1SGeert Uytterhoeven
2140d5528cc1SGeert Uytterhoeven	      test_dhry.run
2141d5528cc1SGeert Uytterhoeven
2142d5528cc1SGeert Uytterhoeven	  Set number of iterations from kernel command line:
2143d5528cc1SGeert Uytterhoeven
2144d5528cc1SGeert Uytterhoeven	      test_dhry.iterations=<n>
2145d5528cc1SGeert Uytterhoeven
2146d5528cc1SGeert Uytterhoeven	  Set number of iterations from userspace:
2147d5528cc1SGeert Uytterhoeven
2148d5528cc1SGeert Uytterhoeven	      echo <n> > /sys/module/test_dhry/parameters/iterations
2149d5528cc1SGeert Uytterhoeven
2150d5528cc1SGeert Uytterhoeven	  Trigger manual run from userspace:
2151d5528cc1SGeert Uytterhoeven
2152d5528cc1SGeert Uytterhoeven	      echo y > /sys/module/test_dhry/parameters/run
2153d5528cc1SGeert Uytterhoeven
2154d5528cc1SGeert Uytterhoeven	  If the number of iterations is <= 0, the test will devise a suitable
2155d5528cc1SGeert Uytterhoeven	  number of iterations (test runs for at least 2s) automatically.
2156d5528cc1SGeert Uytterhoeven	  This process takes ca. 4s.
2157d5528cc1SGeert Uytterhoeven
2158d5528cc1SGeert Uytterhoeven	  If unsure, say N.
2159d5528cc1SGeert Uytterhoeven
2160881c5149SDave Hansenconfig LKDTM
2161881c5149SDave Hansen	tristate "Linux Kernel Dump Test Tool Module"
2162881c5149SDave Hansen	depends on DEBUG_FS
2163881c5149SDave Hansen	help
2164881c5149SDave Hansen	This module enables testing of the different dumping mechanisms by
2165881c5149SDave Hansen	inducing system failures at predefined crash points.
2166881c5149SDave Hansen	If you don't need it: say N
2167881c5149SDave Hansen	Choose M here to compile this code as a module. The module will be
2168881c5149SDave Hansen	called lkdtm.
2169881c5149SDave Hansen
2170881c5149SDave Hansen	Documentation on how to use the module can be found in
217110ffebbeSMauro Carvalho Chehab	Documentation/fault-injection/provoke-crashes.rst
2172881c5149SDave Hansen
2173d3c0ca49SSander Vanheuleconfig CPUMASK_KUNIT_TEST
2174d3c0ca49SSander Vanheule	tristate "KUnit test for cpumask" if !KUNIT_ALL_TESTS
2175c41e8866SSander Vanheule	depends on KUNIT
2176c41e8866SSander Vanheule	default KUNIT_ALL_TESTS
2177c41e8866SSander Vanheule	help
2178c41e8866SSander Vanheule	  Enable to turn on cpumask tests, running at boot or module load time.
2179c41e8866SSander Vanheule
2180d3c0ca49SSander Vanheule	  For more information on KUnit and unit tests in general, please refer
2181d3c0ca49SSander Vanheule	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2182d3c0ca49SSander Vanheule
2183c41e8866SSander Vanheule	  If unsure, say N.
2184c41e8866SSander Vanheule
2185881c5149SDave Hansenconfig TEST_LIST_SORT
2186ebd09577SDaniel Latypov	tristate "Linked list sorting test" if !KUNIT_ALL_TESTS
2187ebd09577SDaniel Latypov	depends on KUNIT
2188ebd09577SDaniel Latypov	default KUNIT_ALL_TESTS
2189881c5149SDave Hansen	help
2190881c5149SDave Hansen	  Enable this to turn on 'list_sort()' function test. This test is
2191e327fd7cSGeert Uytterhoeven	  executed only once during system boot (so affects only boot time),
2192e327fd7cSGeert Uytterhoeven	  or at module load time.
2193881c5149SDave Hansen
2194881c5149SDave Hansen	  If unsure, say N.
2195881c5149SDave Hansen
21966e24628dSIan Rogersconfig TEST_MIN_HEAP
21976e24628dSIan Rogers	tristate "Min heap test"
21986e24628dSIan Rogers	depends on DEBUG_KERNEL || m
21996e24628dSIan Rogers	help
22006e24628dSIan Rogers	  Enable this to turn on min heap function tests. This test is
22016e24628dSIan Rogers	  executed only once during system boot (so affects only boot time),
22026e24628dSIan Rogers	  or at module load time.
22036e24628dSIan Rogers
22046e24628dSIan Rogers	  If unsure, say N.
22056e24628dSIan Rogers
2206c5adae95SKostenzer Felixconfig TEST_SORT
220736f33b56SDaniel Latypov	tristate "Array-based sort test" if !KUNIT_ALL_TESTS
220836f33b56SDaniel Latypov	depends on KUNIT
220936f33b56SDaniel Latypov	default KUNIT_ALL_TESTS
2210c5adae95SKostenzer Felix	help
22115c4e6798SGeert Uytterhoeven	  This option enables the self-test function of 'sort()' at boot,
22125c4e6798SGeert Uytterhoeven	  or at module load time.
2213c5adae95SKostenzer Felix
2214c5adae95SKostenzer Felix	  If unsure, say N.
2215c5adae95SKostenzer Felix
22165086ea4bSMaciej W. Rozyckiconfig TEST_DIV64
22175086ea4bSMaciej W. Rozycki	tristate "64bit/32bit division and modulo test"
22185086ea4bSMaciej W. Rozycki	depends on DEBUG_KERNEL || m
22195086ea4bSMaciej W. Rozycki	help
22205086ea4bSMaciej W. Rozycki	  Enable this to turn on 'do_div()' function test. This test is
22215086ea4bSMaciej W. Rozycki	  executed only once during system boot (so affects only boot time),
22225086ea4bSMaciej W. Rozycki	  or at module load time.
22235086ea4bSMaciej W. Rozycki
22245086ea4bSMaciej W. Rozycki	  If unsure, say N.
22255086ea4bSMaciej W. Rozycki
22262d71340fSDavid Howellsconfig TEST_IOV_ITER
22272d71340fSDavid Howells	tristate "Test iov_iter operation" if !KUNIT_ALL_TESTS
22282d71340fSDavid Howells	depends on KUNIT
2229e6316749SGuenter Roeck	depends on MMU
22302d71340fSDavid Howells	default KUNIT_ALL_TESTS
22312d71340fSDavid Howells	help
22322d71340fSDavid Howells	  Enable this to turn on testing of the operation of the I/O iterator
22332d71340fSDavid Howells	  (iov_iter). This test is executed only once during system boot (so
22342d71340fSDavid Howells	  affects only boot time), or at module load time.
22352d71340fSDavid Howells
22362d71340fSDavid Howells	  If unsure, say N.
22372d71340fSDavid Howells
2238881c5149SDave Hansenconfig KPROBES_SANITY_TEST
2239dcbb2ee2SDaniel Latypov	tristate "Kprobes sanity tests" if !KUNIT_ALL_TESTS
2240881c5149SDave Hansen	depends on DEBUG_KERNEL
2241881c5149SDave Hansen	depends on KPROBES
2242e44e81c5SSven Schnelle	depends on KUNIT
2243de3db3f8SLi Hua	select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
2244dcbb2ee2SDaniel Latypov	default KUNIT_ALL_TESTS
2245881c5149SDave Hansen	help
2246881c5149SDave Hansen	  This option provides for testing basic kprobes functionality on
22475a6cf77fSMasami Hiramatsu	  boot. Samples of kprobe and kretprobe are inserted and
2248881c5149SDave Hansen	  verified for functionality.
2249881c5149SDave Hansen
2250881c5149SDave Hansen	  Say N if you are unsure.
2251881c5149SDave Hansen
2252f4616fabSMasami Hiramatsuconfig FPROBE_SANITY_TEST
2253f4616fabSMasami Hiramatsu	bool "Self test for fprobe"
2254f4616fabSMasami Hiramatsu	depends on DEBUG_KERNEL
2255f4616fabSMasami Hiramatsu	depends on FPROBE
2256f4616fabSMasami Hiramatsu	depends on KUNIT=y
2257f4616fabSMasami Hiramatsu	help
2258f4616fabSMasami Hiramatsu	  This option will enable testing the fprobe when the system boot.
2259f4616fabSMasami Hiramatsu	  A series of tests are made to verify that the fprobe is functioning
2260f4616fabSMasami Hiramatsu	  properly.
2261f4616fabSMasami Hiramatsu
2262f4616fabSMasami Hiramatsu	  Say N if you are unsure.
2263f4616fabSMasami Hiramatsu
2264881c5149SDave Hansenconfig BACKTRACE_SELF_TEST
2265881c5149SDave Hansen	tristate "Self test for the backtrace code"
2266881c5149SDave Hansen	depends on DEBUG_KERNEL
2267881c5149SDave Hansen	help
2268881c5149SDave Hansen	  This option provides a kernel module that can be used to test
2269881c5149SDave Hansen	  the kernel stack backtrace code. This option is not useful
2270881c5149SDave Hansen	  for distributions or general kernels, but only for kernel
2271881c5149SDave Hansen	  developers working on architecture code.
2272881c5149SDave Hansen
2273881c5149SDave Hansen	  Note that if you want to also test saved backtraces, you will
2274881c5149SDave Hansen	  have to enable STACKTRACE as well.
2275881c5149SDave Hansen
2276881c5149SDave Hansen	  Say N if you are unsure.
2277881c5149SDave Hansen
2278914a7b50SEric Dumazetconfig TEST_REF_TRACKER
2279914a7b50SEric Dumazet	tristate "Self test for reference tracker"
2280914a7b50SEric Dumazet	depends on DEBUG_KERNEL && STACKTRACE_SUPPORT
2281914a7b50SEric Dumazet	select REF_TRACKER
2282914a7b50SEric Dumazet	help
2283914a7b50SEric Dumazet	  This option provides a kernel module performing tests
2284914a7b50SEric Dumazet	  using reference tracker infrastructure.
2285914a7b50SEric Dumazet
2286914a7b50SEric Dumazet	  Say N if you are unsure.
2287914a7b50SEric Dumazet
2288910a742dSMichel Lespinasseconfig RBTREE_TEST
2289910a742dSMichel Lespinasse	tristate "Red-Black tree test"
22907c993e11SCody P Schafer	depends on DEBUG_KERNEL
2291910a742dSMichel Lespinasse	help
2292910a742dSMichel Lespinasse	  A benchmark measuring the performance of the rbtree library.
2293910a742dSMichel Lespinasse	  Also includes rbtree invariant checks.
2294910a742dSMichel Lespinasse
22954b4f3accSFerdinand Blomqvistconfig REED_SOLOMON_TEST
22964b4f3accSFerdinand Blomqvist	tristate "Reed-Solomon library test"
22974b4f3accSFerdinand Blomqvist	depends on DEBUG_KERNEL || m
22984b4f3accSFerdinand Blomqvist	select REED_SOLOMON
22994b4f3accSFerdinand Blomqvist	select REED_SOLOMON_ENC16
23004b4f3accSFerdinand Blomqvist	select REED_SOLOMON_DEC16
23014b4f3accSFerdinand Blomqvist	help
23024b4f3accSFerdinand Blomqvist	  This option enables the self-test function of rslib at boot,
23034b4f3accSFerdinand Blomqvist	  or at module load time.
23044b4f3accSFerdinand Blomqvist
23054b4f3accSFerdinand Blomqvist	  If unsure, say N.
23064b4f3accSFerdinand Blomqvist
2307fff3fd8aSMichel Lespinasseconfig INTERVAL_TREE_TEST
2308fff3fd8aSMichel Lespinasse	tristate "Interval tree test"
23090f789b67SDavidlohr Bueso	depends on DEBUG_KERNEL
2310a88cc108SChris Wilson	select INTERVAL_TREE
2311fff3fd8aSMichel Lespinasse	help
2312fff3fd8aSMichel Lespinasse	  A benchmark measuring the performance of the interval tree library
2313fff3fd8aSMichel Lespinasse
2314623fd807SGreg Thelenconfig PERCPU_TEST
2315623fd807SGreg Thelen	tristate "Per cpu operations test"
2316623fd807SGreg Thelen	depends on m && DEBUG_KERNEL
2317623fd807SGreg Thelen	help
2318623fd807SGreg Thelen	  Enable this option to build test module which validates per-cpu
2319623fd807SGreg Thelen	  operations.
2320623fd807SGreg Thelen
2321623fd807SGreg Thelen	  If unsure, say N.
2322623fd807SGreg Thelen
2323881c5149SDave Hansenconfig ATOMIC64_SELFTEST
232455ded955SGeert Uytterhoeven	tristate "Perform an atomic64_t self-test"
2325881c5149SDave Hansen	help
232655ded955SGeert Uytterhoeven	  Enable this option to test the atomic64_t functions at boot or
232755ded955SGeert Uytterhoeven	  at module load time.
2328881c5149SDave Hansen
2329881c5149SDave Hansen	  If unsure, say N.
2330881c5149SDave Hansen
2331881c5149SDave Hansenconfig ASYNC_RAID6_TEST
2332881c5149SDave Hansen	tristate "Self test for hardware accelerated raid6 recovery"
2333881c5149SDave Hansen	depends on ASYNC_RAID6_RECOV
2334881c5149SDave Hansen	select ASYNC_MEMCPY
2335a7f7f624SMasahiro Yamada	help
2336881c5149SDave Hansen	  This is a one-shot self test that permutes through the
2337881c5149SDave Hansen	  recovery of all the possible two disk failure scenarios for a
2338881c5149SDave Hansen	  N-disk array.  Recovery is performed with the asynchronous
2339881c5149SDave Hansen	  raid6 recovery routines, and will optionally use an offload
2340881c5149SDave Hansen	  engine if one is available.
2341881c5149SDave Hansen
2342881c5149SDave Hansen	  If unsure, say N.
2343881c5149SDave Hansen
234464d1d77aSAndy Shevchenkoconfig TEST_HEXDUMP
234564d1d77aSAndy Shevchenko	tristate "Test functions located in the hexdump module at runtime"
234664d1d77aSAndy Shevchenko
2347b2ff70a0SMatteo Croceconfig STRING_SELFTEST
2348b2ff70a0SMatteo Croce	tristate "Test string functions at runtime"
2349b2ff70a0SMatteo Croce
2350881c5149SDave Hansenconfig TEST_STRING_HELPERS
2351881c5149SDave Hansen	tristate "Test functions located in the string_helpers module at runtime"
2352881c5149SDave Hansen
2353881c5149SDave Hansenconfig TEST_KSTRTOX
2354881c5149SDave Hansen	tristate "Test kstrto*() family of functions at runtime"
2355881c5149SDave Hansen
2356707cc728SRasmus Villemoesconfig TEST_PRINTF
2357707cc728SRasmus Villemoes	tristate "Test printf() family of functions at runtime"
2358707cc728SRasmus Villemoes
235950f530e1SRichard Fitzgeraldconfig TEST_SCANF
236050f530e1SRichard Fitzgerald	tristate "Test scanf() family of functions at runtime"
236150f530e1SRichard Fitzgerald
23625fd003f5SDavid Decotignyconfig TEST_BITMAP
23635fd003f5SDavid Decotigny	tristate "Test bitmap_*() family of functions at runtime"
23645fd003f5SDavid Decotigny	help
23655fd003f5SDavid Decotigny	  Enable this option to test the bitmap functions at boot.
23665fd003f5SDavid Decotigny
23675fd003f5SDavid Decotigny	  If unsure, say N.
23685fd003f5SDavid Decotigny
2369cfaff0e5SAndy Shevchenkoconfig TEST_UUID
2370cfaff0e5SAndy Shevchenko	tristate "Test functions located in the uuid module at runtime"
2371cfaff0e5SAndy Shevchenko
2372ad3d6c72SMatthew Wilcoxconfig TEST_XARRAY
2373ad3d6c72SMatthew Wilcox	tristate "Test the XArray code at runtime"
2374ad3d6c72SMatthew Wilcox
2375120b1162SLiam Howlettconfig TEST_MAPLE_TREE
2376a5199577SLiam R. Howlett	tristate "Test the Maple Tree code at runtime or module load"
2377a5199577SLiam R. Howlett	help
2378a5199577SLiam R. Howlett	  Enable this option to test the maple tree code functions at boot, or
2379a5199577SLiam R. Howlett	  when the module is loaded. Enable "Debug Maple Trees" will enable
2380a5199577SLiam R. Howlett	  more verbose output on failures.
2381a5199577SLiam R. Howlett
2382a5199577SLiam R. Howlett	  If unsure, say N.
2383120b1162SLiam Howlett
23847e1e7763SThomas Grafconfig TEST_RHASHTABLE
23859d6dbe1bSGeert Uytterhoeven	tristate "Perform selftest on resizable hash table"
23867e1e7763SThomas Graf	help
23877e1e7763SThomas Graf	  Enable this option to test the rhashtable functions at boot.
23887e1e7763SThomas Graf
23897e1e7763SThomas Graf	  If unsure, say N.
23907e1e7763SThomas Graf
23918ab8ba38SMatthew Wilcoxconfig TEST_IDA
23928ab8ba38SMatthew Wilcox	tristate "Perform selftest on IDA functions"
23938ab8ba38SMatthew Wilcox
239444091d29SJiri Pirkoconfig TEST_PARMAN
239544091d29SJiri Pirko	tristate "Perform selftest on priority array manager"
239644091d29SJiri Pirko	depends on PARMAN
239744091d29SJiri Pirko	help
239844091d29SJiri Pirko	  Enable this option to test priority array manager on boot
239944091d29SJiri Pirko	  (or module load).
240044091d29SJiri Pirko
240144091d29SJiri Pirko	  If unsure, say N.
240244091d29SJiri Pirko
24036aed82deSDaniel Lezcanoconfig TEST_IRQ_TIMINGS
24046aed82deSDaniel Lezcano	bool "IRQ timings selftest"
24056aed82deSDaniel Lezcano	depends on IRQ_TIMINGS
24066aed82deSDaniel Lezcano	help
24076aed82deSDaniel Lezcano	  Enable this option to test the irq timings code on boot.
24086aed82deSDaniel Lezcano
24096aed82deSDaniel Lezcano	  If unsure, say N.
24106aed82deSDaniel Lezcano
24118a6f0b47SValentin Rothbergconfig TEST_LKM
241293e9ef83SKees Cook	tristate "Test module loading with 'hello world' module"
241393e9ef83SKees Cook	depends on m
241493e9ef83SKees Cook	help
241593e9ef83SKees Cook	  This builds the "test_module" module that emits "Hello, world"
241693e9ef83SKees Cook	  on printk when loaded. It is designed to be used for basic
241793e9ef83SKees Cook	  evaluation of the module loading subsystem (for example when
241893e9ef83SKees Cook	  validating module verification). It lacks any extra dependencies,
241993e9ef83SKees Cook	  and will not normally be loaded by the system unless explicitly
242093e9ef83SKees Cook	  requested by name.
242193e9ef83SKees Cook
242293e9ef83SKees Cook	  If unsure, say N.
242393e9ef83SKees Cook
2424c348c163SJesse Brandeburgconfig TEST_BITOPS
24256af132f3SWei Yang	tristate "Test module for compilation of bitops operations"
2426c348c163SJesse Brandeburg	depends on m
2427c348c163SJesse Brandeburg	help
2428c348c163SJesse Brandeburg	  This builds the "test_bitops" module that is much like the
2429c348c163SJesse Brandeburg	  TEST_LKM module except that it does a basic exercise of the
24306af132f3SWei Yang	  set/clear_bit macros and get_count_order/long to make sure there are
24316af132f3SWei Yang	  no compiler warnings from C=1 sparse checker or -Wextra
24326af132f3SWei Yang	  compilations. It has no dependencies and doesn't run or load unless
24336af132f3SWei Yang	  explicitly requested by name.  for example: modprobe test_bitops.
2434c348c163SJesse Brandeburg
2435c348c163SJesse Brandeburg	  If unsure, say N.
2436c348c163SJesse Brandeburg
24373f21a6b7SUladzislau Rezki (Sony)config TEST_VMALLOC
24383f21a6b7SUladzislau Rezki (Sony)	tristate "Test module for stress/performance analysis of vmalloc allocator"
24393f21a6b7SUladzislau Rezki (Sony)	default n
24403f21a6b7SUladzislau Rezki (Sony)       depends on MMU
24413f21a6b7SUladzislau Rezki (Sony)	depends on m
24423f21a6b7SUladzislau Rezki (Sony)	help
24433f21a6b7SUladzislau Rezki (Sony)	  This builds the "test_vmalloc" module that should be used for
24443f21a6b7SUladzislau Rezki (Sony)	  stress and performance analysis. So, any new change for vmalloc
24453f21a6b7SUladzislau Rezki (Sony)	  subsystem can be evaluated from performance and stability point
24463f21a6b7SUladzislau Rezki (Sony)	  of view.
24473f21a6b7SUladzislau Rezki (Sony)
24483f21a6b7SUladzislau Rezki (Sony)	  If unsure, say N.
24493f21a6b7SUladzislau Rezki (Sony)
24503e2a4c18SKees Cookconfig TEST_USER_COPY
24513e2a4c18SKees Cook	tristate "Test user/kernel boundary protections"
24523e2a4c18SKees Cook	depends on m
24533e2a4c18SKees Cook	help
24543e2a4c18SKees Cook	  This builds the "test_user_copy" module that runs sanity checks
24553e2a4c18SKees Cook	  on the copy_to/from_user infrastructure, making sure basic
24563e2a4c18SKees Cook	  user/kernel boundary testing is working. If it fails to load,
24573e2a4c18SKees Cook	  a regression has been detected in the user/kernel memory boundary
24583e2a4c18SKees Cook	  protections.
24593e2a4c18SKees Cook
24603e2a4c18SKees Cook	  If unsure, say N.
24613e2a4c18SKees Cook
246264a8946bSAlexei Starovoitovconfig TEST_BPF
246364a8946bSAlexei Starovoitov	tristate "Test BPF filter functionality"
246498920ba6SRandy Dunlap	depends on m && NET
246564a8946bSAlexei Starovoitov	help
246664a8946bSAlexei Starovoitov	  This builds the "test_bpf" module that runs various test vectors
246764a8946bSAlexei Starovoitov	  against the BPF interpreter or BPF JIT compiler depending on the
246864a8946bSAlexei Starovoitov	  current setting. This is in particular useful for BPF JIT compiler
246964a8946bSAlexei Starovoitov	  development, but also to run regression tests against changes in
24703c731ebaSAlexei Starovoitov	  the interpreter code. It also enables test stubs for eBPF maps and
24713c731ebaSAlexei Starovoitov	  verifier used by user space verifier testsuite.
247264a8946bSAlexei Starovoitov
247364a8946bSAlexei Starovoitov	  If unsure, say N.
247464a8946bSAlexei Starovoitov
2475509e56b3SMahesh Bandewarconfig TEST_BLACKHOLE_DEV
2476509e56b3SMahesh Bandewar	tristate "Test blackhole netdev functionality"
2477509e56b3SMahesh Bandewar	depends on m && NET
2478509e56b3SMahesh Bandewar	help
2479509e56b3SMahesh Bandewar	  This builds the "test_blackhole_dev" module that validates the
2480509e56b3SMahesh Bandewar	  data path through this blackhole netdev.
2481509e56b3SMahesh Bandewar
2482509e56b3SMahesh Bandewar	  If unsure, say N.
2483509e56b3SMahesh Bandewar
2484dceeb3e7SYury Norovconfig FIND_BIT_BENCHMARK
24854441fca0SYury Norov	tristate "Test find_bit functions"
24864441fca0SYury Norov	help
24874441fca0SYury Norov	  This builds the "test_find_bit" module that measure find_*_bit()
24884441fca0SYury Norov	  functions performance.
24894441fca0SYury Norov
24904441fca0SYury Norov	  If unsure, say N.
24914441fca0SYury Norov
24920a8adf58SKees Cookconfig TEST_FIRMWARE
24930a8adf58SKees Cook	tristate "Test firmware loading via userspace interface"
24940a8adf58SKees Cook	depends on FW_LOADER
24950a8adf58SKees Cook	help
24960a8adf58SKees Cook	  This builds the "test_firmware" module that creates a userspace
24970a8adf58SKees Cook	  interface for testing firmware loading. This can be used to
24980a8adf58SKees Cook	  control the triggering of firmware loading without needing an
24990a8adf58SKees Cook	  actual firmware-using device. The contents can be rechecked by
25000a8adf58SKees Cook	  userspace.
25010a8adf58SKees Cook
25020a8adf58SKees Cook	  If unsure, say N.
25030a8adf58SKees Cook
25049308f2f9SLuis R. Rodriguezconfig TEST_SYSCTL
25059308f2f9SLuis R. Rodriguez	tristate "sysctl test driver"
25069308f2f9SLuis R. Rodriguez	depends on PROC_SYSCTL
25079308f2f9SLuis R. Rodriguez	help
25089308f2f9SLuis R. Rodriguez	  This builds the "test_sysctl" module. This driver enables to test the
25099308f2f9SLuis R. Rodriguez	  proc sysctl interfaces available to drivers safely without affecting
25109308f2f9SLuis R. Rodriguez	  production knobs which might alter system functionality.
25119308f2f9SLuis R. Rodriguez
25129308f2f9SLuis R. Rodriguez	  If unsure, say N.
25139308f2f9SLuis R. Rodriguez
2514d2585f51SVitor Massaru Ihaconfig BITFIELD_KUNIT
2515dcbb2ee2SDaniel Latypov	tristate "KUnit test bitfield functions at runtime" if !KUNIT_ALL_TESTS
2516d2585f51SVitor Massaru Iha	depends on KUNIT
2517dcbb2ee2SDaniel Latypov	default KUNIT_ALL_TESTS
2518d2585f51SVitor Massaru Iha	help
2519d2585f51SVitor Massaru Iha	  Enable this option to test the bitfield functions at boot.
2520d2585f51SVitor Massaru Iha
2521d2585f51SVitor Massaru Iha	  KUnit tests run during boot and output the results to the debug log
2522d2585f51SVitor Massaru Iha	  in TAP format (http://testanything.org/). Only useful for kernel devs
2523d2585f51SVitor Massaru Iha	  running the KUnit test harness, and not intended for inclusion into a
2524d2585f51SVitor Massaru Iha	  production build.
2525d2585f51SVitor Massaru Iha
2526d2585f51SVitor Massaru Iha	  For more information on KUnit and unit tests in general please refer
2527d2585f51SVitor Massaru Iha	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2528d2585f51SVitor Massaru Iha
2529d2585f51SVitor Massaru Iha	  If unsure, say N.
2530d2585f51SVitor Massaru Iha
2531688eb819SNoah Goldsteinconfig CHECKSUM_KUNIT
2532688eb819SNoah Goldstein	tristate "KUnit test checksum functions at runtime" if !KUNIT_ALL_TESTS
2533688eb819SNoah Goldstein	depends on KUNIT
2534688eb819SNoah Goldstein	default KUNIT_ALL_TESTS
2535688eb819SNoah Goldstein	help
2536688eb819SNoah Goldstein	  Enable this option to test the checksum functions at boot.
2537688eb819SNoah Goldstein
2538688eb819SNoah Goldstein	  KUnit tests run during boot and output the results to the debug log
2539688eb819SNoah Goldstein	  in TAP format (http://testanything.org/). Only useful for kernel devs
2540688eb819SNoah Goldstein	  running the KUnit test harness, and not intended for inclusion into a
2541688eb819SNoah Goldstein	  production build.
2542688eb819SNoah Goldstein
2543688eb819SNoah Goldstein	  For more information on KUnit and unit tests in general please refer
2544688eb819SNoah Goldstein	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2545688eb819SNoah Goldstein
2546688eb819SNoah Goldstein	  If unsure, say N.
2547688eb819SNoah Goldstein
25480acc968fSIsabella Bassoconfig HASH_KUNIT_TEST
25490acc968fSIsabella Basso	tristate "KUnit Test for integer hash functions" if !KUNIT_ALL_TESTS
25500acc968fSIsabella Basso	depends on KUNIT
25510acc968fSIsabella Basso	default KUNIT_ALL_TESTS
25520acc968fSIsabella Basso	help
25530acc968fSIsabella Basso	  Enable this option to test the kernel's string (<linux/stringhash.h>), and
25540acc968fSIsabella Basso	  integer (<linux/hash.h>) hash functions on boot.
25550acc968fSIsabella Basso
25560acc968fSIsabella Basso	  KUnit tests run during boot and output the results to the debug log
25570acc968fSIsabella Basso	  in TAP format (https://testanything.org/). Only useful for kernel devs
25580acc968fSIsabella Basso	  running the KUnit test harness, and not intended for inclusion into a
25590acc968fSIsabella Basso	  production build.
25600acc968fSIsabella Basso
25610acc968fSIsabella Basso	  For more information on KUnit and unit tests in general please refer
25620acc968fSIsabella Basso	  to the KUnit documentation in Documentation/dev-tools/kunit/.
25630acc968fSIsabella Basso
25640acc968fSIsabella Basso	  This is intended to help people writing architecture-specific
25650acc968fSIsabella Basso	  optimized versions. If unsure, say N.
25660acc968fSIsabella Basso
25675df38ca6SAndy Shevchenkoconfig RESOURCE_KUNIT_TEST
2568dcbb2ee2SDaniel Latypov	tristate "KUnit test for resource API" if !KUNIT_ALL_TESTS
25695df38ca6SAndy Shevchenko	depends on KUNIT
2570dcbb2ee2SDaniel Latypov	default KUNIT_ALL_TESTS
25715df38ca6SAndy Shevchenko	help
25725df38ca6SAndy Shevchenko	  This builds the resource API unit test.
25735df38ca6SAndy Shevchenko	  Tests the logic of API provided by resource.c and ioport.h.
25745df38ca6SAndy Shevchenko	  For more information on KUnit and unit tests in general please refer
25755df38ca6SAndy Shevchenko	  to the KUnit documentation in Documentation/dev-tools/kunit/.
25765df38ca6SAndy Shevchenko
25775df38ca6SAndy Shevchenko	  If unsure, say N.
25785df38ca6SAndy Shevchenko
25792cb80dbbSIurii Zaikinconfig SYSCTL_KUNIT_TEST
25805f215aabSAnders Roxell	tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS
25812cb80dbbSIurii Zaikin	depends on KUNIT
25825f215aabSAnders Roxell	default KUNIT_ALL_TESTS
25832cb80dbbSIurii Zaikin	help
25842cb80dbbSIurii Zaikin	  This builds the proc sysctl unit test, which runs on boot.
25852cb80dbbSIurii Zaikin	  Tests the API contract and implementation correctness of sysctl.
25862cb80dbbSIurii Zaikin	  For more information on KUnit and unit tests in general please refer
25872cb80dbbSIurii Zaikin	  to the KUnit documentation in Documentation/dev-tools/kunit/.
25882cb80dbbSIurii Zaikin
25892cb80dbbSIurii Zaikin	  If unsure, say N.
25902cb80dbbSIurii Zaikin
2591ea2dd7c0SDavid Gowconfig LIST_KUNIT_TEST
25925f215aabSAnders Roxell	tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
2593ea2dd7c0SDavid Gow	depends on KUNIT
25945f215aabSAnders Roxell	default KUNIT_ALL_TESTS
2595ea2dd7c0SDavid Gow	help
2596ea2dd7c0SDavid Gow	  This builds the linked list KUnit test suite.
2597ea2dd7c0SDavid Gow	  It tests that the API and basic functionality of the list_head type
2598ea2dd7c0SDavid Gow	  and associated macros.
2599ea2dd7c0SDavid Gow
2600ea2dd7c0SDavid Gow	  KUnit tests run during boot and output the results to the debug log
2601d89775fcSAlexander A. Klimov	  in TAP format (https://testanything.org/). Only useful for kernel devs
2602ea2dd7c0SDavid Gow	  running the KUnit test harness, and not intended for inclusion into a
2603ea2dd7c0SDavid Gow	  production build.
2604ea2dd7c0SDavid Gow
2605ea2dd7c0SDavid Gow	  For more information on KUnit and unit tests in general please refer
2606ea2dd7c0SDavid Gow	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2607ea2dd7c0SDavid Gow
2608ea2dd7c0SDavid Gow	  If unsure, say N.
2609ea2dd7c0SDavid Gow
2610789538c6SRae Moarconfig HASHTABLE_KUNIT_TEST
2611789538c6SRae Moar	tristate "KUnit Test for Kernel Hashtable structures" if !KUNIT_ALL_TESTS
2612789538c6SRae Moar	depends on KUNIT
2613789538c6SRae Moar	default KUNIT_ALL_TESTS
2614789538c6SRae Moar	help
2615789538c6SRae Moar	  This builds the hashtable KUnit test suite.
2616789538c6SRae Moar	  It tests the basic functionality of the API defined in
2617789538c6SRae Moar	  include/linux/hashtable.h. For more information on KUnit and
2618789538c6SRae Moar	  unit tests in general please refer to the KUnit documentation
2619789538c6SRae Moar	  in Documentation/dev-tools/kunit/.
2620789538c6SRae Moar
2621789538c6SRae Moar	  If unsure, say N.
2622789538c6SRae Moar
262333d599f0SMatti Vaittinenconfig LINEAR_RANGES_TEST
262433d599f0SMatti Vaittinen	tristate "KUnit test for linear_ranges"
262533d599f0SMatti Vaittinen	depends on KUNIT
262633d599f0SMatti Vaittinen	select LINEAR_RANGES
262733d599f0SMatti Vaittinen	help
262833d599f0SMatti Vaittinen	  This builds the linear_ranges unit test, which runs on boot.
262933d599f0SMatti Vaittinen	  Tests the linear_ranges logic correctness.
263033d599f0SMatti Vaittinen	  For more information on KUnit and unit tests in general please refer
263133d599f0SMatti Vaittinen	  to the KUnit documentation in Documentation/dev-tools/kunit/.
263233d599f0SMatti Vaittinen
263333d599f0SMatti Vaittinen	  If unsure, say N.
263433d599f0SMatti Vaittinen
26357546861aSAndy Shevchenkoconfig CMDLINE_KUNIT_TEST
2636dcbb2ee2SDaniel Latypov	tristate "KUnit test for cmdline API" if !KUNIT_ALL_TESTS
26377546861aSAndy Shevchenko	depends on KUNIT
2638dcbb2ee2SDaniel Latypov	default KUNIT_ALL_TESTS
26397546861aSAndy Shevchenko	help
26407546861aSAndy Shevchenko	  This builds the cmdline API unit test.
26417546861aSAndy Shevchenko	  Tests the logic of API provided by cmdline.c.
26427546861aSAndy Shevchenko	  For more information on KUnit and unit tests in general please refer
26437546861aSAndy Shevchenko	  to the KUnit documentation in Documentation/dev-tools/kunit/.
26447546861aSAndy Shevchenko
26457546861aSAndy Shevchenko	  If unsure, say N.
26467546861aSAndy Shevchenko
26476d511020SRikard Falkebornconfig BITS_TEST
2648dcbb2ee2SDaniel Latypov	tristate "KUnit test for bits.h" if !KUNIT_ALL_TESTS
26496d511020SRikard Falkeborn	depends on KUNIT
2650dcbb2ee2SDaniel Latypov	default KUNIT_ALL_TESTS
26516d511020SRikard Falkeborn	help
26526d511020SRikard Falkeborn	  This builds the bits unit test.
26536d511020SRikard Falkeborn	  Tests the logic of macros defined in bits.h.
26546d511020SRikard Falkeborn	  For more information on KUnit and unit tests in general please refer
26556d511020SRikard Falkeborn	  to the KUnit documentation in Documentation/dev-tools/kunit/.
26566d511020SRikard Falkeborn
26576d511020SRikard Falkeborn	  If unsure, say N.
26586d511020SRikard Falkeborn
26591f9f78b1SOliver Glittaconfig SLUB_KUNIT_TEST
26601f9f78b1SOliver Glitta	tristate "KUnit test for SLUB cache error detection" if !KUNIT_ALL_TESTS
26611f9f78b1SOliver Glitta	depends on SLUB_DEBUG && KUNIT
26621f9f78b1SOliver Glitta	default KUNIT_ALL_TESTS
26631f9f78b1SOliver Glitta	help
26641f9f78b1SOliver Glitta	  This builds SLUB allocator unit test.
26651f9f78b1SOliver Glitta	  Tests SLUB cache debugging functionality.
26661f9f78b1SOliver Glitta	  For more information on KUnit and unit tests in general please refer
26671f9f78b1SOliver Glitta	  to the KUnit documentation in Documentation/dev-tools/kunit/.
26681f9f78b1SOliver Glitta
26691f9f78b1SOliver Glitta	  If unsure, say N.
26701f9f78b1SOliver Glitta
2671b6c75c4aSTrent Piephoconfig RATIONAL_KUNIT_TEST
2672b6c75c4aSTrent Piepho	tristate "KUnit test for rational.c" if !KUNIT_ALL_TESTS
26738ba739edSGeert Uytterhoeven	depends on KUNIT && RATIONAL
2674b6c75c4aSTrent Piepho	default KUNIT_ALL_TESTS
2675b6c75c4aSTrent Piepho	help
2676b6c75c4aSTrent Piepho	  This builds the rational math unit test.
2677b6c75c4aSTrent Piepho	  For more information on KUnit and unit tests in general please refer
2678b6c75c4aSTrent Piepho	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2679b6c75c4aSTrent Piepho
2680b6c75c4aSTrent Piepho	  If unsure, say N.
2681b6c75c4aSTrent Piepho
2682bb95ebbeSKees Cookconfig MEMCPY_KUNIT_TEST
2683bb95ebbeSKees Cook	tristate "Test memcpy(), memmove(), and memset() functions at runtime" if !KUNIT_ALL_TESTS
2684bb95ebbeSKees Cook	depends on KUNIT
2685bb95ebbeSKees Cook	default KUNIT_ALL_TESTS
2686bb95ebbeSKees Cook	help
2687bb95ebbeSKees Cook	  Builds unit tests for memcpy(), memmove(), and memset() functions.
2688bb95ebbeSKees Cook	  For more information on KUnit and unit tests in general please refer
2689bb95ebbeSKees Cook	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2690bb95ebbeSKees Cook
2691bb95ebbeSKees Cook	  If unsure, say N.
2692bb95ebbeSKees Cook
26934acf1de3SKees Cookconfig MEMCPY_SLOW_KUNIT_TEST
26944acf1de3SKees Cook	bool "Include exhaustive memcpy tests"
26954acf1de3SKees Cook	depends on MEMCPY_KUNIT_TEST
26964acf1de3SKees Cook	default y
26974acf1de3SKees Cook	help
26984acf1de3SKees Cook	  Some memcpy tests are quite exhaustive in checking for overlaps
26994acf1de3SKees Cook	  and bit ranges. These can be very slow, so they are split out
27004acf1de3SKees Cook	  as a separate config, in case they need to be disabled.
27014acf1de3SKees Cook
2702d055c6a2SRae Moar	  Note this config option will be replaced by the use of KUnit test
2703d055c6a2SRae Moar	  attributes.
2704d055c6a2SRae Moar
2705addbeea6SBart Van Asscheconfig IS_SIGNED_TYPE_KUNIT_TEST
2706addbeea6SBart Van Assche	tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS
2707addbeea6SBart Van Assche	depends on KUNIT
2708addbeea6SBart Van Assche	default KUNIT_ALL_TESTS
2709addbeea6SBart Van Assche	help
2710addbeea6SBart Van Assche	  Builds unit tests for the is_signed_type() macro.
2711addbeea6SBart Van Assche
2712addbeea6SBart Van Assche	  For more information on KUnit and unit tests in general please refer
2713addbeea6SBart Van Assche	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2714addbeea6SBart Van Assche
2715addbeea6SBart Van Assche	  If unsure, say N.
2716addbeea6SBart Van Assche
2717617f55e2SKees Cookconfig OVERFLOW_KUNIT_TEST
2718617f55e2SKees Cook	tristate "Test check_*_overflow() functions at runtime" if !KUNIT_ALL_TESTS
2719617f55e2SKees Cook	depends on KUNIT
2720617f55e2SKees Cook	default KUNIT_ALL_TESTS
2721617f55e2SKees Cook	help
2722617f55e2SKees Cook	  Builds unit tests for the check_*_overflow(), size_*(), allocation, and
2723617f55e2SKees Cook	  related functions.
2724617f55e2SKees Cook
2725617f55e2SKees Cook	  For more information on KUnit and unit tests in general please refer
2726617f55e2SKees Cook	  to the KUnit documentation in Documentation/dev-tools/kunit/.
2727617f55e2SKees Cook
2728617f55e2SKees Cook	  If unsure, say N.
2729617f55e2SKees Cook
273002788ebcSKees Cookconfig STACKINIT_KUNIT_TEST
273102788ebcSKees Cook	tristate "Test level of stack variable initialization" if !KUNIT_ALL_TESTS
273202788ebcSKees Cook	depends on KUNIT
273302788ebcSKees Cook	default KUNIT_ALL_TESTS
273402788ebcSKees Cook	help
273502788ebcSKees Cook	  Test if the kernel is zero-initializing stack variables and
273602788ebcSKees Cook	  padding. Coverage is controlled by compiler flags,
273702788ebcSKees Cook	  CONFIG_INIT_STACK_ALL_PATTERN, CONFIG_INIT_STACK_ALL_ZERO,
273802788ebcSKees Cook	  CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF,
273902788ebcSKees Cook	  or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.
274002788ebcSKees Cook
2741875bfd52SKees Cookconfig FORTIFY_KUNIT_TEST
2742875bfd52SKees Cook	tristate "Test fortified str*() and mem*() function internals at runtime" if !KUNIT_ALL_TESTS
27435e2956eeSKees Cook	depends on KUNIT && FORTIFY_SOURCE
2744875bfd52SKees Cook	default KUNIT_ALL_TESTS
2745875bfd52SKees Cook	help
2746875bfd52SKees Cook	  Builds unit tests for checking internals of FORTIFY_SOURCE as used
2747875bfd52SKees Cook	  by the str*() and mem*() family of functions. For testing runtime
2748875bfd52SKees Cook	  traps of FORTIFY_SOURCE, see LKDTM's "FORTIFY_*" tests.
2749875bfd52SKees Cook
2750724c299cSMarco Elverconfig HW_BREAKPOINT_KUNIT_TEST
2751724c299cSMarco Elver	bool "Test hw_breakpoint constraints accounting" if !KUNIT_ALL_TESTS
2752724c299cSMarco Elver	depends on HAVE_HW_BREAKPOINT
2753724c299cSMarco Elver	depends on KUNIT=y
2754724c299cSMarco Elver	default KUNIT_ALL_TESTS
2755724c299cSMarco Elver	help
2756724c299cSMarco Elver	  Tests for hw_breakpoint constraints accounting.
2757724c299cSMarco Elver
2758724c299cSMarco Elver	  If unsure, say N.
2759724c299cSMarco Elver
27603bf301e1SKees Cookconfig STRCAT_KUNIT_TEST
27613bf301e1SKees Cook	tristate "Test strcat() family of functions at runtime" if !KUNIT_ALL_TESTS
27623bf301e1SKees Cook	depends on KUNIT
27633bf301e1SKees Cook	default KUNIT_ALL_TESTS
27643bf301e1SKees Cook
276541eefc46SKees Cookconfig STRSCPY_KUNIT_TEST
276641eefc46SKees Cook	tristate "Test strscpy*() family of functions at runtime" if !KUNIT_ALL_TESTS
276741eefc46SKees Cook	depends on KUNIT
276841eefc46SKees Cook	default KUNIT_ALL_TESTS
276941eefc46SKees Cook
2770fb3d88abSKees Cookconfig SIPHASH_KUNIT_TEST
2771fb3d88abSKees Cook	tristate "Perform selftest on siphash functions" if !KUNIT_ALL_TESTS
2772fb3d88abSKees Cook	depends on KUNIT
2773fb3d88abSKees Cook	default KUNIT_ALL_TESTS
2774fb3d88abSKees Cook	help
2775fb3d88abSKees Cook	  Enable this option to test the kernel's siphash (<linux/siphash.h>) hash
2776fb3d88abSKees Cook	  functions on boot (or module load).
2777fb3d88abSKees Cook
2778fb3d88abSKees Cook	  This is intended to help people writing architecture-specific
2779fb3d88abSKees Cook	  optimized versions.  If unsure, say N.
2780fb3d88abSKees Cook
2781e704f93aSDavid Rileyconfig TEST_UDELAY
2782e704f93aSDavid Riley	tristate "udelay test driver"
2783e704f93aSDavid Riley	help
2784e704f93aSDavid Riley	  This builds the "udelay_test" module that helps to make sure
2785e704f93aSDavid Riley	  that udelay() is working properly.
2786e704f93aSDavid Riley
2787e704f93aSDavid Riley	  If unsure, say N.
2788e704f93aSDavid Riley
27892bf9e0abSIngo Molnarconfig TEST_STATIC_KEYS
27902bf9e0abSIngo Molnar	tristate "Test static keys"
2791579e1acbSJason Baron	depends on m
2792579e1acbSJason Baron	help
27932bf9e0abSIngo Molnar	  Test the static key interfaces.
2794579e1acbSJason Baron
2795579e1acbSJason Baron	  If unsure, say N.
2796579e1acbSJason Baron
2797683263a5SJim Cromieconfig TEST_DYNAMIC_DEBUG
2798683263a5SJim Cromie	tristate "Test DYNAMIC_DEBUG"
2799683263a5SJim Cromie	depends on DYNAMIC_DEBUG
2800683263a5SJim Cromie	help
2801683263a5SJim Cromie	  This module registers a tracer callback to count enabled
2802683263a5SJim Cromie	  pr_debugs in a 'do_debugging' function, then alters their
2803683263a5SJim Cromie	  enablements, calls the function, and compares counts.
2804683263a5SJim Cromie
2805683263a5SJim Cromie	  If unsure, say N.
2806683263a5SJim Cromie
2807d9c6a72dSLuis R. Rodriguezconfig TEST_KMOD
2808d9c6a72dSLuis R. Rodriguez	tristate "kmod stress tester"
2809d9c6a72dSLuis R. Rodriguez	depends on m
2810d9c6a72dSLuis R. Rodriguez	depends on NETDEVICES && NET_CORE && INET # for TUN
2811ae3d6a32SYueHaibing	depends on BLOCK
2812bbd2e05fSNathan Chancellor	depends on PAGE_SIZE_LESS_THAN_256KB # for BTRFS
2813d9c6a72dSLuis R. Rodriguez	select TEST_LKM
2814d9c6a72dSLuis R. Rodriguez	select XFS_FS
2815d9c6a72dSLuis R. Rodriguez	select TUN
2816d9c6a72dSLuis R. Rodriguez	select BTRFS_FS
2817d9c6a72dSLuis R. Rodriguez	help
2818d9c6a72dSLuis R. Rodriguez	  Test the kernel's module loading mechanism: kmod. kmod implements
2819d9c6a72dSLuis R. Rodriguez	  support to load modules using the Linux kernel's usermode helper.
2820d9c6a72dSLuis R. Rodriguez	  This test provides a series of tests against kmod.
2821d9c6a72dSLuis R. Rodriguez
2822d9c6a72dSLuis R. Rodriguez	  Although technically you can either build test_kmod as a module or
2823d9c6a72dSLuis R. Rodriguez	  into the kernel we disallow building it into the kernel since
2824d9c6a72dSLuis R. Rodriguez	  it stress tests request_module() and this will very likely cause
2825d9c6a72dSLuis R. Rodriguez	  some issues by taking over precious threads available from other
2826d9c6a72dSLuis R. Rodriguez	  module load requests, ultimately this could be fatal.
2827d9c6a72dSLuis R. Rodriguez
2828d9c6a72dSLuis R. Rodriguez	  To run tests run:
2829d9c6a72dSLuis R. Rodriguez
2830d9c6a72dSLuis R. Rodriguez	  tools/testing/selftests/kmod/kmod.sh --help
2831d9c6a72dSLuis R. Rodriguez
2832d9c6a72dSLuis R. Rodriguez	  If unsure, say N.
2833d9c6a72dSLuis R. Rodriguez
2834e4dace36SFlorian Fainelliconfig TEST_DEBUG_VIRTUAL
2835e4dace36SFlorian Fainelli	tristate "Test CONFIG_DEBUG_VIRTUAL feature"
2836e4dace36SFlorian Fainelli	depends on DEBUG_VIRTUAL
2837e4dace36SFlorian Fainelli	help
2838e4dace36SFlorian Fainelli	  Test the kernel's ability to detect incorrect calls to
2839e4dace36SFlorian Fainelli	  virt_to_phys() done against the non-linear part of the
2840e4dace36SFlorian Fainelli	  kernel's virtual address map.
2841e4dace36SFlorian Fainelli
2842e4dace36SFlorian Fainelli	  If unsure, say N.
2843e4dace36SFlorian Fainelli
2844ce76d938SAlexander Shishkinconfig TEST_MEMCAT_P
2845ce76d938SAlexander Shishkin	tristate "Test memcat_p() helper function"
2846ce76d938SAlexander Shishkin	help
2847ce76d938SAlexander Shishkin	  Test the memcat_p() helper for correctly merging two
2848ce76d938SAlexander Shishkin	  pointer arrays together.
2849ce76d938SAlexander Shishkin
2850ce76d938SAlexander Shishkin	  If unsure, say N.
2851ce76d938SAlexander Shishkin
2852a2818ee4SJoe Lawrenceconfig TEST_LIVEPATCH
2853a2818ee4SJoe Lawrence	tristate "Test livepatching"
2854a2818ee4SJoe Lawrence	default n
2855bae05437SJoe Lawrence	depends on DYNAMIC_DEBUG
2856a2818ee4SJoe Lawrence	depends on LIVEPATCH
2857a2818ee4SJoe Lawrence	depends on m
2858a2818ee4SJoe Lawrence	help
2859a2818ee4SJoe Lawrence	  Test kernel livepatching features for correctness.  The tests will
2860a2818ee4SJoe Lawrence	  load test modules that will be livepatched in various scenarios.
2861a2818ee4SJoe Lawrence
2862a2818ee4SJoe Lawrence	  To run all the livepatching tests:
2863a2818ee4SJoe Lawrence
2864a2818ee4SJoe Lawrence	  make -C tools/testing/selftests TARGETS=livepatch run_tests
2865a2818ee4SJoe Lawrence
2866a2818ee4SJoe Lawrence	  Alternatively, individual tests may be invoked:
2867a2818ee4SJoe Lawrence
2868a2818ee4SJoe Lawrence	  tools/testing/selftests/livepatch/test-callbacks.sh
2869a2818ee4SJoe Lawrence	  tools/testing/selftests/livepatch/test-livepatch.sh
2870a2818ee4SJoe Lawrence	  tools/testing/selftests/livepatch/test-shadow-vars.sh
2871a2818ee4SJoe Lawrence
2872a2818ee4SJoe Lawrence	  If unsure, say N.
2873a2818ee4SJoe Lawrence
28740a020d41SJiri Pirkoconfig TEST_OBJAGG
28750a020d41SJiri Pirko	tristate "Perform selftest on object aggreration manager"
28760a020d41SJiri Pirko	default n
28770a020d41SJiri Pirko	depends on OBJAGG
28780a020d41SJiri Pirko	help
28790a020d41SJiri Pirko	  Enable this option to test object aggregation manager on boot
28800a020d41SJiri Pirko	  (or module load).
28810a020d41SJiri Pirko
28825015a300SAlexander Potapenkoconfig TEST_MEMINIT
28835015a300SAlexander Potapenko	tristate "Test heap/page initialization"
28845015a300SAlexander Potapenko	help
28855015a300SAlexander Potapenko	  Test if the kernel is zero-initializing heap and page allocations.
28865015a300SAlexander Potapenko	  This can be useful to test init_on_alloc and init_on_free features.
28875015a300SAlexander Potapenko
28885015a300SAlexander Potapenko	  If unsure, say N.
28895015a300SAlexander Potapenko
2890b2ef9f5aSRalph Campbellconfig TEST_HMM
2891b2ef9f5aSRalph Campbell	tristate "Test HMM (Heterogeneous Memory Management)"
2892b2ef9f5aSRalph Campbell	depends on TRANSPARENT_HUGEPAGE
2893b2ef9f5aSRalph Campbell	depends on DEVICE_PRIVATE
2894b2ef9f5aSRalph Campbell	select HMM_MIRROR
2895b2ef9f5aSRalph Campbell	select MMU_NOTIFIER
2896b2ef9f5aSRalph Campbell	help
2897b2ef9f5aSRalph Campbell	  This is a pseudo device driver solely for testing HMM.
2898b2ef9f5aSRalph Campbell	  Say M here if you want to build the HMM test module.
2899b2ef9f5aSRalph Campbell	  Doing so will allow you to run tools/testing/selftest/vm/hmm-tests.
2900b2ef9f5aSRalph Campbell
2901b2ef9f5aSRalph Campbell	  If unsure, say N.
2902b2ef9f5aSRalph Campbell
2903e320d301SMatthew Wilcox (Oracle)config TEST_FREE_PAGES
2904e320d301SMatthew Wilcox (Oracle)	tristate "Test freeing pages"
2905e320d301SMatthew Wilcox (Oracle)	help
2906e320d301SMatthew Wilcox (Oracle)	  Test that a memory leak does not occur due to a race between
2907e320d301SMatthew Wilcox (Oracle)	  freeing a block of pages and a speculative page reference.
2908e320d301SMatthew Wilcox (Oracle)	  Loading this module is safe if your kernel has the bug fixed.
2909e320d301SMatthew Wilcox (Oracle)	  If the bug is not fixed, it will leak gigabytes of memory and
2910e320d301SMatthew Wilcox (Oracle)	  probably OOM your system.
2911e320d301SMatthew Wilcox (Oracle)
29124185b3b9SPetteri Aimonenconfig TEST_FPU
29134185b3b9SPetteri Aimonen	tristate "Test floating point operations in kernel space"
29144185b3b9SPetteri Aimonen	depends on X86 && !KCOV_INSTRUMENT_ALL
29154185b3b9SPetteri Aimonen	help
29164185b3b9SPetteri Aimonen	  Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu
29174185b3b9SPetteri Aimonen	  which will trigger a sequence of floating point operations. This is used
29184185b3b9SPetteri Aimonen	  for self-testing floating point control register setting in
29194185b3b9SPetteri Aimonen	  kernel_fpu_begin().
29204185b3b9SPetteri Aimonen
29214185b3b9SPetteri Aimonen	  If unsure, say N.
29224185b3b9SPetteri Aimonen
29231253b9b8SPaul E. McKenneyconfig TEST_CLOCKSOURCE_WATCHDOG
29241253b9b8SPaul E. McKenney	tristate "Test clocksource watchdog in kernel space"
29251253b9b8SPaul E. McKenney	depends on CLOCKSOURCE_WATCHDOG
29261253b9b8SPaul E. McKenney	help
29271253b9b8SPaul E. McKenney	  Enable this option to create a kernel module that will trigger
29281253b9b8SPaul E. McKenney	  a test of the clocksource watchdog.  This module may be loaded
29291253b9b8SPaul E. McKenney	  via modprobe or insmod in which case it will run upon being
29301253b9b8SPaul E. McKenney	  loaded, or it may be built in, in which case it will run
29311253b9b8SPaul E. McKenney	  shortly after boot.
29321253b9b8SPaul E. McKenney
29331253b9b8SPaul E. McKenney	  If unsure, say N.
29341253b9b8SPaul E. McKenney
2935d3deafaaSVincent Legollendif # RUNTIME_TESTING_MENU
2936cc3fa840SRandy Dunlap
2937dce44566SAnshuman Khandualconfig ARCH_USE_MEMTEST
2938dce44566SAnshuman Khandual	bool
2939dce44566SAnshuman Khandual	help
2940dce44566SAnshuman Khandual	  An architecture should select this when it uses early_memtest()
2941dce44566SAnshuman Khandual	  during boot process.
2942dce44566SAnshuman Khandual
2943cc3fa840SRandy Dunlapconfig MEMTEST
2944cc3fa840SRandy Dunlap	bool "Memtest"
2945dce44566SAnshuman Khandual	depends on ARCH_USE_MEMTEST
2946a7f7f624SMasahiro Yamada	help
2947cc3fa840SRandy Dunlap	  This option adds a kernel parameter 'memtest', which allows memtest
2948dce44566SAnshuman Khandual	  to be set and executed.
2949cc3fa840SRandy Dunlap	        memtest=0, mean disabled; -- default
2950cc3fa840SRandy Dunlap	        memtest=1, mean do 1 test pattern;
2951cc3fa840SRandy Dunlap	        ...
2952cc3fa840SRandy Dunlap	        memtest=17, mean do 17 test patterns.
2953cc3fa840SRandy Dunlap	  If you are unsure how to answer this question, answer N.
2954cc3fa840SRandy Dunlap
2955cc3fa840SRandy Dunlap
295606ec64b8SChristoph Hellwig
2957af9ca6f9SBranden Bonabyconfig HYPERV_TESTING
2958af9ca6f9SBranden Bonaby	bool "Microsoft Hyper-V driver testing"
2959af9ca6f9SBranden Bonaby	default n
2960af9ca6f9SBranden Bonaby	depends on HYPERV && DEBUG_FS
2961af9ca6f9SBranden Bonaby	help
2962af9ca6f9SBranden Bonaby	  Select this option to enable Hyper-V vmbus testing.
2963af9ca6f9SBranden Bonaby
2964045f6d79SChangbin Duendmenu # "Kernel Testing and Coverage"
2965045f6d79SChangbin Du
29662f7ab126SMiguel Ojedamenu "Rust hacking"
29672f7ab126SMiguel Ojeda
29682f7ab126SMiguel Ojedaconfig RUST_DEBUG_ASSERTIONS
29692f7ab126SMiguel Ojeda	bool "Debug assertions"
29702f7ab126SMiguel Ojeda	depends on RUST
29712f7ab126SMiguel Ojeda	help
29722f7ab126SMiguel Ojeda	  Enables rustc's `-Cdebug-assertions` codegen option.
29732f7ab126SMiguel Ojeda
29742f7ab126SMiguel Ojeda	  This flag lets you turn `cfg(debug_assertions)` conditional
29752f7ab126SMiguel Ojeda	  compilation on or off. This can be used to enable extra debugging
29762f7ab126SMiguel Ojeda	  code in development but not in production. For example, it controls
29772f7ab126SMiguel Ojeda	  the behavior of the standard library's `debug_assert!` macro.
29782f7ab126SMiguel Ojeda
29792f7ab126SMiguel Ojeda	  Note that this will apply to all Rust code, including `core`.
29802f7ab126SMiguel Ojeda
29812f7ab126SMiguel Ojeda	  If unsure, say N.
29822f7ab126SMiguel Ojeda
29832f7ab126SMiguel Ojedaconfig RUST_OVERFLOW_CHECKS
29842f7ab126SMiguel Ojeda	bool "Overflow checks"
29852f7ab126SMiguel Ojeda	default y
29862f7ab126SMiguel Ojeda	depends on RUST
29872f7ab126SMiguel Ojeda	help
29882f7ab126SMiguel Ojeda	  Enables rustc's `-Coverflow-checks` codegen option.
29892f7ab126SMiguel Ojeda
29902f7ab126SMiguel Ojeda	  This flag allows you to control the behavior of runtime integer
29912f7ab126SMiguel Ojeda	  overflow. When overflow-checks are enabled, a Rust panic will occur
29922f7ab126SMiguel Ojeda	  on overflow.
29932f7ab126SMiguel Ojeda
29942f7ab126SMiguel Ojeda	  Note that this will apply to all Rust code, including `core`.
29952f7ab126SMiguel Ojeda
29962f7ab126SMiguel Ojeda	  If unsure, say Y.
29972f7ab126SMiguel Ojeda
2998ecaa6ddfSGary Guoconfig RUST_BUILD_ASSERT_ALLOW
2999ecaa6ddfSGary Guo	bool "Allow unoptimized build-time assertions"
3000ecaa6ddfSGary Guo	depends on RUST
3001ecaa6ddfSGary Guo	help
3002ecaa6ddfSGary Guo	  Controls how are `build_error!` and `build_assert!` handled during build.
3003ecaa6ddfSGary Guo
3004ecaa6ddfSGary Guo	  If calls to them exist in the binary, it may indicate a violated invariant
3005ecaa6ddfSGary Guo	  or that the optimizer failed to verify the invariant during compilation.
3006ecaa6ddfSGary Guo
3007ecaa6ddfSGary Guo	  This should not happen, thus by default the build is aborted. However,
3008ecaa6ddfSGary Guo	  as an escape hatch, you can choose Y here to ignore them during build
3009ecaa6ddfSGary Guo	  and let the check be carried at runtime (with `panic!` being called if
3010ecaa6ddfSGary Guo	  the check fails).
3011ecaa6ddfSGary Guo
3012ecaa6ddfSGary Guo	  If unsure, say N.
3013ecaa6ddfSGary Guo
3014a66d733dSMiguel Ojedaconfig RUST_KERNEL_DOCTESTS
3015a66d733dSMiguel Ojeda	bool "Doctests for the `kernel` crate" if !KUNIT_ALL_TESTS
3016a66d733dSMiguel Ojeda	depends on RUST && KUNIT=y
3017a66d733dSMiguel Ojeda	default KUNIT_ALL_TESTS
3018a66d733dSMiguel Ojeda	help
3019a66d733dSMiguel Ojeda	  This builds the documentation tests of the `kernel` crate
3020a66d733dSMiguel Ojeda	  as KUnit tests.
3021a66d733dSMiguel Ojeda
3022a66d733dSMiguel Ojeda	  For more information on KUnit and unit tests in general,
3023a66d733dSMiguel Ojeda	  please refer to the KUnit documentation in Documentation/dev-tools/kunit/.
3024a66d733dSMiguel Ojeda
3025a66d733dSMiguel Ojeda	  If unsure, say N.
3026a66d733dSMiguel Ojeda
30272f7ab126SMiguel Ojedaendmenu # "Rust"
30282f7ab126SMiguel Ojeda
302906ec64b8SChristoph Hellwigendmenu # Kernel hacking
3030