From patchwork Wed Nov 19 11:48:38 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 9555 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 9C984DDED4 for ; Wed, 19 Nov 2008 22:50:16 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from sipsolutions.net (xc.sipsolutions.net [83.246.72.84]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A9EE5DDDFB for ; Wed, 19 Nov 2008 22:49:20 +1100 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1L2lYW-0001q0-L0; Wed, 19 Nov 2008 12:49:12 +0100 Subject: [PATCH v2] powerpc: allow configuring max stack dump depth From: Johannes Berg To: Paul Mackerras In-Reply-To: <18723.38125.245930.196074@cargo.ozlabs.ibm.com> References: <1225534317.3560.8.camel@johannes.berg> <18723.38125.245930.196074@cargo.ozlabs.ibm.com> Date: Wed, 19 Nov 2008 12:48:38 +0100 Message-Id: <1227095318.26243.17.camel@johannes.berg> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Cc: linuxppc-dev list X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org 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 --- 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) {