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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 38868C00140 for ; Tue, 9 Aug 2022 02:10:39 +0000 (UTC) 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rnteBSdw1VqKtLMxu5ek+WWNzUqlF5thSHqsxeTx+b4=; b=a2hquGny2fsjGJI69blBwSiFeC HAlJW1InJfzgnOrD7tAhSlcADPYF0jDqFF37j4+hPXMK85BGgRFrVCw84MJ/egmtu0r3CPCeXTRY1 /saz1ue7bHbK9ylLi2NanfnFDmRvyKdZi3JYu1gy2Ak2YkTgRU2zLuPty4MWiXoGC8adG1WbArd4O 0xicWv2IVR3NhaSB+J7Ny0GRgymCwXGGN9z29cDO77lnhkzKBuRnWrj8MEPHnIy9eeUlr1kN33FcK v2IFIlhjfgCd9bc9LxMfzLyOudSwkVVmeIW1jhwUhzS4I/werq0dKmtKeL//5uUyjsAW1Xtiwy2B6 JVHQCYgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLEgZ-000Ire-In; Tue, 09 Aug 2022 02:09:35 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLEgV-000Ins-1q for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2022 02:09:33 +0000 Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4M1xKJ4SlrzmVZL; Tue, 9 Aug 2022 10:07:16 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 9 Aug 2022 10:09:18 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 9 Aug 2022 10:09:18 +0800 Subject: Re: [PATCH] ARM: Remove the special printing format of pc and lr in __show_regs() To: "Russell King (Oracle)" CC: , , References: <20220801032016.1524-1-thunder.leizhen@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: <9f630d80-68c7-8816-f2f6-7e39c890c4d1@huawei.com> Date: Tue, 9 Aug 2022 10:09:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220808_190931_494134_FC8ADFAB X-CRM114-Status: GOOD ( 27.96 ) 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 On 2022/8/8 17:41, Russell King (Oracle) wrote: > On Mon, Aug 01, 2022 at 11:20:16AM +0800, Zhen Lei wrote: >> Currently, instruction pointers are printed in [<%08lx>] format to make >> them more visible. However, it is not necessary in __show_regs() because >> they have the prefix 'pc :' or 'lr :', and it is also inconsistent with >> that of other registers, which causes misalignment. > > The formatting is not "to make them more visible" - it was to mark the > addresses that we wanted the ksymoops utility to translate to kernel > symbols before we had kallsyms in the kernel. If one disables kallsyms, > then we still need a way to translate kernel addresses to symbols. I searched the git log and found that the ksymoops utility is discarded. See: 073a9ecb3a73401662430bb955aedeac1de643d1 However, a commit in the pre-git era [1] had added the statement, "ksymoops is useless on 2.6. Please use the Oops in its original format". That statement existed until commit 4eb9241127a0 ("Documentation: admin-guide: update bug-hunting.rst") finally removed the stale ksymoops information. 4eb9241127a0b5ac3aaaf1b246728009527ebc86 - delete all references to ksymoops since it is no longer applicable; > > I notice there is a script which helps with this that is part of the > kernel source - scripts/decode_stacktrace.sh. I haven't tried this on > arm32 since I always use kallsyms - and I suspect that is rather > universally true as it avoids needing System.map files etc to decode > the oops. That said, if you're building a kernel for small systems, > you probably don't want the overhead of kallsyms. Yes, I read scripts/decode_stacktrace.sh, it requires the format "[<...>]". But if that's the only concern, maybe we can do the conversion from "pc: addr" and "lr: addr" to "[]" first in scripts/decode_stacktrace.sh I'm usually "objdump -d vmlinux > asm_file", then search "addr:" in asm_file. Honestly, I think format "[<...>]" is dump_backtrace()'s requirement, not __show_regs()'s. > > So, there's an argument for keeping it - it's an API in that it > provides hints to scripting to identify which values need to be > converted to symbols. There's also the argument for getting rid of it, > which is that hardly anyone does that anymore. > > The question is, which is the more important argument, and I don't > think there's a definite answer. So I'm inclined to leave this > as-is. OK > -- Regards, Zhen Lei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel