Skip to content

Commit c4d04be

Browse files
jmbergpaulusmack
authored andcommitted
powerpc: Allow the max stack trace depth to be configured
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 introduces a config option for it so that I can keep the setting in my config. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 0186f47 commit c4d04be

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎arch/powerpc/Kconfig.debug‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ menu "Kernel hacking"
22

33
source "lib/Kconfig.debug"
44

5+
config PRINT_STACK_DEPTH
6+
int "Stack depth to print" if DEBUG_KERNEL
7+
default 64
8+
help
9+
This option allows you to set the stack depth that the kernel
10+
prints in stack traces. This can be useful if your display is
11+
too small and stack traces cause important information to
12+
scroll off the screen.
13+
514
config DEBUG_STACKOVERFLOW
615
bool "Check for stack overflows"
716
depends on DEBUG_KERNEL

‎arch/powerpc/kernel/process.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ unsigned long get_wchan(struct task_struct *p)
10001000
return 0;
10011001
}
10021002

1003-
static int kstack_depth_to_print = 64;
1003+
static int kstack_depth_to_print = CONFIG_PRINT_STACK_DEPTH;
10041004

10051005
void show_stack(struct task_struct *tsk, unsigned long *stack)
10061006
{

0 commit comments

Comments
 (0)