Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1086709pxb; Tue, 1 Feb 2022 18:04:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRHTCBLB0JZEvdKKgoLHf1g1sJCJdP9BNyn6+XDlBu5QXJgjx5Huy6vH+FMWYkiFiZzpbB X-Received: by 2002:a65:67ce:: with SMTP id b14mr22794138pgs.360.1643767468792; Tue, 01 Feb 2022 18:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643767468; cv=none; d=google.com; s=arc-20160816; b=d2jiLBz2AhO1wH0SODQ3g+4w/7mbvwVWhqW5KGdx8XAcwQQ1GnBqpjZGQRE8eU8IJB 6l12xllMolJPr+qH9ZqlKPzR38Nk+Sgi8d9hYuLfuw3wL+6r4jj91vanese8198pqcWP /D26bhoPLKp+jNBrJHWpaF0dAxQX/CbWydKWZis7V0HJvcdtcIPWLtSlOAnQnVGK0Yw9 q6sSMCovJZsxUSZqvV8vbO7lwJcj/I6O3CMR/O7EQhtzwirWlw6+xSGviFjPMUBU8JTw jtHCK8EMarsqEoWf1T+yMx7EvJtTL9C9v+gbEW+H7Dt1yH0hpImEKs0TTQk27tgX8iw2 Flmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MoWm32zvhEyqRVmUpa5LXZEYybwAAQFRmq/wU8a+Gt4=; b=CoPWHEg7Cukv4oCh0U2XMPlw9xFzpKtQRbUHsw+Kwjs7BPyPBZ6XU5qk1+S8nrf/OZ +nvztQVSGGuTWADt1WsJUqZQdj5nz4jBCOzQux980i5ssnJcClCadEE7NviDW1u7x+/I yad1DHINZYpELzkCL4jZrgNmv4LXj/zDNGfLUDnEoRBLyO20LVXNPYYfWWT+cw2EQnNz GQw07hRkStrnLXxbGj9oOTX/ga+KsIcEuVHcnfRlUaOJR3btYiAna7aDdypbti0+MbmU sBPe7K+obL8C0nRUaXdYwNEpHa0oj+n6fGHLYXUlnLX1C3oHzpneGsyOpZqaN4eMOU4A yBFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EgGzc5rt; 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 k15si21631466pga.245.2022.02.01.18.03.54; Tue, 01 Feb 2022 18:04:28 -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=EgGzc5rt; 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 S231876AbiBABdG (ORCPT + 99 others); Mon, 31 Jan 2022 20:33:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231829AbiBABdG (ORCPT ); Mon, 31 Jan 2022 20:33:06 -0500 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D3BDC061714 for ; Mon, 31 Jan 2022 17:33:06 -0800 (PST) Received: by mail-qt1-x833.google.com with SMTP id s1so14364qtw.9 for ; Mon, 31 Jan 2022 17:33:06 -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=MoWm32zvhEyqRVmUpa5LXZEYybwAAQFRmq/wU8a+Gt4=; b=EgGzc5rt8LRF5c2Eif2fVlYrh9HTecIoACGjTA6wXsMIE5Cq6qPShWc2VkeRIbLQLJ NzdWdQo2IAl4ibTNTDpXspNbyJX8M4MXNhOrJdH7s1L6p52qZ4QQmdA9tPnPO84GtTBx t7MPx8RQAxDA9goxsppgIVZ+UrbAWYJM/6BsuBOZkSZXcDSdMWpTIxG/j+/nhuMs3Lqj 3/1dB0rzc7uOB2csLmqRxJfM1rzyDgXH68UG9wViOR32SdzStDiwpIWGxdl9ILrg8+5K qn0HtVvCShbOisPior89CQpUSaHiw49SefIEMrjQqmB2DRVai7BMhol9HGp4yJaVyAvZ B1yQ== 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=MoWm32zvhEyqRVmUpa5LXZEYybwAAQFRmq/wU8a+Gt4=; b=6H7YPR+tj4ZrSyqoJ/7nEOeWTVx7hr2FtBqvNDvOe0qQFa/um9yYk4KshooTIsjFLd mK3W1ikCFIL2Jv3DaszDliua9DhU7IoXg/rmO3b0tClHuwvaC25mrO5RojcUBzQJE41v bGYRakCdsQjYBs0V47e61wI8xuwiw1oNuhFgCO36d6xb32u7OOUum+aOd9G+tB2iwneq FPK0/craCDrD8Kz42gxNPNQeRxzyNVgPduLx2csJUev/uM121rUqPfb1uoWvq52ird+0 83QE1xKley/rKfjsNHAMBmN8s4zdVPHS35Ksot7tLIVhFB2Vuls6m40jqBhu7A3Q0c6N NHcQ== X-Gm-Message-State: AOAM531KkH7kCpzRA4UIyE4QFcH6dIvY7j4uzaz2ws2TMh2DH/m4Qjvd 3+mUQysStLAmGimGas3bhPiFOGSWJM6hPOVk X-Received: by 2002:a05:622a:1881:: with SMTP id v1mr17345340qtc.683.1643679185259; Mon, 31 Jan 2022 17:33:05 -0800 (PST) Received: from WRT-WX9.. ([207.246.89.135]) by smtp.gmail.com with ESMTPSA id v73sm9272458qkb.51.2022.01.31.17.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:33:04 -0800 (PST) From: Changbin Du To: Nick Desaulniers , Nathan Chancellor , Masahiro Yamada Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, Changbin Du Subject: [PATCH] kallsyms: ignore all local labels prefixed by '.L' Date: Tue, 1 Feb 2022 09:32:57 +0800 Message-Id: <20220201013257.17926-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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