hotspot icon indicating copy to clipboard operation
hotspot copied to clipboard

elf files created by perf inject are not read correctly

Open lievenhey opened this issue 1 year ago • 4 comments

Describe the bug hotspot cant read the symbols created by perf inject.

failed to report elf for pid = 118447 : ElfInfo{localFile="/home/lieven/.debug/tmp/jitted-118447-38.so/062a186662248dc7250a8b3a99466d52e08db2df/elf", isFile=true, originalFileName="jitted-118447-38.so", originalPath="/tmp/jitted-118447-38.so", addr=7f9a85782570, len=80, pgoff=40, baseAddr=n/a} : No ELF program headers

To Reproduce

  1. create a file named test.dart with the following content:
void main() {
  print("Hello World");
}
  1. run perf record --call-graph dwarf -k 1 dart --generate-perf-jitdump test.dart
  2. run perf inject -j -i perf.data -o perf.data.jitted
  3. read a book or two
  4. open perf.data.jitted with hotspot

Expected behavior hotspot is able to read the files created by perf inject

Screenshots If applicable, add screenshots to help explain your problem.

Version Info (please complete the following information):

  • Linux Kernel version: 5.18.14-arch1-1
  • perf version: 5.18.g4b0986a3613c
  • hotspot version (appimage? selfcompiled?): 1.3.80 - selfcompiled
  • if self-compiled hotspot, what version of elfutils: 2.38

Additional context file reports:

/home/lieven/.debug/tmp/jitted-96698-38.so/e5a9ae846f6b0e6cff2026576633b9f746ea86be/elf: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), no program header, BuildID[sha1]=e5a9ae846f6b0e6cff2026576633b9f746ea86be, with debug_info, not stripped

nm reports on the same file:

0000000000000040 t CallToRuntime

objdump can also open that file

lievenhey avatar Aug 12 '22 14:08 lievenhey