PerfJITEventListener needs perf-<pid>.map?

I’m trying to use PerfJITEventListener with llvm::orc::LLJITBuilder:

  1. perf record -o /tmp/ – <my_binary_with_event_listener>
  2. perf inject -j -v -i /tmp/ -o /tmp/

jit marker found: ~.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump

injecting: ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump

write ELF image ~/.debug/jit/llvm-IR-jit-20200417-3c2242/

write ELF image ~/.debug/jit/llvm-IR-jit-20200417-3c2242/

injected: ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump (0)

Generated ELF files have correct .text sections.

However perf report can’t find these generated so files:

  • 69.50% 23.82% my_binary [JIT] tid 149849 [.] 0x00007f9c34d5106a
  • 51.78% 45.69% my_binary [JIT] tid 149849 [.] 0x00007f9c34d51065
  • 27.71% 6.09% my_binary [JIT] tid 149849 [.] 0x00007f9c34d51060

It seems that perf report is looking for a shared object in /tmp/, but that file doesn’t exist.

Looking at examples in the original LLVM change (, I don’t see any mentions of file.

Do I miss something? Are there any examples of how to use perf listener?


Figured out how to make it work, thanks to example in

auto objectLayer = std::make_unique(

session, { return std::make_unique(); });


Previously I was forwarding to JITEventListener::notifyObjectLoaded from objectLayer->setNotifyLoaded callback.


Hi Eugene,

Did you ever discover the root cause of this problem? I seeing the same symptoms when using MCJIT.