LLVM: lib/ExecutionEngine/IntelJITProfiling/IntelJITEventsWrapper.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef INTEL_JIT_EVENTS_WRAPPER_H
18#define INTEL_JIT_EVENTS_WRAPPER_H
19
21
22namespace llvm {
23
30
32
33
35 typedef int (*IttnotifyInfoPtr)(IttEventType, const char *, unsigned int);
38 typedef void (*FinalizeThreadPtr)(void);
39 typedef void (*FinalizeProcessPtr)(void);
40 typedef unsigned int (*GetNewMethodIDPtr)(void);
41
42 NotifyEventPtr NotifyEventFunc;
43 IttnotifyInfoPtr IttnotifyInfoFunc;
44 RegisterCallbackExPtr RegisterCallbackExFunc;
45 IsProfilingActivePtr IsProfilingActiveFunc;
46 GetNewMethodIDPtr GetNewMethodIDFunc;
47
48public:
52
58
60 IttnotifyInfoPtr IttnotifyInfoImpl,
61 RegisterCallbackExPtr RegisterCallbackExImpl,
62 IsProfilingActivePtr IsProfilingActiveImpl,
63 FinalizeThreadPtr FinalizeThreadImpl,
64 FinalizeProcessPtr FinalizeProcessImpl,
65 GetNewMethodIDPtr GetNewMethodIDImpl)
66 : NotifyEventFunc(NotifyEventImpl), IttnotifyInfoFunc(IttnotifyInfoImpl),
67 RegisterCallbackExFunc(RegisterCallbackExImpl),
68 IsProfilingActiveFunc(IsProfilingActiveImpl),
69 GetNewMethodIDFunc(GetNewMethodIDImpl) {}
70
71
72
74 if (!NotifyEventFunc)
75 return -1;
76 return NotifyEventFunc(EventType, EventSpecificData);
77 }
78
80 unsigned int Size) {
81 if (!IttnotifyInfoFunc)
82 return -1;
83 return IttnotifyInfoFunc(EventType, Name, Size);
84 }
85
86
89 if (RegisterCallbackExFunc)
90 RegisterCallbackExFunc(UserData, NewModeCallBackFuncEx);
91 }
92
93
95 if (!IsProfilingActiveFunc)
97 return IsProfilingActiveFunc();
98 }
99
100
102 if (!GetNewMethodIDFunc)
103 return -1;
104 return GetNewMethodIDFunc();
105 }
106};
107
108}
109
110#endif
IntelJITEventsWrapper()
Definition IntelJITEventsWrapper.h:53
void iJIT_RegisterCallbackEx(void *UserData, iJIT_ModeChangedEx NewModeCallBackFuncEx)
Definition IntelJITEventsWrapper.h:87
bool isAmplifierRunning()
Definition IntelJITEventsWrapper.h:49
int iJitIttNotifyInfo(IttEventType EventType, const char *Name, unsigned int Size)
Definition IntelJITEventsWrapper.h:79
IntelJITEventsWrapper(NotifyEventPtr NotifyEventImpl, IttnotifyInfoPtr IttnotifyInfoImpl, RegisterCallbackExPtr RegisterCallbackExImpl, IsProfilingActivePtr IsProfilingActiveImpl, FinalizeThreadPtr FinalizeThreadImpl, FinalizeProcessPtr FinalizeProcessImpl, GetNewMethodIDPtr GetNewMethodIDImpl)
Definition IntelJITEventsWrapper.h:59
unsigned int iJIT_GetNewMethodID(void)
Definition IntelJITEventsWrapper.h:101
iJIT_IsProfilingActiveFlags iJIT_IsProfilingActive(void)
Definition IntelJITEventsWrapper.h:94
int iJIT_NotifyEvent(iJIT_JVM_EVENT EventType, void *EventSpecificData)
Definition IntelJITEventsWrapper.h:73
void(* iJIT_ModeChangedEx)(void *UserData, iJIT_ModeFlags Flags)
enum iJIT_jvm_event iJIT_JVM_EVENT
enum _iJIT_IsProfilingActiveFlags iJIT_IsProfilingActiveFlags
This is an optimization pass for GlobalISel generic memory operations.
IttEventType
Definition IntelJITEventsWrapper.h:24
@ UnloadBinaryModule
Definition IntelJITEventsWrapper.h:27
@ LoadBinaryModule
Definition IntelJITEventsWrapper.h:25
@ LoadBinarySection
Definition IntelJITEventsWrapper.h:26
@ UnloadBinarySection
Definition IntelJITEventsWrapper.h:28