diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h')
-rw-r--r-- | contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h b/contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h index 68699c6a2200..088b33b798a3 100644 --- a/contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h +++ b/contrib/llvm-project/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h @@ -21,10 +21,18 @@ namespace llvm { +typedef enum { + LoadBinaryModule, + LoadBinarySection, + UnloadBinaryModule, + UnloadBinarySection +} IttEventType; + class IntelJITEventsWrapper { // Function pointer types for testing implementation of Intel jitprofiling // library typedef int (*NotifyEventPtr)(iJIT_JVM_EVENT, void*); + typedef int (*IttnotifyInfoPtr)(IttEventType, const char *, unsigned int); typedef void (*RegisterCallbackExPtr)(void *, iJIT_ModeChangedEx ); typedef iJIT_IsProfilingActiveFlags (*IsProfilingActivePtr)(void); typedef void (*FinalizeThreadPtr)(void); @@ -32,6 +40,7 @@ class IntelJITEventsWrapper { typedef unsigned int (*GetNewMethodIDPtr)(void); NotifyEventPtr NotifyEventFunc; + IttnotifyInfoPtr IttnotifyInfoFunc; RegisterCallbackExPtr RegisterCallbackExFunc; IsProfilingActivePtr IsProfilingActiveFunc; GetNewMethodIDPtr GetNewMethodIDFunc; @@ -42,23 +51,22 @@ public: } IntelJITEventsWrapper() - : NotifyEventFunc(::iJIT_NotifyEvent), - RegisterCallbackExFunc(::iJIT_RegisterCallbackEx), - IsProfilingActiveFunc(::iJIT_IsProfilingActive), - GetNewMethodIDFunc(::iJIT_GetNewMethodID) { - } + : NotifyEventFunc(::iJIT_NotifyEvent), IttnotifyInfoFunc(0), + RegisterCallbackExFunc(::iJIT_RegisterCallbackEx), + IsProfilingActiveFunc(::iJIT_IsProfilingActive), + GetNewMethodIDFunc(::iJIT_GetNewMethodID) {} IntelJITEventsWrapper(NotifyEventPtr NotifyEventImpl, - RegisterCallbackExPtr RegisterCallbackExImpl, - IsProfilingActivePtr IsProfilingActiveImpl, - FinalizeThreadPtr FinalizeThreadImpl, - FinalizeProcessPtr FinalizeProcessImpl, - GetNewMethodIDPtr GetNewMethodIDImpl) - : NotifyEventFunc(NotifyEventImpl), - RegisterCallbackExFunc(RegisterCallbackExImpl), - IsProfilingActiveFunc(IsProfilingActiveImpl), - GetNewMethodIDFunc(GetNewMethodIDImpl) { - } + IttnotifyInfoPtr IttnotifyInfoImpl, + RegisterCallbackExPtr RegisterCallbackExImpl, + IsProfilingActivePtr IsProfilingActiveImpl, + FinalizeThreadPtr FinalizeThreadImpl, + FinalizeProcessPtr FinalizeProcessImpl, + GetNewMethodIDPtr GetNewMethodIDImpl) + : NotifyEventFunc(NotifyEventImpl), IttnotifyInfoFunc(IttnotifyInfoImpl), + RegisterCallbackExFunc(RegisterCallbackExImpl), + IsProfilingActiveFunc(IsProfilingActiveImpl), + GetNewMethodIDFunc(GetNewMethodIDImpl) {} // Sends an event announcing that a function has been emitted // return values are event-specific. See Intel documentation for details. @@ -68,6 +76,13 @@ public: return NotifyEventFunc(EventType, EventSpecificData); } + int iJitIttNotifyInfo(IttEventType EventType, const char *Name, + unsigned int Size) { + if (!IttnotifyInfoFunc) + return -1; + return IttnotifyInfoFunc(EventType, Name, Size); + } + // Registers a callback function to receive notice of profiling state changes void iJIT_RegisterCallbackEx(void *UserData, iJIT_ModeChangedEx NewModeCallBackFuncEx) { |