perf symbols: Ignore mapping symbols on riscv
authorHaibo Xu <haibo1.xu@intel.com>
Wed, 9 Apr 2025 02:51:56 +0000 (10:51 +0800)
committerPalmer Dabbelt <palmer@dabbelt.com>
Thu, 5 Jun 2025 18:10:16 +0000 (11:10 -0700)
commit4d6319289e8661a1845dde5d05859afc21ec3ed9
treeb4fff6ff339bbe8b069289dfbc38430ba8654135
parent9eb9ea31fff0f66e5d41b6fe62c4119dc1e580ba
perf symbols: Ignore mapping symbols on riscv

RISCV ELF use mapping symbols with special names $x, $d to
identify regions of RISCV code or code with different ISAs[1].
These symbols don't identify functions, so will confuse the
perf output.

The patch filters out these symbols at load time, similar to
"4886f2ca perf symbols: Ignore mapping symbols on aarch64".

[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/
    master/riscv-elf.adoc#mapping-symbol

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20250409025202.201046-1-haibo1.xu@intel.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
tools/perf/util/symbol-elf.c