perf symbols: Handle 'N' symbols in /proc/kallsyms
Subsystems (2)
Arnaldo Carvalho de Melo
maintainerPATCH 1/1 perf symbols: Handle 'N' symbols in /proc/kallsyms
I started seeing this in recent Fedora 42 kernels:
# uname -a
Linux number 6.16.3-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Aug 23 17:02:17 UTC 2025 x86_64 GNU/Linux
#
# perf test vmlinux
1: vmlinux symtab matches kallsyms : FAILED!
#Rust is enabled and these were the symbols causing the above failure, i.e. found in vmlinux but not in /proc/kallsyms:
$ grep -w N /proc/kallsyms 0000000000000000 N __pfx__RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ 0000000000000000 N _RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ $
So accept those 'N' symbols as well.
About them, from 'man nm':
"N" The symbol is a debugging symbol.
"n" The symbol is in a non-data, non-code, non-debug read-only section.
--- tools/perf/util/symbol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/perf/util/symbol.c +6 -1
@@ -107,9 +107,14 @@ static enum dso_binary_type binary_type_symtab[] = {static bool symbol_type__filter (char __symbol_type) {// Since 'U' == undefined and 'u' == unique global symbol, we can't use toupper there +// 'N' is for debugging symbols, 'n' is a non-data, non-code, non-debug read-only section. +// According to 'man nm'. +// 'N' first seen in: +// ffffffff9b35d130 N __pfx__RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ +// a seemingly Rust mangled name char symbol_type =toupper (__symbol_type);return symbol_type =='T' || symbol_type =='W' || symbol_type =='D' || symbol_type =='B' || - __symbol_type =='u' || __symbol_type =='l' ; + __symbol_type =='u' || __symbol_type =='l' || __symbol_type =='N' ; }static int prefix_underscores_count (const char *str)
Signature · 1 line
2.51.0
Quoted 26 lines · Arnaldo Carvalho de Melo
I started seeing this in recent Fedora 42 kernels:
# uname -a Linux number 6.16.3-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Aug 23 17:02:17 UTC 2025 x86_64 GNU/Linux # # perf test vmlinux 1: vmlinux symtab matches kallsyms : FAILED! #Rust is enabled and these were the symbols causing the above failure, i.e. found in vmlinux but not in
/proc/kallsyms:$ grep -w N /proc/kallsyms 0000000000000000 N __pfx__RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ 0000000000000000 N _RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ $So accept those 'N' symbols as well.
About them, from 'man nm':
"N" The symbol is a debugging symbol.
"n" The symbol is in a non-data, non-code, non-debug read-only section.
Quoted 8 lines
Cc Adrian Hunter <[email protected]>Cc Ian Rogers <[email protected]>Cc Miguel Ojeda <[email protected]>Cc James Clark <[email protected]>Cc Jiri Olsa <[email protected]>Cc Kan Liang <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
Thanks,
Ian
Quoted 27 lines
--- tools/perf/util/symbol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)tools/perf/util/symbol.c +6
-2@@ -107,9 +107,14 @@ static enum dso_binary_type binary_type_symtab[] = {static bool symbol_type__filter (char __symbol_type) {// Since 'U' == undefined and 'u' == unique global symbol, we can't use toupper there +// 'N' is for debugging symbols, 'n' is a non-data, non-code, non-debug read-only section. +// According to 'man nm'. +// 'N' first seen in: +// ffffffff9b35d130 N __pfx__RNCINvNtNtNtCsbDUBuN8AbD4_4core4iter8adapters3map12map_try_foldjNtCs6vVzKs5jPr6_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_ +// a seemingly Rust mangled name char symbol_type =toupper (__symbol_type);return symbol_type =='T' || symbol_type =='W' || symbol_type =='D' || symbol_type =='B' || - __symbol_type =='u' || __symbol_type =='l' ; + __symbol_type =='u' || __symbol_type =='l' || __symbol_type =='N' ; }static int prefix_underscores_count (const char *str) --2.51.0
Quoted 2 lines · Arnaldo Carvalho de Melo
+ // a seemingly Rust mangled name
Yeah, it is a Rust mangled symbol:
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}
From your grep, it seems that is the only one you see? If so, it would be nice to understand why.
Cheers,
Miguel
Quoted 8 lines · Miguel Ojeda
Quoted 2 lines · Arnaldo Carvalho de Melo
+ // a seemingly Rust mangled name
Yeah, it is a Rust mangled symbol:
core::iter::adapters::map::map_try_fold::<usize,
Quoted 8 lines
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}From your
grep, it seems that is the only one you see? If so, it would be nice to understand why.
Nope, there are 2 lines in the commit message, both zeroed as I did it as !root, I can see them as root.
Cheers,
- Arnaldo
Quoted 2 lines · Arnaldo Carvalho de Melo
Nope, there are 2 lines in the commit message, both zeroed as I did it as !root, I can see them as root.
Not sure I follow -- what I meant was whether you saw other N symbols apart from that one (and its __pfx_ prefixed variant).
Thanks!
Cheers,
Miguel