OProfileWrapper.h (234353) | OProfileWrapper.h (249423) |
---|---|
1//===-- OProfileWrapper.h - OProfile JIT API Wrapper ------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// This file defines a OProfileWrapper object that detects if the oprofile 10// daemon is running, and provides wrappers for opagent functions used to 11// communicate with the oprofile JIT interface. The dynamic library libopagent 12// does not need to be linked directly as this object lazily loads the library 13// when the first op_ function is called. 14// 15// See http://oprofile.sourceforge.net/doc/devel/jit-interface.html for the 16// definition of the interface. 17// 18//===----------------------------------------------------------------------===// 19 | 1//===-- OProfileWrapper.h - OProfile JIT API Wrapper ------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// This file defines a OProfileWrapper object that detects if the oprofile 10// daemon is running, and provides wrappers for opagent functions used to 11// communicate with the oprofile JIT interface. The dynamic library libopagent 12// does not need to be linked directly as this object lazily loads the library 13// when the first op_ function is called. 14// 15// See http://oprofile.sourceforge.net/doc/devel/jit-interface.html for the 16// definition of the interface. 17// 18//===----------------------------------------------------------------------===// 19 |
20#ifndef OPROFILE_WRAPPER_H 21#define OPROFILE_WRAPPER_H | 20#ifndef LLVM_EXECUTIONENGINE_OPROFILEWRAPPER_H 21#define LLVM_EXECUTIONENGINE_OPROFILEWRAPPER_H |
22 23#include "llvm/Support/DataTypes.h" 24#include <opagent.h> 25 26namespace llvm { 27 28 29class OProfileWrapper { --- 6 unchanged lines hidden (view full) --- 36 const unsigned int); 37 typedef int (*op_write_debug_line_info_ptr_t)(op_agent_t, 38 void const*, 39 size_t, 40 struct debug_line_info const*); 41 typedef int (*op_unload_native_code_ptr_t)(op_agent_t, uint64_t); 42 43 // Also used for op_minor_version function which has the same signature | 22 23#include "llvm/Support/DataTypes.h" 24#include <opagent.h> 25 26namespace llvm { 27 28 29class OProfileWrapper { --- 6 unchanged lines hidden (view full) --- 36 const unsigned int); 37 typedef int (*op_write_debug_line_info_ptr_t)(op_agent_t, 38 void const*, 39 size_t, 40 struct debug_line_info const*); 41 typedef int (*op_unload_native_code_ptr_t)(op_agent_t, uint64_t); 42 43 // Also used for op_minor_version function which has the same signature |
44 typedef int (*op_major_version_ptr_t)(void); | 44 typedef int (*op_major_version_ptr_t)(); |
45 46 // This is not a part of the opagent API, but is useful nonetheless | 45 46 // This is not a part of the opagent API, but is useful nonetheless |
47 typedef bool (*IsOProfileRunningPtrT)(void); | 47 typedef bool (*IsOProfileRunningPtrT)(); |
48 49 50 op_agent_t Agent; 51 op_open_agent_ptr_t OpenAgentFunc; 52 op_close_agent_ptr_t CloseAgentFunc; 53 op_write_native_code_ptr_t WriteNativeCodeFunc; 54 op_write_debug_line_info_ptr_t WriteDebugLineInfoFunc; 55 op_unload_native_code_ptr_t UnloadNativeCodeFunc; --- 38 unchanged lines hidden (view full) --- 94 int op_write_native_code(const char* name, 95 uint64_t addr, 96 void const* code, 97 const unsigned int size); 98 int op_write_debug_line_info(void const* code, 99 size_t num_entries, 100 struct debug_line_info const* info); 101 int op_unload_native_code(uint64_t addr); | 48 49 50 op_agent_t Agent; 51 op_open_agent_ptr_t OpenAgentFunc; 52 op_close_agent_ptr_t CloseAgentFunc; 53 op_write_native_code_ptr_t WriteNativeCodeFunc; 54 op_write_debug_line_info_ptr_t WriteDebugLineInfoFunc; 55 op_unload_native_code_ptr_t UnloadNativeCodeFunc; --- 38 unchanged lines hidden (view full) --- 94 int op_write_native_code(const char* name, 95 uint64_t addr, 96 void const* code, 97 const unsigned int size); 98 int op_write_debug_line_info(void const* code, 99 size_t num_entries, 100 struct debug_line_info const* info); 101 int op_unload_native_code(uint64_t addr); |
102 int op_major_version(void); 103 int op_minor_version(void); | 102 int op_major_version(); 103 int op_minor_version(); |
104 105 // Returns true if the oprofiled process is running, the opagent library is 106 // loaded and a connection to the agent has been established, and false 107 // otherwise. 108 bool isAgentAvailable(); 109 110private: 111 // Loads the libopagent library and initializes this wrapper if the oprofile --- 4 unchanged lines hidden (view full) --- 116 // found, or false otherwise. 117 bool checkForOProfileProcEntry(); 118 119 bool isOProfileRunning(); 120}; 121 122} // namespace llvm 123 | 104 105 // Returns true if the oprofiled process is running, the opagent library is 106 // loaded and a connection to the agent has been established, and false 107 // otherwise. 108 bool isAgentAvailable(); 109 110private: 111 // Loads the libopagent library and initializes this wrapper if the oprofile --- 4 unchanged lines hidden (view full) --- 116 // found, or false otherwise. 117 bool checkForOProfileProcEntry(); 118 119 bool isOProfileRunning(); 120}; 121 122} // namespace llvm 123 |
124#endif //OPROFILE_WRAPPER_H | 124#endif // LLVM_EXECUTIONENGINE_OPROFILEWRAPPER_H |