[llvm-dev] Interest in integrating a linux perf JITEventListener?

Andres Freund via llvm-dev llvm-dev at lists.llvm.org
Sat Dec 10 13:27:41 PST 2016


Hi,

Under linux a large portion of the profiling these days happens with
perf, but there's no support for it from LLVM's JITs.

For a while perf could associate address+size to symbols by writing a
/tmp/perf-$pid.map file:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/tools/perf/Documentation/jit-interface.txt

A year or so perf also gained the ability to actually see code & debug
info. It's even being documented now:
http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=b3151ea500655f232255ddcdf2bbcf691cb39646

I've a very preliminary JITEventListener using both of this. Is there
interest in integrating that into LLVM?  If so, I'll try to follow LLVM
coding standards and submit it, otherwise I'll keep it somewhere in
postgres...

If in LLVM, does anybody have preference about how to integrate the two
methods above?  Because the second method currently (linux limitation)
only works if the program is profiled from start, I think it makes to
allow either or both of the methods to be used, which seems to suggest
an argument to the listener constructor, rather than different wrappers
for either.  Comments?

Greetings,

Andres Freund


More information about the llvm-dev mailing list