xref: /linux/lib/Kconfig.debug (revision 50c36504fc6090847f1fbdc7cf4852ae16d6e500)
1604ff0dcSDave Hansenmenu "printk and dmesg options"
21da177e4SLinus Torvalds
31da177e4SLinus Torvaldsconfig PRINTK_TIME
41da177e4SLinus Torvalds	bool "Show timing information on printks"
5d3b8b6e5SRandy Dunlap	depends on PRINTK
61da177e4SLinus Torvalds	help
7649e6ee3SKay Sievers	  Selecting this option causes time stamps of the printk()
8649e6ee3SKay Sievers	  messages to be added to the output of the syslog() system
9649e6ee3SKay Sievers	  call and at the console.
10649e6ee3SKay Sievers
11649e6ee3SKay Sievers	  The timestamp is always recorded internally, and exported
12649e6ee3SKay Sievers	  to /dev/kmsg. This flag just specifies if the timestamp should
13649e6ee3SKay Sievers	  be included, not that the timestamp is recorded.
14649e6ee3SKay Sievers
15649e6ee3SKay Sievers	  The behavior is also controlled by the kernel command line
16649e6ee3SKay Sievers	  parameter printk.time=1. See Documentation/kernel-parameters.txt
171da177e4SLinus Torvalds
1842a9dc0bSAlex Elderconfig MESSAGE_LOGLEVEL_DEFAULT
195af5bcb8SMandeep Singh Baines	int "Default message log level (1-7)"
205af5bcb8SMandeep Singh Baines	range 1 7
215af5bcb8SMandeep Singh Baines	default "4"
225af5bcb8SMandeep Singh Baines	help
235af5bcb8SMandeep Singh Baines	  Default log level for printk statements with no specified priority.
245af5bcb8SMandeep Singh Baines
255af5bcb8SMandeep Singh Baines	  This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
265af5bcb8SMandeep Singh Baines	  that are auditing their logs closely may want to set it to a lower
275af5bcb8SMandeep Singh Baines	  priority.
285af5bcb8SMandeep Singh Baines
29604ff0dcSDave Hansenconfig BOOT_PRINTK_DELAY
30604ff0dcSDave Hansen	bool "Delay each boot printk message by N milliseconds"
31604ff0dcSDave Hansen	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
32604ff0dcSDave Hansen	help
33604ff0dcSDave Hansen	  This build option allows you to read kernel boot messages
34604ff0dcSDave Hansen	  by inserting a short delay after each one.  The delay is
35604ff0dcSDave Hansen	  specified in milliseconds on the kernel command line,
36604ff0dcSDave Hansen	  using "boot_delay=N".
37604ff0dcSDave Hansen
38604ff0dcSDave Hansen	  It is likely that you would also need to use "lpj=M" to preset
39604ff0dcSDave Hansen	  the "loops per jiffie" value.
40604ff0dcSDave Hansen	  See a previous boot log for the "lpj" value to use for your
41604ff0dcSDave Hansen	  system, and then set "lpj=M" before setting "boot_delay=N".
42604ff0dcSDave Hansen	  NOTE:  Using this option may adversely affect SMP systems.
43604ff0dcSDave Hansen	  I.e., processors other than the first one may not boot up.
44604ff0dcSDave Hansen	  BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
45604ff0dcSDave Hansen	  what it believes to be lockup conditions.
46604ff0dcSDave Hansen
47604ff0dcSDave Hansenconfig DYNAMIC_DEBUG
48604ff0dcSDave Hansen	bool "Enable dynamic printk() support"
49604ff0dcSDave Hansen	default n
50604ff0dcSDave Hansen	depends on PRINTK
51604ff0dcSDave Hansen	depends on DEBUG_FS
52604ff0dcSDave Hansen	help
53604ff0dcSDave Hansen
54604ff0dcSDave Hansen	  Compiles debug level messages into the kernel, which would not
55604ff0dcSDave Hansen	  otherwise be available at runtime. These messages can then be
56604ff0dcSDave Hansen	  enabled/disabled based on various levels of scope - per source file,
57604ff0dcSDave Hansen	  function, module, format string, and line number. This mechanism
58604ff0dcSDave Hansen	  implicitly compiles in all pr_debug() and dev_dbg() calls, which
59604ff0dcSDave Hansen	  enlarges the kernel text size by about 2%.
60604ff0dcSDave Hansen
61604ff0dcSDave Hansen	  If a source file is compiled with DEBUG flag set, any
62604ff0dcSDave Hansen	  pr_debug() calls in it are enabled by default, but can be
63604ff0dcSDave Hansen	  disabled at runtime as below.  Note that DEBUG flag is
64604ff0dcSDave Hansen	  turned on by many CONFIG_*DEBUG* options.
65604ff0dcSDave Hansen
66604ff0dcSDave Hansen	  Usage:
67604ff0dcSDave Hansen
68604ff0dcSDave Hansen	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
69604ff0dcSDave Hansen	  which is contained in the 'debugfs' filesystem. Thus, the debugfs
70604ff0dcSDave Hansen	  filesystem must first be mounted before making use of this feature.
71604ff0dcSDave Hansen	  We refer the control file as: <debugfs>/dynamic_debug/control. This
72604ff0dcSDave Hansen	  file contains a list of the debug statements that can be enabled. The
73604ff0dcSDave Hansen	  format for each line of the file is:
74604ff0dcSDave Hansen
75604ff0dcSDave Hansen		filename:lineno [module]function flags format
76604ff0dcSDave Hansen
77604ff0dcSDave Hansen	  filename : source file of the debug statement
78604ff0dcSDave Hansen	  lineno : line number of the debug statement
79604ff0dcSDave Hansen	  module : module that contains the debug statement
80604ff0dcSDave Hansen	  function : function that contains the debug statement
81604ff0dcSDave Hansen          flags : '=p' means the line is turned 'on' for printing
82604ff0dcSDave Hansen          format : the format used for the debug statement
83604ff0dcSDave Hansen
84604ff0dcSDave Hansen	  From a live system:
85604ff0dcSDave Hansen
86604ff0dcSDave Hansen		nullarbor:~ # cat <debugfs>/dynamic_debug/control
87604ff0dcSDave Hansen		# filename:lineno [module]function flags format
88604ff0dcSDave Hansen		fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
89604ff0dcSDave Hansen		fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
90604ff0dcSDave Hansen		fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
91604ff0dcSDave Hansen
92604ff0dcSDave Hansen	  Example usage:
93604ff0dcSDave Hansen
94604ff0dcSDave Hansen		// enable the message at line 1603 of file svcsock.c
95604ff0dcSDave Hansen		nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
96604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
97604ff0dcSDave Hansen
98604ff0dcSDave Hansen		// enable all the messages in file svcsock.c
99604ff0dcSDave Hansen		nullarbor:~ # echo -n 'file svcsock.c +p' >
100604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
101604ff0dcSDave Hansen
102604ff0dcSDave Hansen		// enable all the messages in the NFS server module
103604ff0dcSDave Hansen		nullarbor:~ # echo -n 'module nfsd +p' >
104604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
105604ff0dcSDave Hansen
106604ff0dcSDave Hansen		// enable all 12 messages in the function svc_process()
107604ff0dcSDave Hansen		nullarbor:~ # echo -n 'func svc_process +p' >
108604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
109604ff0dcSDave Hansen
110604ff0dcSDave Hansen		// disable all 12 messages in the function svc_process()
111604ff0dcSDave Hansen		nullarbor:~ # echo -n 'func svc_process -p' >
112604ff0dcSDave Hansen						<debugfs>/dynamic_debug/control
113604ff0dcSDave Hansen
114604ff0dcSDave Hansen	  See Documentation/dynamic-debug-howto.txt for additional information.
115604ff0dcSDave Hansen
116604ff0dcSDave Hansenendmenu # "printk and dmesg options"
117604ff0dcSDave Hansen
1186dfc0665SDave Hansenmenu "Compile-time checks and compiler options"
1196dfc0665SDave Hansen
1206dfc0665SDave Hansenconfig DEBUG_INFO
1216dfc0665SDave Hansen	bool "Compile the kernel with debug info"
12212b13835SLinus Torvalds	depends on DEBUG_KERNEL && !COMPILE_TEST
1236dfc0665SDave Hansen	help
1246dfc0665SDave Hansen          If you say Y here the resulting kernel image will include
1256dfc0665SDave Hansen	  debugging info resulting in a larger kernel image.
1266dfc0665SDave Hansen	  This adds debug symbols to the kernel and modules (gcc -g), and
1276dfc0665SDave Hansen	  is needed if you intend to use kernel crashdump or binary object
1286dfc0665SDave Hansen	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
1296dfc0665SDave Hansen	  Say Y here only if you plan to debug the kernel.
1306dfc0665SDave Hansen
1316dfc0665SDave Hansen	  If unsure, say N.
1326dfc0665SDave Hansen
1336dfc0665SDave Hansenconfig DEBUG_INFO_REDUCED
1346dfc0665SDave Hansen	bool "Reduce debugging information"
1356dfc0665SDave Hansen	depends on DEBUG_INFO
1366dfc0665SDave Hansen	help
1376dfc0665SDave Hansen	  If you say Y here gcc is instructed to generate less debugging
1386dfc0665SDave Hansen	  information for structure types. This means that tools that
1396dfc0665SDave Hansen	  need full debugging information (like kgdb or systemtap) won't
1406dfc0665SDave Hansen	  be happy. But if you merely need debugging information to
1416dfc0665SDave Hansen	  resolve line numbers there is no loss. Advantage is that
1426dfc0665SDave Hansen	  build directory object sizes shrink dramatically over a full
1436dfc0665SDave Hansen	  DEBUG_INFO build and compile times are reduced too.
1446dfc0665SDave Hansen	  Only works with newer gcc versions.
1456dfc0665SDave Hansen
146866ced95SAndi Kleenconfig DEBUG_INFO_SPLIT
147866ced95SAndi Kleen	bool "Produce split debuginfo in .dwo files"
148866ced95SAndi Kleen	depends on DEBUG_INFO
149866ced95SAndi Kleen	help
150866ced95SAndi Kleen	  Generate debug info into separate .dwo files. This significantly
151866ced95SAndi Kleen	  reduces the build directory size for builds with DEBUG_INFO,
152866ced95SAndi Kleen	  because it stores the information only once on disk in .dwo
153866ced95SAndi Kleen	  files instead of multiple times in object files and executables.
154866ced95SAndi Kleen	  In addition the debug information is also compressed.
155866ced95SAndi Kleen
156866ced95SAndi Kleen	  Requires recent gcc (4.7+) and recent gdb/binutils.
157866ced95SAndi Kleen	  Any tool that packages or reads debug information would need
158866ced95SAndi Kleen	  to know about the .dwo files and include them.
159866ced95SAndi Kleen	  Incompatible with older versions of ccache.
160866ced95SAndi Kleen
161bfaf2dd3SAndi Kleenconfig DEBUG_INFO_DWARF4
162bfaf2dd3SAndi Kleen	bool "Generate dwarf4 debuginfo"
163bfaf2dd3SAndi Kleen	depends on DEBUG_INFO
164bfaf2dd3SAndi Kleen	help
165bfaf2dd3SAndi Kleen	  Generate dwarf4 debug info. This requires recent versions
166bfaf2dd3SAndi Kleen	  of gcc and gdb. It makes the debug information larger.
167bfaf2dd3SAndi Kleen	  But it significantly improves the success of resolving
168bfaf2dd3SAndi Kleen	  variables in gdb on optimized code.
169bfaf2dd3SAndi Kleen
1703ee7b3faSJan Kiszkaconfig GDB_SCRIPTS
1713ee7b3faSJan Kiszka	bool "Provide GDB scripts for kernel debugging"
1723ee7b3faSJan Kiszka	depends on DEBUG_INFO
1733ee7b3faSJan Kiszka	help
1743ee7b3faSJan Kiszka	  This creates the required links to GDB helper scripts in the
1753ee7b3faSJan Kiszka	  build directory. If you load vmlinux into gdb, the helper
1763ee7b3faSJan Kiszka	  scripts will be automatically imported by gdb as well, and
1773ee7b3faSJan Kiszka	  additional functions are available to analyze a Linux kernel
1783ee7b3faSJan Kiszka	  instance. See Documentation/gdb-kernel-debugging.txt for further
1793ee7b3faSJan Kiszka	  details.
1803ee7b3faSJan Kiszka
181de488443SJeff Garzikconfig ENABLE_WARN_DEPRECATED
182de488443SJeff Garzik	bool "Enable __deprecated logic"
183de488443SJeff Garzik	default y
184de488443SJeff Garzik	help
185de488443SJeff Garzik	  Enable the __deprecated logic in the kernel build.
186de488443SJeff Garzik	  Disable this to suppress the "warning: 'foo' is deprecated
187de488443SJeff Garzik	  (declared at kernel/power/somefile.c:1234)" messages.
188de488443SJeff Garzik
189cebc04baSAndrew Mortonconfig ENABLE_MUST_CHECK
190cebc04baSAndrew Morton	bool "Enable __must_check logic"
191cebc04baSAndrew Morton	default y
192cebc04baSAndrew Morton	help
193cebc04baSAndrew Morton	  Enable the __must_check logic in the kernel build.  Disable this to
194cebc04baSAndrew Morton	  suppress the "warning: ignoring return value of 'foo', declared with
195cebc04baSAndrew Morton	  attribute warn_unused_result" messages.
1961da177e4SLinus Torvalds
19735bb5b1eSAndi Kleenconfig FRAME_WARN
19835bb5b1eSAndi Kleen	int "Warn for stack frames larger than (needs gcc 4.4)"
19935bb5b1eSAndi Kleen	range 0 8192
2003f181b4dSAndrey Ryabinin	default 0 if KASAN
20135bb5b1eSAndi Kleen	default 1024 if !64BIT
20235bb5b1eSAndi Kleen	default 2048 if 64BIT
20335bb5b1eSAndi Kleen	help
20435bb5b1eSAndi Kleen	  Tell gcc to warn at build time for stack frames larger than this.
20535bb5b1eSAndi Kleen	  Setting this too low will cause a lot of warnings.
20635bb5b1eSAndi Kleen	  Setting it to 0 disables the warning.
20735bb5b1eSAndi Kleen	  Requires gcc 4.4
20835bb5b1eSAndi Kleen
20999657c78SRandy Dunlapconfig STRIP_ASM_SYMS
21099657c78SRandy Dunlap	bool "Strip assembler-generated symbols during link"
21199657c78SRandy Dunlap	default n
21299657c78SRandy Dunlap	help
21399657c78SRandy Dunlap	  Strip internal assembler-generated symbols during a link (symbols
21499657c78SRandy Dunlap	  that look like '.Lxxx') so they don't pollute the output of
21599657c78SRandy Dunlap	  get_wchan() and suchlike.
21699657c78SRandy Dunlap
2171873e870SAndi Kleenconfig READABLE_ASM
2181873e870SAndi Kleen        bool "Generate readable assembler code"
2191873e870SAndi Kleen        depends on DEBUG_KERNEL
2201873e870SAndi Kleen        help
2211873e870SAndi Kleen          Disable some compiler optimizations that tend to generate human unreadable
2221873e870SAndi Kleen          assembler output. This may make the kernel slightly slower, but it helps
2231873e870SAndi Kleen          to keep kernel developers who have to stare a lot at assembler listings
2241873e870SAndi Kleen          sane.
2251873e870SAndi Kleen
226f71d20e9SArjan van de Venconfig UNUSED_SYMBOLS
227f71d20e9SArjan van de Ven	bool "Enable unused/obsolete exported symbols"
228f71d20e9SArjan van de Ven	default y if X86
229f71d20e9SArjan van de Ven	help
230f71d20e9SArjan van de Ven	  Unused but exported symbols make the kernel needlessly bigger.  For
231f71d20e9SArjan van de Ven	  that reason most of these unused exports will soon be removed.  This
232f71d20e9SArjan van de Ven	  option is provided temporarily to provide a transition period in case
233f71d20e9SArjan van de Ven	  some external kernel module needs one of these symbols anyway. If you
234f71d20e9SArjan van de Ven	  encounter such a case in your module, consider if you are actually
235f71d20e9SArjan van de Ven	  using the right API.  (rationale: since nobody in the kernel is using
236f71d20e9SArjan van de Ven	  this in a module, there is a pretty good chance it's actually the
237f71d20e9SArjan van de Ven	  wrong interface to use).  If you really need the symbol, please send a
238f71d20e9SArjan van de Ven	  mail to the linux kernel mailing list mentioning the symbol and why
239f71d20e9SArjan van de Ven	  you really need it, and what the merge plan to the mainline kernel for
240f71d20e9SArjan van de Ven	  your module is.
241f71d20e9SArjan van de Ven
24248c96a36SJoonsoo Kimconfig PAGE_OWNER
24348c96a36SJoonsoo Kim	bool "Track page owner"
24448c96a36SJoonsoo Kim	depends on DEBUG_KERNEL && STACKTRACE_SUPPORT
24548c96a36SJoonsoo Kim	select DEBUG_FS
24648c96a36SJoonsoo Kim	select STACKTRACE
24748c96a36SJoonsoo Kim	select PAGE_EXTENSION
24848c96a36SJoonsoo Kim	help
24948c96a36SJoonsoo Kim	  This keeps track of what call chain is the owner of a page, may
25048c96a36SJoonsoo Kim	  help to find bare alloc_page(s) leaks. Even if you include this
25148c96a36SJoonsoo Kim	  feature on your build, it is disabled in default. You should pass
25248c96a36SJoonsoo Kim	  "page_owner=on" to boot parameter in order to enable it. Eats
25348c96a36SJoonsoo Kim	  a fair amount of memory if enabled. See tools/vm/page_owner_sort.c
25448c96a36SJoonsoo Kim	  for user-space helper.
25548c96a36SJoonsoo Kim
25648c96a36SJoonsoo Kim	  If unsure, say N.
25748c96a36SJoonsoo Kim
258bf4735a4SDon Mullisconfig DEBUG_FS
259bf4735a4SDon Mullis	bool "Debug Filesystem"
260bf4735a4SDon Mullis	help
261bf4735a4SDon Mullis	  debugfs is a virtual file system that kernel developers use to put
262bf4735a4SDon Mullis	  debugging files into.  Enable this option to be able to read and
263bf4735a4SDon Mullis	  write to these files.
264bf4735a4SDon Mullis
265ff543332SRobert P. J. Day	  For detailed documentation on the debugfs API, see
266ff543332SRobert P. J. Day	  Documentation/DocBook/filesystems.
267ff543332SRobert P. J. Day
268bf4735a4SDon Mullis	  If unsure, say N.
269bf4735a4SDon Mullis
270bf4735a4SDon Mullisconfig HEADERS_CHECK
271bf4735a4SDon Mullis	bool "Run 'make headers_check' when building vmlinux"
272bf4735a4SDon Mullis	depends on !UML
273bf4735a4SDon Mullis	help
274bf4735a4SDon Mullis	  This option will extract the user-visible kernel headers whenever
275bf4735a4SDon Mullis	  building the kernel, and will run basic sanity checks on them to
276bf4735a4SDon Mullis	  ensure that exported files do not attempt to include files which
277bf4735a4SDon Mullis	  were not exported, etc.
278bf4735a4SDon Mullis
279bf4735a4SDon Mullis	  If you're making modifications to header files which are
280bf4735a4SDon Mullis	  relevant for userspace, say 'Y', and check the headers
281bf4735a4SDon Mullis	  exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
282bf4735a4SDon Mullis	  your build tree), to make sure they're suitable.
283bf4735a4SDon Mullis
28491341d4bSSam Ravnborgconfig DEBUG_SECTION_MISMATCH
28591341d4bSSam Ravnborg	bool "Enable full Section mismatch analysis"
28691341d4bSSam Ravnborg	help
28791341d4bSSam Ravnborg	  The section mismatch analysis checks if there are illegal
28891341d4bSSam Ravnborg	  references from one section to another section.
289e809ab01SMichael Witten	  During linktime or runtime, some sections are dropped;
290e809ab01SMichael Witten	  any use of code/data previously in these sections would
29191341d4bSSam Ravnborg	  most likely result in an oops.
292e809ab01SMichael Witten	  In the code, functions and variables are annotated with
2930db0628dSPaul Gortmaker	  __init,, etc. (see the full list in include/linux/init.h),
294d6fbfa4fSGeert Uytterhoeven	  which results in the code/data being placed in specific sections.
295e809ab01SMichael Witten	  The section mismatch analysis is always performed after a full
296e809ab01SMichael Witten	  kernel build, and enabling this option causes the following
297e809ab01SMichael Witten	  additional steps to occur:
298e809ab01SMichael Witten	  - Add the option -fno-inline-functions-called-once to gcc commands.
299e809ab01SMichael Witten	    When inlining a function annotated with __init in a non-init
300e809ab01SMichael Witten	    function, we would lose the section information and thus
30191341d4bSSam Ravnborg	    the analysis would not catch the illegal reference.
302e809ab01SMichael Witten	    This option tells gcc to inline less (but it does result in
303e809ab01SMichael Witten	    a larger kernel).
304e809ab01SMichael Witten	  - Run the section mismatch analysis for each module/built-in.o file.
305e809ab01SMichael Witten	    When we run the section mismatch analysis on vmlinux.o, we
306d6fbfa4fSGeert Uytterhoeven	    lose valueble information about where the mismatch was
30791341d4bSSam Ravnborg	    introduced.
30891341d4bSSam Ravnborg	    Running the analysis for each module/built-in.o file
309e809ab01SMichael Witten	    tells where the mismatch happens much closer to the
310e809ab01SMichael Witten	    source. The drawback is that the same mismatch is
311e809ab01SMichael Witten	    reported at least twice.
312e809ab01SMichael Witten	  - Enable verbose reporting from modpost in order to help resolve
313e809ab01SMichael Witten	    the section mismatches that are reported.
31491341d4bSSam Ravnborg
31547490ec1SNicolas Boichatconfig SECTION_MISMATCH_WARN_ONLY
31647490ec1SNicolas Boichat	bool "Make section mismatch errors non-fatal"
31747490ec1SNicolas Boichat	default y
31847490ec1SNicolas Boichat	help
31947490ec1SNicolas Boichat	  If you say N here, the build process will fail if there are any
32047490ec1SNicolas Boichat	  section mismatch, instead of just throwing warnings.
32147490ec1SNicolas Boichat
32247490ec1SNicolas Boichat	  If unsure, say Y.
32347490ec1SNicolas Boichat
3246dfc0665SDave Hansen#
3256dfc0665SDave Hansen# Select this config option from the architecture Kconfig, if it
3266dfc0665SDave Hansen# is preferred to always offer frame pointers as a config
3276dfc0665SDave Hansen# option on the architecture (regardless of KERNEL_DEBUG):
3286dfc0665SDave Hansen#
3296dfc0665SDave Hansenconfig ARCH_WANT_FRAME_POINTERS
3306dfc0665SDave Hansen	bool
3316dfc0665SDave Hansen	help
3326dfc0665SDave Hansen
3336dfc0665SDave Hansenconfig FRAME_POINTER
3346dfc0665SDave Hansen	bool "Compile the kernel with frame pointers"
3356dfc0665SDave Hansen	depends on DEBUG_KERNEL && \
3366dfc0665SDave Hansen		(CRIS || M68K || FRV || UML || \
3376dfc0665SDave Hansen		 AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
3386dfc0665SDave Hansen		ARCH_WANT_FRAME_POINTERS
3396dfc0665SDave Hansen	default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
3406dfc0665SDave Hansen	help
3416dfc0665SDave Hansen	  If you say Y here the resulting kernel image will be slightly
3426dfc0665SDave Hansen	  larger and slower, but it gives very useful debugging information
3436dfc0665SDave Hansen	  in case of kernel bugs. (precise oopses/stacktraces/warnings)
3446dfc0665SDave Hansen
3456dfc0665SDave Hansenconfig DEBUG_FORCE_WEAK_PER_CPU
3466dfc0665SDave Hansen	bool "Force weak per-cpu definitions"
3476dfc0665SDave Hansen	depends on DEBUG_KERNEL
3486dfc0665SDave Hansen	help
3496dfc0665SDave Hansen	  s390 and alpha require percpu variables in modules to be
3506dfc0665SDave Hansen	  defined weak to work around addressing range issue which
3516dfc0665SDave Hansen	  puts the following two restrictions on percpu variable
3526dfc0665SDave Hansen	  definitions.
3536dfc0665SDave Hansen
3546dfc0665SDave Hansen	  1. percpu symbols must be unique whether static or not
3556dfc0665SDave Hansen	  2. percpu variables can't be defined inside a function
3566dfc0665SDave Hansen
3576dfc0665SDave Hansen	  To ensure that generic code follows the above rules, this
3586dfc0665SDave Hansen	  option forces all percpu variables to be defined as weak.
3596dfc0665SDave Hansen
3606dfc0665SDave Hansenendmenu # "Compiler options"
3616dfc0665SDave Hansen
3626dfc0665SDave Hansenconfig MAGIC_SYSRQ
3636dfc0665SDave Hansen	bool "Magic SysRq key"
3646dfc0665SDave Hansen	depends on !UML
3656dfc0665SDave Hansen	help
3666dfc0665SDave Hansen	  If you say Y here, you will have some control over the system even
3676dfc0665SDave Hansen	  if the system crashes for example during kernel debugging (e.g., you
3686dfc0665SDave Hansen	  will be able to flush the buffer cache to disk, reboot the system
3696dfc0665SDave Hansen	  immediately or dump some status information). This is accomplished
3706dfc0665SDave Hansen	  by pressing various keys while holding SysRq (Alt+PrintScreen). It
3716dfc0665SDave Hansen	  also works on a serial console (on PC hardware at least), if you
3726dfc0665SDave Hansen	  send a BREAK and then within 5 seconds a command keypress. The
3736dfc0665SDave Hansen	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
3746dfc0665SDave Hansen	  unless you really know what this hack does.
3756dfc0665SDave Hansen
3768eaede49SBen Hutchingsconfig MAGIC_SYSRQ_DEFAULT_ENABLE
3778eaede49SBen Hutchings	hex "Enable magic SysRq key functions by default"
3788eaede49SBen Hutchings	depends on MAGIC_SYSRQ
3798eaede49SBen Hutchings	default 0x1
3808eaede49SBen Hutchings	help
3818eaede49SBen Hutchings	  Specifies which SysRq key functions are enabled by default.
3828eaede49SBen Hutchings	  This may be set to 1 or 0 to enable or disable them all, or
3838eaede49SBen Hutchings	  to a bitmask as described in Documentation/sysrq.txt.
3848eaede49SBen Hutchings
385f346f4b3SAdrian Bunkconfig DEBUG_KERNEL
386f346f4b3SAdrian Bunk	bool "Kernel debugging"
387f346f4b3SAdrian Bunk	help
388f346f4b3SAdrian Bunk	  Say Y here if you are developing drivers or trying to debug and
389f346f4b3SAdrian Bunk	  identify kernel problems.
390f346f4b3SAdrian Bunk
3910610c8a8SDave Hansenmenu "Memory Debugging"
392a304e1b8SDavid Woodhouse
3930610c8a8SDave Hansensource mm/Kconfig.debug
39482f67cd9SIngo Molnar
3953ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS
3963ac7fe5aSThomas Gleixner	bool "Debug object operations"
3973ac7fe5aSThomas Gleixner	depends on DEBUG_KERNEL
3983ac7fe5aSThomas Gleixner	help
3993ac7fe5aSThomas Gleixner	  If you say Y here, additional code will be inserted into the
4003ac7fe5aSThomas Gleixner	  kernel to track the life time of various objects and validate
4013ac7fe5aSThomas Gleixner	  the operations on those objects.
4023ac7fe5aSThomas Gleixner
4033ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_SELFTEST
4043ac7fe5aSThomas Gleixner	bool "Debug objects selftest"
4053ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
4063ac7fe5aSThomas Gleixner	help
4073ac7fe5aSThomas Gleixner	  This enables the selftest of the object debug code.
4083ac7fe5aSThomas Gleixner
4093ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_FREE
4103ac7fe5aSThomas Gleixner	bool "Debug objects in freed memory"
4113ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
4123ac7fe5aSThomas Gleixner	help
4133ac7fe5aSThomas Gleixner	  This enables checks whether a k/v free operation frees an area
4143ac7fe5aSThomas Gleixner	  which contains an object which has not been deactivated
4153ac7fe5aSThomas Gleixner	  properly. This can make kmalloc/kfree-intensive workloads
4163ac7fe5aSThomas Gleixner	  much slower.
4173ac7fe5aSThomas Gleixner
418c6f3a97fSThomas Gleixnerconfig DEBUG_OBJECTS_TIMERS
419c6f3a97fSThomas Gleixner	bool "Debug timer objects"
420c6f3a97fSThomas Gleixner	depends on DEBUG_OBJECTS
421c6f3a97fSThomas Gleixner	help
422c6f3a97fSThomas Gleixner	  If you say Y here, additional code will be inserted into the
423c6f3a97fSThomas Gleixner	  timer routines to track the life time of timer objects and
424c6f3a97fSThomas Gleixner	  validate the timer operations.
425c6f3a97fSThomas Gleixner
426dc186ad7SThomas Gleixnerconfig DEBUG_OBJECTS_WORK
427dc186ad7SThomas Gleixner	bool "Debug work objects"
428dc186ad7SThomas Gleixner	depends on DEBUG_OBJECTS
429dc186ad7SThomas Gleixner	help
430dc186ad7SThomas Gleixner	  If you say Y here, additional code will be inserted into the
431dc186ad7SThomas Gleixner	  work queue routines to track the life time of work objects and
432dc186ad7SThomas Gleixner	  validate the work operations.
433dc186ad7SThomas Gleixner
434551d55a9SMathieu Desnoyersconfig DEBUG_OBJECTS_RCU_HEAD
435551d55a9SMathieu Desnoyers	bool "Debug RCU callbacks objects"
436fc2ecf7eSMathieu Desnoyers	depends on DEBUG_OBJECTS
437551d55a9SMathieu Desnoyers	help
438551d55a9SMathieu Desnoyers	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
439551d55a9SMathieu Desnoyers
440e2852ae8STejun Heoconfig DEBUG_OBJECTS_PERCPU_COUNTER
441e2852ae8STejun Heo	bool "Debug percpu counter objects"
442e2852ae8STejun Heo	depends on DEBUG_OBJECTS
443e2852ae8STejun Heo	help
444e2852ae8STejun Heo	  If you say Y here, additional code will be inserted into the
445e2852ae8STejun Heo	  percpu counter routines to track the life time of percpu counter
446e2852ae8STejun Heo	  objects and validate the percpu counter operations.
447e2852ae8STejun Heo
4483ae70205SIngo Molnarconfig DEBUG_OBJECTS_ENABLE_DEFAULT
4493ae70205SIngo Molnar	int "debug_objects bootup default value (0-1)"
4503ae70205SIngo Molnar        range 0 1
4513ae70205SIngo Molnar        default "1"
4523ae70205SIngo Molnar        depends on DEBUG_OBJECTS
4533ae70205SIngo Molnar        help
4543ae70205SIngo Molnar          Debug objects boot parameter default value
4553ae70205SIngo Molnar
4561da177e4SLinus Torvaldsconfig DEBUG_SLAB
4574a2f0acfSAndrew Morton	bool "Debug slab memory allocations"
4587d46d9e6SVegard Nossum	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
4591da177e4SLinus Torvalds	help
4601da177e4SLinus Torvalds	  Say Y here to have the kernel do limited verification on memory
4611da177e4SLinus Torvalds	  allocation as well as poisoning memory on free to catch use of freed
4621da177e4SLinus Torvalds	  memory. This can make kmalloc/kfree-intensive workloads much slower.
4631da177e4SLinus Torvalds
464871751e2SAl Viroconfig DEBUG_SLAB_LEAK
465871751e2SAl Viro	bool "Memory leak debugging"
466871751e2SAl Viro	depends on DEBUG_SLAB
467871751e2SAl Viro
468f0630fffSChristoph Lameterconfig SLUB_DEBUG_ON
469f0630fffSChristoph Lameter	bool "SLUB debugging on by default"
4707d46d9e6SVegard Nossum	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
471f0630fffSChristoph Lameter	default n
472f0630fffSChristoph Lameter	help
473f0630fffSChristoph Lameter	  Boot with debugging on by default. SLUB boots by default with
474f0630fffSChristoph Lameter	  the runtime debug capabilities switched off. Enabling this is
475f0630fffSChristoph Lameter	  equivalent to specifying the "slub_debug" parameter on boot.
476f0630fffSChristoph Lameter	  There is no support for more fine grained debug control like
477f0630fffSChristoph Lameter	  possible with slub_debug=xxx. SLUB debugging may be switched
478f0630fffSChristoph Lameter	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
479f0630fffSChristoph Lameter	  "slub_debug=-".
480f0630fffSChristoph Lameter
4818ff12cfcSChristoph Lameterconfig SLUB_STATS
4828ff12cfcSChristoph Lameter	default n
4838ff12cfcSChristoph Lameter	bool "Enable SLUB performance statistics"
484ab4d5ed5SChristoph Lameter	depends on SLUB && SYSFS
4858ff12cfcSChristoph Lameter	help
4868ff12cfcSChristoph Lameter	  SLUB statistics are useful to debug SLUBs allocation behavior in
4878ff12cfcSChristoph Lameter	  order find ways to optimize the allocator. This should never be
4888ff12cfcSChristoph Lameter	  enabled for production use since keeping statistics slows down
4898ff12cfcSChristoph Lameter	  the allocator by a few percentage points. The slabinfo command
4908ff12cfcSChristoph Lameter	  supports the determination of the most active slabs to figure
4918ff12cfcSChristoph Lameter	  out which slabs are relevant to a particular load.
4928ff12cfcSChristoph Lameter	  Try running: slabinfo -DA
4938ff12cfcSChristoph Lameter
494b69ec42bSCatalin Marinasconfig HAVE_DEBUG_KMEMLEAK
495b69ec42bSCatalin Marinas	bool
496b69ec42bSCatalin Marinas
4973bba00d7SCatalin Marinasconfig DEBUG_KMEMLEAK
4983bba00d7SCatalin Marinas	bool "Kernel memory leak detector"
499525c1f92SKees Cook	depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
50079e0d9bdSCatalin Marinas	select DEBUG_FS
5013bba00d7SCatalin Marinas	select STACKTRACE if STACKTRACE_SUPPORT
5023bba00d7SCatalin Marinas	select KALLSYMS
503b60e26a2SRandy Dunlap	select CRC32
5043bba00d7SCatalin Marinas	help
5053bba00d7SCatalin Marinas	  Say Y here if you want to enable the memory leak
5063bba00d7SCatalin Marinas	  detector. The memory allocation/freeing is traced in a way
5073bba00d7SCatalin Marinas	  similar to the Boehm's conservative garbage collector, the
5083bba00d7SCatalin Marinas	  difference being that the orphan objects are not freed but
5093bba00d7SCatalin Marinas	  only shown in /sys/kernel/debug/kmemleak. Enabling this
5103bba00d7SCatalin Marinas	  feature will introduce an overhead to memory
5113bba00d7SCatalin Marinas	  allocations. See Documentation/kmemleak.txt for more
5123bba00d7SCatalin Marinas	  details.
5133bba00d7SCatalin Marinas
514bf96d1e3SCatalin Marinas	  Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
515bf96d1e3SCatalin Marinas	  of finding leaks due to the slab objects poisoning.
516bf96d1e3SCatalin Marinas
5173bba00d7SCatalin Marinas	  In order to access the kmemleak file, debugfs needs to be
5183bba00d7SCatalin Marinas	  mounted (usually at /sys/kernel/debug).
5193bba00d7SCatalin Marinas
520a9d9058aSCatalin Marinasconfig DEBUG_KMEMLEAK_EARLY_LOG_SIZE
521a9d9058aSCatalin Marinas	int "Maximum kmemleak early log entries"
522a9d9058aSCatalin Marinas	depends on DEBUG_KMEMLEAK
523dfcc3e6aSHeiko Carstens	range 200 40000
524a9d9058aSCatalin Marinas	default 400
525a9d9058aSCatalin Marinas	help
526a9d9058aSCatalin Marinas	  Kmemleak must track all the memory allocations to avoid
527a9d9058aSCatalin Marinas	  reporting false positives. Since memory may be allocated or
528a9d9058aSCatalin Marinas	  freed before kmemleak is initialised, an early log buffer is
529a9d9058aSCatalin Marinas	  used to store these actions. If kmemleak reports "early log
530a9d9058aSCatalin Marinas	  buffer exceeded", please increase this value.
531a9d9058aSCatalin Marinas
5320822ee4aSCatalin Marinasconfig DEBUG_KMEMLEAK_TEST
5330822ee4aSCatalin Marinas	tristate "Simple test for the kernel memory leak detector"
5349718269aSDaniel Baluta	depends on DEBUG_KMEMLEAK && m
5350822ee4aSCatalin Marinas	help
5369718269aSDaniel Baluta	  This option enables a module that explicitly leaks memory.
5370822ee4aSCatalin Marinas
5380822ee4aSCatalin Marinas	  If unsure, say N.
5390822ee4aSCatalin Marinas
540ab0155a2SJason Baronconfig DEBUG_KMEMLEAK_DEFAULT_OFF
541ab0155a2SJason Baron	bool "Default kmemleak to off"
542ab0155a2SJason Baron	depends on DEBUG_KMEMLEAK
543ab0155a2SJason Baron	help
544ab0155a2SJason Baron	  Say Y here to disable kmemleak by default. It can then be enabled
545ab0155a2SJason Baron	  on the command line via kmemleak=on.
546ab0155a2SJason Baron
5470610c8a8SDave Hansenconfig DEBUG_STACK_USAGE
5480610c8a8SDave Hansen	bool "Stack utilization instrumentation"
5490610c8a8SDave Hansen	depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
5500610c8a8SDave Hansen	help
5510610c8a8SDave Hansen	  Enables the display of the minimum amount of free stack which each
5520610c8a8SDave Hansen	  task has ever had available in the sysrq-T and sysrq-P debug output.
5530610c8a8SDave Hansen
5540610c8a8SDave Hansen	  This option will slow down process creation somewhat.
5550610c8a8SDave Hansen
5560610c8a8SDave Hansenconfig DEBUG_VM
5570610c8a8SDave Hansen	bool "Debug VM"
5580610c8a8SDave Hansen	depends on DEBUG_KERNEL
5590610c8a8SDave Hansen	help
5600610c8a8SDave Hansen	  Enable this to turn on extended checks in the virtual-memory system
5610610c8a8SDave Hansen          that may impact performance.
5620610c8a8SDave Hansen
5630610c8a8SDave Hansen	  If unsure, say N.
5640610c8a8SDave Hansen
5654f115147SDavidlohr Buesoconfig DEBUG_VM_VMACACHE
5664f115147SDavidlohr Bueso	bool "Debug VMA caching"
5674f115147SDavidlohr Bueso	depends on DEBUG_VM
5684f115147SDavidlohr Bueso	help
5694f115147SDavidlohr Bueso	  Enable this to turn on VMA caching debug information. Doing so
5704f115147SDavidlohr Bueso	  can cause significant overhead, so only enable it in non-production
5714f115147SDavidlohr Bueso	  environments.
5724f115147SDavidlohr Bueso
5734f115147SDavidlohr Bueso	  If unsure, say N.
5744f115147SDavidlohr Bueso
5750610c8a8SDave Hansenconfig DEBUG_VM_RB
5760610c8a8SDave Hansen	bool "Debug VM red-black trees"
5770610c8a8SDave Hansen	depends on DEBUG_VM
5780610c8a8SDave Hansen	help
579a663dad6SDavidlohr Bueso	  Enable VM red-black tree debugging information and extra validations.
5800610c8a8SDave Hansen
5810610c8a8SDave Hansen	  If unsure, say N.
5820610c8a8SDave Hansen
5830610c8a8SDave Hansenconfig DEBUG_VIRTUAL
5840610c8a8SDave Hansen	bool "Debug VM translations"
5850610c8a8SDave Hansen	depends on DEBUG_KERNEL && X86
5860610c8a8SDave Hansen	help
5870610c8a8SDave Hansen	  Enable some costly sanity checks in virtual to page code. This can
5880610c8a8SDave Hansen	  catch mistakes with virt_to_page() and friends.
5890610c8a8SDave Hansen
5900610c8a8SDave Hansen	  If unsure, say N.
5910610c8a8SDave Hansen
5920610c8a8SDave Hansenconfig DEBUG_NOMMU_REGIONS
5930610c8a8SDave Hansen	bool "Debug the global anon/private NOMMU mapping region tree"
5940610c8a8SDave Hansen	depends on DEBUG_KERNEL && !MMU
5950610c8a8SDave Hansen	help
5960610c8a8SDave Hansen	  This option causes the global tree of anonymous and private mapping
5970610c8a8SDave Hansen	  regions to be regularly checked for invalid topology.
5980610c8a8SDave Hansen
5990610c8a8SDave Hansenconfig DEBUG_MEMORY_INIT
6000610c8a8SDave Hansen	bool "Debug memory initialisation" if EXPERT
6010610c8a8SDave Hansen	default !EXPERT
6020610c8a8SDave Hansen	help
6030610c8a8SDave Hansen	  Enable this for additional checks during memory initialisation.
6040610c8a8SDave Hansen	  The sanity checks verify aspects of the VM such as the memory model
6050610c8a8SDave Hansen	  and other information provided by the architecture. Verbose
6060610c8a8SDave Hansen	  information will be printed at KERN_DEBUG loglevel depending
6070610c8a8SDave Hansen	  on the mminit_loglevel= command-line option.
6080610c8a8SDave Hansen
6090610c8a8SDave Hansen	  If unsure, say Y
6100610c8a8SDave Hansen
6110610c8a8SDave Hansenconfig MEMORY_NOTIFIER_ERROR_INJECT
6120610c8a8SDave Hansen	tristate "Memory hotplug notifier error injection module"
6130610c8a8SDave Hansen	depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
6140610c8a8SDave Hansen	help
6150610c8a8SDave Hansen	  This option provides the ability to inject artificial errors to
6160610c8a8SDave Hansen	  memory hotplug notifier chain callbacks.  It is controlled through
6170610c8a8SDave Hansen	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
6180610c8a8SDave Hansen
6190610c8a8SDave Hansen	  If the notifier call chain should be failed with some events
6200610c8a8SDave Hansen	  notified, write the error code to "actions/<notifier event>/error".
6210610c8a8SDave Hansen
6220610c8a8SDave Hansen	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
6230610c8a8SDave Hansen
6240610c8a8SDave Hansen	  # cd /sys/kernel/debug/notifier-error-inject/memory
6250610c8a8SDave Hansen	  # echo -12 > actions/MEM_GOING_OFFLINE/error
6260610c8a8SDave Hansen	  # echo offline > /sys/devices/system/memory/memoryXXX/state
6270610c8a8SDave Hansen	  bash: echo: write error: Cannot allocate memory
6280610c8a8SDave Hansen
6290610c8a8SDave Hansen	  To compile this code as a module, choose M here: the module will
6300610c8a8SDave Hansen	  be called memory-notifier-error-inject.
6310610c8a8SDave Hansen
6320610c8a8SDave Hansen	  If unsure, say N.
6330610c8a8SDave Hansen
6340610c8a8SDave Hansenconfig DEBUG_PER_CPU_MAPS
6350610c8a8SDave Hansen	bool "Debug access to per_cpu maps"
6360610c8a8SDave Hansen	depends on DEBUG_KERNEL
6370610c8a8SDave Hansen	depends on SMP
6380610c8a8SDave Hansen	help
6390610c8a8SDave Hansen	  Say Y to verify that the per_cpu map being accessed has
6400610c8a8SDave Hansen	  been set up. This adds a fair amount of code to kernel memory
6410610c8a8SDave Hansen	  and decreases performance.
6420610c8a8SDave Hansen
6430610c8a8SDave Hansen	  Say N if unsure.
6440610c8a8SDave Hansen
6450610c8a8SDave Hansenconfig DEBUG_HIGHMEM
6460610c8a8SDave Hansen	bool "Highmem debugging"
6470610c8a8SDave Hansen	depends on DEBUG_KERNEL && HIGHMEM
6480610c8a8SDave Hansen	help
649b1357c9fSGeert Uytterhoeven	  This option enables additional error checking for high memory
650b1357c9fSGeert Uytterhoeven	  systems.  Disable for production systems.
6510610c8a8SDave Hansen
6520610c8a8SDave Hansenconfig HAVE_DEBUG_STACKOVERFLOW
6530610c8a8SDave Hansen	bool
6540610c8a8SDave Hansen
6550610c8a8SDave Hansenconfig DEBUG_STACKOVERFLOW
6560610c8a8SDave Hansen	bool "Check for stack overflows"
6570610c8a8SDave Hansen	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
6580610c8a8SDave Hansen	---help---
6590610c8a8SDave Hansen	  Say Y here if you want to check for overflows of kernel, IRQ
660edb0ec07SBorislav Petkov	  and exception stacks (if your architecture uses them). This
6610610c8a8SDave Hansen	  option will show detailed messages if free stack space drops
6620610c8a8SDave Hansen	  below a certain limit.
6630610c8a8SDave Hansen
6640610c8a8SDave Hansen	  These kinds of bugs usually occur when call-chains in the
6650610c8a8SDave Hansen	  kernel get too deep, especially when interrupts are
6660610c8a8SDave Hansen	  involved.
6670610c8a8SDave Hansen
6680610c8a8SDave Hansen	  Use this in cases where you see apparently random memory
6690610c8a8SDave Hansen	  corruption, especially if it appears in 'struct thread_info'
6700610c8a8SDave Hansen
6710610c8a8SDave Hansen	  If in doubt, say "N".
6720610c8a8SDave Hansen
6730610c8a8SDave Hansensource "lib/Kconfig.kmemcheck"
6740610c8a8SDave Hansen
6750b24beccSAndrey Ryabininsource "lib/Kconfig.kasan"
6760b24beccSAndrey Ryabinin
6770610c8a8SDave Hansenendmenu # "Memory Debugging"
6780610c8a8SDave Hansen
6791da177e4SLinus Torvaldsconfig DEBUG_SHIRQ
6801da177e4SLinus Torvalds	bool "Debug shared IRQ handlers"
6810244ad00SMartin Schwidefsky	depends on DEBUG_KERNEL
6821da177e4SLinus Torvalds	help
6831da177e4SLinus Torvalds	  Enable this to generate a spurious interrupt as soon as a shared
6841da177e4SLinus Torvalds	  interrupt handler is registered, and just before one is deregistered.
6851da177e4SLinus Torvalds	  Drivers ought to be able to handle interrupts coming in at those
6861da177e4SLinus Torvalds	  points; some don't and need to be caught.
6871da177e4SLinus Torvalds
68892aef8fbSDave Hansenmenu "Debug Lockups and Hangs"
68992aef8fbSDave Hansen
6901da177e4SLinus Torvaldsconfig LOCKUP_DETECTOR
6911da177e4SLinus Torvalds	bool "Detect Hard and Soft Lockups"
6921da177e4SLinus Torvalds	depends on DEBUG_KERNEL && !S390
6931da177e4SLinus Torvalds	help
6941da177e4SLinus Torvalds	  Say Y here to enable the kernel to act as a watchdog to detect
6951da177e4SLinus Torvalds	  hard and soft lockups.
6961da177e4SLinus Torvalds
6971da177e4SLinus Torvalds	  Softlockups are bugs that cause the kernel to loop in kernel
6981da177e4SLinus Torvalds	  mode for more than 20 seconds, without giving other tasks a
6991da177e4SLinus Torvalds	  chance to run.  The current stack trace is displayed upon
7001da177e4SLinus Torvalds	  detection and the system will stay locked up.
7011da177e4SLinus Torvalds
7021da177e4SLinus Torvalds	  Hardlockups are bugs that cause the CPU to loop in kernel mode
7031da177e4SLinus Torvalds	  for more than 10 seconds, without letting other interrupts have a
7041da177e4SLinus Torvalds	  chance to run.  The current stack trace is displayed upon detection
7051da177e4SLinus Torvalds	  and the system will stay locked up.
7061da177e4SLinus Torvalds
7071da177e4SLinus Torvalds	  The overhead should be minimal.  A periodic hrtimer runs to
7081da177e4SLinus Torvalds	  generate interrupts and kick the watchdog task every 4 seconds.
7091da177e4SLinus Torvalds	  An NMI is generated every 10 seconds or so to check for hardlockups.
7101da177e4SLinus Torvalds
7111da177e4SLinus Torvalds	  The frequency of hrtimer and NMI events and the soft and hard lockup
7121da177e4SLinus Torvalds	  thresholds can be controlled through the sysctl watchdog_thresh.
7131da177e4SLinus Torvalds
7141da177e4SLinus Torvaldsconfig HARDLOCKUP_DETECTOR
7151da177e4SLinus Torvalds	def_bool y
7161da177e4SLinus Torvalds	depends on LOCKUP_DETECTOR && !HAVE_NMI_WATCHDOG
7171da177e4SLinus Torvalds	depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
7181da177e4SLinus Torvalds
7191da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC
7201da177e4SLinus Torvalds	bool "Panic (Reboot) On Hard Lockups"
7211da177e4SLinus Torvalds	depends on HARDLOCKUP_DETECTOR
7221da177e4SLinus Torvalds	help
7231da177e4SLinus Torvalds	  Say Y here to enable the kernel to panic on "hard lockups",
7241da177e4SLinus Torvalds	  which are bugs that cause the kernel to loop in kernel
7251da177e4SLinus Torvalds	  mode with interrupts disabled for more than 10 seconds (configurable
7261da177e4SLinus Torvalds	  using the watchdog_thresh sysctl).
7271da177e4SLinus Torvalds
7281da177e4SLinus Torvalds	  Say N if unsure.
7291da177e4SLinus Torvalds
7301da177e4SLinus Torvaldsconfig BOOTPARAM_HARDLOCKUP_PANIC_VALUE
7311da177e4SLinus Torvalds	int
7321da177e4SLinus Torvalds	depends on HARDLOCKUP_DETECTOR
7331da177e4SLinus Torvalds	range 0 1
7341da177e4SLinus Torvalds	default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
7351da177e4SLinus Torvalds	default 1 if BOOTPARAM_HARDLOCKUP_PANIC
7361da177e4SLinus Torvalds
7371da177e4SLinus Torvaldsconfig BOOTPARAM_SOFTLOCKUP_PANIC
7381da177e4SLinus Torvalds	bool "Panic (Reboot) On Soft Lockups"
7391da177e4SLinus Torvalds	depends on LOCKUP_DETECTOR
7401da177e4SLinus Torvalds	help
7411da177e4SLinus Torvalds	  Say Y here to enable the kernel to panic on "soft lockups",
7421da177e4SLinus Torvalds	  which are bugs that cause the kernel to loop in kernel
7431da177e4SLinus Torvalds	  mode for more than 20 seconds (configurable using the watchdog_thresh
7441da177e4SLinus Torvalds	  sysctl), without giving other tasks a chance to run.
7451da177e4SLinus Torvalds
7461da177e4SLinus Torvalds	  The panic can be used in combination with panic_timeout,
7471da177e4SLinus Torvalds	  to cause the system to reboot automatically after a
7481da177e4SLinus Torvalds	  lockup has been detected. This feature is useful for
7491da177e4SLinus Torvalds	  high-availability systems that have uptime guarantees and
7501da177e4SLinus Torvalds	  where a lockup must be resolved ASAP.
7511da177e4SLinus Torvalds
7528637c099SIngo Molnar	  Say N if unsure.
7531da177e4SLinus Torvalds
7541da177e4SLinus Torvaldsconfig BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
7551da177e4SLinus Torvalds	int
7561da177e4SLinus Torvalds	depends on LOCKUP_DETECTOR
7571da177e4SLinus Torvalds	range 0 1
7581da177e4SLinus Torvalds	default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
7591da177e4SLinus Torvalds	default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
760e7eebaf6SIngo Molnar
7611da177e4SLinus Torvaldsconfig DETECT_HUNG_TASK
7621da177e4SLinus Torvalds	bool "Detect Hung Tasks"
7631da177e4SLinus Torvalds	depends on DEBUG_KERNEL
7641da177e4SLinus Torvalds	default LOCKUP_DETECTOR
7651da177e4SLinus Torvalds	help
7661da177e4SLinus Torvalds	  Say Y here to enable the kernel to detect "hung tasks",
7671da177e4SLinus Torvalds	  which are bugs that cause the task to be stuck in
7681da177e4SLinus Torvalds	  uninterruptible "D" state indefinitiley.
7691da177e4SLinus Torvalds
7701da177e4SLinus Torvalds	  When a hung task is detected, the kernel will print the
7711da177e4SLinus Torvalds	  current stack trace (which you should report), but the
7721da177e4SLinus Torvalds	  task will stay in uninterruptible state. If lockdep is
7731da177e4SLinus Torvalds	  enabled then all held locks will also be reported. This
7741da177e4SLinus Torvalds	  feature has negligible overhead.
7751da177e4SLinus Torvalds
7761da177e4SLinus Torvaldsconfig DEFAULT_HUNG_TASK_TIMEOUT
7771da177e4SLinus Torvalds	int "Default timeout for hung task detection (in seconds)"
7781da177e4SLinus Torvalds	depends on DETECT_HUNG_TASK
7791da177e4SLinus Torvalds	default 120
7801da177e4SLinus Torvalds	help
7811da177e4SLinus Torvalds	  This option controls the default timeout (in seconds) used
7821da177e4SLinus Torvalds	  to determine when a task has become non-responsive and should
7831da177e4SLinus Torvalds	  be considered hung.
7841da177e4SLinus Torvalds
7851da177e4SLinus Torvalds	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
7861da177e4SLinus Torvalds	  sysctl or by writing a value to
7871da177e4SLinus Torvalds	  /proc/sys/kernel/hung_task_timeout_secs.
7881da177e4SLinus Torvalds
789408894eeSIngo Molnar	  A timeout of 0 disables the check.  The default is two minutes.
790408894eeSIngo Molnar	  Keeping the default should be fine in most cases.
791408894eeSIngo Molnar
792408894eeSIngo Molnarconfig BOOTPARAM_HUNG_TASK_PANIC
793408894eeSIngo Molnar	bool "Panic (Reboot) On Hung Tasks"
794408894eeSIngo Molnar	depends on DETECT_HUNG_TASK
795cca57c5bSTim Chen	help
796408894eeSIngo Molnar	  Say Y here to enable the kernel to panic on "hung tasks",
797408894eeSIngo Molnar	  which are bugs that cause the kernel to leave a task stuck
798408894eeSIngo Molnar	  in uninterruptible "D" state.
799408894eeSIngo Molnar
800408894eeSIngo Molnar	  The panic can be used in combination with panic_timeout,
801e7eebaf6SIngo Molnar	  to cause the system to reboot automatically after a
802e7eebaf6SIngo Molnar	  hung task has been detected. This feature is useful for
803e7eebaf6SIngo Molnar	  high-availability systems that have uptime guarantees and
804e7eebaf6SIngo Molnar	  where a hung tasks must be resolved ASAP.
805e7eebaf6SIngo Molnar
806e7eebaf6SIngo Molnar	  Say N if unsure.
807e7eebaf6SIngo Molnar
808e7eebaf6SIngo Molnarconfig BOOTPARAM_HUNG_TASK_PANIC_VALUE
809e7eebaf6SIngo Molnar	int
810e7eebaf6SIngo Molnar	depends on DETECT_HUNG_TASK
811e7eebaf6SIngo Molnar	range 0 1
812048c8bc9SHugh Dickins	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
8131da177e4SLinus Torvalds	default 1 if BOOTPARAM_HUNG_TASK_PANIC
8141da177e4SLinus Torvalds
81592aef8fbSDave Hansenendmenu # "Debug lockups and hangs"
81692aef8fbSDave Hansen
81792aef8fbSDave Hansenconfig PANIC_ON_OOPS
81892aef8fbSDave Hansen	bool "Panic on Oops"
81992aef8fbSDave Hansen	help
82092aef8fbSDave Hansen	  Say Y here to enable the kernel to panic when it oopses. This
82192aef8fbSDave Hansen	  has the same effect as setting oops=panic on the kernel command
82292aef8fbSDave Hansen	  line.
82392aef8fbSDave Hansen
82492aef8fbSDave Hansen	  This feature is useful to ensure that the kernel does not do
82592aef8fbSDave Hansen	  anything erroneous after an oops which could result in data
82692aef8fbSDave Hansen	  corruption or other issues.
82792aef8fbSDave Hansen
82892aef8fbSDave Hansen	  Say N if unsure.
82992aef8fbSDave Hansen
83092aef8fbSDave Hansenconfig PANIC_ON_OOPS_VALUE
83192aef8fbSDave Hansen	int
83292aef8fbSDave Hansen	range 0 1
83392aef8fbSDave Hansen	default 0 if !PANIC_ON_OOPS
83492aef8fbSDave Hansen	default 1 if PANIC_ON_OOPS
83592aef8fbSDave Hansen
8365800dc3cSJason Baronconfig PANIC_TIMEOUT
8375800dc3cSJason Baron	int "panic timeout"
8385800dc3cSJason Baron	default 0
8395800dc3cSJason Baron	help
8405800dc3cSJason Baron	  Set the timeout value (in seconds) until a reboot occurs when the
8415800dc3cSJason Baron	  the kernel panics. If n = 0, then we wait forever. A timeout
8425800dc3cSJason Baron	  value n > 0 will wait n seconds before rebooting, while a timeout
8435800dc3cSJason Baron	  value n < 0 will reboot immediately.
8445800dc3cSJason Baron
8451da177e4SLinus Torvaldsconfig SCHED_DEBUG
8461da177e4SLinus Torvalds	bool "Collect scheduler debugging info"
8471da177e4SLinus Torvalds	depends on DEBUG_KERNEL && PROC_FS
8481da177e4SLinus Torvalds	default y
8491da177e4SLinus Torvalds	help
8501da177e4SLinus Torvalds	  If you say Y here, the /proc/sched_debug file will be provided
8511da177e4SLinus Torvalds	  that can help debug the scheduler. The runtime overhead of this
8521da177e4SLinus Torvalds	  option is minimal.
8531da177e4SLinus Torvalds
854f6db8347SNaveen N. Raoconfig SCHED_INFO
855f6db8347SNaveen N. Rao	bool
856f6db8347SNaveen N. Rao	default n
857f6db8347SNaveen N. Rao
8581da177e4SLinus Torvaldsconfig SCHEDSTATS
8591da177e4SLinus Torvalds	bool "Collect scheduler statistics"
8601da177e4SLinus Torvalds	depends on DEBUG_KERNEL && PROC_FS
861f6db8347SNaveen N. Rao	select SCHED_INFO
8621da177e4SLinus Torvalds	help
8631da177e4SLinus Torvalds	  If you say Y here, additional code will be inserted into the
8641da177e4SLinus Torvalds	  scheduler and related routines to collect statistics about
8651da177e4SLinus Torvalds	  scheduler behavior and provide them in /proc/schedstat.  These
8661da177e4SLinus Torvalds	  stats may be useful for both tuning and debugging the scheduler
8671da177e4SLinus Torvalds	  If you aren't debugging the scheduler or trying to tune a specific
8681da177e4SLinus Torvalds	  application, you can say N to avoid the very slight overhead
8691da177e4SLinus Torvalds	  this adds.
8701da177e4SLinus Torvalds
8710d9e2632SAaron Tomlinconfig SCHED_STACK_END_CHECK
8720d9e2632SAaron Tomlin	bool "Detect stack corruption on calls to schedule()"
8730d9e2632SAaron Tomlin	depends on DEBUG_KERNEL
8740d9e2632SAaron Tomlin	default n
8750d9e2632SAaron Tomlin	help
8760d9e2632SAaron Tomlin	  This option checks for a stack overrun on calls to schedule().
8770d9e2632SAaron Tomlin	  If the stack end location is found to be over written always panic as
8780d9e2632SAaron Tomlin	  the content of the corrupted region can no longer be trusted.
8790d9e2632SAaron Tomlin	  This is to ensure no erroneous behaviour occurs which could result in
8800d9e2632SAaron Tomlin	  data corruption or a sporadic crash at a later stage once the region
8810d9e2632SAaron Tomlin	  is examined. The runtime overhead introduced is minimal.
8820d9e2632SAaron Tomlin
8833c17ad19SJohn Stultzconfig DEBUG_TIMEKEEPING
8843c17ad19SJohn Stultz	bool "Enable extra timekeeping sanity checking"
8853c17ad19SJohn Stultz	help
8863c17ad19SJohn Stultz	  This option will enable additional timekeeping sanity checks
8873c17ad19SJohn Stultz	  which may be helpful when diagnosing issues where timekeeping
8883c17ad19SJohn Stultz	  problems are suspected.
8893c17ad19SJohn Stultz
8903c17ad19SJohn Stultz	  This may include checks in the timekeeping hotpaths, so this
8913c17ad19SJohn Stultz	  option may have a (very small) performance impact to some
8923c17ad19SJohn Stultz	  workloads.
8933c17ad19SJohn Stultz
8943c17ad19SJohn Stultz	  If unsure, say N.
8953c17ad19SJohn Stultz
8961da177e4SLinus Torvaldsconfig TIMER_STATS
8971da177e4SLinus Torvalds	bool "Collect kernel timers statistics"
8981da177e4SLinus Torvalds	depends on DEBUG_KERNEL && PROC_FS
8991da177e4SLinus Torvalds	help
9001da177e4SLinus Torvalds	  If you say Y here, additional code will be inserted into the
9011da177e4SLinus Torvalds	  timer routines to collect statistics about kernel timers being
9021da177e4SLinus Torvalds	  reprogrammed. The statistics can be read from /proc/timer_stats.
9031da177e4SLinus Torvalds	  The statistics collection is started by writing 1 to /proc/timer_stats,
9041da177e4SLinus Torvalds	  writing 0 stops it. This feature is useful to collect information
9051da177e4SLinus Torvalds	  about timer usage patterns in kernel and userspace. This feature
9061da177e4SLinus Torvalds	  is lightweight if enabled in the kernel config but not activated
9071da177e4SLinus Torvalds	  (it defaults to deactivated on bootup and will only be activated
9081da177e4SLinus Torvalds	  if some application like powertop activates it explicitly).
9091da177e4SLinus Torvalds
9101da177e4SLinus Torvaldsconfig DEBUG_PREEMPT
9111da177e4SLinus Torvalds	bool "Debug preemptible kernel"
91201deab98SKumar Gala	depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
9131da177e4SLinus Torvalds	default y
9141da177e4SLinus Torvalds	help
9151da177e4SLinus Torvalds	  If you say Y here then the kernel will use a debug variant of the
9161da177e4SLinus Torvalds	  commonly used smp_processor_id() function and will print warnings
9171da177e4SLinus Torvalds	  if kernel code uses it in a preemption-unsafe way. Also, the kernel
9181da177e4SLinus Torvalds	  will detect preemption count underflows.
9191da177e4SLinus Torvalds
9209eade16bSDave Hansenmenu "Lock Debugging (spinlocks, mutexes, etc...)"
9219eade16bSDave Hansen
922e7eebaf6SIngo Molnarconfig DEBUG_RT_MUTEXES
923e7eebaf6SIngo Molnar	bool "RT Mutex debugging, deadlock detection"
924e7eebaf6SIngo Molnar	depends on DEBUG_KERNEL && RT_MUTEXES
925e7eebaf6SIngo Molnar	help
926e7eebaf6SIngo Molnar	 This allows rt mutex semantics violations and rt mutex related
927e7eebaf6SIngo Molnar	 deadlocks (lockups) to be detected and reported automatically.
928e7eebaf6SIngo Molnar
9291da177e4SLinus Torvaldsconfig DEBUG_SPINLOCK
9304d9f34adSIngo Molnar	bool "Spinlock and rw-lock debugging: basic checks"
9311da177e4SLinus Torvalds	depends on DEBUG_KERNEL
932e335e3ebSRaghavendra K T	select UNINLINE_SPIN_UNLOCK
9331da177e4SLinus Torvalds	help
9341da177e4SLinus Torvalds	  Say Y here and build SMP to catch missing spinlock initialization
9351da177e4SLinus Torvalds	  and certain other kinds of spinlock errors commonly made.  This is
9361da177e4SLinus Torvalds	  best used in conjunction with the NMI watchdog so that spinlock
9371da177e4SLinus Torvalds	  deadlocks are also debuggable.
9381da177e4SLinus Torvalds
9394d9f34adSIngo Molnarconfig DEBUG_MUTEXES
9404d9f34adSIngo Molnar	bool "Mutex debugging: basic checks"
9414d9f34adSIngo Molnar	depends on DEBUG_KERNEL
9424d9f34adSIngo Molnar	help
9434d9f34adSIngo Molnar	 This feature allows mutex semantics violations to be detected and
9444d9f34adSIngo Molnar	 reported.
9454d9f34adSIngo Molnar
94623010027SDaniel Vetterconfig DEBUG_WW_MUTEX_SLOWPATH
94723010027SDaniel Vetter	bool "Wait/wound mutex debugging: Slowpath testing"
94823010027SDaniel Vetter	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
94923010027SDaniel Vetter	select DEBUG_LOCK_ALLOC
95023010027SDaniel Vetter	select DEBUG_SPINLOCK
95123010027SDaniel Vetter	select DEBUG_MUTEXES
95223010027SDaniel Vetter	help
95323010027SDaniel Vetter	 This feature enables slowpath testing for w/w mutex users by
95423010027SDaniel Vetter	 injecting additional -EDEADLK wound/backoff cases. Together with
95523010027SDaniel Vetter	 the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
95623010027SDaniel Vetter	 will test all possible w/w mutex interface abuse with the
95723010027SDaniel Vetter	 exception of simply not acquiring all the required locks.
9584d692373SRob Clark	 Note that this feature can introduce significant overhead, so
9594d692373SRob Clark	 it really should not be enabled in a production or distro kernel,
9604d692373SRob Clark	 even a debug kernel.  If you are a driver writer, enable it.  If
9614d692373SRob Clark	 you are a distro, do not.
96223010027SDaniel Vetter
9634d9f34adSIngo Molnarconfig DEBUG_LOCK_ALLOC
9644d9f34adSIngo Molnar	bool "Lock debugging: detect incorrect freeing of live locks"
965517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
9664d9f34adSIngo Molnar	select DEBUG_SPINLOCK
9674d9f34adSIngo Molnar	select DEBUG_MUTEXES
9684d9f34adSIngo Molnar	select LOCKDEP
9694d9f34adSIngo Molnar	help
9704d9f34adSIngo Molnar	 This feature will check whether any held lock (spinlock, rwlock,
9714d9f34adSIngo Molnar	 mutex or rwsem) is incorrectly freed by the kernel, via any of the
9724d9f34adSIngo Molnar	 memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
9734d9f34adSIngo Molnar	 vfree(), etc.), whether a live lock is incorrectly reinitialized via
9744d9f34adSIngo Molnar	 spin_lock_init()/mutex_init()/etc., or whether there is any lock
9754d9f34adSIngo Molnar	 held during task exit.
9764d9f34adSIngo Molnar
9774d9f34adSIngo Molnarconfig PROVE_LOCKING
9784d9f34adSIngo Molnar	bool "Lock debugging: prove locking correctness"
979517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
9804d9f34adSIngo Molnar	select LOCKDEP
9814d9f34adSIngo Molnar	select DEBUG_SPINLOCK
9824d9f34adSIngo Molnar	select DEBUG_MUTEXES
9834d9f34adSIngo Molnar	select DEBUG_LOCK_ALLOC
98446b93b74SSteven Rostedt	select TRACE_IRQFLAGS
9854d9f34adSIngo Molnar	default n
9864d9f34adSIngo Molnar	help
9874d9f34adSIngo Molnar	 This feature enables the kernel to prove that all locking
9884d9f34adSIngo Molnar	 that occurs in the kernel runtime is mathematically
9894d9f34adSIngo Molnar	 correct: that under no circumstance could an arbitrary (and
9904d9f34adSIngo Molnar	 not yet triggered) combination of observed locking
9914d9f34adSIngo Molnar	 sequences (on an arbitrary number of CPUs, running an
9924d9f34adSIngo Molnar	 arbitrary number of tasks and interrupt contexts) cause a
9934d9f34adSIngo Molnar	 deadlock.
9944d9f34adSIngo Molnar
9954d9f34adSIngo Molnar	 In short, this feature enables the kernel to report locking
9964d9f34adSIngo Molnar	 related deadlocks before they actually occur.
9974d9f34adSIngo Molnar
9984d9f34adSIngo Molnar	 The proof does not depend on how hard and complex a
9994d9f34adSIngo Molnar	 deadlock scenario would be to trigger: how many
10004d9f34adSIngo Molnar	 participant CPUs, tasks and irq-contexts would be needed
10014d9f34adSIngo Molnar	 for it to trigger. The proof also does not depend on
10024d9f34adSIngo Molnar	 timing: if a race and a resulting deadlock is possible
10034d9f34adSIngo Molnar	 theoretically (no matter how unlikely the race scenario
10044d9f34adSIngo Molnar	 is), it will be proven so and will immediately be
10054d9f34adSIngo Molnar	 reported by the kernel (once the event is observed that
10064d9f34adSIngo Molnar	 makes the deadlock theoretically possible).
10074d9f34adSIngo Molnar
10084d9f34adSIngo Molnar	 If a deadlock is impossible (i.e. the locking rules, as
10094d9f34adSIngo Molnar	 observed by the kernel, are mathematically correct), the
10104d9f34adSIngo Molnar	 kernel reports nothing.
10114d9f34adSIngo Molnar
10124d9f34adSIngo Molnar	 NOTE: this feature can also be enabled for rwlocks, mutexes
10134d9f34adSIngo Molnar	 and rwsems - in which case all dependencies between these
10144d9f34adSIngo Molnar	 different locking variants are observed and mapped too, and
10154d9f34adSIngo Molnar	 the proof of observed correctness is also maintained for an
10164d9f34adSIngo Molnar	 arbitrary combination of these separate locking variants.
10174d9f34adSIngo Molnar
1018214e0aedSDavidlohr Bueso	 For more details, see Documentation/locking/lockdep-design.txt.
10194d9f34adSIngo Molnar
10204d9f34adSIngo Molnarconfig LOCKDEP
10214d9f34adSIngo Molnar	bool
1022517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
10234d9f34adSIngo Molnar	select STACKTRACE
1024df2e1ef6SChen Gang	select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE
10254d9f34adSIngo Molnar	select KALLSYMS
10264d9f34adSIngo Molnar	select KALLSYMS_ALL
10274d9f34adSIngo Molnar
1028f20786ffSPeter Zijlstraconfig LOCK_STAT
1029fdfb870fSDanny ter Haar	bool "Lock usage statistics"
1030f20786ffSPeter Zijlstra	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
1031f20786ffSPeter Zijlstra	select LOCKDEP
1032f20786ffSPeter Zijlstra	select DEBUG_SPINLOCK
1033f20786ffSPeter Zijlstra	select DEBUG_MUTEXES
1034f20786ffSPeter Zijlstra	select DEBUG_LOCK_ALLOC
1035f20786ffSPeter Zijlstra	default n
1036f20786ffSPeter Zijlstra	help
1037f20786ffSPeter Zijlstra	 This feature enables tracking lock contention points
1038f20786ffSPeter Zijlstra
1039214e0aedSDavidlohr Bueso	 For more details, see Documentation/locking/lockstat.txt
1040a560aa48SPeter Zijlstra
1041dd8b1cf6SFrederic Weisbecker	 This also enables lock events required by "perf lock",
1042dd8b1cf6SFrederic Weisbecker	 subcommand of perf.
1043dd8b1cf6SFrederic Weisbecker	 If you want to use "perf lock", you also need to turn on
1044dd8b1cf6SFrederic Weisbecker	 CONFIG_EVENT_TRACING.
104584c6f88fSHitoshi Mitake
104684c6f88fSHitoshi Mitake	 CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
104784c6f88fSHitoshi Mitake	 (CONFIG_LOCKDEP defines "acquire" and "release" events.)
104884c6f88fSHitoshi Mitake
10494d9f34adSIngo Molnarconfig DEBUG_LOCKDEP
10504d9f34adSIngo Molnar	bool "Lock dependency engine debugging"
1051517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && LOCKDEP
10524d9f34adSIngo Molnar	help
10534d9f34adSIngo Molnar	  If you say Y here, the lock dependency engine will do
10544d9f34adSIngo Molnar	  additional runtime checks to debug itself, at the price
10554d9f34adSIngo Molnar	  of more runtime overhead.
10564d9f34adSIngo Molnar
1057d902db1eSFrederic Weisbeckerconfig DEBUG_ATOMIC_SLEEP
1058d902db1eSFrederic Weisbecker	bool "Sleep inside atomic section checking"
1059e8f7c70fSFrederic Weisbecker	select PREEMPT_COUNT
10601da177e4SLinus Torvalds	depends on DEBUG_KERNEL
10611da177e4SLinus Torvalds	help
10621da177e4SLinus Torvalds	  If you say Y here, various routines which may sleep will become very
1063d902db1eSFrederic Weisbecker	  noisy if they are called inside atomic sections: when a spinlock is
1064d902db1eSFrederic Weisbecker	  held, inside an rcu read side critical section, inside preempt disabled
1065d902db1eSFrederic Weisbecker	  sections, inside an interrupt, etc...
10661da177e4SLinus Torvalds
1067cae2ed9aSIngo Molnarconfig DEBUG_LOCKING_API_SELFTESTS
1068cae2ed9aSIngo Molnar	bool "Locking API boot-time self-tests"
1069cae2ed9aSIngo Molnar	depends on DEBUG_KERNEL
1070cae2ed9aSIngo Molnar	help
1071cae2ed9aSIngo Molnar	  Say Y here if you want the kernel to run a short self-test during
1072cae2ed9aSIngo Molnar	  bootup. The self-test checks whether common types of locking bugs
1073cae2ed9aSIngo Molnar	  are detected by debugging mechanisms or not. (if you disable
1074cae2ed9aSIngo Molnar	  lock debugging then those bugs wont be detected of course.)
1075cae2ed9aSIngo Molnar	  The following locking APIs are covered: spinlocks, rwlocks,
1076cae2ed9aSIngo Molnar	  mutexes and rwsems.
1077cae2ed9aSIngo Molnar
10780af3fe1eSPaul E. McKenneyconfig LOCK_TORTURE_TEST
10790af3fe1eSPaul E. McKenney	tristate "torture tests for locking"
10800af3fe1eSPaul E. McKenney	depends on DEBUG_KERNEL
10810af3fe1eSPaul E. McKenney	select TORTURE_TEST
10820af3fe1eSPaul E. McKenney	default n
10830af3fe1eSPaul E. McKenney	help
10840af3fe1eSPaul E. McKenney	  This option provides a kernel module that runs torture tests
10850af3fe1eSPaul E. McKenney	  on kernel locking primitives.  The kernel module may be built
10860af3fe1eSPaul E. McKenney	  after the fact on the running kernel to be tested, if desired.
10870af3fe1eSPaul E. McKenney
10880af3fe1eSPaul E. McKenney	  Say Y here if you want kernel locking-primitive torture tests
10890af3fe1eSPaul E. McKenney	  to be built into the kernel.
10900af3fe1eSPaul E. McKenney	  Say M if you want these torture tests to build as a module.
10910af3fe1eSPaul E. McKenney	  Say N if you are unsure.
10920af3fe1eSPaul E. McKenney
10939eade16bSDave Hansenendmenu # lock debugging
10949eade16bSDave Hansen
10959eade16bSDave Hansenconfig TRACE_IRQFLAGS
10969eade16bSDave Hansen	bool
10979eade16bSDave Hansen	help
10989eade16bSDave Hansen	  Enables hooks to interrupt enabling and disabling for
10999eade16bSDave Hansen	  either tracing or lock debugging.
11009eade16bSDave Hansen
11018637c099SIngo Molnarconfig STACKTRACE
11020c38e1feSDave Jones	bool "Stack backtrace support"
11038637c099SIngo Molnar	depends on STACKTRACE_SUPPORT
11040c38e1feSDave Jones	help
11050c38e1feSDave Jones	  This option causes the kernel to create a /proc/pid/stack for
11060c38e1feSDave Jones	  every process, showing its current stack trace.
11070c38e1feSDave Jones	  It is also used by various kernel debugging features that require
11080c38e1feSDave Jones	  stack trace generation.
11098637c099SIngo Molnar
11101da177e4SLinus Torvaldsconfig DEBUG_KOBJECT
11111da177e4SLinus Torvalds	bool "kobject debugging"
11121da177e4SLinus Torvalds	depends on DEBUG_KERNEL
11131da177e4SLinus Torvalds	help
11141da177e4SLinus Torvalds	  If you say Y here, some extra kobject debugging messages will be sent
11151da177e4SLinus Torvalds	  to the syslog.
11161da177e4SLinus Torvalds
1117c817a67eSRussell Kingconfig DEBUG_KOBJECT_RELEASE
1118c817a67eSRussell King	bool "kobject release debugging"
11192a999aa0SLinus Torvalds	depends on DEBUG_OBJECTS_TIMERS
1120c817a67eSRussell King	help
1121c817a67eSRussell King	  kobjects are reference counted objects.  This means that their
1122c817a67eSRussell King	  last reference count put is not predictable, and the kobject can
1123c817a67eSRussell King	  live on past the point at which a driver decides to drop it's
1124c817a67eSRussell King	  initial reference to the kobject gained on allocation.  An
1125c817a67eSRussell King	  example of this would be a struct device which has just been
1126c817a67eSRussell King	  unregistered.
1127c817a67eSRussell King
1128c817a67eSRussell King	  However, some buggy drivers assume that after such an operation,
1129c817a67eSRussell King	  the memory backing the kobject can be immediately freed.  This
1130c817a67eSRussell King	  goes completely against the principles of a refcounted object.
1131c817a67eSRussell King
1132c817a67eSRussell King	  If you say Y here, the kernel will delay the release of kobjects
1133c817a67eSRussell King	  on the last reference count to improve the visibility of this
1134c817a67eSRussell King	  kind of kobject release bug.
1135c817a67eSRussell King
11369b2a60c4SCatalin Marinasconfig HAVE_DEBUG_BUGVERBOSE
11379b2a60c4SCatalin Marinas	bool
11389b2a60c4SCatalin Marinas
11391da177e4SLinus Torvaldsconfig DEBUG_BUGVERBOSE
11406a108a14SDavid Rientjes	bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
11419b2a60c4SCatalin Marinas	depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
11428420e7efSAlexey Dobriyan	default y
11431da177e4SLinus Torvalds	help
11441da177e4SLinus Torvalds	  Say Y here to make BUG() panics output the file name and line number
11451da177e4SLinus Torvalds	  of the BUG call as well as the EIP and oops trace.  This aids
11461da177e4SLinus Torvalds	  debugging but costs about 70-100K of memory.
11471da177e4SLinus Torvalds
1148199a9afcSDave Jonesconfig DEBUG_LIST
1149199a9afcSDave Jones	bool "Debug linked list manipulation"
1150199a9afcSDave Jones	depends on DEBUG_KERNEL
1151199a9afcSDave Jones	help
1152199a9afcSDave Jones	  Enable this to turn on extended checks in the linked-list
1153199a9afcSDave Jones	  walking routines.
1154199a9afcSDave Jones
1155199a9afcSDave Jones	  If unsure, say N.
1156199a9afcSDave Jones
1157b8cfff68SDan Streetmanconfig DEBUG_PI_LIST
1158b8cfff68SDan Streetman	bool "Debug priority linked list manipulation"
1159b8cfff68SDan Streetman	depends on DEBUG_KERNEL
1160b8cfff68SDan Streetman	help
1161b8cfff68SDan Streetman	  Enable this to turn on extended checks in the priority-ordered
1162b8cfff68SDan Streetman	  linked-list (plist) walking routines.  This checks the entire
1163b8cfff68SDan Streetman	  list multiple times during each manipulation.
1164b8cfff68SDan Streetman
1165b8cfff68SDan Streetman	  If unsure, say N.
1166b8cfff68SDan Streetman
1167d6ec0842SJens Axboeconfig DEBUG_SG
1168d6ec0842SJens Axboe	bool "Debug SG table operations"
1169d6ec0842SJens Axboe	depends on DEBUG_KERNEL
1170d6ec0842SJens Axboe	help
1171d6ec0842SJens Axboe	  Enable this to turn on checks on scatter-gather tables. This can
1172d6ec0842SJens Axboe	  help find problems with drivers that do not properly initialize
1173d6ec0842SJens Axboe	  their sg tables.
1174d6ec0842SJens Axboe
1175d6ec0842SJens Axboe	  If unsure, say N.
1176d6ec0842SJens Axboe
11771b2439dbSArjan van de Venconfig DEBUG_NOTIFIERS
11781b2439dbSArjan van de Ven	bool "Debug notifier call chains"
11791b2439dbSArjan van de Ven	depends on DEBUG_KERNEL
11801b2439dbSArjan van de Ven	help
11811b2439dbSArjan van de Ven	  Enable this to turn on sanity checking for notifier call chains.
11821b2439dbSArjan van de Ven	  This is most useful for kernel developers to make sure that
11831b2439dbSArjan van de Ven	  modules properly unregister themselves from notifier chains.
11841b2439dbSArjan van de Ven	  This is a relatively cheap check but if you care about maximum
11851b2439dbSArjan van de Ven	  performance, say N.
11861b2439dbSArjan van de Ven
1187e0e81739SDavid Howellsconfig DEBUG_CREDENTIALS
1188e0e81739SDavid Howells	bool "Debug credential management"
1189e0e81739SDavid Howells	depends on DEBUG_KERNEL
1190e0e81739SDavid Howells	help
1191e0e81739SDavid Howells	  Enable this to turn on some debug checking for credential
1192e0e81739SDavid Howells	  management.  The additional code keeps track of the number of
1193e0e81739SDavid Howells	  pointers from task_structs to any given cred struct, and checks to
1194e0e81739SDavid Howells	  see that this number never exceeds the usage count of the cred
1195e0e81739SDavid Howells	  struct.
1196e0e81739SDavid Howells
1197e0e81739SDavid Howells	  Furthermore, if SELinux is enabled, this also checks that the
1198e0e81739SDavid Howells	  security pointer in the cred struct is never seen to be invalid.
1199e0e81739SDavid Howells
1200e0e81739SDavid Howells	  If unsure, say N.
1201e0e81739SDavid Howells
12022f03e3caSDave Hansenmenu "RCU Debugging"
12032f03e3caSDave Hansen
12042f03e3caSDave Hansenconfig PROVE_RCU
12059bae6592SPaul E. McKenney	def_bool PROVE_LOCKING
12062f03e3caSDave Hansen
12072f03e3caSDave Hansenconfig PROVE_RCU_REPEATEDLY
12082f03e3caSDave Hansen	bool "RCU debugging: don't disable PROVE_RCU on first splat"
12092f03e3caSDave Hansen	depends on PROVE_RCU
12102f03e3caSDave Hansen	default n
12112f03e3caSDave Hansen	help
12122f03e3caSDave Hansen	 By itself, PROVE_RCU will disable checking upon issuing the
12132f03e3caSDave Hansen	 first warning (or "splat").  This feature prevents such
12142f03e3caSDave Hansen	 disabling, allowing multiple RCU-lockdep warnings to be printed
12152f03e3caSDave Hansen	 on a single reboot.
12162f03e3caSDave Hansen
12172f03e3caSDave Hansen	 Say Y to allow multiple RCU-lockdep warnings per boot.
12182f03e3caSDave Hansen
12192f03e3caSDave Hansen	 Say N if you are unsure.
12202f03e3caSDave Hansen
12212f03e3caSDave Hansenconfig SPARSE_RCU_POINTER
12222f03e3caSDave Hansen	bool "RCU debugging: sparse-based checks for pointer usage"
12232f03e3caSDave Hansen	default n
12242f03e3caSDave Hansen	help
12252f03e3caSDave Hansen	 This feature enables the __rcu sparse annotation for
12262f03e3caSDave Hansen	 RCU-protected pointers.  This annotation will cause sparse
12272f03e3caSDave Hansen	 to flag any non-RCU used of annotated pointers.  This can be
12282f03e3caSDave Hansen	 helpful when debugging RCU usage.  Please note that this feature
12292f03e3caSDave Hansen	 is not intended to enforce code cleanliness; it is instead merely
12302f03e3caSDave Hansen	 a debugging aid.
12312f03e3caSDave Hansen
12322f03e3caSDave Hansen	 Say Y to make sparse flag questionable use of RCU-protected pointers
12332f03e3caSDave Hansen
12342f03e3caSDave Hansen	 Say N if you are unsure.
12352f03e3caSDave Hansen
123651b1130eSPaul E. McKenneyconfig TORTURE_TEST
123751b1130eSPaul E. McKenney	tristate
123851b1130eSPaul E. McKenney	default n
123951b1130eSPaul E. McKenney
1240a241ec65SPaul E. McKenneyconfig RCU_TORTURE_TEST
1241a241ec65SPaul E. McKenney	tristate "torture tests for RCU"
1242a241ec65SPaul E. McKenney	depends on DEBUG_KERNEL
124351b1130eSPaul E. McKenney	select TORTURE_TEST
124483fe27eaSPranith Kumar	select SRCU
124582d0f4c0SPaul E. McKenney	select TASKS_RCU
1246a241ec65SPaul E. McKenney	default n
1247a241ec65SPaul E. McKenney	help
1248a241ec65SPaul E. McKenney	  This option provides a kernel module that runs torture tests
1249a241ec65SPaul E. McKenney	  on the RCU infrastructure.  The kernel module may be built
1250a241ec65SPaul E. McKenney	  after the fact on the running kernel to be tested, if desired.
1251a241ec65SPaul E. McKenney
125231a72bceSPaul E. McKenney	  Say Y here if you want RCU torture tests to be built into
125331a72bceSPaul E. McKenney	  the kernel.
1254a241ec65SPaul E. McKenney	  Say M if you want the RCU torture tests to build as a module.
1255a241ec65SPaul E. McKenney	  Say N if you are unsure.
12568bb31b9dSAnkita Garg
125731a72bceSPaul E. McKenneyconfig RCU_TORTURE_TEST_RUNNABLE
125831a72bceSPaul E. McKenney	bool "torture tests for RCU runnable by default"
125931a72bceSPaul E. McKenney	depends on RCU_TORTURE_TEST = y
126031a72bceSPaul E. McKenney	default n
126131a72bceSPaul E. McKenney	help
126231a72bceSPaul E. McKenney	  This option provides a way to build the RCU torture tests
126331a72bceSPaul E. McKenney	  directly into the kernel without them starting up at boot
126431a72bceSPaul E. McKenney	  time.  You can use /proc/sys/kernel/rcutorture_runnable
126531a72bceSPaul E. McKenney	  to manually override this setting.  This /proc file is
126631a72bceSPaul E. McKenney	  available only when the RCU torture tests have been built
126731a72bceSPaul E. McKenney	  into the kernel.
126831a72bceSPaul E. McKenney
126931a72bceSPaul E. McKenney	  Say Y here if you want the RCU torture tests to start during
127031a72bceSPaul E. McKenney	  boot (you probably don't).
127131a72bceSPaul E. McKenney	  Say N here if you want the RCU torture tests to start only
127231a72bceSPaul E. McKenney	  after being manually enabled via /proc.
127331a72bceSPaul E. McKenney
12740f41c0ddSPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_PREINIT
12750f41c0ddSPaul E. McKenney	bool "Slow down RCU grace-period pre-initialization to expose races"
12760f41c0ddSPaul E. McKenney	depends on RCU_TORTURE_TEST
12770f41c0ddSPaul E. McKenney	help
12780f41c0ddSPaul E. McKenney	  This option delays grace-period pre-initialization (the
12790f41c0ddSPaul E. McKenney	  propagation of CPU-hotplug changes up the rcu_node combining
12800f41c0ddSPaul E. McKenney	  tree) for a few jiffies between initializing each pair of
12810f41c0ddSPaul E. McKenney	  consecutive rcu_node structures.  This helps to expose races
12820f41c0ddSPaul E. McKenney	  involving grace-period pre-initialization, in other words, it
12830f41c0ddSPaul E. McKenney	  makes your kernel less stable.  It can also greatly increase
12840f41c0ddSPaul E. McKenney	  grace-period latency, especially on systems with large numbers
12850f41c0ddSPaul E. McKenney	  of CPUs.  This is useful when torture-testing RCU, but in
12860f41c0ddSPaul E. McKenney	  almost no other circumstance.
12870f41c0ddSPaul E. McKenney
12880f41c0ddSPaul E. McKenney	  Say Y here if you want your system to crash and hang more often.
12890f41c0ddSPaul E. McKenney	  Say N if you want a sane system.
12900f41c0ddSPaul E. McKenney
12910f41c0ddSPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_PREINIT_DELAY
12920f41c0ddSPaul E. McKenney	int "How much to slow down RCU grace-period pre-initialization"
12930f41c0ddSPaul E. McKenney	range 0 5
12940f41c0ddSPaul E. McKenney	default 3
12950f41c0ddSPaul E. McKenney	depends on RCU_TORTURE_TEST_SLOW_PREINIT
12960f41c0ddSPaul E. McKenney	help
12970f41c0ddSPaul E. McKenney	  This option specifies the number of jiffies to wait between
12980f41c0ddSPaul E. McKenney	  each rcu_node structure pre-initialization step.
12990f41c0ddSPaul E. McKenney
130037745d28SPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_INIT
130137745d28SPaul E. McKenney	bool "Slow down RCU grace-period initialization to expose races"
130237745d28SPaul E. McKenney	depends on RCU_TORTURE_TEST
130337745d28SPaul E. McKenney	help
13040f41c0ddSPaul E. McKenney	  This option delays grace-period initialization for a few
13050f41c0ddSPaul E. McKenney	  jiffies between initializing each pair of consecutive
130637745d28SPaul E. McKenney	  rcu_node structures.	This helps to expose races involving
130737745d28SPaul E. McKenney	  grace-period initialization, in other words, it makes your
130837745d28SPaul E. McKenney	  kernel less stable.  It can also greatly increase grace-period
130937745d28SPaul E. McKenney	  latency, especially on systems with large numbers of CPUs.
131037745d28SPaul E. McKenney	  This is useful when torture-testing RCU, but in almost no
131137745d28SPaul E. McKenney	  other circumstance.
131237745d28SPaul E. McKenney
131337745d28SPaul E. McKenney	  Say Y here if you want your system to crash and hang more often.
131437745d28SPaul E. McKenney	  Say N if you want a sane system.
131537745d28SPaul E. McKenney
131637745d28SPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_INIT_DELAY
131737745d28SPaul E. McKenney	int "How much to slow down RCU grace-period initialization"
131837745d28SPaul E. McKenney	range 0 5
1319186bea5dSPaul E. McKenney	default 3
13208d7dc928SPaul E. McKenney	depends on RCU_TORTURE_TEST_SLOW_INIT
132137745d28SPaul E. McKenney	help
132237745d28SPaul E. McKenney	  This option specifies the number of jiffies to wait between
132337745d28SPaul E. McKenney	  each rcu_node structure initialization.
132437745d28SPaul E. McKenney
13250f41c0ddSPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_CLEANUP
13260f41c0ddSPaul E. McKenney	bool "Slow down RCU grace-period cleanup to expose races"
13270f41c0ddSPaul E. McKenney	depends on RCU_TORTURE_TEST
13280f41c0ddSPaul E. McKenney	help
13290f41c0ddSPaul E. McKenney	  This option delays grace-period cleanup for a few jiffies
13300f41c0ddSPaul E. McKenney	  between cleaning up each pair of consecutive rcu_node
13310f41c0ddSPaul E. McKenney	  structures.  This helps to expose races involving grace-period
13320f41c0ddSPaul E. McKenney	  cleanup, in other words, it makes your kernel less stable.
13330f41c0ddSPaul E. McKenney	  It can also greatly increase grace-period latency, especially
13340f41c0ddSPaul E. McKenney	  on systems with large numbers of CPUs.  This is useful when
13350f41c0ddSPaul E. McKenney	  torture-testing RCU, but in almost no other circumstance.
13360f41c0ddSPaul E. McKenney
13370f41c0ddSPaul E. McKenney	  Say Y here if you want your system to crash and hang more often.
13380f41c0ddSPaul E. McKenney	  Say N if you want a sane system.
13390f41c0ddSPaul E. McKenney
13400f41c0ddSPaul E. McKenneyconfig RCU_TORTURE_TEST_SLOW_CLEANUP_DELAY
13410f41c0ddSPaul E. McKenney	int "How much to slow down RCU grace-period cleanup"
13420f41c0ddSPaul E. McKenney	range 0 5
13430f41c0ddSPaul E. McKenney	default 3
13440f41c0ddSPaul E. McKenney	depends on RCU_TORTURE_TEST_SLOW_CLEANUP
13450f41c0ddSPaul E. McKenney	help
13460f41c0ddSPaul E. McKenney	  This option specifies the number of jiffies to wait between
13470f41c0ddSPaul E. McKenney	  each rcu_node structure cleanup operation.
13480f41c0ddSPaul E. McKenney
1349b163760eSPaul E. McKenneyconfig RCU_CPU_STALL_TIMEOUT
1350b163760eSPaul E. McKenney	int "RCU CPU stall timeout in seconds"
13516bfc09e2SPaul E. McKenney	depends on RCU_STALL_COMMON
1352b163760eSPaul E. McKenney	range 3 300
1353c896054fSPaul E. McKenney	default 21
1354b163760eSPaul E. McKenney	help
1355b163760eSPaul E. McKenney	  If a given RCU grace period extends more than the specified
1356b163760eSPaul E. McKenney	  number of seconds, a CPU stall warning is printed.  If the
1357b163760eSPaul E. McKenney	  RCU grace period persists, additional CPU stall warnings are
1358b163760eSPaul E. McKenney	  printed at more widely spaced intervals.
1359b163760eSPaul E. McKenney
13605c8806a0SPaul E. McKenneyconfig RCU_TRACE
13615c8806a0SPaul E. McKenney	bool "Enable tracing for RCU"
13625c8806a0SPaul E. McKenney	depends on DEBUG_KERNEL
136352494535SPaul E. McKenney	select TRACE_CLOCK
13645c8806a0SPaul E. McKenney	help
13655c8806a0SPaul E. McKenney	  This option provides tracing in RCU which presents stats
13665c8806a0SPaul E. McKenney	  in debugfs for debugging RCU implementation.
13675c8806a0SPaul E. McKenney
13685c8806a0SPaul E. McKenney	  Say Y here if you want to enable RCU tracing
13695c8806a0SPaul E. McKenney	  Say N if you are unsure.
13705c8806a0SPaul E. McKenney
13711ce46ee5SPaul E. McKenneyconfig RCU_EQS_DEBUG
1372eb6d5b0aSPaul E. McKenney	bool "Provide debugging asserts for adding NO_HZ support to an arch"
13731ce46ee5SPaul E. McKenney	depends on DEBUG_KERNEL
13741ce46ee5SPaul E. McKenney	help
13751ce46ee5SPaul E. McKenney	  This option provides consistency checks in RCU's handling of
13761ce46ee5SPaul E. McKenney	  NO_HZ.  These checks have proven quite helpful in detecting
13771ce46ee5SPaul E. McKenney	  bugs in arch-specific NO_HZ code.
13781ce46ee5SPaul E. McKenney
13791ce46ee5SPaul E. McKenney	  Say N here if you need ultimate kernel/user switch latencies
13801ce46ee5SPaul E. McKenney	  Say Y if you are unsure
13811ce46ee5SPaul E. McKenney
13822f03e3caSDave Hansenendmenu # "RCU Debugging"
13832f03e3caSDave Hansen
1384870d6656STejun Heoconfig DEBUG_BLOCK_EXT_DEVT
1385870d6656STejun Heo        bool "Force extended block device numbers and spread them"
1386870d6656STejun Heo	depends on DEBUG_KERNEL
1387870d6656STejun Heo	depends on BLOCK
1388759f8ca3SJens Axboe	default n
1389870d6656STejun Heo	help
13900e11e342STejun Heo	  BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
13910e11e342STejun Heo	  SOME DISTRIBUTIONS.  DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
13920e11e342STejun Heo	  YOU ARE DOING.  Distros, please enable this and fix whatever
13930e11e342STejun Heo	  is broken.
13940e11e342STejun Heo
1395870d6656STejun Heo	  Conventionally, block device numbers are allocated from
1396870d6656STejun Heo	  predetermined contiguous area.  However, extended block area
1397870d6656STejun Heo	  may introduce non-contiguous block device numbers.  This
1398870d6656STejun Heo	  option forces most block device numbers to be allocated from
1399870d6656STejun Heo	  the extended space and spreads them to discover kernel or
1400870d6656STejun Heo	  userland code paths which assume predetermined contiguous
1401870d6656STejun Heo	  device number allocation.
1402870d6656STejun Heo
140355dc7db7STejun Heo	  Note that turning on this debug option shuffles all the
140455dc7db7STejun Heo	  device numbers for all IDE and SCSI devices including libata
140555dc7db7STejun Heo	  ones, so root partition specified using device number
140655dc7db7STejun Heo	  directly (via rdev or root=MAJ:MIN) won't work anymore.
140755dc7db7STejun Heo	  Textual device names (root=/dev/sdXn) will continue to work.
140855dc7db7STejun Heo
1409870d6656STejun Heo	  Say N if you are unsure.
1410870d6656STejun Heo
14118d438288SAkinobu Mitaconfig NOTIFIER_ERROR_INJECTION
14128d438288SAkinobu Mita	tristate "Notifier error injection"
14138d438288SAkinobu Mita	depends on DEBUG_KERNEL
14148d438288SAkinobu Mita	select DEBUG_FS
14158d438288SAkinobu Mita	help
1416e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
14178d438288SAkinobu Mita	  specified notifier chain callbacks. It is useful to test the error
14188d438288SAkinobu Mita	  handling of notifier call chain failures.
14198d438288SAkinobu Mita
14208d438288SAkinobu Mita	  Say N if unsure.
14218d438288SAkinobu Mita
1422c9d221f8SAkinobu Mitaconfig CPU_NOTIFIER_ERROR_INJECT
1423c9d221f8SAkinobu Mita	tristate "CPU notifier error injection module"
1424f5a9f52eSAkinobu Mita	depends on HOTPLUG_CPU && NOTIFIER_ERROR_INJECTION
1425c9d221f8SAkinobu Mita	help
1426c9d221f8SAkinobu Mita	  This option provides a kernel module that can be used to test
1427e41e85ccSMasanari Iida	  the error handling of the cpu notifiers by injecting artificial
1428f5a9f52eSAkinobu Mita	  errors to CPU notifier chain callbacks.  It is controlled through
1429f5a9f52eSAkinobu Mita	  debugfs interface under /sys/kernel/debug/notifier-error-inject/cpu
1430f5a9f52eSAkinobu Mita
1431f5a9f52eSAkinobu Mita	  If the notifier call chain should be failed with some events
1432f5a9f52eSAkinobu Mita	  notified, write the error code to "actions/<notifier event>/error".
1433f5a9f52eSAkinobu Mita
1434f5a9f52eSAkinobu Mita	  Example: Inject CPU offline error (-1 == -EPERM)
1435f5a9f52eSAkinobu Mita
1436f5a9f52eSAkinobu Mita	  # cd /sys/kernel/debug/notifier-error-inject/cpu
1437f5a9f52eSAkinobu Mita	  # echo -1 > actions/CPU_DOWN_PREPARE/error
1438f5a9f52eSAkinobu Mita	  # echo 0 > /sys/devices/system/cpu/cpu1/online
1439f5a9f52eSAkinobu Mita	  bash: echo: write error: Operation not permitted
1440c9d221f8SAkinobu Mita
1441c9d221f8SAkinobu Mita	  To compile this code as a module, choose M here: the module will
1442c9d221f8SAkinobu Mita	  be called cpu-notifier-error-inject.
1443c9d221f8SAkinobu Mita
1444c9d221f8SAkinobu Mita	  If unsure, say N.
1445c9d221f8SAkinobu Mita
1446048b9c35SAkinobu Mitaconfig PM_NOTIFIER_ERROR_INJECT
1447048b9c35SAkinobu Mita	tristate "PM notifier error injection module"
1448048b9c35SAkinobu Mita	depends on PM && NOTIFIER_ERROR_INJECTION
1449048b9c35SAkinobu Mita	default m if PM_DEBUG
1450048b9c35SAkinobu Mita	help
1451e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
1452048b9c35SAkinobu Mita	  PM notifier chain callbacks.  It is controlled through debugfs
1453048b9c35SAkinobu Mita	  interface /sys/kernel/debug/notifier-error-inject/pm
1454048b9c35SAkinobu Mita
1455048b9c35SAkinobu Mita	  If the notifier call chain should be failed with some events
1456048b9c35SAkinobu Mita	  notified, write the error code to "actions/<notifier event>/error".
1457048b9c35SAkinobu Mita
1458048b9c35SAkinobu Mita	  Example: Inject PM suspend error (-12 = -ENOMEM)
1459048b9c35SAkinobu Mita
1460048b9c35SAkinobu Mita	  # cd /sys/kernel/debug/notifier-error-inject/pm/
1461048b9c35SAkinobu Mita	  # echo -12 > actions/PM_SUSPEND_PREPARE/error
1462048b9c35SAkinobu Mita	  # echo mem > /sys/power/state
1463048b9c35SAkinobu Mita	  bash: echo: write error: Cannot allocate memory
1464048b9c35SAkinobu Mita
1465048b9c35SAkinobu Mita	  To compile this code as a module, choose M here: the module will
1466048b9c35SAkinobu Mita	  be called pm-notifier-error-inject.
1467048b9c35SAkinobu Mita
1468048b9c35SAkinobu Mita	  If unsure, say N.
1469048b9c35SAkinobu Mita
1470d526e85fSBenjamin Herrenschmidtconfig OF_RECONFIG_NOTIFIER_ERROR_INJECT
1471d526e85fSBenjamin Herrenschmidt	tristate "OF reconfig notifier error injection module"
1472d526e85fSBenjamin Herrenschmidt	depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
147308dfb4ddSAkinobu Mita	help
1474e41e85ccSMasanari Iida	  This option provides the ability to inject artificial errors to
1475d526e85fSBenjamin Herrenschmidt	  OF reconfig notifier chain callbacks.  It is controlled
147608dfb4ddSAkinobu Mita	  through debugfs interface under
1477d526e85fSBenjamin Herrenschmidt	  /sys/kernel/debug/notifier-error-inject/OF-reconfig/
147808dfb4ddSAkinobu Mita
147908dfb4ddSAkinobu Mita	  If the notifier call chain should be failed with some events
148008dfb4ddSAkinobu Mita	  notified, write the error code to "actions/<notifier event>/error".
148108dfb4ddSAkinobu Mita
148208dfb4ddSAkinobu Mita	  To compile this code as a module, choose M here: the module will
1483e12a95f4SAkinobu Mita	  be called of-reconfig-notifier-error-inject.
148408dfb4ddSAkinobu Mita
148508dfb4ddSAkinobu Mita	  If unsure, say N.
148608dfb4ddSAkinobu Mita
14876ff1cb35SAkinobu Mitaconfig FAULT_INJECTION
14881ab8509aSAndrew Morton	bool "Fault-injection framework"
14891ab8509aSAndrew Morton	depends on DEBUG_KERNEL
1490329409aeSAkinobu Mita	help
1491329409aeSAkinobu Mita	  Provide fault-injection framework.
1492329409aeSAkinobu Mita	  For more details, see Documentation/fault-injection/.
14936ff1cb35SAkinobu Mita
14948a8b6502SAkinobu Mitaconfig FAILSLAB
14951ab8509aSAndrew Morton	bool "Fault-injection capability for kmalloc"
14961ab8509aSAndrew Morton	depends on FAULT_INJECTION
1497773ff60eSAkinobu Mita	depends on SLAB || SLUB
14988a8b6502SAkinobu Mita	help
14991ab8509aSAndrew Morton	  Provide fault-injection capability for kmalloc.
15008a8b6502SAkinobu Mita
1501933e312eSAkinobu Mitaconfig FAIL_PAGE_ALLOC
1502933e312eSAkinobu Mita	bool "Fault-injection capabilitiy for alloc_pages()"
15031ab8509aSAndrew Morton	depends on FAULT_INJECTION
1504933e312eSAkinobu Mita	help
15051ab8509aSAndrew Morton	  Provide fault-injection capability for alloc_pages().
1506933e312eSAkinobu Mita
1507c17bb495SAkinobu Mitaconfig FAIL_MAKE_REQUEST
150886327d19SDave Jones	bool "Fault-injection capability for disk IO"
1509581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1510c17bb495SAkinobu Mita	help
15111ab8509aSAndrew Morton	  Provide fault-injection capability for disk IO.
1512c17bb495SAkinobu Mita
1513581d4e28SJens Axboeconfig FAIL_IO_TIMEOUT
1514f4d01439STakuya Yoshikawa	bool "Fault-injection capability for faking disk interrupts"
1515581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1516581d4e28SJens Axboe	help
1517581d4e28SJens Axboe	  Provide fault-injection capability on end IO handling. This
1518581d4e28SJens Axboe	  will make the block layer "forget" an interrupt as configured,
1519581d4e28SJens Axboe	  thus exercising the error handling.
1520581d4e28SJens Axboe
1521581d4e28SJens Axboe	  Only works with drivers that use the generic timeout handling,
1522581d4e28SJens Axboe	  for others it wont do anything.
1523581d4e28SJens Axboe
15241b676f70SPer Forlinconfig FAIL_MMC_REQUEST
15251b676f70SPer Forlin	bool "Fault-injection capability for MMC IO"
15261b676f70SPer Forlin	select DEBUG_FS
15271b676f70SPer Forlin	depends on FAULT_INJECTION && MMC
15281b676f70SPer Forlin	help
15291b676f70SPer Forlin	  Provide fault-injection capability for MMC IO.
15301b676f70SPer Forlin	  This will make the mmc core return data errors. This is
15311b676f70SPer Forlin	  useful to test the error handling in the mmc block device
15321b676f70SPer Forlin	  and to test how the mmc host driver handles retries from
15331b676f70SPer Forlin	  the block device.
15341b676f70SPer Forlin
1535ab51fbabSDavidlohr Buesoconfig FAIL_FUTEX
1536ab51fbabSDavidlohr Bueso	bool "Fault-injection capability for futexes"
1537ab51fbabSDavidlohr Bueso	select DEBUG_FS
1538ab51fbabSDavidlohr Bueso	depends on FAULT_INJECTION && FUTEX
1539ab51fbabSDavidlohr Bueso	help
1540ab51fbabSDavidlohr Bueso	  Provide fault-injection capability for futexes.
1541ab51fbabSDavidlohr Bueso
15426ff1cb35SAkinobu Mitaconfig FAULT_INJECTION_DEBUG_FS
15436ff1cb35SAkinobu Mita	bool "Debugfs entries for fault-injection capabilities"
15441ab8509aSAndrew Morton	depends on FAULT_INJECTION && SYSFS && DEBUG_FS
15456ff1cb35SAkinobu Mita	help
15461ab8509aSAndrew Morton	  Enable configuration of fault-injection capabilities via debugfs.
15471df49008SAkinobu Mita
15481df49008SAkinobu Mitaconfig FAULT_INJECTION_STACKTRACE_FILTER
15491df49008SAkinobu Mita	bool "stacktrace filter for fault-injection capabilities"
15501df49008SAkinobu Mita	depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
15516d690dcaSAkinobu Mita	depends on !X86_64
15521df49008SAkinobu Mita	select STACKTRACE
1553df2e1ef6SChen Gang	select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE
15541df49008SAkinobu Mita	help
15551df49008SAkinobu Mita	  Provide stacktrace filter for fault-injection capabilities
1556267c4025SMathieu Desnoyers
15579745512cSArjan van de Venconfig LATENCYTOP
15589745512cSArjan van de Ven	bool "Latency measuring infrastructure"
1559625fdcaaSRandy Dunlap	depends on HAVE_LATENCYTOP_SUPPORT
1560625fdcaaSRandy Dunlap	depends on DEBUG_KERNEL
1561625fdcaaSRandy Dunlap	depends on STACKTRACE_SUPPORT
1562625fdcaaSRandy Dunlap	depends on PROC_FS
1563cc80ae38SVineet Gupta	select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
15649745512cSArjan van de Ven	select KALLSYMS
15659745512cSArjan van de Ven	select KALLSYMS_ALL
15669745512cSArjan van de Ven	select STACKTRACE
15679745512cSArjan van de Ven	select SCHEDSTATS
15689745512cSArjan van de Ven	select SCHED_DEBUG
15699745512cSArjan van de Ven	help
15709745512cSArjan van de Ven	  Enable this option if you want to use the LatencyTOP tool
15719745512cSArjan van de Ven	  to find out which userspace is blocking on what kernel operations.
15729745512cSArjan van de Ven
1573446f24d1SStephen Boydconfig ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
1574446f24d1SStephen Boyd	bool
1575446f24d1SStephen Boyd
1576446f24d1SStephen Boydconfig DEBUG_STRICT_USER_COPY_CHECKS
1577446f24d1SStephen Boyd	bool "Strict user copy size checks"
1578446f24d1SStephen Boyd	depends on ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
1579446f24d1SStephen Boyd	depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
1580446f24d1SStephen Boyd	help
1581446f24d1SStephen Boyd	  Enabling this option turns a certain set of sanity checks for user
1582446f24d1SStephen Boyd	  copy operations into compile time failures.
1583446f24d1SStephen Boyd
1584446f24d1SStephen Boyd	  The copy_from_user() etc checks are there to help test if there
1585446f24d1SStephen Boyd	  are sufficient security checks on the length argument of
1586446f24d1SStephen Boyd	  the copy operation, by having gcc prove that the argument is
1587446f24d1SStephen Boyd	  within bounds.
1588446f24d1SStephen Boyd
1589446f24d1SStephen Boyd	  If unsure, say N.
1590446f24d1SStephen Boyd
159116444a8aSArnaldo Carvalho de Melosource kernel/trace/Kconfig
159216444a8aSArnaldo Carvalho de Melo
1593881c5149SDave Hansenmenu "Runtime Testing"
1594881c5149SDave Hansen
1595881c5149SDave Hansenconfig LKDTM
1596881c5149SDave Hansen	tristate "Linux Kernel Dump Test Tool Module"
1597881c5149SDave Hansen	depends on DEBUG_FS
1598881c5149SDave Hansen	depends on BLOCK
1599881c5149SDave Hansen	default n
1600881c5149SDave Hansen	help
1601881c5149SDave Hansen	This module enables testing of the different dumping mechanisms by
1602881c5149SDave Hansen	inducing system failures at predefined crash points.
1603881c5149SDave Hansen	If you don't need it: say N
1604881c5149SDave Hansen	Choose M here to compile this code as a module. The module will be
1605881c5149SDave Hansen	called lkdtm.
1606881c5149SDave Hansen
1607881c5149SDave Hansen	Documentation on how to use the module can be found in
1608881c5149SDave Hansen	Documentation/fault-injection/provoke-crashes.txt
1609881c5149SDave Hansen
1610881c5149SDave Hansenconfig TEST_LIST_SORT
1611881c5149SDave Hansen	bool "Linked list sorting test"
1612881c5149SDave Hansen	depends on DEBUG_KERNEL
1613881c5149SDave Hansen	help
1614881c5149SDave Hansen	  Enable this to turn on 'list_sort()' function test. This test is
1615881c5149SDave Hansen	  executed only once during system boot, so affects only boot time.
1616881c5149SDave Hansen
1617881c5149SDave Hansen	  If unsure, say N.
1618881c5149SDave Hansen
1619881c5149SDave Hansenconfig KPROBES_SANITY_TEST
1620881c5149SDave Hansen	bool "Kprobes sanity tests"
1621881c5149SDave Hansen	depends on DEBUG_KERNEL
1622881c5149SDave Hansen	depends on KPROBES
1623881c5149SDave Hansen	default n
1624881c5149SDave Hansen	help
1625881c5149SDave Hansen	  This option provides for testing basic kprobes functionality on
1626881c5149SDave Hansen	  boot. A sample kprobe, jprobe and kretprobe are inserted and
1627881c5149SDave Hansen	  verified for functionality.
1628881c5149SDave Hansen
1629881c5149SDave Hansen	  Say N if you are unsure.
1630881c5149SDave Hansen
1631881c5149SDave Hansenconfig BACKTRACE_SELF_TEST
1632881c5149SDave Hansen	tristate "Self test for the backtrace code"
1633881c5149SDave Hansen	depends on DEBUG_KERNEL
1634881c5149SDave Hansen	default n
1635881c5149SDave Hansen	help
1636881c5149SDave Hansen	  This option provides a kernel module that can be used to test
1637881c5149SDave Hansen	  the kernel stack backtrace code. This option is not useful
1638881c5149SDave Hansen	  for distributions or general kernels, but only for kernel
1639881c5149SDave Hansen	  developers working on architecture code.
1640881c5149SDave Hansen
1641881c5149SDave Hansen	  Note that if you want to also test saved backtraces, you will
1642881c5149SDave Hansen	  have to enable STACKTRACE as well.
1643881c5149SDave Hansen
1644881c5149SDave Hansen	  Say N if you are unsure.
1645881c5149SDave Hansen
1646910a742dSMichel Lespinasseconfig RBTREE_TEST
1647910a742dSMichel Lespinasse	tristate "Red-Black tree test"
16487c993e11SCody P Schafer	depends on DEBUG_KERNEL
1649910a742dSMichel Lespinasse	help
1650910a742dSMichel Lespinasse	  A benchmark measuring the performance of the rbtree library.
1651910a742dSMichel Lespinasse	  Also includes rbtree invariant checks.
1652910a742dSMichel Lespinasse
1653fff3fd8aSMichel Lespinasseconfig INTERVAL_TREE_TEST
1654fff3fd8aSMichel Lespinasse	tristate "Interval tree test"
1655fff3fd8aSMichel Lespinasse	depends on m && DEBUG_KERNEL
1656a88cc108SChris Wilson	select INTERVAL_TREE
1657fff3fd8aSMichel Lespinasse	help
1658fff3fd8aSMichel Lespinasse	  A benchmark measuring the performance of the interval tree library
1659fff3fd8aSMichel Lespinasse
1660623fd807SGreg Thelenconfig PERCPU_TEST
1661623fd807SGreg Thelen	tristate "Per cpu operations test"
1662623fd807SGreg Thelen	depends on m && DEBUG_KERNEL
1663623fd807SGreg Thelen	help
1664623fd807SGreg Thelen	  Enable this option to build test module which validates per-cpu
1665623fd807SGreg Thelen	  operations.
1666623fd807SGreg Thelen
1667623fd807SGreg Thelen	  If unsure, say N.
1668623fd807SGreg Thelen
1669881c5149SDave Hansenconfig ATOMIC64_SELFTEST
1670881c5149SDave Hansen	bool "Perform an atomic64_t self-test at boot"
1671881c5149SDave Hansen	help
1672881c5149SDave Hansen	  Enable this option to test the atomic64_t functions at boot.
1673881c5149SDave Hansen
1674881c5149SDave Hansen	  If unsure, say N.
1675881c5149SDave Hansen
1676881c5149SDave Hansenconfig ASYNC_RAID6_TEST
1677881c5149SDave Hansen	tristate "Self test for hardware accelerated raid6 recovery"
1678881c5149SDave Hansen	depends on ASYNC_RAID6_RECOV
1679881c5149SDave Hansen	select ASYNC_MEMCPY
1680881c5149SDave Hansen	---help---
1681881c5149SDave Hansen	  This is a one-shot self test that permutes through the
1682881c5149SDave Hansen	  recovery of all the possible two disk failure scenarios for a
1683881c5149SDave Hansen	  N-disk array.  Recovery is performed with the asynchronous
1684881c5149SDave Hansen	  raid6 recovery routines, and will optionally use an offload
1685881c5149SDave Hansen	  engine if one is available.
1686881c5149SDave Hansen
1687881c5149SDave Hansen	  If unsure, say N.
1688881c5149SDave Hansen
168964d1d77aSAndy Shevchenkoconfig TEST_HEXDUMP
169064d1d77aSAndy Shevchenko	tristate "Test functions located in the hexdump module at runtime"
169164d1d77aSAndy Shevchenko
1692881c5149SDave Hansenconfig TEST_STRING_HELPERS
1693881c5149SDave Hansen	tristate "Test functions located in the string_helpers module at runtime"
1694881c5149SDave Hansen
1695881c5149SDave Hansenconfig TEST_KSTRTOX
1696881c5149SDave Hansen	tristate "Test kstrto*() family of functions at runtime"
1697881c5149SDave Hansen
1698707cc728SRasmus Villemoesconfig TEST_PRINTF
1699707cc728SRasmus Villemoes	tristate "Test printf() family of functions at runtime"
1700707cc728SRasmus Villemoes
17017e1e7763SThomas Grafconfig TEST_RHASHTABLE
17029d6dbe1bSGeert Uytterhoeven	tristate "Perform selftest on resizable hash table"
17037e1e7763SThomas Graf	default n
17047e1e7763SThomas Graf	help
17057e1e7763SThomas Graf	  Enable this option to test the rhashtable functions at boot.
17067e1e7763SThomas Graf
17077e1e7763SThomas Graf	  If unsure, say N.
17087e1e7763SThomas Graf
1709881c5149SDave Hansenendmenu # runtime tests
1710881c5149SDave Hansen
1711f212ec4bSBernhard Kaindlconfig PROVIDE_OHCI1394_DMA_INIT
1712080de8c2SStefan Richter	bool "Remote debugging over FireWire early on boot"
1713f212ec4bSBernhard Kaindl	depends on PCI && X86
1714f212ec4bSBernhard Kaindl	help
1715f212ec4bSBernhard Kaindl	  If you want to debug problems which hang or crash the kernel early
1716f212ec4bSBernhard Kaindl	  on boot and the crashing machine has a FireWire port, you can use
1717f212ec4bSBernhard Kaindl	  this feature to remotely access the memory of the crashed machine
1718f212ec4bSBernhard Kaindl	  over FireWire. This employs remote DMA as part of the OHCI1394
1719f212ec4bSBernhard Kaindl	  specification which is now the standard for FireWire controllers.
1720f212ec4bSBernhard Kaindl
1721f212ec4bSBernhard Kaindl	  With remote DMA, you can monitor the printk buffer remotely using
1722f212ec4bSBernhard Kaindl	  firescope and access all memory below 4GB using fireproxy from gdb.
1723f212ec4bSBernhard Kaindl	  Even controlling a kernel debugger is possible using remote DMA.
1724f212ec4bSBernhard Kaindl
1725f212ec4bSBernhard Kaindl	  Usage:
1726f212ec4bSBernhard Kaindl
1727f212ec4bSBernhard Kaindl	  If ohci1394_dma=early is used as boot parameter, it will initialize
1728f212ec4bSBernhard Kaindl	  all OHCI1394 controllers which are found in the PCI config space.
1729f212ec4bSBernhard Kaindl
1730f212ec4bSBernhard Kaindl	  As all changes to the FireWire bus such as enabling and disabling
1731f212ec4bSBernhard Kaindl	  devices cause a bus reset and thereby disable remote DMA for all
1732f212ec4bSBernhard Kaindl	  devices, be sure to have the cable plugged and FireWire enabled on
1733f212ec4bSBernhard Kaindl	  the debugging host before booting the debug target for debugging.
1734f212ec4bSBernhard Kaindl
1735f212ec4bSBernhard Kaindl	  This code (~1k) is freed after boot. By then, the firewire stack
1736f212ec4bSBernhard Kaindl	  in charge of the OHCI-1394 controllers should be used instead.
1737f212ec4bSBernhard Kaindl
1738f212ec4bSBernhard Kaindl	  See Documentation/debugging-via-ohci1394.txt for more information.
17399745512cSArjan van de Ven
1740152de30bSRandy Dunlapconfig BUILD_DOCSRC
17413794f3e8SRandy Dunlap	bool "Build targets in Documentation/ tree"
17423794f3e8SRandy Dunlap	depends on HEADERS_CHECK
17433794f3e8SRandy Dunlap	help
17443794f3e8SRandy Dunlap	  This option attempts to build objects from the source files in the
17453794f3e8SRandy Dunlap	  kernel Documentation/ tree.
17463794f3e8SRandy Dunlap
17473794f3e8SRandy Dunlap	  Say N if you are unsure.
17483794f3e8SRandy Dunlap
17495ee00bd4SJoerg Roedelconfig DMA_API_DEBUG
17505ee00bd4SJoerg Roedel	bool "Enable debugging of DMA-API usage"
17515ee00bd4SJoerg Roedel	depends on HAVE_DMA_API_DEBUG
17525ee00bd4SJoerg Roedel	help
17535ee00bd4SJoerg Roedel	  Enable this option to debug the use of the DMA API by device drivers.
17545ee00bd4SJoerg Roedel	  With this option you will be able to detect common bugs in device
17555ee00bd4SJoerg Roedel	  drivers like double-freeing of DMA mappings or freeing mappings that
17565ee00bd4SJoerg Roedel	  were never allocated.
17570abdd7a8SDan Williams
17580abdd7a8SDan Williams	  This also attempts to catch cases where a page owned by DMA is
17590abdd7a8SDan Williams	  accessed by the cpu in a way that could cause data corruption.  For
17600abdd7a8SDan Williams	  example, this enables cow_user_page() to check that the source page is
17610abdd7a8SDan Williams	  not undergoing DMA.
17620abdd7a8SDan Williams
17630abdd7a8SDan Williams	  This option causes a performance degradation.  Use only if you want to
17640abdd7a8SDan Williams	  debug device drivers and dma interactions.
17650abdd7a8SDan Williams
17660abdd7a8SDan Williams	  If unsure, say N.
1767346e15beSJason Baron
17688a6f0b47SValentin Rothbergconfig TEST_LKM
176993e9ef83SKees Cook	tristate "Test module loading with 'hello world' module"
177093e9ef83SKees Cook	default n
177193e9ef83SKees Cook	depends on m
177293e9ef83SKees Cook	help
177393e9ef83SKees Cook	  This builds the "test_module" module that emits "Hello, world"
177493e9ef83SKees Cook	  on printk when loaded. It is designed to be used for basic
177593e9ef83SKees Cook	  evaluation of the module loading subsystem (for example when
177693e9ef83SKees Cook	  validating module verification). It lacks any extra dependencies,
177793e9ef83SKees Cook	  and will not normally be loaded by the system unless explicitly
177893e9ef83SKees Cook	  requested by name.
177993e9ef83SKees Cook
178093e9ef83SKees Cook	  If unsure, say N.
178193e9ef83SKees Cook
17823e2a4c18SKees Cookconfig TEST_USER_COPY
17833e2a4c18SKees Cook	tristate "Test user/kernel boundary protections"
17843e2a4c18SKees Cook	default n
17853e2a4c18SKees Cook	depends on m
17863e2a4c18SKees Cook	help
17873e2a4c18SKees Cook	  This builds the "test_user_copy" module that runs sanity checks
17883e2a4c18SKees Cook	  on the copy_to/from_user infrastructure, making sure basic
17893e2a4c18SKees Cook	  user/kernel boundary testing is working. If it fails to load,
17903e2a4c18SKees Cook	  a regression has been detected in the user/kernel memory boundary
17913e2a4c18SKees Cook	  protections.
17923e2a4c18SKees Cook
17933e2a4c18SKees Cook	  If unsure, say N.
17943e2a4c18SKees Cook
179564a8946bSAlexei Starovoitovconfig TEST_BPF
179664a8946bSAlexei Starovoitov	tristate "Test BPF filter functionality"
179764a8946bSAlexei Starovoitov	default n
179898920ba6SRandy Dunlap	depends on m && NET
179964a8946bSAlexei Starovoitov	help
180064a8946bSAlexei Starovoitov	  This builds the "test_bpf" module that runs various test vectors
180164a8946bSAlexei Starovoitov	  against the BPF interpreter or BPF JIT compiler depending on the
180264a8946bSAlexei Starovoitov	  current setting. This is in particular useful for BPF JIT compiler
180364a8946bSAlexei Starovoitov	  development, but also to run regression tests against changes in
18043c731ebaSAlexei Starovoitov	  the interpreter code. It also enables test stubs for eBPF maps and
18053c731ebaSAlexei Starovoitov	  verifier used by user space verifier testsuite.
180664a8946bSAlexei Starovoitov
180764a8946bSAlexei Starovoitov	  If unsure, say N.
180864a8946bSAlexei Starovoitov
18090a8adf58SKees Cookconfig TEST_FIRMWARE
18100a8adf58SKees Cook	tristate "Test firmware loading via userspace interface"
18110a8adf58SKees Cook	default n
18120a8adf58SKees Cook	depends on FW_LOADER
18130a8adf58SKees Cook	help
18140a8adf58SKees Cook	  This builds the "test_firmware" module that creates a userspace
18150a8adf58SKees Cook	  interface for testing firmware loading. This can be used to
18160a8adf58SKees Cook	  control the triggering of firmware loading without needing an
18170a8adf58SKees Cook	  actual firmware-using device. The contents can be rechecked by
18180a8adf58SKees Cook	  userspace.
18190a8adf58SKees Cook
18200a8adf58SKees Cook	  If unsure, say N.
18210a8adf58SKees Cook
1822e704f93aSDavid Rileyconfig TEST_UDELAY
1823e704f93aSDavid Riley	tristate "udelay test driver"
1824e704f93aSDavid Riley	default n
1825e704f93aSDavid Riley	help
1826e704f93aSDavid Riley	  This builds the "udelay_test" module that helps to make sure
1827e704f93aSDavid Riley	  that udelay() is working properly.
1828e704f93aSDavid Riley
1829e704f93aSDavid Riley	  If unsure, say N.
1830e704f93aSDavid Riley
18314a20799dSVladimir Murzinconfig MEMTEST
18324a20799dSVladimir Murzin	bool "Memtest"
18334a20799dSVladimir Murzin	depends on HAVE_MEMBLOCK
18344a20799dSVladimir Murzin	---help---
18354a20799dSVladimir Murzin	  This option adds a kernel parameter 'memtest', which allows memtest
18364a20799dSVladimir Murzin	  to be set.
18374a20799dSVladimir Murzin	        memtest=0, mean disabled; -- default
18384a20799dSVladimir Murzin	        memtest=1, mean do 1 test pattern;
18394a20799dSVladimir Murzin	        ...
18408d8cfb47SVladimir Murzin	        memtest=17, mean do 17 test patterns.
18414a20799dSVladimir Murzin	  If you are unsure how to answer this question, answer N.
18424a20799dSVladimir Murzin
18432bf9e0abSIngo Molnarconfig TEST_STATIC_KEYS
18442bf9e0abSIngo Molnar	tristate "Test static keys"
1845579e1acbSJason Baron	default n
1846579e1acbSJason Baron	depends on m
1847579e1acbSJason Baron	help
18482bf9e0abSIngo Molnar	  Test the static key interfaces.
1849579e1acbSJason Baron
1850579e1acbSJason Baron	  If unsure, say N.
1851579e1acbSJason Baron
1852267c4025SMathieu Desnoyerssource "samples/Kconfig"
1853dc7d5527SJason Wessel
1854dc7d5527SJason Wesselsource "lib/Kconfig.kgdb"
18550a4af3b0SPekka Enberg
1856