From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1990FC47087 for ; Fri, 28 May 2021 11:10:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3350613C9 for ; Fri, 28 May 2021 11:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3350613C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=g2SgDZNMsJt685ZWH5mC6+2h6RNP6aSqi6wdsyWKCBQ=; b=t7cLJqOfI2sxZP diZcvqyG0rjuCf3l47Eucnw9hAmJ5tlwJNoj7uMin5cybUtvogk9jV21OWbFiDoA8BVJVhAmEI2NG IQQS9KlgzTxMWg1Fix31huT9DefxvHYNL4zgFVP2CyCOXarz76x/z1Pz0OLepTbv/qtNndmYI4pgg bTZV7TiUIn1ZACYaU2cV7Oxq6iY3WfHKlCV9NXyWWpRgknWOtHJXxi5XgQ2NgTgOB5ubcXK+z+GUi I8CiKrmifl8TSAP5WGTiWGnEZ59s0nu2jdV8BZzQv7+pdknrRFAHHW6UKAGQIWEaKVTVcOVKVJ3jX /tjY/IBMg9wPAE2P9i3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmaLm-00EgKQ-Ka; Fri, 28 May 2021 11:08:25 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmZXY-00EIZ2-Es for linux-arm-kernel@lists.infradead.org; Fri, 28 May 2021 10:16:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:To:From:Reply-To:Cc:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2Smz0XavOqG5VDGuIUEIbx4uHfvdEKP0GCJd7n29z5M=; b=VDMsK0H9LceCsuqbI+A62EjsE/ pggzxEuhI08YtaCrHQ5oD2Y+7NEVKM1gtlfhzVmiEoCXna7jHbh7cnkJ8FPeh9RKxZmF/y/XO5JZF 4KxmKV6LbWjz6NIj9ppX1dSXNE1cmRWRzAAp1ilOddR9pUMmGlMD82gc/QNr4iDrYa6UC2YAoilyb 0i2L03qlrpl/3q4C2daD46rve3B6Z0Nui2dTYVX5+ODnAkKfLxMioMjwNDEvejRimGn6U0xWimGxE z2QOw9RyBZ4L6CpJSi8hiYQ2cMrfGAX6fzVSpj6QxUx8196gwoNZAUa8ceRHnkdT9plVwsDKhW5o/ mCANUOgQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:57334 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmZXW-0008HV-3R; Fri, 28 May 2021 11:16:26 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lmZXV-0005XG-Sl; Fri, 28 May 2021 11:16:25 +0100 From: "Russell King (Oracle)" To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: reduce the information printed in call traces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 28 May 2021 11:16:25 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210528_031628_545415_07FA74C1 X-CRM114-Status: GOOD ( 15.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A while back, Linus complained about the numeric values printed by the ARM backtracing code. Printing these values does not make sense if one does not have access to the kernel ELF image (as is normally the case when helping a third party on a mailing list), but if one does, they can be very useful to find the code, rather than searching for the function name, and then doing hex math to work out where the backtrace entry is referring to. Provide an option to control whether this information is included, which will only be visible if EXPERT is enabled. Signed-off-by: Russell King (Oracle) --- arch/arm/Kconfig.debug | 11 +++++++++++ arch/arm/kernel/traps.c | 8 +++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index c56970cf17ac..0c809360a573 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -79,6 +79,17 @@ endchoice config ARM_UNWIND bool +config BACKTRACE_VERBOSE + bool "Verbose backtrace" + depends on EXPERT + help + When the kernel produces a warning or oops, the kernel prints a + trace of the call chain. This option controls whether we include + the numeric addresses or only include the symbolic information. + + In most cases, say N here, unless you are intending to debug the + kernel and have access to the kernel binary image. + config FRAME_POINTER bool diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index fe5c63b49013..e829263425e3 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -68,12 +68,14 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, { unsigned long end = frame + 4 + sizeof(struct pt_regs); -#ifdef CONFIG_KALLSYMS +#ifndef CONFIG_KALLSYMS + printk("%sFunction entered at [<%08lx>] from [<%08lx>]\n", + loglvl, where, from); +#elif defined CONFIG_BACKTRACE_VERBOSE printk("%s[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", loglvl, where, (void *)where, from, (void *)from); #else - printk("%sFunction entered at [<%08lx>] from [<%08lx>]\n", - loglvl, where, from); + printk("%s %ps from %pS\n", loglvl, (void *)where, (void *)from); #endif if (in_entry_text(from) && end <= ALIGN(frame, THREAD_SIZE)) -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel