linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: [PATCH v2] powerpc: allow configuring max stack dump depth
Date: Wed, 19 Nov 2008 12:48:38 +0100	[thread overview]
Message-ID: <1227095318.26243.17.camel@johannes.berg> (raw)
In-Reply-To: <18723.38125.245930.196074@cargo.ozlabs.ibm.com>

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

  reply	other threads:[~2008-11-19 11:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Johannes Berg [this message]
2008-11-19 22:10     ` [PATCH v2] " Paul Mackerras
2008-11-20 13:20       ` Johannes Berg
2008-11-20 13:24       ` [PATCH v3] " Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1227095318.26243.17.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).