<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/151368>151368</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [BOLT] [perf2bolt] PERF2BOLT-ERROR: could not find a profile matching binary "vmlinux"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MCredbear
      </td>
    </tr>
</table>

<pre>
    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)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysV99v4joW_mvMy1GQ4xCSPPAApYyq7bRz265m35ATn4BvnTiynXbYv37lBGigtJ0dXYSEcL7znZ_-7HBr5aZGnJF4QeLliLduq83s-5VBkSM3o1yL3ewGX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