Skip to contentSkip to conversation

lib: Consolidate DEBUG_STACK_USAGE option

PATCH In review Stephen Boyd 6 participants 6 messages May 7, 2011 – May 19, 2011

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 different with this option enabled, but I erred on the side of caution by keeping the most inclusive wording.

---

This is on top of mmotm's lib-conslidate-debug_per_cpu_maps patch.

 arch/arm/Kconfig.debug       |    7 -------
 arch/blackfin/Kconfig.debug  |    9 ---------
 arch/m32r/Kconfig.debug      |    9 ---------
 arch/mips/Kconfig.debug      |    9 ---------
 arch/powerpc/Kconfig.debug   |    9 ---------
 arch/score/Kconfig.debug     |    9 ---------
 arch/sh/Kconfig.debug        |    9 ---------
 arch/sparc/Kconfig.debug     |    9 ---------
 arch/tile/Kconfig.debug      |    9 ---------
 arch/um/Kconfig.debug        |    9 ---------
 arch/unicore32/Kconfig.debug |    7 -------
 arch/x86/Kconfig.debug       |    9 ---------
 lib/Kconfig.debug            |    9 +++++++++
 13 files changed, 9 insertions(+), 104 deletions(-)
arch/arm/Kconfig.debug +0 -7
index 03d01d7..81cbe40 100644
@@ -63,13 +63,6 @@ config DEBUG_USER
 	      8 - SIGSEGV faults
 	     16 - SIGBUS faults
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T output.
-
 # These options are only for real kernel hackers who want to get their hands dirty.
 config DEBUG_LL
 	bool "Kernel low-level debugging functions"
arch/blackfin/Kconfig.debug +0 -9
index 2641731..19ccfb3 100644
@@ -9,15 +9,6 @@ config DEBUG_STACKOVERFLOW
 	  This option will cause messages to be printed if free stack space
 	  drops below a certain limit.
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T output.
-
-	  This option will slow down process creation somewhat.
-
 config DEBUG_VERBOSE
 	bool "Verbose fault messages"
 	default y
arch/m32r/Kconfig.debug +0 -9
index 2e1019d..bb1afc1 100644
@@ -9,15 +9,6 @@ config DEBUG_STACKOVERFLOW
 	  This option will cause messages to be printed if free stack space
 	  drops below a certain limit.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config DEBUG_PAGEALLOC
 	bool "Debug page memory allocations"
 	depends on DEBUG_KERNEL && BROKEN
arch/mips/Kconfig.debug +0 -9
index 5358f90..83ed00a 100644
@@ -76,15 +76,6 @@ config DEBUG_STACKOVERFLOW
 	  provides another way to check stack overflow happened on kernel mode
 	  stack usually caused by nested interruption.
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config SMTC_IDLE_HOOK_DEBUG
 	bool "Enable additional debug checks before going into CPU idle loop"
 	depends on DEBUG_KERNEL && MIPS_MT_SMTC
arch/powerpc/Kconfig.debug +0 -9
index 12a8d18..f862fc0 100644
@@ -35,15 +35,6 @@ config DEBUG_STACKOVERFLOW
 	  This option will cause messages to be printed if free stack space
 	  drops below a certain limit.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config HCALL_STATS
 	bool "Hypervisor call instrumentation"
 	depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
arch/score/Kconfig.debug +0 -9
index 451ed54..a1f346d 100644
@@ -16,15 +16,6 @@ config CMDLINE
 	  other cases you can specify kernel args so that you don't have
 	  to set them up in board prom initialization routines.
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config RUNTIME_DEBUG
 	bool "Enable run-time debugging"
 	depends on DEBUG_KERNEL
arch/sh/Kconfig.debug +0 -9
index 1553d56..c1d5a82 100644
@@ -28,15 +28,6 @@ config STACK_DEBUG
 	  every function call and will therefore incur a major
 	  performance hit. Most users should say N.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config 4KSTACKS
 	bool "Use 4Kb for kernel stacks instead of 8Kb"
 	depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
arch/sparc/Kconfig.debug +0 -9
index d9a795e..6db35fb 100644
@@ -6,15 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config DEBUG_DCFLUSH
 	bool "D-cache flush debugging"
 	depends on SPARC64 && DEBUG_KERNEL
arch/tile/Kconfig.debug +0 -9
index 9bc161a..ddbfc33 100644
@@ -21,15 +21,6 @@ config DEBUG_STACKOVERFLOW
 	  This option will cause messages to be printed if free stack space
 	  drops below a certain limit.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config DEBUG_EXTRA_FLAGS
 	string "Additional compiler arguments when building with '-g'"
 	depends on DEBUG_INFO
arch/um/Kconfig.debug +0 -9
index 8fce5e5..34ac57f 100644
@@ -28,13 +28,4 @@ config GCOV
 	  If you're involved in UML kernel development and want to use gcov,
 	  say Y.  If you're unsure, say N.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	default N
-	help
-	  Track the maximum kernel stack usage - this will look at each
-	  kernel stack at process exit and log it if it's the deepest
-	  stack seen so far.
-
-	  This option will slow down process creation and destruction somewhat.
 endmenu
arch/unicore32/Kconfig.debug +0 -7
index 3140151..ae2ec33 100644
@@ -27,13 +27,6 @@ config EARLY_PRINTK
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash.
 
-config DEBUG_STACK_USAGE
-	bool "Enable stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T output.
-
 # These options are only for real kernel hackers who want to get their hands dirty.
 config DEBUG_LL
 	bool "Kernel low-level debugging functions"
arch/x86/Kconfig.debug +0 -9
index 1bf8839..c0f8a5c 100644
@@ -66,15 +66,6 @@ config DEBUG_STACKOVERFLOW
 	  This option will cause messages to be printed if free stack space
 	  drops below a certain limit.
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL
-	---help---
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config X86_PTDUMP
 	bool "Export kernel pagetable layout to userspace via debugfs"
 	depends on DEBUG_KERNEL
lib/Kconfig.debug +9 -0
index c0872ee..37fae12 100644
@@ -654,6 +654,15 @@ config STACKTRACE
 	bool
 	depends on STACKTRACE_SUPPORT
 
+config DEBUG_STACK_USAGE
+	bool "Stack utilization instrumentation"
+	depends on DEBUG_KERNEL
+	help
+	  Enables the display of the minimum amount of free stack which each
+	  task has ever had available in the sysrq-T and sysrq-P debug output.
+
+	  This option will slow down process creation somewhat.
+
 config DEBUG_KOBJECT
 	bool "kobject debugging"
 	depends on DEBUG_KERNEL
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
maintainer Acked-by on v1 1/1
#1 lore raw

From: Stephen Boyd <[email protected]>
Date: Fri, 6 May 2011 22:57:11 -0700

Quoted 9 lines

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 different with this option enabled, but I erred on the side of caution by keeping the most inclusive wording.

Quoted 12 lines
Cc linux-arch at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc uclinux-dist-devel at blackfin.uclinux.org
Cc linux-m32r at ml.linux-m32r.org
Cc linux-mips at linux-mips.org
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-sh at vger.kernel.org
Cc sparclinux at vger.kernel.org
Cc Chris Metcalf <[email protected]>
Cc user-mode-linux-devel at lists.sourceforge.net
Cc x86 at kernel.org
Acked-by Richard Weinberger on v1 1/1
#2 lore raw
In reply to Stephen Boyd
Quoted 21 lines · Stephen Boyd

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 different with this option enabled, but I erred on the side of caution by keeping the most inclusive wording.

Quoted 1 line

---

Signature · 2 lines
Thanks,
//richard
Acked-by on v1 1/1
#3 lore raw
In reply to Stephen Boyd
Quoted 11 lines · Stephen Boyd

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 different with this option enabled, but I erred on the side of caution by keeping the most inclusive wording.

Cc: uclinux-dist-devel at blackfin.uclinux.org
?arch/blackfin/Kconfig.debug ?| ? ?9 ---------

-mike

Acked-by on v1 1/1
#5 lore raw
In reply to Stephen Boyd
Quoted 8 lines · Stephen Boyd

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 different with this option enabled, but I erred on the side of caution by keeping the most inclusive wording.

Sorry for the delay...

For powerpc:

Cheers,
Ben.