[PATCH] D44890: Allow to integrate OrcJIT with JitEventListenersSee #31521Contained-Commits:[ORC] Extend object layer callbacks so JITEventListener can be supported.

Andres Freund via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 25 22:03:25 PDT 2018


anarazel created this revision.
Herald added a reviewer: deadalnix.
Herald added a subscriber: llvm-commits.

Currently the RTDyldObjectLinkingLayer makes it hard to support
JITEventListeners. Which in turn means debugging and profiling JIT
generated code hard.

Supporting JITEventListeners at minimum requries a freed
callback (added).

As listeners expect the ObjectFile to be passed as well, an adaptor
between RTDyldObjectLinkingLayer and JITEventListeners would currently
need to also maintain ObjectFiles for all loaded modules. To make that
less awkward extend the callbacks to pass the ObjectFile to both
Finalized and Freed callbacks.  That requires extending the lifetime
of the object file when callbacks are present.

[ORC] Add ability [un]register JITEventListener on C Orc stack.

[ORC][C-API] Expose LLVMOrc{Unr,R}egisterJITEventListener().

[C-API] Add functions to create GDB, Intel, Oprofile event listeners.

Intel and Oprofile were done blindly, I don't have the environment to
build them.


Repository:
  rL LLVM

https://reviews.llvm.org/D44890

Files:
  include/llvm-c/ExecutionEngine.h
  include/llvm-c/OrcBindings.h
  include/llvm-c/Types.h
  include/llvm/ExecutionEngine/JITEventListener.h
  include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
  lib/ExecutionEngine/GDBRegistrationListener.cpp
  lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
  lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
  lib/ExecutionEngine/Orc/OrcCBindings.cpp
  lib/ExecutionEngine/Orc/OrcCBindingsStack.h
  lib/ExecutionEngine/Orc/OrcMCJITReplacement.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44890.139761.patch
Type: text/x-patch
Size: 13653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180326/0b832590/attachment-0001.bin>


More information about the llvm-commits mailing list