From nobody Sat Feb 7 18:15:44 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 227E92D97BB; Tue, 23 Dec 2025 17:54:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766512499; cv=none; b=hoYpbtFKS8cnxJnfdpxe20RMHoIvYVSW0RCxb21pdajHACx9Szspzzbg9kPvqiQgz8gyJ/+2jBM+KwIHTXU5Tv7h78oVJ3v0FhNGiHROeoqsLxM+QwspnoQ/X69HWpKXTeVubadCeYBFvveXBclnxBJ/4MoaN/J9+UApOhNGw08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766512499; c=relaxed/simple; bh=XLM2fikAcavvgjUlqwc5tL6SD3nCDVnUcFY/V0XJ4HY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kjm9YZj1+JbIgMz5430PX0IWZn0gU4BiwlcMGQeKyYpUdzCej+7J2ILPNgbsutpzkNu99VgHXEDgwSQkAGPjIjxUnW3gliziUeCKxKCUoWQ+uS0W4hC5YURmgyCFjQbi3k3L8WLs66QuxL4zC1rNaiTMGGxemvvKPqeT9QdFS0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZWF5rpw4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZWF5rpw4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BCA7C116B1; Tue, 23 Dec 2025 17:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766512498; bh=XLM2fikAcavvgjUlqwc5tL6SD3nCDVnUcFY/V0XJ4HY=; h=From:To:Cc:Subject:Date:Reply-To:From; b=ZWF5rpw4IlCT9luOR7eqj2o3IOokxIpGUpbyMj8xqkHECttuE9k6EavV6nDS+ZVkY V6neOwj5ZMW0aBeqj8CtykSZa6oUhiJCDSjxCkgIzQLDqTkL2XwamdxMxSSOUqhbXU GvN7QOJZzM32cVy8wf8Bw3OKKyNx9Xzux+9MNgaBVyyHJiv/hQQKhTNd1ETFHkBJkP U881tHlB8BfyX5fhjtiT/szW7hGDqOWPHREf2K2sJSbFIP6+sXuNkZqlx7KpAbBJcl d2H7arKE/4aoGztdcX5vwLPKsez9cxuB6f18IRVdr5UPJsXIEAMvuoCd/XAktio7ha N/gsnsdXUrOpw== From: Gary Guo To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andi Kleen , Dmitry Vyukov , Stephen Brennan Cc: Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] perf symbol: remove Rust symbol workarounds Date: Tue, 23 Dec 2025 17:52:10 +0000 Message-ID: <20251223175216.1353814-1-gary@kernel.org> X-Mailer: git-send-email 2.51.2 Reply-To: Gary Guo Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gary Guo Due to an off-by-one error introduced in commit 73bbb94466fd ("kallsyms: support "big" kernel symbols"), long symbols (which are currently only produced by Rust) can have their symbol type being wrongly parsed by kernel/kallsyms.c. This has been fixed in commit f3f9f42232dee5 ("kallsyms: Fix wrong "big" kernel symbol type read from procfs"), and these symbols are now reported correctly. Drop the workaround in perf symbol that filter out these symbol types. Specifically, '1' and 'l' can never be generated by nm -- 'u' does indicate GNU unique, however such symbols are only generated by G++ for C++ templates, and are never generated by LLVM (LLVM generates weak symbols in such cases instead). Therefore, the previous occurrence of these symbols types must be due to the off-by-error and can be safely removed. Cc: Arnaldo Carvalho de Melo Cc: Miguel Ojeda Signed-off-by: Gary Guo Acked-by: Miguel Ojeda --- tools/perf/util/symbol.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 814f960fa8f8d..eabb218b4e195 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -106,19 +106,8 @@ static enum dso_binary_type binary_type_symtab[] =3D { =20 static bool symbol_type__filter(char __symbol_type) { - // Since 'U' =3D=3D undefined and 'u' =3D=3D unique global symbol, we can= 't use toupper there - // 'N' is for debugging symbols, 'n' is a non-data, non-code, non-debug r= ead-only section. - // According to 'man nm'. - // 'N' first seen in: - // ffffffff9b35d130 N __pfx__RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapter= s3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12= control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Itera= tor4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ - // a seemingly Rust mangled name - // Ditto for '1': - // root@x1:~# grep ' 1 ' /proc/kallsyms - // ffffffffb098bc00 1 __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapter= s3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12= control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Itera= tor4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ - // ffffffffb098bc10 1 _RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map1= 2map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12contro= l_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4fi= nd5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ char symbol_type =3D toupper(__symbol_type); - return symbol_type =3D=3D 'T' || symbol_type =3D=3D 'W' || symbol_type = =3D=3D 'D' || symbol_type =3D=3D 'B' || - __symbol_type =3D=3D 'u' || __symbol_type =3D=3D 'l' || __symbol_t= ype =3D=3D 'N' || __symbol_type =3D=3D '1'; + return symbol_type =3D=3D 'T' || symbol_type =3D=3D 'W' || symbol_type = =3D=3D 'D' || symbol_type =3D=3D 'B'; } =20 static int prefix_underscores_count(const char *str) base-commit: b927546677c876e26eba308550207c2ddf812a43 --=20 2.51.2