19#ifndef LLVM_EXECUTIONENGINE_OPROFILEWRAPPER_H
20#define LLVM_EXECUTIONENGINE_OPROFILEWRAPPER_H
29 typedef op_agent_t (*op_open_agent_ptr_t)();
30 typedef int (*op_close_agent_ptr_t)(op_agent_t);
31 typedef int (*op_write_native_code_ptr_t)(op_agent_t,
36 typedef int (*op_write_debug_line_info_ptr_t)(op_agent_t,
39 struct debug_line_info
const*);
40 typedef int (*op_unload_native_code_ptr_t)(op_agent_t,
uint64_t);
43 typedef int (*op_major_version_ptr_t)();
46 typedef bool (*IsOProfileRunningPtrT)();
50 op_open_agent_ptr_t OpenAgentFunc;
51 op_close_agent_ptr_t CloseAgentFunc;
52 op_write_native_code_ptr_t WriteNativeCodeFunc;
53 op_write_debug_line_info_ptr_t WriteDebugLineInfoFunc;
54 op_unload_native_code_ptr_t UnloadNativeCodeFunc;
55 op_major_version_ptr_t MajorVersionFunc;
56 op_major_version_ptr_t MinorVersionFunc;
57 IsOProfileRunningPtrT IsOProfileRunningFunc;
67 op_close_agent_ptr_t CloseAgentImpl,
68 op_write_native_code_ptr_t WriteNativeCodeImpl,
69 op_write_debug_line_info_ptr_t WriteDebugLineInfoImpl,
70 op_unload_native_code_ptr_t UnloadNativeCodeImpl,
71 op_major_version_ptr_t MajorVersionImpl,
72 op_major_version_ptr_t MinorVersionImpl,
73 IsOProfileRunningPtrT MockIsOProfileRunningImpl = 0)
74 : OpenAgentFunc(OpenAgentImpl),
75 CloseAgentFunc(CloseAgentImpl),
76 WriteNativeCodeFunc(WriteNativeCodeImpl),
77 WriteDebugLineInfoFunc(WriteDebugLineInfoImpl),
78 UnloadNativeCodeFunc(UnloadNativeCodeImpl),
79 MajorVersionFunc(MajorVersionImpl),
80 MinorVersionFunc(MinorVersionImpl),
81 IsOProfileRunningFunc(MockIsOProfileRunningImpl),
96 const unsigned int size);
99 struct debug_line_info
const*
info);
116 bool checkForOProfileProcEntry();
118 bool isOProfileRunning();
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
Initialize the set of available library functions based on the specified target triple.
int op_write_native_code(const char *name, uint64_t addr, void const *code, const unsigned int size)
int op_unload_native_code(uint64_t addr)
OProfileWrapper(op_open_agent_ptr_t OpenAgentImpl, op_close_agent_ptr_t CloseAgentImpl, op_write_native_code_ptr_t WriteNativeCodeImpl, op_write_debug_line_info_ptr_t WriteDebugLineInfoImpl, op_unload_native_code_ptr_t UnloadNativeCodeImpl, op_major_version_ptr_t MajorVersionImpl, op_major_version_ptr_t MinorVersionImpl, IsOProfileRunningPtrT MockIsOProfileRunningImpl=0)
int op_write_debug_line_info(void const *code, size_t num_entries, struct debug_line_info const *info)
This is an optimization pass for GlobalISel generic memory operations.