[v3] powerpc: allow configuring max stack dump depth

Submitted by Johannes Berg on Nov. 20, 2008, 1:24 p.m.

Details

Message ID 1227187447.14852.17.camel@johannes.berg
State Accepted, archived
Commit c4d04be11f99cc9ce4e3801a5da235727db704a9
Delegated to: Paul Mackerras
Headers show

Commit Message

Johannes Berg Nov. 20, 2008, 1:24 p.m.
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>
---
v3 corrects the stupid Kconfig dependency mistake

 arch/powerpc/Kconfig.debug    |    9 +++++++++
 arch/powerpc/kernel/process.c |    2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

--- everything.orig/arch/powerpc/Kconfig.debug	2008-11-19 01:13:16.000000000 +0100
+++ everything/arch/powerpc/Kconfig.debug	2008-11-20 14:21:46.000000000 +0100
@@ -2,6 +2,15 @@  menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config PRINT_STACK_DEPTH
+	int "Stack depth to print" if DEBUG_KERNEL
+	default 64
+	help
+	  This option allows you to set the stack depth that the kernel
+	  prints in stack traces. This can be useful if your display is
+	  too small and stack traces cause important information to
+	  scroll off the screen.
+
 config DEBUG_STACKOVERFLOW
 	bool "Check for stack overflows"
 	depends on DEBUG_KERNEL
--- everything.orig/arch/powerpc/kernel/process.c	2008-11-19 01:13:16.000000000 +0100
+++ everything/arch/powerpc/kernel/process.c	2008-11-19 12:45:28.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)
 {