From patchwork Thu Nov 20 13:24:07 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 9857 X-Patchwork-Delegate: paulus@samba.org 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 3AC80474F4 for ; Fri, 21 Nov 2008 04:55:51 +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 C6920DDDD4 for ; Fri, 21 Nov 2008 04:53:12 +1100 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1L3DiG-0002LV-3S; Thu, 20 Nov 2008 18:53:08 +0100 Subject: [PATCH v3] powerpc: allow configuring max stack dump depth From: Johannes Berg To: Paul Mackerras In-Reply-To: <18724.36588.435729.738363@cargo.ozlabs.ibm.com> References: <1225534317.3560.8.camel@johannes.berg> <18723.38125.245930.196074@cargo.ozlabs.ibm.com> <1227095318.26243.17.camel@johannes.berg> <18724.36588.435729.738363@cargo.ozlabs.ibm.com> Date: Thu, 20 Nov 2008 14:24:07 +0100 Message-Id: <1227187447.14852.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 --- 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) {