linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Benno Lossin" <lossin@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Gary Guo" <gary@garyguo.net>, "Trevor Gross" <tmgross@umich.edu>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Ian Rogers" <irogers@google.com>,
	"James Clark" <james.clark@linaro.org>,
	"Jiri Olsa" <jolsa@kernel.org>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/1] perf symbols: Handle '1' symbols in /proc/kallsyms
Date: Thu, 6 Nov 2025 17:25:40 -0300	[thread overview]
Message-ID: <aQ0ERJiTpiA_rL5D@x1> (raw)
In-Reply-To: <aQltxZIVd6w5VNtI@google.com>

On Mon, Nov 03, 2025 at 07:06:45PM -0800, Namhyung Kim wrote:
> On Mon, Nov 03, 2025 at 03:03:23PM -0300, Arnaldo Carvalho de Melo wrote:
> > Just FYI, I'm carrying this on the perf tools tree.

> > I started seeing this in recent Fedora 42 kernels:

> >   root@x1:~# uname -a
> >   Linux x1 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux
> >   root@x1:~#

> >   root@x1:~# perf test 1
> >     1: vmlinux symtab matches kallsyms     : FAILED!
> >   root@x1:~#

> > Related to:

> >   root@x1:~# grep ' 1 ' /proc/kallsyms
> >   ffffffffb098bc00 1 __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   ffffffffb098bc10 1 _RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   root@x1:~#

> > That is found in:
 
> >   root@x1:~# pahole --running_kernel_vmlinux
> >   /usr/lib/debug/lib/modules/6.17.4-200.fc42.x86_64/vmlinux
> >   root@x1:~#
 
> >   root@x1:~# readelf -sW /usr/lib/debug/lib/modules/6.17.4-200.fc42.x86_64/vmlinux | grep __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   150649: ffffffff81f8bc00    16 FUNC    LOCAL  DEFAULT    1 __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   root@x1:~#
> > 
> > But was being filtered out when reading /proc/kallsyms, as the '1'
> > symbol type was not being handled, do it, there are just two of them at
> > this point.
> 
> Do you know what the type '1' means?  It seems they are from Rust.

They are related to anonymous Rust closures in the QR encoder for the
DRM panic, this part:

drivers/gpu/drm/drm_panic_qr.rs

    fn from_segments(segments: &[&Segment<'_>]) -> Option<Version> {
        (1..=40)
            .map(Version)
            .find(|&v| v.max_data() * 8 >= segments.iter().map(|s| s.total_size_bits(v)).sum())
    }

That 

Using rustfilt we get:

core::iter::adapters::map::map_try_fold::<usize, drm_panic_qr::Version, (), core::ops::control_flow::ControlFlow<drm_panic_qr::Version>, drm_panic_qr::Version, core::iter::traits::iterator::Iterator::find::check<drm_panic_qr::Version, <drm_panic_qr::Version>::from_segments::{closure#0}>::{closure#0}>::{closure#0}
#

Both are for the same symbol, the __pfx__ is to do some stack probing.
LLVM may introduce this for other reasons.

So far, '1' symbols are Rust symbols, in the Linux kernel, for unnamed
closures and its prefix code checking for stack space, Miguel, do you
have something to add?

- Arnaldo

  reply	other threads:[~2025-11-06 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 18:03 [PATCH 1/1] perf symbols: Handle '1' symbols in /proc/kallsyms Arnaldo Carvalho de Melo
2025-11-04  3:06 ` Namhyung Kim
2025-11-06 20:25   ` Arnaldo Carvalho de Melo [this message]
2025-11-07  1:35     ` Miguel Ojeda
2025-11-11 21:16       ` Miguel Ojeda
2025-11-11 21:20         ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQ0ERJiTpiA_rL5D@x1 \
    --to=acme@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).