LLVM: include/llvm/ExecutionEngine/OProfileWrapper.h Source File (original) (raw)

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,

32 const char*,

34 void const*,

35 const unsigned int);

36 typedef int (*op_write_debug_line_info_ptr_t)(op_agent_t,

37 void const*,

38 size_t,

39 struct debug_line_info const*);

40 typedef int (*op_unload_native_code_ptr_t)(op_agent_t, uint64_t);

41

42

43 typedef int (*op_major_version_ptr_t)();

44

45

46 typedef bool (*IsOProfileRunningPtrT)();

47

48

49 op_agent_t Agent;

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;

58

59 bool Initialized;

60

61public:

63

64

65

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),

82 Initialized(true)

83 {

84 }

85

86

87

88

89

91

95 void const* code,

96 const unsigned int size);

98 size_t num_entries,

99 struct debug_line_info const* info);

103

104

105

106

108

109private:

110

111

113

114

115

116 bool checkForOProfileProcEntry();

117

118 bool isOProfileRunning();

119};

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)

Definition OProfileWrapper.h:66