Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2734713pxb; Mon, 31 Jan 2022 03:11:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyppjahxdUo/Zotgf0U2y1ruvenR5IjRbyjJM1xpm3c87tsK7NIl5f5wLBaR2RAJnW6oe4E X-Received: by 2002:a17:902:8483:: with SMTP id c3mr19784558plo.19.1643627512055; Mon, 31 Jan 2022 03:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627512; cv=none; d=google.com; s=arc-20160816; b=kbCbsLg5OwMKYIPJeVtbsA8RigDu0bKUW0r4LH7Dljzwhd7DnrXG4jKMwJoguHQ7f8 66V9dGYXhH83sa2OnlFGzT2MG+VMfsaJuAiZD+pwCnJz98uLIxoFmWe7YQhnBITt96mP 78WGLdDrK89sYaMj7eqqy7XHEnBUH9NWll+u7XUkkY6An5BtXLqPOAtJZvyHs6rv1pEZ xB8fYqrhxW4kkTu8ocmsVc7g+/9QhGHPZOVY77sHYN8pQYb/6nOgu2NmGpfznZClDtn0 +h2gvWUng3dPZVZir7uDpTOb8xKsrWtc6ktRwTeOmuTIPMRnO0QgN9GpFYyTvv4lHYWr CG1A== 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=sXDhGu9GO+2x7oeDXdjJk9+Khk66FD4cDaSrxJDPkgQ=; b=xk/c3B6Tw432a+bt+YAUN2cf4h/rMir9pwFTEwbEzIxZEurz4O9w8kGn5WeK9WJIJE So8HAdqbrLQ+hjo3IPe4Sas7uA5zcEQslfG9l7FIrQZiBIU40F/BxYVpp5vgVD1JOkS6 ae8TbXU93QxSXLyM46iPfXSGTocL9wDeYpRZnI3wZISjAjuy41iVFraQX2gb5+N5bGJz H00pPiZTF2D7O21+MnoMN4wK0v87f5MtW+lLNgxDKcl1y73FpAPWTBHcuMfN9CzFgmW3 mHjTb1zFcjtWnZSHqNjsQA2lspe1Ewj9LmtmfPlLxBnDD80B2xKQ8D/aS6yQufUV5cn7 9NuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ye+Jk2yJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha2si10891417pjb.70.2022.01.31.03.11.41; Mon, 31 Jan 2022 03:11:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ye+Jk2yJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346508AbiA1PV6 (ORCPT + 99 others); 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-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