I believe the perf tool cannot profile/analyze the JITed code in MCJIT model. Can you please confirm this ? I was working on a patch to fix this. Another question, is the there any support to map the llvm IR with x86 generated assembly ? so its easier to analyze the code generator. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140521/56522289/attachment.html>
I think you can profile code generated with MCJIT using either oprofile or Intel® VTune™ Amplifier XE, but you need to do a special build of LLVM to enable it. If you want to enable another performance tool, you can look at the code in lib/ExecutionEngine/OProfileJIT or lib/ExecutionEngine/IntelJITEvents to get an idea of how to do it. The IntelJITEvents implementation is a bit more complete, in that it makes use of generated DWARF information if it is available. Speaking of DWARF information, Daniel Malea wrote a pass called DebugIR that if I recall correctly writes an IR file to disc and associates debug information with it as if that were the source file. You should be able to make that work with any DWARF-based tool to analyze the generated code. -Andy From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of sathvik Sent: Wednesday, May 21, 2014 6:20 PM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] perf tool support in MCJIT I believe the perf tool cannot profile/analyze the JITed code in MCJIT model. Can you please confirm this ? I was working on a patch to fix this. Another question, is the there any support to map the llvm IR with x86 generated assembly ? so its easier to analyze the code generator. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140522/31d22681/attachment.html>
FWIW, Mesa3D has some LLVM <-> linux perf integration (and disassembly output too). This responsibility can and probably should be moved upstream to LLVM though. For more information see: http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp#n411 http://cgit.freedesktop.org/mesa/mesa/tree/bin/perf-annotate-jit Jose ----- Original Message -----> I believe the perf tool cannot profile/analyze the JITed code in MCJIT model. > > Can you please confirm this ? I was working on a patch to fix this. > > Another question, is the there any support to map the llvm IR with x86 > generated assembly ? so its easier to analyze the code generator. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu > https://urldefense.proofpoint.com/v1/url?u=http://llvm.cs.uiuc.edu/&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=pz7CBYMkf0bQ61TAbfTPU3%2BwAe0NO%2FxowmgMa60gjdM%3D%0A&s=0666cf509d2a9468bf6c6c0b283081b5e68c8a70b7dda01f2d6835c50fee7347 > https://urldefense.proofpoint.com/v1/url?u=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=pz7CBYMkf0bQ61TAbfTPU3%2BwAe0NO%2FxowmgMa60gjdM%3D%0A&s=a89ce7b4673ff5778ccddcd60e3da0b52402bcd1bd132301fcb2ecffb64cc62f >
Hi Jose, with the MCJIT model, the size of the functions can be pre-determined, so there wouldn't be a need to call the slower disassemble subroutine. I will try writing a simpler patch and submit it and perhaps it can be up streamed. Thanks sathvik On Fri, May 23, 2014 at 3:11 AM, Jose Fonseca <jfonseca at vmware.com> wrote:> FWIW, Mesa3D has some LLVM <-> linux perf integration (and disassembly > output too). This responsibility can and probably should be moved upstream > to LLVM though. > > For more information see: > > http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp#n411 > http://cgit.freedesktop.org/mesa/mesa/tree/bin/perf-annotate-jit > > Jose > > ----- Original Message ----- > > I believe the perf tool cannot profile/analyze the JITed code in MCJIT > model. > > > > Can you please confirm this ? I was working on a patch to fix this. > > > > Another question, is the there any support to map the llvm IR with x86 > > generated assembly ? so its easier to analyze the code generator. > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu > > > https://urldefense.proofpoint.com/v1/url?u=http://llvm.cs.uiuc.edu/&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=pz7CBYMkf0bQ61TAbfTPU3%2BwAe0NO%2FxowmgMa60gjdM%3D%0A&s=0666cf509d2a9468bf6c6c0b283081b5e68c8a70b7dda01f2d6835c50fee7347 > > > https://urldefense.proofpoint.com/v1/url?u=http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=pz7CBYMkf0bQ61TAbfTPU3%2BwAe0NO%2FxowmgMa60gjdM%3D%0A&s=a89ce7b4673ff5778ccddcd60e3da0b52402bcd1bd132301fcb2ecffb64cc62f > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140527/c69354fd/attachment.html>
Hi Andrew, Thanks for the pointer. I have tried the OProfileJIT agent in LLVM and it works fine. Its good to know that the VTune agent has been fixed to work with MCJIT. Do you have any pointers on how to generate the DWARF based output in LLVM which VTune would be able to use. Thanks -sathvik On Thu, May 22, 2014 at 1:31 PM, Kaylor, Andrew <andrew.kaylor at intel.com>wrote:> I think you can profile code generated with MCJIT using either oprofile > or Intel® VTune™ Amplifier XE, but you need to do a special build of LLVM > to enable it. If you want to enable another performance tool, you can look > at the code in lib/ExecutionEngine/OProfileJIT or > lib/ExecutionEngine/IntelJITEvents to get an idea of how to do it. The > IntelJITEvents implementation is a bit more complete, in that it makes use > of generated DWARF information if it is available. > > > > Speaking of DWARF information, Daniel Malea wrote a pass called DebugIR > that if I recall correctly writes an IR file to disc and associates debug > information with it as if that were the source file. You should be able to > make that work with any DWARF-based tool to analyze the generated code. > > > > -Andy > > > > *From:* llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] *On > Behalf Of *sathvik > *Sent:* Wednesday, May 21, 2014 6:20 PM > *To:* llvmdev at cs.uiuc.edu > *Subject:* [LLVMdev] perf tool support in MCJIT > > > > I believe the perf tool cannot profile/analyze the JITed code in MCJIT > model. > > > > Can you please confirm this ? I was working on a patch to fix this. > > > > Another question, is the there any support to map the llvm IR with x86 > generated assembly ? so its easier to analyze the code generator. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140527/52025da2/attachment.html>