diff mbox

powerpc: allow configuring max stack dump depth

Message ID 1225534317.3560.8.camel@johannes.berg (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Johannes Berg Nov. 1, 2008, 10:11 a.m. UTC
On my screen, when something crashes, I only have space for maybe
16 functions of the stack trace before the information above it
scrolls off the screen. It's easy to hack the kernel to print out
only that much, but it's harder to remember to do it. This patch
introduces a config option for it so that I can keep the setting
in my config.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 arch/powerpc/Kconfig.debug    |    7 +++++++
 arch/powerpc/kernel/process.c |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Paul Mackerras Nov. 19, 2008, 4:24 a.m. UTC | #1
Johannes Berg writes:

> On my screen, when something crashes, I only have space for maybe
> 16 functions of the stack trace before the information above it
> scrolls off the screen. It's easy to hack the kernel to print out
> only that much, but it's harder to remember to do it. This patch
> introduces a config option for it so that I can keep the setting
> in my config.

Could you make it depend on DEBUG_KERNEL or ADVANCED or something?

> +	help
> +	  This option allows you to set the stack depth that the kernel
> +	  prints out in case your display is too small.

The "in case" is a little ambiguous here.  I suggest:

+	  This option allows you to set the maximum depth that the kernel
+	  prints in stack traces.  This can be useful if your display
+	  is too small.

Paul.
diff mbox

Patch

--- everything.orig/arch/powerpc/Kconfig.debug	2008-11-01 11:03:29.000000000 +0100
+++ everything/arch/powerpc/Kconfig.debug	2008-11-01 11:05:45.000000000 +0100
@@ -2,6 +2,13 @@  menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config PRINT_STACK_DEPTH
+	int "Stack depth to print"
+	default 64
+	help
+	  This option allows you to set the stack depth that the kernel
+	  prints out in case your display is too small.
+
 config DEBUG_STACKOVERFLOW
 	bool "Check for stack overflows"
 	depends on DEBUG_KERNEL
--- everything.orig/arch/powerpc/kernel/process.c	2008-11-01 11:03:09.000000000 +0100
+++ everything/arch/powerpc/kernel/process.c	2008-11-01 11:03:21.000000000 +0100
@@ -998,7 +998,7 @@  unsigned long get_wchan(struct task_stru
 	return 0;
 }
 
-static int kstack_depth_to_print = 64;
+static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
 
 void show_stack(struct task_struct *tsk, unsigned long *stack)
 {