linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Kernel functions showing only addresses in `perf` output
@ 2024-07-24 11:11 吴雨薇
  2024-07-26  1:37 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: 吴雨薇 @ 2024-07-24 11:11 UTC (permalink / raw)
  To: linux-perf-users
  Cc: 于佳耕老师, shenzhengdong23

Kernel functions are only showing addresses and not symbols in the sampling output from the `perf` tool.

Environment Information
- Hardware: SG2042
- OS Version: openEuler 23.09
- Kernel Version: Linux openeuler-riscv64 6.6.0+ #1 SMP Wed Apr 3 15:53:06 CST 2024 riscv64 riscv64 riscv64 GNU/Linux
- Perf Version: 6.6.g04f0a6491967
- Kernel Compilation Options:
The following kernel configuration options have been enabled:
CONFIG_PERF_EVENTS
CONFIG_KALLSYMS
CONFIG_KALLSYMS_ALL
CONFIG_FRAME_POINTER
CONFIG_STACKTRACE
CONFIG_DEBUG_INFO

CONFIG_DEBUG_KERNEL



Steps to Reproduce

1. Download Kernel Source Code:
   Clone the kernel source code repository on the Lichee Pi 4A board

2. Install Dependencies:
   Install all necessary development libraries and tools required by `perf`:
   sudo yum install elfutils-libelf-devel -y
   sudo yum install perl-devel -y
   sudo yum install numactl-devel -y
   sudo yum install libbabeltrace-devel -y
   sudo yum install binutils-devel -y
   sudo yum install genwqe-zlib-static -y
   sudo yum install elfutils-devel -y
   sudo yum install slang-devel -y
   sudo yum install zstd-devel -y
   sudo yum install xz-devel -y
   sudo yum install libcap-devel -y
   sudo yum install audit-devel audit-libs -y
   sudo yum install openssl-devel -y
   sudo yum install gtk2-devel -y
   sudo yum install systemtap-sdt-devel -y
   sudo yum install libtraceevent-devel -y
   sudo yum install libpfm -y
   sudo yum install ncurses-devel -y
   sudo yum install java-1.8.0-openjdk-devel -y

3. Compile `perf`:
   cd riscv-kernel/tools/perf
   make ARCH=riscv WERROR=0 -j4

4. Install `perf`:
   sudo cp ./perf /usr/bin/

5. Download `hackbench`

6. Compile `hackbench`:
   gcc -static -O0 -g -fno-omit-frame-pointer hackbench.c -o hackbench -lpthread

7. Run Tests with `perf`:
   Record performance data with `perf` and generate the report:
   sudo perf record -e cpu-cycles -g ./hackbench
   sudo perf report --no-children -G > perf_hackbench.txt


Issue
In the `perf_hackbench.txt` output, you can see that kernel functions show addresses, while user mode functions show function symbol names
96.22%  hackbench  [unknown]          [k] 0xffffffff80cfb2ac

Potential Cause:
It seems that `perf` might be failing to resolve addresses to symbols because it cannot find the addresses in `/proc/kallsyms`.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-29  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 11:11 Kernel functions showing only addresses in `perf` output 吴雨薇
2024-07-26  1:37 ` Namhyung Kim
2024-07-26  2:51   ` 沈郑东
2024-07-29  1:34     ` Namhyung Kim

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).