diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/OProfileJIT')
-rw-r--r-- | llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp | 24 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp | 9 |
2 files changed, 18 insertions, 15 deletions
diff --git a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp index 3581d645839..29d9d080fc5 100644 --- a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp +++ b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp @@ -57,9 +57,10 @@ public: void OProfileJITEventListener::initialize() { if (!Wrapper->op_open_agent()) { const std::string err_str = sys::StrError(); - DEBUG(dbgs() << "Failed to connect to OProfile agent: " << err_str << "\n"); + LLVM_DEBUG(dbgs() << "Failed to connect to OProfile agent: " << err_str + << "\n"); } else { - DEBUG(dbgs() << "Connected to OProfile agent.\n"); + LLVM_DEBUG(dbgs() << "Connected to OProfile agent.\n"); } } @@ -67,10 +68,10 @@ OProfileJITEventListener::~OProfileJITEventListener() { if (Wrapper->isAgentAvailable()) { if (Wrapper->op_close_agent() == -1) { const std::string err_str = sys::StrError(); - DEBUG(dbgs() << "Failed to disconnect from OProfile agent: " - << err_str << "\n"); + LLVM_DEBUG(dbgs() << "Failed to disconnect from OProfile agent: " + << err_str << "\n"); } else { - DEBUG(dbgs() << "Disconnected from OProfile agent.\n"); + LLVM_DEBUG(dbgs() << "Disconnected from OProfile agent.\n"); } } } @@ -103,9 +104,9 @@ void OProfileJITEventListener::NotifyObjectEmitted( if (Wrapper->op_write_native_code(Name.data(), Addr, (void *)Addr, Size) == -1) { - DEBUG(dbgs() << "Failed to tell OProfile about native function " << Name - << " at [" << (void *)Addr << "-" << ((char *)Addr + Size) - << "]\n"); + LLVM_DEBUG(dbgs() << "Failed to tell OProfile about native function " + << Name << " at [" << (void *)Addr << "-" + << ((char *)Addr + Size) << "]\n"); continue; } // TODO: support line number info (similar to IntelJITEventListener.cpp) @@ -135,9 +136,10 @@ void OProfileJITEventListener::NotifyFreeingObject(const ObjectFile &Obj) { uint64_t Addr = *AddrOrErr; if (Wrapper->op_unload_native_code(Addr) == -1) { - DEBUG(dbgs() - << "Failed to tell OProfile about unload of native function at " - << (void*)Addr << "\n"); + LLVM_DEBUG( + dbgs() + << "Failed to tell OProfile about unload of native function at " + << (void *)Addr << "\n"); continue; } } diff --git a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp index d96278a8137..b473ac3faf4 100644 --- a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp +++ b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp @@ -64,15 +64,16 @@ bool OProfileWrapper::initialize() { // If the oprofile daemon is not running, don't load the opagent library if (!isOProfileRunning()) { - DEBUG(dbgs() << "OProfile daemon is not detected.\n"); + LLVM_DEBUG(dbgs() << "OProfile daemon is not detected.\n"); return false; } std::string error; if(!DynamicLibrary::LoadLibraryPermanently("libopagent.so", &error)) { - DEBUG(dbgs() - << "OProfile connector library libopagent.so could not be loaded: " - << error << "\n"); + LLVM_DEBUG( + dbgs() + << "OProfile connector library libopagent.so could not be loaded: " + << error << "\n"); } // Get the addresses of the opagent functions |