Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib: consolidate DEBUG_STACK_USAGE option

Most arches define CONFIG_DEBUG_STACK_USAGE exactly the same way. Move it
to lib/Kconfig.debug so each arch doesn't have to define it. This
obviously makes the option generic, but that's fine because the config is
already used in generic code.

It's not obvious to me that sysrq-P actually does anything caution by
keeping the most inclusive wording.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Richard Weinberger <richard@nod.at>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stephen Boyd and committed by
Linus Torvalds
5ca43f6c c84598bb

+9 -105
-7
arch/arm/Kconfig.debug
··· 63 63 8 - SIGSEGV faults 64 64 16 - SIGBUS faults 65 65 66 - config DEBUG_STACK_USAGE 67 - bool "Enable stack utilization instrumentation" 68 - depends on DEBUG_KERNEL 69 - help 70 - Enables the display of the minimum amount of free stack which each 71 - task has ever had available in the sysrq-T output. 72 - 73 66 # These options are only for real kernel hackers who want to get their hands dirty. 74 67 config DEBUG_LL 75 68 bool "Kernel low-level debugging functions"
-9
arch/blackfin/Kconfig.debug
··· 9 9 This option will cause messages to be printed if free stack space 10 10 drops below a certain limit. 11 11 12 - config DEBUG_STACK_USAGE 13 - bool "Enable stack utilization instrumentation" 14 - depends on DEBUG_KERNEL 15 - help 16 - Enables the display of the minimum amount of free stack which each 17 - task has ever had available in the sysrq-T output. 18 - 19 - This option will slow down process creation somewhat. 20 - 21 12 config DEBUG_VERBOSE 22 13 bool "Verbose fault messages" 23 14 default y
-9
arch/m32r/Kconfig.debug
··· 9 9 This option will cause messages to be printed if free stack space 10 10 drops below a certain limit. 11 11 12 - config DEBUG_STACK_USAGE 13 - bool "Stack utilization instrumentation" 14 - depends on DEBUG_KERNEL 15 - help 16 - Enables the display of the minimum amount of free stack which each 17 - task has ever had available in the sysrq-T and sysrq-P debug output. 18 - 19 - This option will slow down process creation somewhat. 20 - 21 12 config DEBUG_PAGEALLOC 22 13 bool "Debug page memory allocations" 23 14 depends on DEBUG_KERNEL && BROKEN
-9
arch/mips/Kconfig.debug
··· 76 76 provides another way to check stack overflow happened on kernel mode 77 77 stack usually caused by nested interruption. 78 78 79 - config DEBUG_STACK_USAGE 80 - bool "Enable stack utilization instrumentation" 81 - depends on DEBUG_KERNEL 82 - help 83 - Enables the display of the minimum amount of free stack which each 84 - task has ever had available in the sysrq-T and sysrq-P debug output. 85 - 86 - This option will slow down process creation somewhat. 87 - 88 79 config SMTC_IDLE_HOOK_DEBUG 89 80 bool "Enable additional debug checks before going into CPU idle loop" 90 81 depends on DEBUG_KERNEL && MIPS_MT_SMTC
-9
arch/powerpc/Kconfig.debug
··· 35 35 This option will cause messages to be printed if free stack space 36 36 drops below a certain limit. 37 37 38 - config DEBUG_STACK_USAGE 39 - bool "Stack utilization instrumentation" 40 - depends on DEBUG_KERNEL 41 - help 42 - Enables the display of the minimum amount of free stack which each 43 - task has ever had available in the sysrq-T and sysrq-P debug output. 44 - 45 - This option will slow down process creation somewhat. 46 - 47 38 config HCALL_STATS 48 39 bool "Hypervisor call instrumentation" 49 40 depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
-9
arch/score/Kconfig.debug
··· 16 16 other cases you can specify kernel args so that you don't have 17 17 to set them up in board prom initialization routines. 18 18 19 - config DEBUG_STACK_USAGE 20 - bool "Enable stack utilization instrumentation" 21 - depends on DEBUG_KERNEL 22 - help 23 - Enables the display of the minimum amount of free stack which each 24 - task has ever had available in the sysrq-T and sysrq-P debug output. 25 - 26 - This option will slow down process creation somewhat. 27 - 28 19 config RUNTIME_DEBUG 29 20 bool "Enable run-time debugging" 30 21 depends on DEBUG_KERNEL
-9
arch/sh/Kconfig.debug
··· 28 28 every function call and will therefore incur a major 29 29 performance hit. Most users should say N. 30 30 31 - config DEBUG_STACK_USAGE 32 - bool "Stack utilization instrumentation" 33 - depends on DEBUG_KERNEL 34 - help 35 - Enables the display of the minimum amount of free stack which each 36 - task has ever had available in the sysrq-T and sysrq-P debug output. 37 - 38 - This option will slow down process creation somewhat. 39 - 40 31 config 4KSTACKS 41 32 bool "Use 4Kb for kernel stacks instead of 8Kb" 42 33 depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
-9
arch/sparc/Kconfig.debug
··· 6 6 7 7 source "lib/Kconfig.debug" 8 8 9 - config DEBUG_STACK_USAGE 10 - bool "Enable stack utilization instrumentation" 11 - depends on DEBUG_KERNEL 12 - help 13 - Enables the display of the minimum amount of free stack which each 14 - task has ever had available in the sysrq-T and sysrq-P debug output. 15 - 16 - This option will slow down process creation somewhat. 17 - 18 9 config DEBUG_DCFLUSH 19 10 bool "D-cache flush debugging" 20 11 depends on SPARC64 && DEBUG_KERNEL
-9
arch/tile/Kconfig.debug
··· 21 21 This option will cause messages to be printed if free stack space 22 22 drops below a certain limit. 23 23 24 - config DEBUG_STACK_USAGE 25 - bool "Stack utilization instrumentation" 26 - depends on DEBUG_KERNEL 27 - help 28 - Enables the display of the minimum amount of free stack which each 29 - task has ever had available in the sysrq-T and sysrq-P debug output. 30 - 31 - This option will slow down process creation somewhat. 32 - 33 24 config DEBUG_EXTRA_FLAGS 34 25 string "Additional compiler arguments when building with '-g'" 35 26 depends on DEBUG_INFO
-10
arch/um/Kconfig.debug
··· 28 28 If you're involved in UML kernel development and want to use gcov, 29 29 say Y. If you're unsure, say N. 30 30 31 - config DEBUG_STACK_USAGE 32 - bool "Stack utilization instrumentation" 33 - default N 34 - help 35 - Track the maximum kernel stack usage - this will look at each 36 - kernel stack at process exit and log it if it's the deepest 37 - stack seen so far. 38 - 39 - This option will slow down process creation and destruction somewhat. 40 - 41 31 config EARLY_PRINTK 42 32 bool "Early printk" 43 33 default y
-7
arch/unicore32/Kconfig.debug
··· 27 27 with klogd/syslogd or the X server. You should normally N here, 28 28 unless you want to debug such a crash. 29 29 30 - config DEBUG_STACK_USAGE 31 - bool "Enable stack utilization instrumentation" 32 - depends on DEBUG_KERNEL 33 - help 34 - Enables the display of the minimum amount of free stack which each 35 - task has ever had available in the sysrq-T output. 36 - 37 30 # These options are only for real kernel hackers who want to get their hands dirty. 38 31 config DEBUG_LL 39 32 bool "Kernel low-level debugging functions"
-9
arch/x86/Kconfig.debug
··· 66 66 This option will cause messages to be printed if free stack space 67 67 drops below a certain limit. 68 68 69 - config DEBUG_STACK_USAGE 70 - bool "Stack utilization instrumentation" 71 - depends on DEBUG_KERNEL 72 - ---help--- 73 - Enables the display of the minimum amount of free stack which each 74 - task has ever had available in the sysrq-T and sysrq-P debug output. 75 - 76 - This option will slow down process creation somewhat. 77 - 78 69 config X86_PTDUMP 79 70 bool "Export kernel pagetable layout to userspace via debugfs" 80 71 depends on DEBUG_KERNEL
+9
lib/Kconfig.debug
··· 670 670 bool 671 671 depends on STACKTRACE_SUPPORT 672 672 673 + config DEBUG_STACK_USAGE 674 + bool "Stack utilization instrumentation" 675 + depends on DEBUG_KERNEL 676 + help 677 + Enables the display of the minimum amount of free stack which each 678 + task has ever had available in the sysrq-T and sysrq-P debug output. 679 + 680 + This option will slow down process creation somewhat. 681 + 673 682 config DEBUG_KOBJECT 674 683 bool "kobject debugging" 675 684 depends on DEBUG_KERNEL