From patchwork Fri Jan 28 10:57:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changbin Du X-Patchwork-Id: 12728208 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 53B17C433EF for ; Fri, 28 Jan 2022 10:58:15 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xJWXEEHl94BZXFeRm2pWhWweWjvdjNTt6P2RPoyn7pg=; b=HrjuYqMO8upUpx ch28AUAVfIlbreFrCPaeHApg44ARyKzvov81z4pwJhaXdSF4TI4N6bYRhTU/DxGPLHrkqE3ifdWwr ng3K5hFKKnI7A6bVdx3Oyp7Qo70c4LePGXylCTVrOXd8n7ljKWvhv3x8uqTSETacPtjndK0aFFfSS Y66Zh9+K6pBtAcWfpe1hdQI2oj21wWwkdpqeSU9NhYrAWalixaRmmIIZdaCx3cSX+AM4fgNxDbFi8 6mkYMIh1etmCAgZKERu1zKjEncGup2Obvc9HqiBqldtk8pqpzX1ZMfKH47XaD6PdZOIa0xsudRZwl E46at4pDYS2kaVDQrKNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDOx7-001ZJX-0z; Fri, 28 Jan 2022 10:58:01 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDOx4-001ZIf-Uy for linux-riscv@lists.infradead.org; Fri, 28 Jan 2022 10:58:00 +0000 Received: by mail-qk1-x72b.google.com with SMTP id 71so5174078qkf.4 for ; Fri, 28 Jan 2022 02:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/+SeEyjxwFir/H5f1F7mn87tKlWsYSPhRkGZK9gJ8WQ=; b=idITS+qsEgTSqNSARyHb+MK0YAl2Lqm/wpb3MvDnXngVHUq1mz+rnZ7QdNtndfwy/4 uNyfrv58+iBhnw6pxZPKkFayx4X6V8R1jT8XdorGiKT1UH9Pove0mzucSr6xprNbgHU9 6Nk01dHZv4vyA1HMxj+iqrJxlNtvthBQ5kOfiswGZaZWvu8hymtRi7HBsvbGS9/0yjKT YrPHHIT4By0Npi7M/d4LX7s9Kfk72OV6yfzY7alNXjR3UIjigIBMiCovwY500/flfX3c +Ei8dBGIBRda++OvbQsfCrpbi9LgGLFxDgfXAPrGa2RECeIZtIWqx5Uc7RX4xAnJyzK1 XcWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/+SeEyjxwFir/H5f1F7mn87tKlWsYSPhRkGZK9gJ8WQ=; b=O+JgafFYKZhnS9ZNjZITiN7iYE+/nuBDZOgF5109qjb9tda3Ul/9RmfJzPcrsx0OWt 3tTEwUlHaT1uYJC4wUyS3XKhgBR7+TIEjGL7XPPBLZU/oog0Zk1KHDDheRn1vgvzpta8 2KgLhY4UxFkiUO8RlfJE/JJS2qO5pWt+2C8kseIBdiP60OFEfSa/JkGTF7kRq5WqpUZm u8WD+vgBCvUYfxyZSe/3wSaZ+iXUd6OF3GC3WUsFyk0Y9E+zmtImvlntyttVpERn8Law H/f+iwckEgdMCUDe/lxOtOOAsmyf1+1tliR8SGtCmBqbRQ8OEJgl4OzjQ9R8MB/EThQv mqRA== X-Gm-Message-State: AOAM530KY1Uk6oAXkza04HAeHdS3u3gfiJsm4cDYkg70bHkIRm0Kxi9p vugJdy3R5+tz8UWyNrLdBco9xKFOXUNU3Zir X-Google-Smtp-Source: ABdhPJwAlxxr8DwO9VIhBMkCY9tCwgduZKFXPTJfv+jBpE31Di+Bi3EWZhZvy5bwYqTYzZQsDN44Dw== X-Received: by 2002:a05:620a:1132:: with SMTP id p18mr5276652qkk.543.1643367477079; Fri, 28 Jan 2022 02:57:57 -0800 (PST) Received: from WRT-WX9.. ([207.246.89.135]) by smtp.gmail.com with ESMTPSA id t11sm2932998qkm.77.2022.01.28.02.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 02:57:56 -0800 (PST) From: Changbin Du To: Nathan Chancellor , Masahiro Yamada , Nick Desaulniers Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-riscv@lists.infradead.org, Changbin Du Subject: [PATCH] kallsyms: ignore local block labels generated by compiler Date: Fri, 28 Jan 2022 18:57:46 +0800 Message-Id: <20220128105746.2459-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_025759_019821_FE7324B8 X-CRM114-Status: UNSURE ( 7.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 */ ".LASANPC", /* s390 kasan local symbols */ "__crc_", /* modversions */ "__efistub_", /* arm64 EFI stub namespace */