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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40331C433FE for ; Fri, 28 Jan 2022 15:21:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346622AbiA1PV6 (ORCPT ); Fri, 28 Jan 2022 10:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245039AbiA1PV4 (ORCPT ); Fri, 28 Jan 2022 10:21:56 -0500 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8466C061714 for ; Fri, 28 Jan 2022 07:21:56 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id c189so5787105qkg.11 for ; Fri, 28 Jan 2022 07:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sXDhGu9GO+2x7oeDXdjJk9+Khk66FD4cDaSrxJDPkgQ=; b=Ye+Jk2yJquDBLp8LprPQrJBQdOyqQmIavIAudC7Jo+Z8qLzg2KN/Cl8zNHin9h9k25 UvuaJxmZidqK71a6+gdYibjoQGKMCJpojtjIQ4QPePRKwDJaITA31o6Llo/B7zqdYueB L2N4d6Cm2XcWc5vw8ISevauEG+SToOAVB3wWjDwF/qik79Xr/hmb+Nh3+vpypi6f2oCV nI2ikry+opEUL2NQImKYYfBWoKqD0ltg9NSuJBLIvYVzseLkTthDQuUyp2i1sciFZLaR YwdLpvg/V57PiOQVQSUw3rMKUEyinWHZoEl6h0nqMow0sZlFCu22kW8Zl1I8gtSm7iv8 MuKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sXDhGu9GO+2x7oeDXdjJk9+Khk66FD4cDaSrxJDPkgQ=; b=6hvj87KxSZcKFbw47Vv09NQ0xaTZqWIHLllbui7ZG+Mk3D7ZW/v/Y9HhjSQiKgChFn KM+Y2IJTvQ57O5knrgU3TBMQCRY8uclOiXQPDV0lDRycS7A8NnsLRnhWuX17plCdKccZ KxXcrwyX3RYct6YVqF9ym4dWTxA5g81lgniqYx+4EmOke6ZBajz4Us0fNLKHlaixMoDh HQnpg47JEsQloBjtAJT3WSNxpID9uSjtesVIlIA6WtWj14eCAqlnyh+hSRIYh8JfGruB OZn2N+H+QZ3M+5cnlwU7AcsLDAEMvLIRprAXYrcf/K+EHF/PZTnc9uwFt8dWgfWcTvnl VnoA== X-Gm-Message-State: AOAM533v0ZU4HE9Njx2G90X/Bv82Nm8WcTOA5bQKo4qkWogCWDCSjDQp kvBqZZIz5JZ7iBV40wMmUsno7/Izw4T/Hy7C X-Google-Smtp-Source: ABdhPJxv1mdf78ujD+RNvg6CT0H+GTKSKjgvzoPABwxeAxNLIDDUs/3Y1SQ9xD2eSW0m0/elkJS61Q== X-Received: by 2002:a05:620a:71b:: with SMTP id 27mr5974535qkc.474.1643383315857; Fri, 28 Jan 2022 07:21:55 -0800 (PST) Received: from mail.google.com ([207.246.89.135]) by smtp.gmail.com with ESMTPSA id m16sm3575782qkp.90.2022.01.28.07.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 07:21:55 -0800 (PST) Date: Fri, 28 Jan 2022 23:21:47 +0800 From: Changbin Du To: Changbin Du Cc: Nathan Chancellor , Masahiro Yamada , Nick Desaulniers , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-riscv@lists.infradead.org Subject: Re: [PATCH] kallsyms: ignore local block labels generated by compiler Message-ID: <20220128152147.mwjkf45z72qwdikq@mail.google.com> References: <20220128105746.2459-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220128105746.2459-1-changbin.du@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 06:57:46PM +0800, Changbin Du wrote: > The llvm compiler can generate lots of local block labels and they might > overlap with C defined symbols. So let's ignore such local labels. > > Before this change, 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 > > After this change, the C defined symbol is shown which is expected: > [ 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 > --- > scripts/kallsyms.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c > index 54ad86d13784..5f4be9d72a32 100644 > --- a/scripts/kallsyms.c > +++ b/scripts/kallsyms.c > @@ -108,6 +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. */ > + ".LBB", /* local block labels generated by compiler */ I aslo found many symbols like '.Ltmpxxx', '.L__unnamed_xx'. So should we just ignore all symbols prefixed by '.L'? > ".LASANPC", /* s390 kasan local symbols */ > "__crc_", /* modversions */ > "__efistub_", /* arm64 EFI stub namespace */ > -- > 2.32.0 > -- Cheers, Changbin Du