<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Eugene,<div class=""><br class=""></div><div class="">Did you ever discover the root cause of this problem? I seeing the same symptoms when using MCJIT.</div><div class=""><br class=""></div><div class="">--Owen<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 18, 2020, at 1:19 AM, Eugene Zhulenev via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Figured out how to make it work, thanks to example in <a href="https://reviews.llvm.org/rG39253a50f0f33e491e2d021f94cd3a87ee773f2d" class="">https://reviews.llvm.org/rG39253a50f0f33e491e2d021f94cd3a87ee773f2d</a><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><i class=""><br class=""></i></div><div class=""><i class="">auto objectLayer = std::make_unique<RTDyldObjectLinkingLayer>(</i></div><div class=""><div class=""><i class=""> session, []() { return std::make_unique<SectionMemoryManager>(); });</i></div></div><div class=""><div class=""><i class="">objectLayer->registerJITEventListener(*llvm::JITEventListener::createPerfJITEventListener());</i></div></div></blockquote><div class=""><br class=""></div><div class="">Previously I was forwarding to JITEventListener::notifyObjectLoaded from objectLayer->setNotifyLoaded callback.</div><div class=""><br class=""></div><div class="">Eugene</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 17, 2020 at 10:58 PM Eugene Zhulenev <<a href="mailto:ezhulenev@google.com" class="">ezhulenev@google.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">I'm trying to use PerfJITEventListener with llvm::orc::LLJITBuilder:<div class=""><br class=""><div class="">1. perf record -o /tmp/perf.data -- <my_binary_with_event_listener></div><div class="">2. perf inject -j -v -i /tmp/perf.data -o /tmp/perf.data.jit</div><div class=""><br class=""></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><div class=""><i class="">jit marker found: ~.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump</i></div></div><div class=""><div class=""><i class="">injecting: ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump</i></div></div><div class=""><div class=""><i class="">write ELF image ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jitted-149849-1.so</i></div></div><div class=""><div class=""><i class="">write ELF image ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jitted-149849-2.so</i></div></div><div class=""><div class=""><i class="">injected: ~/.debug/jit/llvm-IR-jit-20200417-3c2242/jit-149849.dump (0)</i></div></div></blockquote><div class=""><div class=""><br class=""></div><div class="">Generated ELF files have correct .text sections.</div><div class=""><br class=""></div><div class="">However perf report can't find these generated so files:</div><div class=""><br class=""></div><div class="">+ 69.50% 23.82% my_binary [JIT] tid 149849 [.] 0x00007f9c34d5106a<br class="">+ 51.78% 45.69% my_binary [JIT] tid 149849 [.] 0x00007f9c34d51065<br class="">+ 27.71% 6.09% my_binary [JIT] tid 149849 [.] 0x00007f9c34d51060<br class=""></div><div class=""><br class=""></div><div class="">It seems that perf report is looking for a shared object in /tmp/perf-149849.map, but that file doesn't exist.</div><div class=""><br class=""></div><div class="">Looking at examples in the original LLVM change (<a href="https://reviews.llvm.org/D44892?" target="_blank" class="">https://reviews.llvm.org/D44892?</a>), I don't see any mentions of perf.map file.</div></div><div class=""><br class=""></div><div class="">Do I miss something? Are there any examples of how to use perf listener?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Eugene</div></div>
</blockquote></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>