xref: /linux/lib/Kconfig.debug (revision 8d438288145f19f253a82ca71290b44fce79e23f)
11da177e4SLinus Torvalds
21da177e4SLinus Torvaldsconfig PRINTK_TIME
31da177e4SLinus Torvalds	bool "Show timing information on printks"
4d3b8b6e5SRandy Dunlap	depends on PRINTK
51da177e4SLinus Torvalds	help
6649e6ee3SKay Sievers	  Selecting this option causes time stamps of the printk()
7649e6ee3SKay Sievers	  messages to be added to the output of the syslog() system
8649e6ee3SKay Sievers	  call and at the console.
9649e6ee3SKay Sievers
10649e6ee3SKay Sievers	  The timestamp is always recorded internally, and exported
11649e6ee3SKay Sievers	  to /dev/kmsg. This flag just specifies if the timestamp should
12649e6ee3SKay Sievers	  be included, not that the timestamp is recorded.
13649e6ee3SKay Sievers
14649e6ee3SKay Sievers	  The behavior is also controlled by the kernel command line
15649e6ee3SKay Sievers	  parameter printk.time=1. See Documentation/kernel-parameters.txt
161da177e4SLinus Torvalds
175af5bcb8SMandeep Singh Bainesconfig DEFAULT_MESSAGE_LOGLEVEL
185af5bcb8SMandeep Singh Baines	int "Default message log level (1-7)"
195af5bcb8SMandeep Singh Baines	range 1 7
205af5bcb8SMandeep Singh Baines	default "4"
215af5bcb8SMandeep Singh Baines	help
225af5bcb8SMandeep Singh Baines	  Default log level for printk statements with no specified priority.
235af5bcb8SMandeep Singh Baines
245af5bcb8SMandeep Singh Baines	  This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
255af5bcb8SMandeep Singh Baines	  that are auditing their logs closely may want to set it to a lower
265af5bcb8SMandeep Singh Baines	  priority.
275af5bcb8SMandeep Singh Baines
28de488443SJeff Garzikconfig ENABLE_WARN_DEPRECATED
29de488443SJeff Garzik	bool "Enable __deprecated logic"
30de488443SJeff Garzik	default y
31de488443SJeff Garzik	help
32de488443SJeff Garzik	  Enable the __deprecated logic in the kernel build.
33de488443SJeff Garzik	  Disable this to suppress the "warning: 'foo' is deprecated
34de488443SJeff Garzik	  (declared at kernel/power/somefile.c:1234)" messages.
35de488443SJeff Garzik
36cebc04baSAndrew Mortonconfig ENABLE_MUST_CHECK
37cebc04baSAndrew Morton	bool "Enable __must_check logic"
38cebc04baSAndrew Morton	default y
39cebc04baSAndrew Morton	help
40cebc04baSAndrew Morton	  Enable the __must_check logic in the kernel build.  Disable this to
41cebc04baSAndrew Morton	  suppress the "warning: ignoring return value of 'foo', declared with
42cebc04baSAndrew Morton	  attribute warn_unused_result" messages.
431da177e4SLinus Torvalds
4435bb5b1eSAndi Kleenconfig FRAME_WARN
4535bb5b1eSAndi Kleen	int "Warn for stack frames larger than (needs gcc 4.4)"
4635bb5b1eSAndi Kleen	range 0 8192
4735bb5b1eSAndi Kleen	default 1024 if !64BIT
4835bb5b1eSAndi Kleen	default 2048 if 64BIT
4935bb5b1eSAndi Kleen	help
5035bb5b1eSAndi Kleen	  Tell gcc to warn at build time for stack frames larger than this.
5135bb5b1eSAndi Kleen	  Setting this too low will cause a lot of warnings.
5235bb5b1eSAndi Kleen	  Setting it to 0 disables the warning.
5335bb5b1eSAndi Kleen	  Requires gcc 4.4
5435bb5b1eSAndi Kleen
551da177e4SLinus Torvaldsconfig MAGIC_SYSRQ
561da177e4SLinus Torvalds	bool "Magic SysRq key"
57f346f4b3SAdrian Bunk	depends on !UML
581da177e4SLinus Torvalds	help
591da177e4SLinus Torvalds	  If you say Y here, you will have some control over the system even
601da177e4SLinus Torvalds	  if the system crashes for example during kernel debugging (e.g., you
611da177e4SLinus Torvalds	  will be able to flush the buffer cache to disk, reboot the system
621da177e4SLinus Torvalds	  immediately or dump some status information). This is accomplished
631da177e4SLinus Torvalds	  by pressing various keys while holding SysRq (Alt+PrintScreen). It
641da177e4SLinus Torvalds	  also works on a serial console (on PC hardware at least), if you
651da177e4SLinus Torvalds	  send a BREAK and then within 5 seconds a command keypress. The
661da177e4SLinus Torvalds	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
671da177e4SLinus Torvalds	  unless you really know what this hack does.
681da177e4SLinus Torvalds
6999657c78SRandy Dunlapconfig STRIP_ASM_SYMS
7099657c78SRandy Dunlap	bool "Strip assembler-generated symbols during link"
7199657c78SRandy Dunlap	default n
7299657c78SRandy Dunlap	help
7399657c78SRandy Dunlap	  Strip internal assembler-generated symbols during a link (symbols
7499657c78SRandy Dunlap	  that look like '.Lxxx') so they don't pollute the output of
7599657c78SRandy Dunlap	  get_wchan() and suchlike.
7699657c78SRandy Dunlap
771873e870SAndi Kleenconfig READABLE_ASM
781873e870SAndi Kleen        bool "Generate readable assembler code"
791873e870SAndi Kleen        depends on DEBUG_KERNEL
801873e870SAndi Kleen        help
811873e870SAndi Kleen          Disable some compiler optimizations that tend to generate human unreadable
821873e870SAndi Kleen          assembler output. This may make the kernel slightly slower, but it helps
831873e870SAndi Kleen          to keep kernel developers who have to stare a lot at assembler listings
841873e870SAndi Kleen          sane.
851873e870SAndi Kleen
86f71d20e9SArjan van de Venconfig UNUSED_SYMBOLS
87f71d20e9SArjan van de Ven	bool "Enable unused/obsolete exported symbols"
88f71d20e9SArjan van de Ven	default y if X86
89f71d20e9SArjan van de Ven	help
90f71d20e9SArjan van de Ven	  Unused but exported symbols make the kernel needlessly bigger.  For
91f71d20e9SArjan van de Ven	  that reason most of these unused exports will soon be removed.  This
92f71d20e9SArjan van de Ven	  option is provided temporarily to provide a transition period in case
93f71d20e9SArjan van de Ven	  some external kernel module needs one of these symbols anyway. If you
94f71d20e9SArjan van de Ven	  encounter such a case in your module, consider if you are actually
95f71d20e9SArjan van de Ven	  using the right API.  (rationale: since nobody in the kernel is using
96f71d20e9SArjan van de Ven	  this in a module, there is a pretty good chance it's actually the
97f71d20e9SArjan van de Ven	  wrong interface to use).  If you really need the symbol, please send a
98f71d20e9SArjan van de Ven	  mail to the linux kernel mailing list mentioning the symbol and why
99f71d20e9SArjan van de Ven	  you really need it, and what the merge plan to the mainline kernel for
100f71d20e9SArjan van de Ven	  your module is.
101f71d20e9SArjan van de Ven
102bf4735a4SDon Mullisconfig DEBUG_FS
103bf4735a4SDon Mullis	bool "Debug Filesystem"
104bf4735a4SDon Mullis	help
105bf4735a4SDon Mullis	  debugfs is a virtual file system that kernel developers use to put
106bf4735a4SDon Mullis	  debugging files into.  Enable this option to be able to read and
107bf4735a4SDon Mullis	  write to these files.
108bf4735a4SDon Mullis
109ff543332SRobert P. J. Day	  For detailed documentation on the debugfs API, see
110ff543332SRobert P. J. Day	  Documentation/DocBook/filesystems.
111ff543332SRobert P. J. Day
112bf4735a4SDon Mullis	  If unsure, say N.
113bf4735a4SDon Mullis
114bf4735a4SDon Mullisconfig HEADERS_CHECK
115bf4735a4SDon Mullis	bool "Run 'make headers_check' when building vmlinux"
116bf4735a4SDon Mullis	depends on !UML
117bf4735a4SDon Mullis	help
118bf4735a4SDon Mullis	  This option will extract the user-visible kernel headers whenever
119bf4735a4SDon Mullis	  building the kernel, and will run basic sanity checks on them to
120bf4735a4SDon Mullis	  ensure that exported files do not attempt to include files which
121bf4735a4SDon Mullis	  were not exported, etc.
122bf4735a4SDon Mullis
123bf4735a4SDon Mullis	  If you're making modifications to header files which are
124bf4735a4SDon Mullis	  relevant for userspace, say 'Y', and check the headers
125bf4735a4SDon Mullis	  exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
126bf4735a4SDon Mullis	  your build tree), to make sure they're suitable.
127bf4735a4SDon Mullis
12891341d4bSSam Ravnborgconfig DEBUG_SECTION_MISMATCH
12991341d4bSSam Ravnborg	bool "Enable full Section mismatch analysis"
13091341d4bSSam Ravnborg	help
13191341d4bSSam Ravnborg	  The section mismatch analysis checks if there are illegal
13291341d4bSSam Ravnborg	  references from one section to another section.
133e809ab01SMichael Witten	  During linktime or runtime, some sections are dropped;
134e809ab01SMichael Witten	  any use of code/data previously in these sections would
13591341d4bSSam Ravnborg	  most likely result in an oops.
136e809ab01SMichael Witten	  In the code, functions and variables are annotated with
137e809ab01SMichael Witten	  __init, __devinit, etc. (see the full list in include/linux/init.h),
138d6fbfa4fSGeert Uytterhoeven	  which results in the code/data being placed in specific sections.
139e809ab01SMichael Witten	  The section mismatch analysis is always performed after a full
140e809ab01SMichael Witten	  kernel build, and enabling this option causes the following
141e809ab01SMichael Witten	  additional steps to occur:
142e809ab01SMichael Witten	  - Add the option -fno-inline-functions-called-once to gcc commands.
143e809ab01SMichael Witten	    When inlining a function annotated with __init in a non-init
144e809ab01SMichael Witten	    function, we would lose the section information and thus
14591341d4bSSam Ravnborg	    the analysis would not catch the illegal reference.
146e809ab01SMichael Witten	    This option tells gcc to inline less (but it does result in
147e809ab01SMichael Witten	    a larger kernel).
148e809ab01SMichael Witten	  - Run the section mismatch analysis for each module/built-in.o file.
149e809ab01SMichael Witten	    When we run the section mismatch analysis on vmlinux.o, we
150d6fbfa4fSGeert Uytterhoeven	    lose valueble information about where the mismatch was
15191341d4bSSam Ravnborg	    introduced.
15291341d4bSSam Ravnborg	    Running the analysis for each module/built-in.o file
153e809ab01SMichael Witten	    tells where the mismatch happens much closer to the
154e809ab01SMichael Witten	    source. The drawback is that the same mismatch is
155e809ab01SMichael Witten	    reported at least twice.
156e809ab01SMichael Witten	  - Enable verbose reporting from modpost in order to help resolve
157e809ab01SMichael Witten	    the section mismatches that are reported.
15891341d4bSSam Ravnborg
159f346f4b3SAdrian Bunkconfig DEBUG_KERNEL
160f346f4b3SAdrian Bunk	bool "Kernel debugging"
161f346f4b3SAdrian Bunk	help
162f346f4b3SAdrian Bunk	  Say Y here if you are developing drivers or trying to debug and
163f346f4b3SAdrian Bunk	  identify kernel problems.
164f346f4b3SAdrian Bunk
165a304e1b8SDavid Woodhouseconfig DEBUG_SHIRQ
166a304e1b8SDavid Woodhouse	bool "Debug shared IRQ handlers"
167a304e1b8SDavid Woodhouse	depends on DEBUG_KERNEL && GENERIC_HARDIRQS
168a304e1b8SDavid Woodhouse	help
169a304e1b8SDavid Woodhouse	  Enable this to generate a spurious interrupt as soon as a shared
170a304e1b8SDavid Woodhouse	  interrupt handler is registered, and just before one is deregistered.
171a304e1b8SDavid Woodhouse	  Drivers ought to be able to handle interrupts coming in at those
172a304e1b8SDavid Woodhouse	  points; some don't and need to be caught.
173a304e1b8SDavid Woodhouse
17458687acbSDon Zickusconfig LOCKUP_DETECTOR
17558687acbSDon Zickus	bool "Detect Hard and Soft Lockups"
176dea20a3fSHeiko Carstens	depends on DEBUG_KERNEL && !S390
1778446f1d3SIngo Molnar	help
17858687acbSDon Zickus	  Say Y here to enable the kernel to act as a watchdog to detect
17958687acbSDon Zickus	  hard and soft lockups.
18084e478c6SDon Zickus
18158687acbSDon Zickus	  Softlockups are bugs that cause the kernel to loop in kernel
1825f329089SFernando Luis Vázquez Cao	  mode for more than 20 seconds, without giving other tasks a
18358687acbSDon Zickus	  chance to run.  The current stack trace is displayed upon
18458687acbSDon Zickus	  detection and the system will stay locked up.
1858446f1d3SIngo Molnar
18658687acbSDon Zickus	  Hardlockups are bugs that cause the CPU to loop in kernel mode
1875f329089SFernando Luis Vázquez Cao	  for more than 10 seconds, without letting other interrupts have a
18858687acbSDon Zickus	  chance to run.  The current stack trace is displayed upon detection
18958687acbSDon Zickus	  and the system will stay locked up.
1908446f1d3SIngo Molnar
19158687acbSDon Zickus	  The overhead should be minimal.  A periodic hrtimer runs to
1925f329089SFernando Luis Vázquez Cao	  generate interrupts and kick the watchdog task every 4 seconds.
1935f329089SFernando Luis Vázquez Cao	  An NMI is generated every 10 seconds or so to check for hardlockups.
1945f329089SFernando Luis Vázquez Cao
1955f329089SFernando Luis Vázquez Cao	  The frequency of hrtimer and NMI events and the soft and hard lockup
1965f329089SFernando Luis Vázquez Cao	  thresholds can be controlled through the sysctl watchdog_thresh.
19784e478c6SDon Zickus
19823637d47SFrederic Weisbeckerconfig HARDLOCKUP_DETECTOR
1994a7863ccSDon Zickus	def_bool LOCKUP_DETECTOR && PERF_EVENTS && HAVE_PERF_EVENTS_NMI && \
200d314d74cSCong Wang		 !HAVE_NMI_WATCHDOG
2018446f1d3SIngo Molnar
202fef2c9bcSDon Zickusconfig BOOTPARAM_HARDLOCKUP_PANIC
203fef2c9bcSDon Zickus	bool "Panic (Reboot) On Hard Lockups"
204fef2c9bcSDon Zickus	depends on LOCKUP_DETECTOR
205fef2c9bcSDon Zickus	help
206fef2c9bcSDon Zickus	  Say Y here to enable the kernel to panic on "hard lockups",
207fef2c9bcSDon Zickus	  which are bugs that cause the kernel to loop in kernel
2085f329089SFernando Luis Vázquez Cao	  mode with interrupts disabled for more than 10 seconds (configurable
2095f329089SFernando Luis Vázquez Cao	  using the watchdog_thresh sysctl).
210fef2c9bcSDon Zickus
211fef2c9bcSDon Zickus	  Say N if unsure.
212fef2c9bcSDon Zickus
213fef2c9bcSDon Zickusconfig BOOTPARAM_HARDLOCKUP_PANIC_VALUE
214fef2c9bcSDon Zickus	int
215fef2c9bcSDon Zickus	depends on LOCKUP_DETECTOR
216fef2c9bcSDon Zickus	range 0 1
217fef2c9bcSDon Zickus	default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
218fef2c9bcSDon Zickus	default 1 if BOOTPARAM_HARDLOCKUP_PANIC
219fef2c9bcSDon Zickus
2209c44bc03SIngo Molnarconfig BOOTPARAM_SOFTLOCKUP_PANIC
2219c44bc03SIngo Molnar	bool "Panic (Reboot) On Soft Lockups"
22289d7ce2aSFrederic Weisbecker	depends on LOCKUP_DETECTOR
2239c44bc03SIngo Molnar	help
2249c44bc03SIngo Molnar	  Say Y here to enable the kernel to panic on "soft lockups",
2259c44bc03SIngo Molnar	  which are bugs that cause the kernel to loop in kernel
2265f329089SFernando Luis Vázquez Cao	  mode for more than 20 seconds (configurable using the watchdog_thresh
2275f329089SFernando Luis Vázquez Cao	  sysctl), without giving other tasks a chance to run.
2289c44bc03SIngo Molnar
2299c44bc03SIngo Molnar	  The panic can be used in combination with panic_timeout,
2309c44bc03SIngo Molnar	  to cause the system to reboot automatically after a
2319c44bc03SIngo Molnar	  lockup has been detected. This feature is useful for
2329c44bc03SIngo Molnar	  high-availability systems that have uptime guarantees and
2339c44bc03SIngo Molnar	  where a lockup must be resolved ASAP.
2349c44bc03SIngo Molnar
2359c44bc03SIngo Molnar	  Say N if unsure.
2369c44bc03SIngo Molnar
2379c44bc03SIngo Molnarconfig BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
2389c44bc03SIngo Molnar	int
239e16bb1d7SFrederic Weisbecker	depends on LOCKUP_DETECTOR
2409c44bc03SIngo Molnar	range 0 1
2419c44bc03SIngo Molnar	default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
2429c44bc03SIngo Molnar	default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
2439c44bc03SIngo Molnar
2442a01bb38SKyle McMartinconfig PANIC_ON_OOPS
2452a01bb38SKyle McMartin	bool "Panic on Oops" if EXPERT
2462a01bb38SKyle McMartin	default n
2472a01bb38SKyle McMartin	help
2482a01bb38SKyle McMartin	  Say Y here to enable the kernel to panic when it oopses. This
2492a01bb38SKyle McMartin	  has the same effect as setting oops=panic on the kernel command
2502a01bb38SKyle McMartin	  line.
2512a01bb38SKyle McMartin
2522a01bb38SKyle McMartin	  This feature is useful to ensure that the kernel does not do
2532a01bb38SKyle McMartin	  anything erroneous after an oops which could result in data
2542a01bb38SKyle McMartin	  corruption or other issues.
2552a01bb38SKyle McMartin
2562a01bb38SKyle McMartin	  Say N if unsure.
2572a01bb38SKyle McMartin
2582a01bb38SKyle McMartinconfig PANIC_ON_OOPS_VALUE
2592a01bb38SKyle McMartin	int
2602a01bb38SKyle McMartin	range 0 1
2612a01bb38SKyle McMartin	default 0 if !PANIC_ON_OOPS
2622a01bb38SKyle McMartin	default 1 if PANIC_ON_OOPS
2632a01bb38SKyle McMartin
264e162b39aSMandeep Singh Bainesconfig DETECT_HUNG_TASK
265e162b39aSMandeep Singh Baines	bool "Detect Hung Tasks"
266e162b39aSMandeep Singh Baines	depends on DEBUG_KERNEL
2678edbb83eSAnton Blanchard	default LOCKUP_DETECTOR
268e162b39aSMandeep Singh Baines	help
269e162b39aSMandeep Singh Baines	  Say Y here to enable the kernel to detect "hung tasks",
270e162b39aSMandeep Singh Baines	  which are bugs that cause the task to be stuck in
271e162b39aSMandeep Singh Baines	  uninterruptible "D" state indefinitiley.
272e162b39aSMandeep Singh Baines
273e162b39aSMandeep Singh Baines	  When a hung task is detected, the kernel will print the
274e162b39aSMandeep Singh Baines	  current stack trace (which you should report), but the
275e162b39aSMandeep Singh Baines	  task will stay in uninterruptible state. If lockdep is
276e162b39aSMandeep Singh Baines	  enabled then all held locks will also be reported. This
277e162b39aSMandeep Singh Baines	  feature has negligible overhead.
278e162b39aSMandeep Singh Baines
279e11feaa1SJeff Mahoneyconfig DEFAULT_HUNG_TASK_TIMEOUT
280e11feaa1SJeff Mahoney	int "Default timeout for hung task detection (in seconds)"
281e11feaa1SJeff Mahoney	depends on DETECT_HUNG_TASK
282e11feaa1SJeff Mahoney	default 120
283e11feaa1SJeff Mahoney	help
284e11feaa1SJeff Mahoney	  This option controls the default timeout (in seconds) used
285e11feaa1SJeff Mahoney	  to determine when a task has become non-responsive and should
286e11feaa1SJeff Mahoney	  be considered hung.
287e11feaa1SJeff Mahoney
288c51eaaccSJiaju Zhang	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
289c51eaaccSJiaju Zhang	  sysctl or by writing a value to
290c51eaaccSJiaju Zhang	  /proc/sys/kernel/hung_task_timeout_secs.
291e11feaa1SJeff Mahoney
292e11feaa1SJeff Mahoney	  A timeout of 0 disables the check.  The default is two minutes.
293e11feaa1SJeff Mahoney	  Keeping the default should be fine in most cases.
294e11feaa1SJeff Mahoney
295e162b39aSMandeep Singh Bainesconfig BOOTPARAM_HUNG_TASK_PANIC
296e162b39aSMandeep Singh Baines	bool "Panic (Reboot) On Hung Tasks"
297e162b39aSMandeep Singh Baines	depends on DETECT_HUNG_TASK
298e162b39aSMandeep Singh Baines	help
299e162b39aSMandeep Singh Baines	  Say Y here to enable the kernel to panic on "hung tasks",
300e162b39aSMandeep Singh Baines	  which are bugs that cause the kernel to leave a task stuck
301e162b39aSMandeep Singh Baines	  in uninterruptible "D" state.
302e162b39aSMandeep Singh Baines
303e162b39aSMandeep Singh Baines	  The panic can be used in combination with panic_timeout,
304e162b39aSMandeep Singh Baines	  to cause the system to reboot automatically after a
305e162b39aSMandeep Singh Baines	  hung task has been detected. This feature is useful for
306e162b39aSMandeep Singh Baines	  high-availability systems that have uptime guarantees and
307e162b39aSMandeep Singh Baines	  where a hung tasks must be resolved ASAP.
308e162b39aSMandeep Singh Baines
309e162b39aSMandeep Singh Baines	  Say N if unsure.
310e162b39aSMandeep Singh Baines
311e162b39aSMandeep Singh Bainesconfig BOOTPARAM_HUNG_TASK_PANIC_VALUE
312e162b39aSMandeep Singh Baines	int
313e162b39aSMandeep Singh Baines	depends on DETECT_HUNG_TASK
314e162b39aSMandeep Singh Baines	range 0 1
315e162b39aSMandeep Singh Baines	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
316e162b39aSMandeep Singh Baines	default 1 if BOOTPARAM_HUNG_TASK_PANIC
317e162b39aSMandeep Singh Baines
318b642b6d3SIngo Molnarconfig SCHED_DEBUG
319b642b6d3SIngo Molnar	bool "Collect scheduler debugging info"
320b642b6d3SIngo Molnar	depends on DEBUG_KERNEL && PROC_FS
321b642b6d3SIngo Molnar	default y
322b642b6d3SIngo Molnar	help
323b642b6d3SIngo Molnar	  If you say Y here, the /proc/sched_debug file will be provided
324b642b6d3SIngo Molnar	  that can help debug the scheduler. The runtime overhead of this
325b642b6d3SIngo Molnar	  option is minimal.
326b642b6d3SIngo Molnar
3271da177e4SLinus Torvaldsconfig SCHEDSTATS
3281da177e4SLinus Torvalds	bool "Collect scheduler statistics"
3291da177e4SLinus Torvalds	depends on DEBUG_KERNEL && PROC_FS
3301da177e4SLinus Torvalds	help
3311da177e4SLinus Torvalds	  If you say Y here, additional code will be inserted into the
3321da177e4SLinus Torvalds	  scheduler and related routines to collect statistics about
3331da177e4SLinus Torvalds	  scheduler behavior and provide them in /proc/schedstat.  These
3341da177e4SLinus Torvalds	  stats may be useful for both tuning and debugging the scheduler
3351da177e4SLinus Torvalds	  If you aren't debugging the scheduler or trying to tune a specific
3361da177e4SLinus Torvalds	  application, you can say N to avoid the very slight overhead
3371da177e4SLinus Torvalds	  this adds.
3381da177e4SLinus Torvalds
33982f67cd9SIngo Molnarconfig TIMER_STATS
34082f67cd9SIngo Molnar	bool "Collect kernel timers statistics"
34182f67cd9SIngo Molnar	depends on DEBUG_KERNEL && PROC_FS
34282f67cd9SIngo Molnar	help
34382f67cd9SIngo Molnar	  If you say Y here, additional code will be inserted into the
34482f67cd9SIngo Molnar	  timer routines to collect statistics about kernel timers being
34582f67cd9SIngo Molnar	  reprogrammed. The statistics can be read from /proc/timer_stats.
34682f67cd9SIngo Molnar	  The statistics collection is started by writing 1 to /proc/timer_stats,
34782f67cd9SIngo Molnar	  writing 0 stops it. This feature is useful to collect information
348c1a834dcSIngo Molnar	  about timer usage patterns in kernel and userspace. This feature
349c1a834dcSIngo Molnar	  is lightweight if enabled in the kernel config but not activated
350c1a834dcSIngo Molnar	  (it defaults to deactivated on bootup and will only be activated
351c1a834dcSIngo Molnar	  if some application like powertop activates it explicitly).
35282f67cd9SIngo Molnar
3533ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS
3543ac7fe5aSThomas Gleixner	bool "Debug object operations"
3553ac7fe5aSThomas Gleixner	depends on DEBUG_KERNEL
3563ac7fe5aSThomas Gleixner	help
3573ac7fe5aSThomas Gleixner	  If you say Y here, additional code will be inserted into the
3583ac7fe5aSThomas Gleixner	  kernel to track the life time of various objects and validate
3593ac7fe5aSThomas Gleixner	  the operations on those objects.
3603ac7fe5aSThomas Gleixner
3613ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_SELFTEST
3623ac7fe5aSThomas Gleixner	bool "Debug objects selftest"
3633ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
3643ac7fe5aSThomas Gleixner	help
3653ac7fe5aSThomas Gleixner	  This enables the selftest of the object debug code.
3663ac7fe5aSThomas Gleixner
3673ac7fe5aSThomas Gleixnerconfig DEBUG_OBJECTS_FREE
3683ac7fe5aSThomas Gleixner	bool "Debug objects in freed memory"
3693ac7fe5aSThomas Gleixner	depends on DEBUG_OBJECTS
3703ac7fe5aSThomas Gleixner	help
3713ac7fe5aSThomas Gleixner	  This enables checks whether a k/v free operation frees an area
3723ac7fe5aSThomas Gleixner	  which contains an object which has not been deactivated
3733ac7fe5aSThomas Gleixner	  properly. This can make kmalloc/kfree-intensive workloads
3743ac7fe5aSThomas Gleixner	  much slower.
3753ac7fe5aSThomas Gleixner
376c6f3a97fSThomas Gleixnerconfig DEBUG_OBJECTS_TIMERS
377c6f3a97fSThomas Gleixner	bool "Debug timer objects"
378c6f3a97fSThomas Gleixner	depends on DEBUG_OBJECTS
379c6f3a97fSThomas Gleixner	help
380c6f3a97fSThomas Gleixner	  If you say Y here, additional code will be inserted into the
381c6f3a97fSThomas Gleixner	  timer routines to track the life time of timer objects and
382c6f3a97fSThomas Gleixner	  validate the timer operations.
383c6f3a97fSThomas Gleixner
384dc186ad7SThomas Gleixnerconfig DEBUG_OBJECTS_WORK
385dc186ad7SThomas Gleixner	bool "Debug work objects"
386dc186ad7SThomas Gleixner	depends on DEBUG_OBJECTS
387dc186ad7SThomas Gleixner	help
388dc186ad7SThomas Gleixner	  If you say Y here, additional code will be inserted into the
389dc186ad7SThomas Gleixner	  work queue routines to track the life time of work objects and
390dc186ad7SThomas Gleixner	  validate the work operations.
391dc186ad7SThomas Gleixner
392551d55a9SMathieu Desnoyersconfig DEBUG_OBJECTS_RCU_HEAD
393551d55a9SMathieu Desnoyers	bool "Debug RCU callbacks objects"
394fc2ecf7eSMathieu Desnoyers	depends on DEBUG_OBJECTS
395551d55a9SMathieu Desnoyers	help
396551d55a9SMathieu Desnoyers	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
397551d55a9SMathieu Desnoyers
398e2852ae8STejun Heoconfig DEBUG_OBJECTS_PERCPU_COUNTER
399e2852ae8STejun Heo	bool "Debug percpu counter objects"
400e2852ae8STejun Heo	depends on DEBUG_OBJECTS
401e2852ae8STejun Heo	help
402e2852ae8STejun Heo	  If you say Y here, additional code will be inserted into the
403e2852ae8STejun Heo	  percpu counter routines to track the life time of percpu counter
404e2852ae8STejun Heo	  objects and validate the percpu counter operations.
405e2852ae8STejun Heo
4063ae70205SIngo Molnarconfig DEBUG_OBJECTS_ENABLE_DEFAULT
4073ae70205SIngo Molnar	int "debug_objects bootup default value (0-1)"
4083ae70205SIngo Molnar        range 0 1
4093ae70205SIngo Molnar        default "1"
4103ae70205SIngo Molnar        depends on DEBUG_OBJECTS
4113ae70205SIngo Molnar        help
4123ae70205SIngo Molnar          Debug objects boot parameter default value
4133ae70205SIngo Molnar
4141da177e4SLinus Torvaldsconfig DEBUG_SLAB
4154a2f0acfSAndrew Morton	bool "Debug slab memory allocations"
4167d46d9e6SVegard Nossum	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
4171da177e4SLinus Torvalds	help
4181da177e4SLinus Torvalds	  Say Y here to have the kernel do limited verification on memory
4191da177e4SLinus Torvalds	  allocation as well as poisoning memory on free to catch use of freed
4201da177e4SLinus Torvalds	  memory. This can make kmalloc/kfree-intensive workloads much slower.
4211da177e4SLinus Torvalds
422871751e2SAl Viroconfig DEBUG_SLAB_LEAK
423871751e2SAl Viro	bool "Memory leak debugging"
424871751e2SAl Viro	depends on DEBUG_SLAB
425871751e2SAl Viro
426f0630fffSChristoph Lameterconfig SLUB_DEBUG_ON
427f0630fffSChristoph Lameter	bool "SLUB debugging on by default"
4287d46d9e6SVegard Nossum	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
429f0630fffSChristoph Lameter	default n
430f0630fffSChristoph Lameter	help
431f0630fffSChristoph Lameter	  Boot with debugging on by default. SLUB boots by default with
432f0630fffSChristoph Lameter	  the runtime debug capabilities switched off. Enabling this is
433f0630fffSChristoph Lameter	  equivalent to specifying the "slub_debug" parameter on boot.
434f0630fffSChristoph Lameter	  There is no support for more fine grained debug control like
435f0630fffSChristoph Lameter	  possible with slub_debug=xxx. SLUB debugging may be switched
436f0630fffSChristoph Lameter	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
437f0630fffSChristoph Lameter	  "slub_debug=-".
438f0630fffSChristoph Lameter
4398ff12cfcSChristoph Lameterconfig SLUB_STATS
4408ff12cfcSChristoph Lameter	default n
4418ff12cfcSChristoph Lameter	bool "Enable SLUB performance statistics"
442ab4d5ed5SChristoph Lameter	depends on SLUB && SYSFS
4438ff12cfcSChristoph Lameter	help
4448ff12cfcSChristoph Lameter	  SLUB statistics are useful to debug SLUBs allocation behavior in
4458ff12cfcSChristoph Lameter	  order find ways to optimize the allocator. This should never be
4468ff12cfcSChristoph Lameter	  enabled for production use since keeping statistics slows down
4478ff12cfcSChristoph Lameter	  the allocator by a few percentage points. The slabinfo command
4488ff12cfcSChristoph Lameter	  supports the determination of the most active slabs to figure
4498ff12cfcSChristoph Lameter	  out which slabs are relevant to a particular load.
4508ff12cfcSChristoph Lameter	  Try running: slabinfo -DA
4518ff12cfcSChristoph Lameter
4523bba00d7SCatalin Marinasconfig DEBUG_KMEMLEAK
4533bba00d7SCatalin Marinas	bool "Kernel memory leak detector"
454029aeff5SLaura Abbott	depends on DEBUG_KERNEL && EXPERIMENTAL && \
455c0a5afb9SMaxin John		(X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE)
456dfcc3e6aSHeiko Carstens
45779e0d9bdSCatalin Marinas	select DEBUG_FS
4583bba00d7SCatalin Marinas	select STACKTRACE if STACKTRACE_SUPPORT
4593bba00d7SCatalin Marinas	select KALLSYMS
460b60e26a2SRandy Dunlap	select CRC32
4613bba00d7SCatalin Marinas	help
4623bba00d7SCatalin Marinas	  Say Y here if you want to enable the memory leak
4633bba00d7SCatalin Marinas	  detector. The memory allocation/freeing is traced in a way
4643bba00d7SCatalin Marinas	  similar to the Boehm's conservative garbage collector, the
4653bba00d7SCatalin Marinas	  difference being that the orphan objects are not freed but
4663bba00d7SCatalin Marinas	  only shown in /sys/kernel/debug/kmemleak. Enabling this
4673bba00d7SCatalin Marinas	  feature will introduce an overhead to memory
4683bba00d7SCatalin Marinas	  allocations. See Documentation/kmemleak.txt for more
4693bba00d7SCatalin Marinas	  details.
4703bba00d7SCatalin Marinas
471bf96d1e3SCatalin Marinas	  Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
472bf96d1e3SCatalin Marinas	  of finding leaks due to the slab objects poisoning.
473bf96d1e3SCatalin Marinas
4743bba00d7SCatalin Marinas	  In order to access the kmemleak file, debugfs needs to be
4753bba00d7SCatalin Marinas	  mounted (usually at /sys/kernel/debug).
4763bba00d7SCatalin Marinas
477a9d9058aSCatalin Marinasconfig DEBUG_KMEMLEAK_EARLY_LOG_SIZE
478a9d9058aSCatalin Marinas	int "Maximum kmemleak early log entries"
479a9d9058aSCatalin Marinas	depends on DEBUG_KMEMLEAK
480dfcc3e6aSHeiko Carstens	range 200 40000
481a9d9058aSCatalin Marinas	default 400
482a9d9058aSCatalin Marinas	help
483a9d9058aSCatalin Marinas	  Kmemleak must track all the memory allocations to avoid
484a9d9058aSCatalin Marinas	  reporting false positives. Since memory may be allocated or
485a9d9058aSCatalin Marinas	  freed before kmemleak is initialised, an early log buffer is
486a9d9058aSCatalin Marinas	  used to store these actions. If kmemleak reports "early log
487a9d9058aSCatalin Marinas	  buffer exceeded", please increase this value.
488a9d9058aSCatalin Marinas
4890822ee4aSCatalin Marinasconfig DEBUG_KMEMLEAK_TEST
4900822ee4aSCatalin Marinas	tristate "Simple test for the kernel memory leak detector"
4919718269aSDaniel Baluta	depends on DEBUG_KMEMLEAK && m
4920822ee4aSCatalin Marinas	help
4939718269aSDaniel Baluta	  This option enables a module that explicitly leaks memory.
4940822ee4aSCatalin Marinas
4950822ee4aSCatalin Marinas	  If unsure, say N.
4960822ee4aSCatalin Marinas
497ab0155a2SJason Baronconfig DEBUG_KMEMLEAK_DEFAULT_OFF
498ab0155a2SJason Baron	bool "Default kmemleak to off"
499ab0155a2SJason Baron	depends on DEBUG_KMEMLEAK
500ab0155a2SJason Baron	help
501ab0155a2SJason Baron	  Say Y here to disable kmemleak by default. It can then be enabled
502ab0155a2SJason Baron	  on the command line via kmemleak=on.
503ab0155a2SJason Baron
5041da177e4SLinus Torvaldsconfig DEBUG_PREEMPT
5051da177e4SLinus Torvalds	bool "Debug preemptible kernel"
50601deab98SKumar Gala	depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
5071da177e4SLinus Torvalds	default y
5081da177e4SLinus Torvalds	help
5091da177e4SLinus Torvalds	  If you say Y here then the kernel will use a debug variant of the
5101da177e4SLinus Torvalds	  commonly used smp_processor_id() function and will print warnings
5111da177e4SLinus Torvalds	  if kernel code uses it in a preemption-unsafe way. Also, the kernel
5121da177e4SLinus Torvalds	  will detect preemption count underflows.
5131da177e4SLinus Torvalds
514e7eebaf6SIngo Molnarconfig DEBUG_RT_MUTEXES
515e7eebaf6SIngo Molnar	bool "RT Mutex debugging, deadlock detection"
516e7eebaf6SIngo Molnar	depends on DEBUG_KERNEL && RT_MUTEXES
517e7eebaf6SIngo Molnar	help
518e7eebaf6SIngo Molnar	 This allows rt mutex semantics violations and rt mutex related
519e7eebaf6SIngo Molnar	 deadlocks (lockups) to be detected and reported automatically.
520e7eebaf6SIngo Molnar
521e7eebaf6SIngo Molnarconfig DEBUG_PI_LIST
522e7eebaf6SIngo Molnar	bool
523e7eebaf6SIngo Molnar	default y
524e7eebaf6SIngo Molnar	depends on DEBUG_RT_MUTEXES
525e7eebaf6SIngo Molnar
52661a87122SThomas Gleixnerconfig RT_MUTEX_TESTER
52761a87122SThomas Gleixner	bool "Built-in scriptable tester for rt-mutexes"
528a1583d3eSRoman Zippel	depends on DEBUG_KERNEL && RT_MUTEXES
52961a87122SThomas Gleixner	help
53061a87122SThomas Gleixner	  This option enables a rt-mutex tester.
53161a87122SThomas Gleixner
5321da177e4SLinus Torvaldsconfig DEBUG_SPINLOCK
5334d9f34adSIngo Molnar	bool "Spinlock and rw-lock debugging: basic checks"
5341da177e4SLinus Torvalds	depends on DEBUG_KERNEL
535e335e3ebSRaghavendra K T	select UNINLINE_SPIN_UNLOCK
5361da177e4SLinus Torvalds	help
5371da177e4SLinus Torvalds	  Say Y here and build SMP to catch missing spinlock initialization
5381da177e4SLinus Torvalds	  and certain other kinds of spinlock errors commonly made.  This is
5391da177e4SLinus Torvalds	  best used in conjunction with the NMI watchdog so that spinlock
5401da177e4SLinus Torvalds	  deadlocks are also debuggable.
5411da177e4SLinus Torvalds
5424d9f34adSIngo Molnarconfig DEBUG_MUTEXES
5434d9f34adSIngo Molnar	bool "Mutex debugging: basic checks"
5444d9f34adSIngo Molnar	depends on DEBUG_KERNEL
5454d9f34adSIngo Molnar	help
5464d9f34adSIngo Molnar	 This feature allows mutex semantics violations to be detected and
5474d9f34adSIngo Molnar	 reported.
5484d9f34adSIngo Molnar
5494d9f34adSIngo Molnarconfig DEBUG_LOCK_ALLOC
5504d9f34adSIngo Molnar	bool "Lock debugging: detect incorrect freeing of live locks"
551517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
5524d9f34adSIngo Molnar	select DEBUG_SPINLOCK
5534d9f34adSIngo Molnar	select DEBUG_MUTEXES
5544d9f34adSIngo Molnar	select LOCKDEP
5554d9f34adSIngo Molnar	help
5564d9f34adSIngo Molnar	 This feature will check whether any held lock (spinlock, rwlock,
5574d9f34adSIngo Molnar	 mutex or rwsem) is incorrectly freed by the kernel, via any of the
5584d9f34adSIngo Molnar	 memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
5594d9f34adSIngo Molnar	 vfree(), etc.), whether a live lock is incorrectly reinitialized via
5604d9f34adSIngo Molnar	 spin_lock_init()/mutex_init()/etc., or whether there is any lock
5614d9f34adSIngo Molnar	 held during task exit.
5624d9f34adSIngo Molnar
5634d9f34adSIngo Molnarconfig PROVE_LOCKING
5644d9f34adSIngo Molnar	bool "Lock debugging: prove locking correctness"
565517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
5664d9f34adSIngo Molnar	select LOCKDEP
5674d9f34adSIngo Molnar	select DEBUG_SPINLOCK
5684d9f34adSIngo Molnar	select DEBUG_MUTEXES
5694d9f34adSIngo Molnar	select DEBUG_LOCK_ALLOC
57046b93b74SSteven Rostedt	select TRACE_IRQFLAGS
5714d9f34adSIngo Molnar	default n
5724d9f34adSIngo Molnar	help
5734d9f34adSIngo Molnar	 This feature enables the kernel to prove that all locking
5744d9f34adSIngo Molnar	 that occurs in the kernel runtime is mathematically
5754d9f34adSIngo Molnar	 correct: that under no circumstance could an arbitrary (and
5764d9f34adSIngo Molnar	 not yet triggered) combination of observed locking
5774d9f34adSIngo Molnar	 sequences (on an arbitrary number of CPUs, running an
5784d9f34adSIngo Molnar	 arbitrary number of tasks and interrupt contexts) cause a
5794d9f34adSIngo Molnar	 deadlock.
5804d9f34adSIngo Molnar
5814d9f34adSIngo Molnar	 In short, this feature enables the kernel to report locking
5824d9f34adSIngo Molnar	 related deadlocks before they actually occur.
5834d9f34adSIngo Molnar
5844d9f34adSIngo Molnar	 The proof does not depend on how hard and complex a
5854d9f34adSIngo Molnar	 deadlock scenario would be to trigger: how many
5864d9f34adSIngo Molnar	 participant CPUs, tasks and irq-contexts would be needed
5874d9f34adSIngo Molnar	 for it to trigger. The proof also does not depend on
5884d9f34adSIngo Molnar	 timing: if a race and a resulting deadlock is possible
5894d9f34adSIngo Molnar	 theoretically (no matter how unlikely the race scenario
5904d9f34adSIngo Molnar	 is), it will be proven so and will immediately be
5914d9f34adSIngo Molnar	 reported by the kernel (once the event is observed that
5924d9f34adSIngo Molnar	 makes the deadlock theoretically possible).
5934d9f34adSIngo Molnar
5944d9f34adSIngo Molnar	 If a deadlock is impossible (i.e. the locking rules, as
5954d9f34adSIngo Molnar	 observed by the kernel, are mathematically correct), the
5964d9f34adSIngo Molnar	 kernel reports nothing.
5974d9f34adSIngo Molnar
5984d9f34adSIngo Molnar	 NOTE: this feature can also be enabled for rwlocks, mutexes
5994d9f34adSIngo Molnar	 and rwsems - in which case all dependencies between these
6004d9f34adSIngo Molnar	 different locking variants are observed and mapped too, and
6014d9f34adSIngo Molnar	 the proof of observed correctness is also maintained for an
6024d9f34adSIngo Molnar	 arbitrary combination of these separate locking variants.
6034d9f34adSIngo Molnar
6044d9f34adSIngo Molnar	 For more details, see Documentation/lockdep-design.txt.
6054d9f34adSIngo Molnar
606632ee200SPaul E. McKenneyconfig PROVE_RCU
607632ee200SPaul E. McKenney	bool "RCU debugging: prove RCU correctness"
608632ee200SPaul E. McKenney	depends on PROVE_LOCKING
609632ee200SPaul E. McKenney	default n
610632ee200SPaul E. McKenney	help
611632ee200SPaul E. McKenney	 This feature enables lockdep extensions that check for correct
612632ee200SPaul E. McKenney	 use of RCU APIs.  This is currently under development.  Say Y
613632ee200SPaul E. McKenney	 if you want to debug RCU usage or help work on the PROVE_RCU
614632ee200SPaul E. McKenney	 feature.
615632ee200SPaul E. McKenney
616632ee200SPaul E. McKenney	 Say N if you are unsure.
617632ee200SPaul E. McKenney
6182b3fc35fSLai Jiangshanconfig PROVE_RCU_REPEATEDLY
6192b3fc35fSLai Jiangshan	bool "RCU debugging: don't disable PROVE_RCU on first splat"
6202b3fc35fSLai Jiangshan	depends on PROVE_RCU
6212b3fc35fSLai Jiangshan	default n
6222b3fc35fSLai Jiangshan	help
6232b3fc35fSLai Jiangshan	 By itself, PROVE_RCU will disable checking upon issuing the
6242b3fc35fSLai Jiangshan	 first warning (or "splat").  This feature prevents such
6252b3fc35fSLai Jiangshan	 disabling, allowing multiple RCU-lockdep warnings to be printed
6262b3fc35fSLai Jiangshan	 on a single reboot.
6272b3fc35fSLai Jiangshan
6282dfbf4dfSPaul E. McKenney	 Say Y to allow multiple RCU-lockdep warnings per boot.
6292dfbf4dfSPaul E. McKenney
6302dfbf4dfSPaul E. McKenney	 Say N if you are unsure.
6312dfbf4dfSPaul E. McKenney
632ca5ecddfSPaul E. McKenneyconfig SPARSE_RCU_POINTER
633ca5ecddfSPaul E. McKenney	bool "RCU debugging: sparse-based checks for pointer usage"
634ca5ecddfSPaul E. McKenney	default n
635ca5ecddfSPaul E. McKenney	help
636ca5ecddfSPaul E. McKenney	 This feature enables the __rcu sparse annotation for
637ca5ecddfSPaul E. McKenney	 RCU-protected pointers.  This annotation will cause sparse
638ca5ecddfSPaul E. McKenney	 to flag any non-RCU used of annotated pointers.  This can be
639ca5ecddfSPaul E. McKenney	 helpful when debugging RCU usage.  Please note that this feature
640ca5ecddfSPaul E. McKenney	 is not intended to enforce code cleanliness; it is instead merely
641ca5ecddfSPaul E. McKenney	 a debugging aid.
642ca5ecddfSPaul E. McKenney
643ca5ecddfSPaul E. McKenney	 Say Y to make sparse flag questionable use of RCU-protected pointers
644ca5ecddfSPaul E. McKenney
6452b3fc35fSLai Jiangshan	 Say N if you are unsure.
6462b3fc35fSLai Jiangshan
6474d9f34adSIngo Molnarconfig LOCKDEP
6484d9f34adSIngo Molnar	bool
649517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
6504d9f34adSIngo Molnar	select STACKTRACE
65179aac889SMichal Simek	select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE
6524d9f34adSIngo Molnar	select KALLSYMS
6534d9f34adSIngo Molnar	select KALLSYMS_ALL
6544d9f34adSIngo Molnar
655f20786ffSPeter Zijlstraconfig LOCK_STAT
656fdfb870fSDanny ter Haar	bool "Lock usage statistics"
657f20786ffSPeter Zijlstra	depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
658f20786ffSPeter Zijlstra	select LOCKDEP
659f20786ffSPeter Zijlstra	select DEBUG_SPINLOCK
660f20786ffSPeter Zijlstra	select DEBUG_MUTEXES
661f20786ffSPeter Zijlstra	select DEBUG_LOCK_ALLOC
662f20786ffSPeter Zijlstra	default n
663f20786ffSPeter Zijlstra	help
664f20786ffSPeter Zijlstra	 This feature enables tracking lock contention points
665f20786ffSPeter Zijlstra
666a560aa48SPeter Zijlstra	 For more details, see Documentation/lockstat.txt
667a560aa48SPeter Zijlstra
668dd8b1cf6SFrederic Weisbecker	 This also enables lock events required by "perf lock",
669dd8b1cf6SFrederic Weisbecker	 subcommand of perf.
670dd8b1cf6SFrederic Weisbecker	 If you want to use "perf lock", you also need to turn on
671dd8b1cf6SFrederic Weisbecker	 CONFIG_EVENT_TRACING.
67284c6f88fSHitoshi Mitake
67384c6f88fSHitoshi Mitake	 CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
67484c6f88fSHitoshi Mitake	 (CONFIG_LOCKDEP defines "acquire" and "release" events.)
67584c6f88fSHitoshi Mitake
6764d9f34adSIngo Molnarconfig DEBUG_LOCKDEP
6774d9f34adSIngo Molnar	bool "Lock dependency engine debugging"
678517e7aa5SAdrian Bunk	depends on DEBUG_KERNEL && LOCKDEP
6794d9f34adSIngo Molnar	help
6804d9f34adSIngo Molnar	  If you say Y here, the lock dependency engine will do
6814d9f34adSIngo Molnar	  additional runtime checks to debug itself, at the price
6824d9f34adSIngo Molnar	  of more runtime overhead.
6834d9f34adSIngo Molnar
6844d9f34adSIngo Molnarconfig TRACE_IRQFLAGS
6854d9f34adSIngo Molnar	bool
68646b93b74SSteven Rostedt	help
68746b93b74SSteven Rostedt	  Enables hooks to interrupt enabling and disabling for
68846b93b74SSteven Rostedt	  either tracing or lock debugging.
6894d9f34adSIngo Molnar
690d902db1eSFrederic Weisbeckerconfig DEBUG_ATOMIC_SLEEP
691d902db1eSFrederic Weisbecker	bool "Sleep inside atomic section checking"
692e8f7c70fSFrederic Weisbecker	select PREEMPT_COUNT
6931da177e4SLinus Torvalds	depends on DEBUG_KERNEL
6941da177e4SLinus Torvalds	help
6951da177e4SLinus Torvalds	  If you say Y here, various routines which may sleep will become very
696d902db1eSFrederic Weisbecker	  noisy if they are called inside atomic sections: when a spinlock is
697d902db1eSFrederic Weisbecker	  held, inside an rcu read side critical section, inside preempt disabled
698d902db1eSFrederic Weisbecker	  sections, inside an interrupt, etc...
6991da177e4SLinus Torvalds
700cae2ed9aSIngo Molnarconfig DEBUG_LOCKING_API_SELFTESTS
701cae2ed9aSIngo Molnar	bool "Locking API boot-time self-tests"
702cae2ed9aSIngo Molnar	depends on DEBUG_KERNEL
703cae2ed9aSIngo Molnar	help
704cae2ed9aSIngo Molnar	  Say Y here if you want the kernel to run a short self-test during
705cae2ed9aSIngo Molnar	  bootup. The self-test checks whether common types of locking bugs
706cae2ed9aSIngo Molnar	  are detected by debugging mechanisms or not. (if you disable
707cae2ed9aSIngo Molnar	  lock debugging then those bugs wont be detected of course.)
708cae2ed9aSIngo Molnar	  The following locking APIs are covered: spinlocks, rwlocks,
709cae2ed9aSIngo Molnar	  mutexes and rwsems.
710cae2ed9aSIngo Molnar
7118637c099SIngo Molnarconfig STACKTRACE
7128637c099SIngo Molnar	bool
7138637c099SIngo Molnar	depends on STACKTRACE_SUPPORT
7148637c099SIngo Molnar
7155ca43f6cSStephen Boydconfig DEBUG_STACK_USAGE
7165ca43f6cSStephen Boyd	bool "Stack utilization instrumentation"
717e9c31b32STony Luck	depends on DEBUG_KERNEL && !IA64 && !PARISC
7185ca43f6cSStephen Boyd	help
7195ca43f6cSStephen Boyd	  Enables the display of the minimum amount of free stack which each
7205ca43f6cSStephen Boyd	  task has ever had available in the sysrq-T and sysrq-P debug output.
7215ca43f6cSStephen Boyd
7225ca43f6cSStephen Boyd	  This option will slow down process creation somewhat.
7235ca43f6cSStephen Boyd
7241da177e4SLinus Torvaldsconfig DEBUG_KOBJECT
7251da177e4SLinus Torvalds	bool "kobject debugging"
7261da177e4SLinus Torvalds	depends on DEBUG_KERNEL
7271da177e4SLinus Torvalds	help
7281da177e4SLinus Torvalds	  If you say Y here, some extra kobject debugging messages will be sent
7291da177e4SLinus Torvalds	  to the syslog.
7301da177e4SLinus Torvalds
7311da177e4SLinus Torvaldsconfig DEBUG_HIGHMEM
7321da177e4SLinus Torvalds	bool "Highmem debugging"
7331da177e4SLinus Torvalds	depends on DEBUG_KERNEL && HIGHMEM
7341da177e4SLinus Torvalds	help
7351da177e4SLinus Torvalds	  This options enables addition error checking for high memory systems.
7361da177e4SLinus Torvalds	  Disable for production systems.
7371da177e4SLinus Torvalds
7381da177e4SLinus Torvaldsconfig DEBUG_BUGVERBOSE
7396a108a14SDavid Rientjes	bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
740c8538a7aSMatt Mackall	depends on BUG
741b920de1bSDavid Howells	depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \
7423cc39b3fSChris Metcalf		   FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300 || TILE
7438420e7efSAlexey Dobriyan	default y
7441da177e4SLinus Torvalds	help
7451da177e4SLinus Torvalds	  Say Y here to make BUG() panics output the file name and line number
7461da177e4SLinus Torvalds	  of the BUG call as well as the EIP and oops trace.  This aids
7471da177e4SLinus Torvalds	  debugging but costs about 70-100K of memory.
7481da177e4SLinus Torvalds
7491da177e4SLinus Torvaldsconfig DEBUG_INFO
7501da177e4SLinus Torvalds	bool "Compile the kernel with debug info"
7511da177e4SLinus Torvalds	depends on DEBUG_KERNEL
7521da177e4SLinus Torvalds	help
7531da177e4SLinus Torvalds          If you say Y here the resulting kernel image will include
7541da177e4SLinus Torvalds	  debugging info resulting in a larger kernel image.
755b72e53f8SAndreas Dilger	  This adds debug symbols to the kernel and modules (gcc -g), and
756b72e53f8SAndreas Dilger	  is needed if you intend to use kernel crashdump or binary object
757b72e53f8SAndreas Dilger	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
7581da177e4SLinus Torvalds	  Say Y here only if you plan to debug the kernel.
7591da177e4SLinus Torvalds
7601da177e4SLinus Torvalds	  If unsure, say N.
7611da177e4SLinus Torvalds
762d6f4ceb7SAndi Kleenconfig DEBUG_INFO_REDUCED
763d6f4ceb7SAndi Kleen	bool "Reduce debugging information"
764d6f4ceb7SAndi Kleen	depends on DEBUG_INFO
765d6f4ceb7SAndi Kleen	help
766d6f4ceb7SAndi Kleen	  If you say Y here gcc is instructed to generate less debugging
767d6f4ceb7SAndi Kleen	  information for structure types. This means that tools that
768d6f4ceb7SAndi Kleen	  need full debugging information (like kgdb or systemtap) won't
769d6f4ceb7SAndi Kleen	  be happy. But if you merely need debugging information to
770d6f4ceb7SAndi Kleen	  resolve line numbers there is no loss. Advantage is that
771d6f4ceb7SAndi Kleen	  build directory object sizes shrink dramatically over a full
772d6f4ceb7SAndi Kleen	  DEBUG_INFO build and compile times are reduced too.
773d6f4ceb7SAndi Kleen	  Only works with newer gcc versions.
774d6f4ceb7SAndi Kleen
775a241ec65SPaul E. McKenneyconfig DEBUG_VM
776a241ec65SPaul E. McKenney	bool "Debug VM"
777a241ec65SPaul E. McKenney	depends on DEBUG_KERNEL
778a241ec65SPaul E. McKenney	help
77913e7444bSNick Piggin	  Enable this to turn on extended checks in the virtual-memory system
78013e7444bSNick Piggin          that may impact performance.
781a241ec65SPaul E. McKenney
782a241ec65SPaul E. McKenney	  If unsure, say N.
783a241ec65SPaul E. McKenney
78459ea7463SJiri Slabyconfig DEBUG_VIRTUAL
78559ea7463SJiri Slaby	bool "Debug VM translations"
78659ea7463SJiri Slaby	depends on DEBUG_KERNEL && X86
78759ea7463SJiri Slaby	help
78859ea7463SJiri Slaby	  Enable some costly sanity checks in virtual to page code. This can
78959ea7463SJiri Slaby	  catch mistakes with virt_to_page() and friends.
79059ea7463SJiri Slaby
79159ea7463SJiri Slaby	  If unsure, say N.
79259ea7463SJiri Slaby
7938feae131SDavid Howellsconfig DEBUG_NOMMU_REGIONS
7948feae131SDavid Howells	bool "Debug the global anon/private NOMMU mapping region tree"
7958feae131SDavid Howells	depends on DEBUG_KERNEL && !MMU
7968feae131SDavid Howells	help
7978feae131SDavid Howells	  This option causes the global tree of anonymous and private mapping
7988feae131SDavid Howells	  regions to be regularly checked for invalid topology.
7998feae131SDavid Howells
800ad775f5aSDave Hansenconfig DEBUG_WRITECOUNT
801ad775f5aSDave Hansen	bool "Debug filesystem writers count"
802ad775f5aSDave Hansen	depends on DEBUG_KERNEL
803ad775f5aSDave Hansen	help
804ad775f5aSDave Hansen	  Enable this to catch wrong use of the writers count in struct
805ad775f5aSDave Hansen	  vfsmount.  This will increase the size of each file struct by
806ad775f5aSDave Hansen	  32 bits.
807ad775f5aSDave Hansen
808ad775f5aSDave Hansen	  If unsure, say N.
809ad775f5aSDave Hansen
8106b74ab97SMel Gormanconfig DEBUG_MEMORY_INIT
8116a108a14SDavid Rientjes	bool "Debug memory initialisation" if EXPERT
8126a108a14SDavid Rientjes	default !EXPERT
8136b74ab97SMel Gorman	help
8146b74ab97SMel Gorman	  Enable this for additional checks during memory initialisation.
8156b74ab97SMel Gorman	  The sanity checks verify aspects of the VM such as the memory model
8166b74ab97SMel Gorman	  and other information provided by the architecture. Verbose
8176b74ab97SMel Gorman	  information will be printed at KERN_DEBUG loglevel depending
8186b74ab97SMel Gorman	  on the mminit_loglevel= command-line option.
8196b74ab97SMel Gorman
8206b74ab97SMel Gorman	  If unsure, say Y
8216b74ab97SMel Gorman
822199a9afcSDave Jonesconfig DEBUG_LIST
823199a9afcSDave Jones	bool "Debug linked list manipulation"
824199a9afcSDave Jones	depends on DEBUG_KERNEL
825199a9afcSDave Jones	help
826199a9afcSDave Jones	  Enable this to turn on extended checks in the linked-list
827199a9afcSDave Jones	  walking routines.
828199a9afcSDave Jones
829199a9afcSDave Jones	  If unsure, say N.
830199a9afcSDave Jones
8316d411e6cSArtem Bityutskiyconfig TEST_LIST_SORT
8326d411e6cSArtem Bityutskiy	bool "Linked list sorting test"
8336d411e6cSArtem Bityutskiy	depends on DEBUG_KERNEL
8346d411e6cSArtem Bityutskiy	help
8356d411e6cSArtem Bityutskiy	  Enable this to turn on 'list_sort()' function test. This test is
8366d411e6cSArtem Bityutskiy	  executed only once during system boot, so affects only boot time.
8376d411e6cSArtem Bityutskiy
8386d411e6cSArtem Bityutskiy	  If unsure, say N.
8396d411e6cSArtem Bityutskiy
840d6ec0842SJens Axboeconfig DEBUG_SG
841d6ec0842SJens Axboe	bool "Debug SG table operations"
842d6ec0842SJens Axboe	depends on DEBUG_KERNEL
843d6ec0842SJens Axboe	help
844d6ec0842SJens Axboe	  Enable this to turn on checks on scatter-gather tables. This can
845d6ec0842SJens Axboe	  help find problems with drivers that do not properly initialize
846d6ec0842SJens Axboe	  their sg tables.
847d6ec0842SJens Axboe
848d6ec0842SJens Axboe	  If unsure, say N.
849d6ec0842SJens Axboe
8501b2439dbSArjan van de Venconfig DEBUG_NOTIFIERS
8511b2439dbSArjan van de Ven	bool "Debug notifier call chains"
8521b2439dbSArjan van de Ven	depends on DEBUG_KERNEL
8531b2439dbSArjan van de Ven	help
8541b2439dbSArjan van de Ven	  Enable this to turn on sanity checking for notifier call chains.
8551b2439dbSArjan van de Ven	  This is most useful for kernel developers to make sure that
8561b2439dbSArjan van de Ven	  modules properly unregister themselves from notifier chains.
8571b2439dbSArjan van de Ven	  This is a relatively cheap check but if you care about maximum
8581b2439dbSArjan van de Ven	  performance, say N.
8591b2439dbSArjan van de Ven
860e0e81739SDavid Howellsconfig DEBUG_CREDENTIALS
861e0e81739SDavid Howells	bool "Debug credential management"
862e0e81739SDavid Howells	depends on DEBUG_KERNEL
863e0e81739SDavid Howells	help
864e0e81739SDavid Howells	  Enable this to turn on some debug checking for credential
865e0e81739SDavid Howells	  management.  The additional code keeps track of the number of
866e0e81739SDavid Howells	  pointers from task_structs to any given cred struct, and checks to
867e0e81739SDavid Howells	  see that this number never exceeds the usage count of the cred
868e0e81739SDavid Howells	  struct.
869e0e81739SDavid Howells
870e0e81739SDavid Howells	  Furthermore, if SELinux is enabled, this also checks that the
871e0e81739SDavid Howells	  security pointer in the cred struct is never seen to be invalid.
872e0e81739SDavid Howells
873e0e81739SDavid Howells	  If unsure, say N.
874e0e81739SDavid Howells
87564dec40dSJeff Mahoney#
87664dec40dSJeff Mahoney# Select this config option from the architecture Kconfig, if it
87752288b66SJustin P. Mattock# is preferred to always offer frame pointers as a config
87864dec40dSJeff Mahoney# option on the architecture (regardless of KERNEL_DEBUG):
87964dec40dSJeff Mahoney#
88064dec40dSJeff Mahoneyconfig ARCH_WANT_FRAME_POINTERS
88164dec40dSJeff Mahoney	bool
88264dec40dSJeff Mahoney	help
88364dec40dSJeff Mahoney
8841da177e4SLinus Torvaldsconfig FRAME_POINTER
8851da177e4SLinus Torvalds	bool "Compile the kernel with frame pointers"
886b920de1bSDavid Howells	depends on DEBUG_KERNEL && \
88773020415SGeert Uytterhoeven		(CRIS || M68K || FRV || UML || \
888da4276b8SIngo Molnar		 AVR32 || SUPERH || BLACKFIN || MN10300) || \
889da4276b8SIngo Molnar		ARCH_WANT_FRAME_POINTERS
890da4276b8SIngo Molnar	default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
8911da177e4SLinus Torvalds	help
892da4276b8SIngo Molnar	  If you say Y here the resulting kernel image will be slightly
893da4276b8SIngo Molnar	  larger and slower, but it gives very useful debugging information
894da4276b8SIngo Molnar	  in case of kernel bugs. (precise oopses/stacktraces/warnings)
8951da177e4SLinus Torvalds
896bfe8df3dSRandy Dunlapconfig BOOT_PRINTK_DELAY
897bfe8df3dSRandy Dunlap	bool "Delay each boot printk message by N milliseconds"
898bfe8df3dSRandy Dunlap	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
899bfe8df3dSRandy Dunlap	help
900bfe8df3dSRandy Dunlap	  This build option allows you to read kernel boot messages
901bfe8df3dSRandy Dunlap	  by inserting a short delay after each one.  The delay is
902bfe8df3dSRandy Dunlap	  specified in milliseconds on the kernel command line,
903bfe8df3dSRandy Dunlap	  using "boot_delay=N".
904bfe8df3dSRandy Dunlap
905bfe8df3dSRandy Dunlap	  It is likely that you would also need to use "lpj=M" to preset
906bfe8df3dSRandy Dunlap	  the "loops per jiffie" value.
907bfe8df3dSRandy Dunlap	  See a previous boot log for the "lpj" value to use for your
908bfe8df3dSRandy Dunlap	  system, and then set "lpj=M" before setting "boot_delay=N".
909bfe8df3dSRandy Dunlap	  NOTE:  Using this option may adversely affect SMP systems.
910bfe8df3dSRandy Dunlap	  I.e., processors other than the first one may not boot up.
9118edbb83eSAnton Blanchard	  BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
912bfe8df3dSRandy Dunlap	  what it believes to be lockup conditions.
913bfe8df3dSRandy Dunlap
914a241ec65SPaul E. McKenneyconfig RCU_TORTURE_TEST
915a241ec65SPaul E. McKenney	tristate "torture tests for RCU"
916a241ec65SPaul E. McKenney	depends on DEBUG_KERNEL
917a241ec65SPaul E. McKenney	default n
918a241ec65SPaul E. McKenney	help
919a241ec65SPaul E. McKenney	  This option provides a kernel module that runs torture tests
920a241ec65SPaul E. McKenney	  on the RCU infrastructure.  The kernel module may be built
921a241ec65SPaul E. McKenney	  after the fact on the running kernel to be tested, if desired.
922a241ec65SPaul E. McKenney
92331a72bceSPaul E. McKenney	  Say Y here if you want RCU torture tests to be built into
92431a72bceSPaul E. McKenney	  the kernel.
925a241ec65SPaul E. McKenney	  Say M if you want the RCU torture tests to build as a module.
926a241ec65SPaul E. McKenney	  Say N if you are unsure.
9278bb31b9dSAnkita Garg
92831a72bceSPaul E. McKenneyconfig RCU_TORTURE_TEST_RUNNABLE
92931a72bceSPaul E. McKenney	bool "torture tests for RCU runnable by default"
93031a72bceSPaul E. McKenney	depends on RCU_TORTURE_TEST = y
93131a72bceSPaul E. McKenney	default n
93231a72bceSPaul E. McKenney	help
93331a72bceSPaul E. McKenney	  This option provides a way to build the RCU torture tests
93431a72bceSPaul E. McKenney	  directly into the kernel without them starting up at boot
93531a72bceSPaul E. McKenney	  time.  You can use /proc/sys/kernel/rcutorture_runnable
93631a72bceSPaul E. McKenney	  to manually override this setting.  This /proc file is
93731a72bceSPaul E. McKenney	  available only when the RCU torture tests have been built
93831a72bceSPaul E. McKenney	  into the kernel.
93931a72bceSPaul E. McKenney
94031a72bceSPaul E. McKenney	  Say Y here if you want the RCU torture tests to start during
94131a72bceSPaul E. McKenney	  boot (you probably don't).
94231a72bceSPaul E. McKenney	  Say N here if you want the RCU torture tests to start only
94331a72bceSPaul E. McKenney	  after being manually enabled via /proc.
94431a72bceSPaul E. McKenney
945b163760eSPaul E. McKenneyconfig RCU_CPU_STALL_TIMEOUT
946b163760eSPaul E. McKenney	int "RCU CPU stall timeout in seconds"
947a00e0d71SPaul E. McKenney	depends on TREE_RCU || TREE_PREEMPT_RCU
948b163760eSPaul E. McKenney	range 3 300
949b163760eSPaul E. McKenney	default 60
950b163760eSPaul E. McKenney	help
951b163760eSPaul E. McKenney	  If a given RCU grace period extends more than the specified
952b163760eSPaul E. McKenney	  number of seconds, a CPU stall warning is printed.  If the
953b163760eSPaul E. McKenney	  RCU grace period persists, additional CPU stall warnings are
954b163760eSPaul E. McKenney	  printed at more widely spaced intervals.
955b163760eSPaul E. McKenney
9561ed509a2SPaul E. McKenneyconfig RCU_CPU_STALL_VERBOSE
9571ed509a2SPaul E. McKenney	bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
958a00e0d71SPaul E. McKenney	depends on TREE_PREEMPT_RCU
95955ec936fSPaul E. McKenney	default y
9601ed509a2SPaul E. McKenney	help
9611ed509a2SPaul E. McKenney	  This option causes RCU to printk detailed per-task information
9621ed509a2SPaul E. McKenney	  for any tasks that are stalling the current RCU grace period.
96364db4cffSPaul E. McKenney
96464db4cffSPaul E. McKenney	  Say N if you are unsure.
96564db4cffSPaul E. McKenney
9661ed509a2SPaul E. McKenney	  Say Y if you want to enable such checks.
9671ed509a2SPaul E. McKenney
968a858af28SPaul E. McKenneyconfig RCU_CPU_STALL_INFO
969a858af28SPaul E. McKenney	bool "Print additional diagnostics on RCU CPU stall"
970a858af28SPaul E. McKenney	depends on (TREE_RCU || TREE_PREEMPT_RCU) && DEBUG_KERNEL
971a858af28SPaul E. McKenney	default n
972a858af28SPaul E. McKenney	help
973a858af28SPaul E. McKenney	  For each stalled CPU that is aware of the current RCU grace
974a858af28SPaul E. McKenney	  period, print out additional per-CPU diagnostic information
975a858af28SPaul E. McKenney	  regarding scheduling-clock ticks, idle state, and,
976a858af28SPaul E. McKenney	  for RCU_FAST_NO_HZ kernels, idle-entry state.
977a858af28SPaul E. McKenney
978a858af28SPaul E. McKenney	  Say N if you are unsure.
979a858af28SPaul E. McKenney
980a858af28SPaul E. McKenney	  Say Y if you want to enable such diagnostics.
981a858af28SPaul E. McKenney
9825c8806a0SPaul E. McKenneyconfig RCU_TRACE
9835c8806a0SPaul E. McKenney	bool "Enable tracing for RCU"
9845c8806a0SPaul E. McKenney	depends on DEBUG_KERNEL
9855c8806a0SPaul E. McKenney	help
9865c8806a0SPaul E. McKenney	  This option provides tracing in RCU which presents stats
9875c8806a0SPaul E. McKenney	  in debugfs for debugging RCU implementation.
9885c8806a0SPaul E. McKenney
9895c8806a0SPaul E. McKenney	  Say Y here if you want to enable RCU tracing
9905c8806a0SPaul E. McKenney	  Say N if you are unsure.
9915c8806a0SPaul E. McKenney
9928c1c9356SAnanth N Mavinakayanahalliconfig KPROBES_SANITY_TEST
9938c1c9356SAnanth N Mavinakayanahalli	bool "Kprobes sanity tests"
9948c1c9356SAnanth N Mavinakayanahalli	depends on DEBUG_KERNEL
9958c1c9356SAnanth N Mavinakayanahalli	depends on KPROBES
9968c1c9356SAnanth N Mavinakayanahalli	default n
9978c1c9356SAnanth N Mavinakayanahalli	help
9988c1c9356SAnanth N Mavinakayanahalli	  This option provides for testing basic kprobes functionality on
9998c1c9356SAnanth N Mavinakayanahalli	  boot. A sample kprobe, jprobe and kretprobe are inserted and
10008c1c9356SAnanth N Mavinakayanahalli	  verified for functionality.
10018c1c9356SAnanth N Mavinakayanahalli
10028c1c9356SAnanth N Mavinakayanahalli	  Say N if you are unsure.
10038c1c9356SAnanth N Mavinakayanahalli
10046dab2778SArjan van de Venconfig BACKTRACE_SELF_TEST
10056dab2778SArjan van de Ven	tristate "Self test for the backtrace code"
10066dab2778SArjan van de Ven	depends on DEBUG_KERNEL
10076dab2778SArjan van de Ven	default n
10086dab2778SArjan van de Ven	help
10096dab2778SArjan van de Ven	  This option provides a kernel module that can be used to test
10106dab2778SArjan van de Ven	  the kernel stack backtrace code. This option is not useful
10116dab2778SArjan van de Ven	  for distributions or general kernels, but only for kernel
10126dab2778SArjan van de Ven	  developers working on architecture code.
10136dab2778SArjan van de Ven
1014ad118c54SVegard Nossum	  Note that if you want to also test saved backtraces, you will
1015ad118c54SVegard Nossum	  have to enable STACKTRACE as well.
1016ad118c54SVegard Nossum
10176dab2778SArjan van de Ven	  Say N if you are unsure.
10186dab2778SArjan van de Ven
1019870d6656STejun Heoconfig DEBUG_BLOCK_EXT_DEVT
1020870d6656STejun Heo        bool "Force extended block device numbers and spread them"
1021870d6656STejun Heo	depends on DEBUG_KERNEL
1022870d6656STejun Heo	depends on BLOCK
1023759f8ca3SJens Axboe	default n
1024870d6656STejun Heo	help
10250e11e342STejun Heo	  BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
10260e11e342STejun Heo	  SOME DISTRIBUTIONS.  DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
10270e11e342STejun Heo	  YOU ARE DOING.  Distros, please enable this and fix whatever
10280e11e342STejun Heo	  is broken.
10290e11e342STejun Heo
1030870d6656STejun Heo	  Conventionally, block device numbers are allocated from
1031870d6656STejun Heo	  predetermined contiguous area.  However, extended block area
1032870d6656STejun Heo	  may introduce non-contiguous block device numbers.  This
1033870d6656STejun Heo	  option forces most block device numbers to be allocated from
1034870d6656STejun Heo	  the extended space and spreads them to discover kernel or
1035870d6656STejun Heo	  userland code paths which assume predetermined contiguous
1036870d6656STejun Heo	  device number allocation.
1037870d6656STejun Heo
103855dc7db7STejun Heo	  Note that turning on this debug option shuffles all the
103955dc7db7STejun Heo	  device numbers for all IDE and SCSI devices including libata
104055dc7db7STejun Heo	  ones, so root partition specified using device number
104155dc7db7STejun Heo	  directly (via rdev or root=MAJ:MIN) won't work anymore.
104255dc7db7STejun Heo	  Textual device names (root=/dev/sdXn) will continue to work.
104355dc7db7STejun Heo
1044870d6656STejun Heo	  Say N if you are unsure.
1045870d6656STejun Heo
10467c756e6eSTejun Heoconfig DEBUG_FORCE_WEAK_PER_CPU
10477c756e6eSTejun Heo	bool "Force weak per-cpu definitions"
10487c756e6eSTejun Heo	depends on DEBUG_KERNEL
10497c756e6eSTejun Heo	help
10507c756e6eSTejun Heo	  s390 and alpha require percpu variables in modules to be
10517c756e6eSTejun Heo	  defined weak to work around addressing range issue which
10527c756e6eSTejun Heo	  puts the following two restrictions on percpu variable
10537c756e6eSTejun Heo	  definitions.
10547c756e6eSTejun Heo
10557c756e6eSTejun Heo	  1. percpu symbols must be unique whether static or not
10567c756e6eSTejun Heo	  2. percpu variables can't be defined inside a function
10577c756e6eSTejun Heo
10587c756e6eSTejun Heo	  To ensure that generic code follows the above rules, this
10597c756e6eSTejun Heo	  option forces all percpu variables to be defined as weak.
10607c756e6eSTejun Heo
106144ec7abeSStephen Boydconfig DEBUG_PER_CPU_MAPS
106244ec7abeSStephen Boyd	bool "Debug access to per_cpu maps"
106344ec7abeSStephen Boyd	depends on DEBUG_KERNEL
106444ec7abeSStephen Boyd	depends on SMP
106544ec7abeSStephen Boyd	help
106644ec7abeSStephen Boyd	  Say Y to verify that the per_cpu map being accessed has
106744ec7abeSStephen Boyd	  been set up. This adds a fair amount of code to kernel memory
106844ec7abeSStephen Boyd	  and decreases performance.
106944ec7abeSStephen Boyd
107044ec7abeSStephen Boyd	  Say N if unsure.
107144ec7abeSStephen Boyd
10728bb31b9dSAnkita Gargconfig LKDTM
10738bb31b9dSAnkita Garg	tristate "Linux Kernel Dump Test Tool Module"
10740347af4eSSimon Kagstrom	depends on DEBUG_FS
1075fddd9cf8SChris Snook	depends on BLOCK
10768bb31b9dSAnkita Garg	default n
10778bb31b9dSAnkita Garg	help
10788bb31b9dSAnkita Garg	This module enables testing of the different dumping mechanisms by
10798bb31b9dSAnkita Garg	inducing system failures at predefined crash points.
10808bb31b9dSAnkita Garg	If you don't need it: say N
10818bb31b9dSAnkita Garg	Choose M here to compile this code as a module. The module will be
10828bb31b9dSAnkita Garg	called lkdtm.
10838bb31b9dSAnkita Garg
10848bb31b9dSAnkita Garg	Documentation on how to use the module can be found in
10850347af4eSSimon Kagstrom	Documentation/fault-injection/provoke-crashes.txt
10866ff1cb35SAkinobu Mita
1087*8d438288SAkinobu Mitaconfig NOTIFIER_ERROR_INJECTION
1088*8d438288SAkinobu Mita	tristate "Notifier error injection"
1089*8d438288SAkinobu Mita	depends on DEBUG_KERNEL
1090*8d438288SAkinobu Mita	select DEBUG_FS
1091*8d438288SAkinobu Mita	help
1092*8d438288SAkinobu Mita	  This option provides the ability to inject artifical errors to
1093*8d438288SAkinobu Mita	  specified notifier chain callbacks. It is useful to test the error
1094*8d438288SAkinobu Mita	  handling of notifier call chain failures.
1095*8d438288SAkinobu Mita
1096*8d438288SAkinobu Mita	  Say N if unsure.
1097*8d438288SAkinobu Mita
1098c9d221f8SAkinobu Mitaconfig CPU_NOTIFIER_ERROR_INJECT
1099c9d221f8SAkinobu Mita	tristate "CPU notifier error injection module"
1100c9d221f8SAkinobu Mita	depends on HOTPLUG_CPU && DEBUG_KERNEL
1101c9d221f8SAkinobu Mita	help
1102c9d221f8SAkinobu Mita	  This option provides a kernel module that can be used to test
1103c9d221f8SAkinobu Mita	  the error handling of the cpu notifiers
1104c9d221f8SAkinobu Mita
1105c9d221f8SAkinobu Mita	  To compile this code as a module, choose M here: the module will
1106c9d221f8SAkinobu Mita	  be called cpu-notifier-error-inject.
1107c9d221f8SAkinobu Mita
1108c9d221f8SAkinobu Mita	  If unsure, say N.
1109c9d221f8SAkinobu Mita
11106ff1cb35SAkinobu Mitaconfig FAULT_INJECTION
11111ab8509aSAndrew Morton	bool "Fault-injection framework"
11121ab8509aSAndrew Morton	depends on DEBUG_KERNEL
1113329409aeSAkinobu Mita	help
1114329409aeSAkinobu Mita	  Provide fault-injection framework.
1115329409aeSAkinobu Mita	  For more details, see Documentation/fault-injection/.
11166ff1cb35SAkinobu Mita
11178a8b6502SAkinobu Mitaconfig FAILSLAB
11181ab8509aSAndrew Morton	bool "Fault-injection capability for kmalloc"
11191ab8509aSAndrew Morton	depends on FAULT_INJECTION
1120773ff60eSAkinobu Mita	depends on SLAB || SLUB
11218a8b6502SAkinobu Mita	help
11221ab8509aSAndrew Morton	  Provide fault-injection capability for kmalloc.
11238a8b6502SAkinobu Mita
1124933e312eSAkinobu Mitaconfig FAIL_PAGE_ALLOC
1125933e312eSAkinobu Mita	bool "Fault-injection capabilitiy for alloc_pages()"
11261ab8509aSAndrew Morton	depends on FAULT_INJECTION
1127933e312eSAkinobu Mita	help
11281ab8509aSAndrew Morton	  Provide fault-injection capability for alloc_pages().
1129933e312eSAkinobu Mita
1130c17bb495SAkinobu Mitaconfig FAIL_MAKE_REQUEST
113186327d19SDave Jones	bool "Fault-injection capability for disk IO"
1132581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1133c17bb495SAkinobu Mita	help
11341ab8509aSAndrew Morton	  Provide fault-injection capability for disk IO.
1135c17bb495SAkinobu Mita
1136581d4e28SJens Axboeconfig FAIL_IO_TIMEOUT
1137f4d01439STakuya Yoshikawa	bool "Fault-injection capability for faking disk interrupts"
1138581d4e28SJens Axboe	depends on FAULT_INJECTION && BLOCK
1139581d4e28SJens Axboe	help
1140581d4e28SJens Axboe	  Provide fault-injection capability on end IO handling. This
1141581d4e28SJens Axboe	  will make the block layer "forget" an interrupt as configured,
1142581d4e28SJens Axboe	  thus exercising the error handling.
1143581d4e28SJens Axboe
1144581d4e28SJens Axboe	  Only works with drivers that use the generic timeout handling,
1145581d4e28SJens Axboe	  for others it wont do anything.
1146581d4e28SJens Axboe
11471b676f70SPer Forlinconfig FAIL_MMC_REQUEST
11481b676f70SPer Forlin	bool "Fault-injection capability for MMC IO"
11491b676f70SPer Forlin	select DEBUG_FS
11501b676f70SPer Forlin	depends on FAULT_INJECTION && MMC
11511b676f70SPer Forlin	help
11521b676f70SPer Forlin	  Provide fault-injection capability for MMC IO.
11531b676f70SPer Forlin	  This will make the mmc core return data errors. This is
11541b676f70SPer Forlin	  useful to test the error handling in the mmc block device
11551b676f70SPer Forlin	  and to test how the mmc host driver handles retries from
11561b676f70SPer Forlin	  the block device.
11571b676f70SPer Forlin
11586ff1cb35SAkinobu Mitaconfig FAULT_INJECTION_DEBUG_FS
11596ff1cb35SAkinobu Mita	bool "Debugfs entries for fault-injection capabilities"
11601ab8509aSAndrew Morton	depends on FAULT_INJECTION && SYSFS && DEBUG_FS
11616ff1cb35SAkinobu Mita	help
11621ab8509aSAndrew Morton	  Enable configuration of fault-injection capabilities via debugfs.
11631df49008SAkinobu Mita
11641df49008SAkinobu Mitaconfig FAULT_INJECTION_STACKTRACE_FILTER
11651df49008SAkinobu Mita	bool "stacktrace filter for fault-injection capabilities"
11661df49008SAkinobu Mita	depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
11676d690dcaSAkinobu Mita	depends on !X86_64
11681df49008SAkinobu Mita	select STACKTRACE
116989bace65SArnd Bergmann	select FRAME_POINTER if !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND
11701df49008SAkinobu Mita	help
11711df49008SAkinobu Mita	  Provide stacktrace filter for fault-injection capabilities
1172267c4025SMathieu Desnoyers
11739745512cSArjan van de Venconfig LATENCYTOP
11749745512cSArjan van de Ven	bool "Latency measuring infrastructure"
1175625fdcaaSRandy Dunlap	depends on HAVE_LATENCYTOP_SUPPORT
1176625fdcaaSRandy Dunlap	depends on DEBUG_KERNEL
1177625fdcaaSRandy Dunlap	depends on STACKTRACE_SUPPORT
1178625fdcaaSRandy Dunlap	depends on PROC_FS
117989bace65SArnd Bergmann	select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND
11809745512cSArjan van de Ven	select KALLSYMS
11819745512cSArjan van de Ven	select KALLSYMS_ALL
11829745512cSArjan van de Ven	select STACKTRACE
11839745512cSArjan van de Ven	select SCHEDSTATS
11849745512cSArjan van de Ven	select SCHED_DEBUG
11859745512cSArjan van de Ven	help
11869745512cSArjan van de Ven	  Enable this option if you want to use the LatencyTOP tool
11879745512cSArjan van de Ven	  to find out which userspace is blocking on what kernel operations.
11889745512cSArjan van de Ven
11896a11f75bSAkinobu Mitasource mm/Kconfig.debug
119016444a8aSArnaldo Carvalho de Melosource kernel/trace/Kconfig
119116444a8aSArnaldo Carvalho de Melo
1192f212ec4bSBernhard Kaindlconfig PROVIDE_OHCI1394_DMA_INIT
1193080de8c2SStefan Richter	bool "Remote debugging over FireWire early on boot"
1194f212ec4bSBernhard Kaindl	depends on PCI && X86
1195f212ec4bSBernhard Kaindl	help
1196f212ec4bSBernhard Kaindl	  If you want to debug problems which hang or crash the kernel early
1197f212ec4bSBernhard Kaindl	  on boot and the crashing machine has a FireWire port, you can use
1198f212ec4bSBernhard Kaindl	  this feature to remotely access the memory of the crashed machine
1199f212ec4bSBernhard Kaindl	  over FireWire. This employs remote DMA as part of the OHCI1394
1200f212ec4bSBernhard Kaindl	  specification which is now the standard for FireWire controllers.
1201f212ec4bSBernhard Kaindl
1202f212ec4bSBernhard Kaindl	  With remote DMA, you can monitor the printk buffer remotely using
1203f212ec4bSBernhard Kaindl	  firescope and access all memory below 4GB using fireproxy from gdb.
1204f212ec4bSBernhard Kaindl	  Even controlling a kernel debugger is possible using remote DMA.
1205f212ec4bSBernhard Kaindl
1206f212ec4bSBernhard Kaindl	  Usage:
1207f212ec4bSBernhard Kaindl
1208f212ec4bSBernhard Kaindl	  If ohci1394_dma=early is used as boot parameter, it will initialize
1209f212ec4bSBernhard Kaindl	  all OHCI1394 controllers which are found in the PCI config space.
1210f212ec4bSBernhard Kaindl
1211f212ec4bSBernhard Kaindl	  As all changes to the FireWire bus such as enabling and disabling
1212f212ec4bSBernhard Kaindl	  devices cause a bus reset and thereby disable remote DMA for all
1213f212ec4bSBernhard Kaindl	  devices, be sure to have the cable plugged and FireWire enabled on
1214f212ec4bSBernhard Kaindl	  the debugging host before booting the debug target for debugging.
1215f212ec4bSBernhard Kaindl
1216f212ec4bSBernhard Kaindl	  This code (~1k) is freed after boot. By then, the firewire stack
1217f212ec4bSBernhard Kaindl	  in charge of the OHCI-1394 controllers should be used instead.
1218f212ec4bSBernhard Kaindl
1219f212ec4bSBernhard Kaindl	  See Documentation/debugging-via-ohci1394.txt for more information.
12209745512cSArjan van de Ven
1221080de8c2SStefan Richterconfig FIREWIRE_OHCI_REMOTE_DMA
1222080de8c2SStefan Richter	bool "Remote debugging over FireWire with firewire-ohci"
1223080de8c2SStefan Richter	depends on FIREWIRE_OHCI
1224080de8c2SStefan Richter	help
1225080de8c2SStefan Richter	  This option lets you use the FireWire bus for remote debugging
1226080de8c2SStefan Richter	  with help of the firewire-ohci driver. It enables unfiltered
1227080de8c2SStefan Richter	  remote DMA in firewire-ohci.
1228080de8c2SStefan Richter	  See Documentation/debugging-via-ohci1394.txt for more information.
1229080de8c2SStefan Richter
1230080de8c2SStefan Richter	  If unsure, say N.
1231080de8c2SStefan Richter
1232152de30bSRandy Dunlapconfig BUILD_DOCSRC
12333794f3e8SRandy Dunlap	bool "Build targets in Documentation/ tree"
12343794f3e8SRandy Dunlap	depends on HEADERS_CHECK
12353794f3e8SRandy Dunlap	help
12363794f3e8SRandy Dunlap	  This option attempts to build objects from the source files in the
12373794f3e8SRandy Dunlap	  kernel Documentation/ tree.
12383794f3e8SRandy Dunlap
12393794f3e8SRandy Dunlap	  Say N if you are unsure.
12403794f3e8SRandy Dunlap
1241e9d376f0SJason Baronconfig DYNAMIC_DEBUG
124286151fdfSJason Baron	bool "Enable dynamic printk() support"
1243346e15beSJason Baron	default n
1244346e15beSJason Baron	depends on PRINTK
124586151fdfSJason Baron	depends on DEBUG_FS
1246346e15beSJason Baron	help
1247346e15beSJason Baron
1248346e15beSJason Baron	  Compiles debug level messages into the kernel, which would not
1249346e15beSJason Baron	  otherwise be available at runtime. These messages can then be
125086151fdfSJason Baron	  enabled/disabled based on various levels of scope - per source file,
125186151fdfSJason Baron	  function, module, format string, and line number. This mechanism
125229e36c9fSJim Cromie	  implicitly compiles in all pr_debug() and dev_dbg() calls, which
125329e36c9fSJim Cromie	  enlarges the kernel text size by about 2%.
125429e36c9fSJim Cromie
125529e36c9fSJim Cromie	  If a source file is compiled with DEBUG flag set, any
125629e36c9fSJim Cromie	  pr_debug() calls in it are enabled by default, but can be
125729e36c9fSJim Cromie	  disabled at runtime as below.  Note that DEBUG flag is
125829e36c9fSJim Cromie	  turned on by many CONFIG_*DEBUG* options.
1259346e15beSJason Baron
1260346e15beSJason Baron	  Usage:
1261346e15beSJason Baron
12622b2f68b5SFlorian Ragwitz	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
126386151fdfSJason Baron	  which is contained in the 'debugfs' filesystem. Thus, the debugfs
126486151fdfSJason Baron	  filesystem must first be mounted before making use of this feature.
12652b2f68b5SFlorian Ragwitz	  We refer the control file as: <debugfs>/dynamic_debug/control. This
126686151fdfSJason Baron	  file contains a list of the debug statements that can be enabled. The
126786151fdfSJason Baron	  format for each line of the file is:
1268346e15beSJason Baron
126986151fdfSJason Baron		filename:lineno [module]function flags format
1270346e15beSJason Baron
127186151fdfSJason Baron	  filename : source file of the debug statement
127286151fdfSJason Baron	  lineno : line number of the debug statement
127386151fdfSJason Baron	  module : module that contains the debug statement
127486151fdfSJason Baron	  function : function that contains the debug statement
127529e36c9fSJim Cromie          flags : '=p' means the line is turned 'on' for printing
127686151fdfSJason Baron          format : the format used for the debug statement
1277346e15beSJason Baron
1278346e15beSJason Baron	  From a live system:
1279346e15beSJason Baron
12802b2f68b5SFlorian Ragwitz		nullarbor:~ # cat <debugfs>/dynamic_debug/control
128186151fdfSJason Baron		# filename:lineno [module]function flags format
128229e36c9fSJim Cromie		fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
128329e36c9fSJim Cromie		fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
128429e36c9fSJim Cromie		fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
1285346e15beSJason Baron
128686151fdfSJason Baron	  Example usage:
1287346e15beSJason Baron
128886151fdfSJason Baron		// enable the message at line 1603 of file svcsock.c
128986151fdfSJason Baron		nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
12902b2f68b5SFlorian Ragwitz						<debugfs>/dynamic_debug/control
1291346e15beSJason Baron
129286151fdfSJason Baron		// enable all the messages in file svcsock.c
129386151fdfSJason Baron		nullarbor:~ # echo -n 'file svcsock.c +p' >
12942b2f68b5SFlorian Ragwitz						<debugfs>/dynamic_debug/control
1295346e15beSJason Baron
129686151fdfSJason Baron		// enable all the messages in the NFS server module
129786151fdfSJason Baron		nullarbor:~ # echo -n 'module nfsd +p' >
12982b2f68b5SFlorian Ragwitz						<debugfs>/dynamic_debug/control
1299346e15beSJason Baron
130086151fdfSJason Baron		// enable all 12 messages in the function svc_process()
130186151fdfSJason Baron		nullarbor:~ # echo -n 'func svc_process +p' >
13022b2f68b5SFlorian Ragwitz						<debugfs>/dynamic_debug/control
1303346e15beSJason Baron
130486151fdfSJason Baron		// disable all 12 messages in the function svc_process()
130586151fdfSJason Baron		nullarbor:~ # echo -n 'func svc_process -p' >
13062b2f68b5SFlorian Ragwitz						<debugfs>/dynamic_debug/control
1307346e15beSJason Baron
130886151fdfSJason Baron	  See Documentation/dynamic-debug-howto.txt for additional information.
1309346e15beSJason Baron
13105ee00bd4SJoerg Roedelconfig DMA_API_DEBUG
13115ee00bd4SJoerg Roedel	bool "Enable debugging of DMA-API usage"
13125ee00bd4SJoerg Roedel	depends on HAVE_DMA_API_DEBUG
13135ee00bd4SJoerg Roedel	help
13145ee00bd4SJoerg Roedel	  Enable this option to debug the use of the DMA API by device drivers.
13155ee00bd4SJoerg Roedel	  With this option you will be able to detect common bugs in device
13165ee00bd4SJoerg Roedel	  drivers like double-freeing of DMA mappings or freeing mappings that
13175ee00bd4SJoerg Roedel	  were never allocated.
13185ee00bd4SJoerg Roedel	  This option causes a performance degredation.  Use only if you want
13195ee00bd4SJoerg Roedel	  to debug device drivers. If unsure, say N.
1320346e15beSJason Baron
132186a89380SLuca Barbiericonfig ATOMIC64_SELFTEST
132286a89380SLuca Barbieri	bool "Perform an atomic64_t self-test at boot"
132386a89380SLuca Barbieri	help
132486a89380SLuca Barbieri	  Enable this option to test the atomic64_t functions at boot.
132586a89380SLuca Barbieri
132686a89380SLuca Barbieri	  If unsure, say N.
132786a89380SLuca Barbieri
1328400fb7f6SDan Williamsconfig ASYNC_RAID6_TEST
1329400fb7f6SDan Williams	tristate "Self test for hardware accelerated raid6 recovery"
1330400fb7f6SDan Williams	depends on ASYNC_RAID6_RECOV
1331400fb7f6SDan Williams	select ASYNC_MEMCPY
1332400fb7f6SDan Williams	---help---
1333400fb7f6SDan Williams	  This is a one-shot self test that permutes through the
1334400fb7f6SDan Williams	  recovery of all the possible two disk failure scenarios for a
1335400fb7f6SDan Williams	  N-disk array.  Recovery is performed with the asynchronous
1336400fb7f6SDan Williams	  raid6 recovery routines, and will optionally use an offload
1337400fb7f6SDan Williams	  engine if one is available.
1338400fb7f6SDan Williams
1339400fb7f6SDan Williams	  If unsure, say N.
1340400fb7f6SDan Williams
1341267c4025SMathieu Desnoyerssource "samples/Kconfig"
1342dc7d5527SJason Wessel
1343dc7d5527SJason Wesselsource "lib/Kconfig.kgdb"
13440a4af3b0SPekka Enberg
13450a4af3b0SPekka Enbergsource "lib/Kconfig.kmemcheck"
134633ee3b2eSAlexey Dobriyan
134733ee3b2eSAlexey Dobriyanconfig TEST_KSTRTOX
134833ee3b2eSAlexey Dobriyan	tristate "Test kstrto*() family of functions at runtime"
1349