FS#75365 - [llvm] Enable LLVM perf JIT events integration

Attached to Project: Arch Linux
Opened by Davide Depau (depaulicious) - Monday, 18 July 2022, 13:11 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 27 July 2022, 10:15 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

LLVM's Orc JIT infrastructure supports cooperating with debug tools such as perf and gdb in order to debug/profile JITd code.

For some reason, the integration with perf is disabled by default, even though it does not require any extra dependencies and even if usage is opt-in for library users. I do not know why this is the case (https://groups.google.com/g/llvm-dev/c/10m9f5f-57s/m/ipxiNJ5sAQAJ) but I regularly use this at work since I work on a JIT compiler.

By adding `-DLLVM_USE_PERF=ON` the relevant library should be built. Reference:

- Relevant CMakeLists: https://github.com/llvm/llvm-project/blob/release/14.x/llvm/lib/ExecutionEngine/CMakeLists.txt#L44-L46
- The source for the event listener (as you can see there are no external dependencies): https://github.com/llvm/llvm-project/blob/release/14.x/llvm/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
- Event listener getter method: https://github.com/llvm/llvm-project/blob/release/14.x/llvm/include/llvm/ExecutionEngine/JITEventListener.h
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Wednesday, 27 July 2022, 10:15 GMT
Reason for closing:  Implemented
Additional comments about closing:  llvm 14.0.6-2

Loading...