Issue 151368
Summary [BOLT] [perf2bolt] PERF2BOLT-ERROR: could not find a profile matching binary "vmlinux"
Labels BOLT
Assignees
Reporter MCredbear
    I was trying to use bolt on an Android kernel from [https://github.com/LineageOS/android_kernel_sony_sm8550/tree/lineage-21](url), I did add `--emit-relocs` in `KBUILD_LDFLAGS` and `readelf -S vmlinux | grep debug` seems right:
```
readelf -S vmlinux | grep debug 
  [37] .debug_aranges    PROGBITS 0000000000000000  030db000
  [38] .debug_info       PROGBITS 0000000000000000  030dba70
  [39] .debug_abbrev     PROGBITS 0000000000000000  0fb91e97
  [40] .debug_line       PROGBITS 0000000000000000  0fb97c62
  [41] .debug_frame      PROGBITS 0000000000000000  113a1678
  [42] .debug_str        PROGBITS 0000000000000000  113a59e8
  [43] .debug_loc        PROGBITS 0000000000000000  1186ea10
  [44] .debug_ranges     PROGBITS 0000000000000000  18bcae80
  [57] .rela.debug_info  RELA 0000000000000000  1d1c5b18
  [58] .rela.debug_[...] RELA 0000000000000000  3d4001e8
  [59] .rela.debug_[...] RELA 0000000000000000  3d400cb0
  [60] .rela.debug_line  RELA 0000000000000000  40904f08
  [65] .rela.debug_loc   RELA 0000000000000000  40a87dd0
  [66] .rela.debug_frame RELA 0000000000000000  42d8ede8
```
getting symbol address from `/proc/kallsysms` was also avaliable:
```
XQ-DQ72:/data/local/tmp # cat /proc/kallsyms | grep " T schedule" 
ffffffc00818e730 T schedule_on_each_cpu
ffffffc0081bea58 T schedule_tail
ffffffc0081bf124 T scheduler_tick
ffffffc00974dd44 T schedule
ffffffc00974e488 T schedule_idle
ffffffc00974e4d8 T schedule_preempt_disabled
ffffffc009758db4 T schedule_timeout_uninterruptible
ffffffc009758de8 T schedule_timeout
ffffffc009758f20 T schedule_timeout_killable
ffffffc009758f54 T schedule_timeout_interruptible
ffffffc009758f88 T schedule_timeout_idle
ffffffc00975925c T schedule_hrtimeout_range_clock
ffffffc00975937c T schedule_hrtimeout_range
ffffffc0097593a8 T schedule_hrtimeout
```
my command to run perf:
```
XQ-DQ72:/data/local/tmp # ./perf record -e cycles:k -a -o perf.data 
Couldn't synthesize cgroup events.
^C[ perf record: Woken up 767 times to write data ]
sh: perf-read-vdso32: inaccessible or not found
[ perf record: Captured and wrote 201.022 MB perf.data (3573204 samples) ]
```
but `perf2bolt-19 -p perf.data -o perf.fdata vmlinux` reported:
```
...
BOLT-INFO: binary build-id is:     1890e74ef3a7b8aa94e7338261bbd250828293da
PERF2BOLT: spawning perf job to read buildid list
PERF2BOLT-WARNING: build-id matched a different file name
PERF2BOLT: waiting for perf mmap events collection to finish...
PERF2BOLT: parsing perf-script mmap events output
PERF2BOLT-WARNING: using "[kernel.kallsyms]" for profile matching
PERF2BOLT-ERROR: could not find a profile matching binary "vmlinux". Profile for the following binary name(s) is available:
 ATFWD-daemon
  ExtServices-sminus.apk
  MediaProvider.apk
 NetworkStack.apk
  TetheringNext.apk
(bunch of programs)...
```
in `perf.data`, I could find `[kernel.kallsyms]` with build id `1890e74ef3a7b8aa94e7338261bbd250828293da`
```
perf buildid-list -i perf.data | grep 1890e74ef3a7b8aa94e7338261bbd250828293da
1890e74ef3a7b8aa94e7338261bbd250828293da [kernel.kallsyms]
```

Full log from perf2bolt attatched:
[perf2bolt_log.txt](https://github.com/user-attachments/files/21515242/perf2bolt_log.txt)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to