linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: allow configuring max stack dump depth
@ 2008-11-01 10:11 Johannes Berg
  2008-11-19  4:24 ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-11-01 10:11 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

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(-)

--- 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)
 {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: allow configuring max stack dump depth
  2008-11-01 10:11 [PATCH] powerpc: allow configuring max stack dump depth Johannes Berg
@ 2008-11-19  4:24 ` Paul Mackerras
  2008-11-19 11:48   ` [PATCH v2] " Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Mackerras @ 2008-11-19  4:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev list

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] powerpc: allow configuring max stack dump depth
  2008-11-19  4:24 ` Paul Mackerras
@ 2008-11-19 11:48   ` Johannes Berg
  2008-11-19 22:10     ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-11-19 11:48 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

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>
---
Sure, here's an updated version. I used DEBUG_KERNEL since the
ADVANCED_CONFIGURATION help text implies it's for MM and can cause the
kernel to not boot, not something this config is related to.

Thanks for your comments.

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

--- everything.orig/arch/powerpc/Kconfig.debug	2008-11-19 01:13:16.000000000 +0100
+++ everything/arch/powerpc/Kconfig.debug	2008-11-19 12:47:24.000000000 +0100
@@ -2,6 +2,16 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config PRINT_STACK_DEPTH
+	int "Stack depth to print"
+	depends on 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)
 {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] powerpc: allow configuring max stack dump depth
  2008-11-19 11:48   ` [PATCH v2] " Johannes Berg
@ 2008-11-19 22:10     ` Paul Mackerras
  2008-11-20 13:20       ` Johannes Berg
  2008-11-20 13:24       ` [PATCH v3] " Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Mackerras @ 2008-11-19 22:10 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev list

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.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> Sure, here's an updated version. I used DEBUG_KERNEL since the
> ADVANCED_CONFIGURATION help text implies it's for MM and can cause the
> kernel to not boot, not something this config is related to.

Um, with this I get a compile error when DEBUG_KERNEL=n:

  CC      arch/powerpc/kernel/process.o
/home/paulus/kernel/powerpc/arch/powerpc/kernel/process.c:1001: error: 'CONFIG_PRINT_STACK_DEPTH' undeclared here (not in a function)
make[2]: *** [arch/powerpc/kernel/process.o] Error 1

I think it needs to look like this:

+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.
+

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] powerpc: allow configuring max stack dump depth
  2008-11-19 22:10     ` Paul Mackerras
@ 2008-11-20 13:20       ` Johannes Berg
  2008-11-20 13:24       ` [PATCH v3] " Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-11-20 13:20 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

On Thu, 2008-11-20 at 09:10 +1100, Paul Mackerras wrote:
> 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.
> > 
> > Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> > ---
> > Sure, here's an updated version. I used DEBUG_KERNEL since the
> > ADVANCED_CONFIGURATION help text implies it's for MM and can cause the
> > kernel to not boot, not something this config is related to.
> 
> Um, with this I get a compile error when DEBUG_KERNEL=n:
> 
>   CC      arch/powerpc/kernel/process.o
> /home/paulus/kernel/powerpc/arch/powerpc/kernel/process.c:1001: error: 'CONFIG_PRINT_STACK_DEPTH' undeclared here (not in a function)
> make[2]: *** [arch/powerpc/kernel/process.o] Error 1

Ouch, clearly I haven't been paying attention, my mistake. Sorry about
that.

> I think it needs to look like this:
> 
> +config PRINT_STACK_DEPTH
> +	int "Stack depth to print" if DEBUG_KERNEL

Yes, that's better, thanks.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] powerpc: allow configuring max stack dump depth
  2008-11-19 22:10     ` Paul Mackerras
  2008-11-20 13:20       ` Johannes Berg
@ 2008-11-20 13:24       ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-11-20 13:24 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

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(-)

--- 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)
 {

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-20 17:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-01 10:11 [PATCH] powerpc: allow configuring max stack dump depth Johannes Berg
2008-11-19  4:24 ` Paul Mackerras
2008-11-19 11:48   ` [PATCH v2] " Johannes Berg
2008-11-19 22:10     ` Paul Mackerras
2008-11-20 13:20       ` Johannes Berg
2008-11-20 13:24       ` [PATCH v3] " Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).