Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2542073pxb; Thu, 3 Feb 2022 08:43:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJze3b970M39dXoBu8S7EI9r29z1s7+VGz992kWk7+xTeYHAuEM2bNqS9LXDORSMD73wCYz4 X-Received: by 2002:a05:6a00:15d0:: with SMTP id o16mr34624966pfu.13.1643906604720; Thu, 03 Feb 2022 08:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643906604; cv=none; d=google.com; s=arc-20160816; b=hoPIHzHw+H1OfsF7s4jQHqa+5w/O5zHbNfZGC/fATnPfmaArqsbvAw3QY2NPPovzQg Xa2JwxcO46t9Aa0ohjBGuJeRaWvD5dHaKAzDFO/z1UtLOnRcNbtNvWqvSBWnBkigWI/e 4OzPUZGDoIgftI/QFrHdFd93KICehUWQbnXh2DxDjXY3619O2Xwa7YIpL+NGTwuxHtUj myVZQC7kMB0xlxr8FFMdsQDDy4MajiiDmDfrP0VxE1S1HbvBSIpji1ylohgnY5lRWb6c DxvHiJBqhc0vkLulZ1lMHcQFGxUbiHQNlHEViBu5FZ9JhoPQqjocZTJm28n2ofZ0qLl0 Qz2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hj646ey548v08WPWykl23f8OnpnSjWCUNeYzEdvSD0k=; b=KkVWwGgmz6BJdOG3ZHC7R2rQJN+4IyhxpGpm7mDbdcHYxhSEInlr4Jne2KbFEjn7jj QJEJq3V1AT8I3WgZX7UYIUUzceI498QdRhtNmOo3DS5Pj8Yp4//6MJf2eF/p3y296KNv SmGdWxoRM3GnarM5VMAeDqW5fWTK6tGTcFMv8ZiAaBBXBOpQ5Jvcn+R359t8kTTwBOy4 2cIIOzxP2so4jd/+M9PLUCqJBlPPzXOllxW1hXZiA1NbxukySE+hwd8FG2no2Ua2L6Y8 Y7kpKlOPdMfKb/fkZ6DEhVAZmivWI2wOrBtlZol+mDPYjUmO4VUGZXx4p65Ugrh/tIVC eAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rwNVGsae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fa20si7917067pjb.76.2022.02.03.08.43.10; Thu, 03 Feb 2022 08:43:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rwNVGsae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241140AbiBAQdx (ORCPT + 99 others); Tue, 1 Feb 2022 11:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241123AbiBAQdu (ORCPT ); Tue, 1 Feb 2022 11:33:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C217C061714 for ; Tue, 1 Feb 2022 08:33:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EBE5BB82EF0 for ; Tue, 1 Feb 2022 16:33:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 620EFC340EB; Tue, 1 Feb 2022 16:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643733227; bh=Arb/BWLua2YlFsMeKijCGl7aXZyD3XcJWl8aMJ/fCGA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rwNVGsaezjiDoPndaeYAKZLw+SBLpc15zCQwh5u0NUK9/UhllQpERXi5FdRjcr/fZ 5DTM5DUPZAxX49dkyt9xlyL0OhLbH/TY1XIRauJfYN8SwjpoOafocGp5AlafmHF8n6 hmFFlOtRoVenPbnobV8qNQIqcD1/CNb8GzKUhPzuHUFg7UnKCr++AhL4L2aJd0DqZG 0QqTT9UrN7HHlLzmyGia47qOxZ0QDUse7FvX/rWfVbthFw8p2EOoCh7YbVojrUb6xS aXpJtZk4CKy9sAAfGnO7OTE8GsW3I5YffMLpJwYsjdAenuVQ3HSo75vfpIsYWCtNft 5lLHaFo7LIZoA== Date: Tue, 1 Feb 2022 09:33:43 -0700 From: Nathan Chancellor To: Changbin Du Cc: Nick Desaulniers , Masahiro Yamada , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [PATCH] kallsyms: ignore all local labels prefixed by '.L' Message-ID: References: <20220201013257.17926-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220201013257.17926-1-changbin.du@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 01, 2022 at 09:32:57AM +0800, Changbin Du wrote: > The llvm compiler can generate lots of local labels ('.LBB', '.Ltmpxxx', > '.L__unnamed_xx', etc.). These symbols usually are useless for debugging. > And they might overlap with handwritten symbols. > > Before this change, a dumpstack shows a local symbol for epc: > [ 0.040341][ T0] Hardware name: riscv-virtio,qemu (DT) > [ 0.040376][ T0] epc : .LBB6_14+0x22/0x6a > [ 0.040452][ T0] ra : restore_all+0x12/0x6e > > The simple solution is that we can ignore all local labels prefixed by '.L'. > For handwritten symbols which need to be preserved should drop the '.L' > prefix. > > After this change, the C defined symbol is shown so we can locate the > problematical code immediately: > [ 0.035795][ T0] Hardware name: riscv-virtio,qemu (DT) > [ 0.036332][ T0] epc : trace_hardirqs_on+0x54/0x13c > [ 0.036567][ T0] ra : restore_all+0x12/0x6e > > Signed-off-by: Changbin Du Does not seem too unreasonable to me. Reviewed-by: Nathan Chancellor > --- > scripts/kallsyms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c > index 54ad86d13784..8caabddf817c 100644 > --- a/scripts/kallsyms.c > +++ b/scripts/kallsyms.c > @@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type) > /* Symbol names that begin with the following are ignored.*/ > static const char * const ignored_prefixes[] = { > "$", /* local symbols for ARM, MIPS, etc. */ > - ".LASANPC", /* s390 kasan local symbols */ > + ".L", /* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ > "__crc_", /* modversions */ > "__efistub_", /* arm64 EFI stub namespace */ > "__kvm_nvhe_", /* arm64 non-VHE KVM namespace */ > -- > 2.32.0 > >