summaryrefslogtreecommitdiff
path: root/lib/xray/xray_fdr_logging_impl.h
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-03-22 04:40:32 +0000
committerDean Michael Berris <dberris@google.com>2017-03-22 04:40:32 +0000
commit6a332346c1699549886caebcfdf634f5f46915a0 (patch)
treeca0ca8401c3ef394859953c5c5f6a0eb47e0e621 /lib/xray/xray_fdr_logging_impl.h
parent42738308e809b9007368dd59d590e4fb61a866f7 (diff)
[XRay][compiler-rt] Remove dependency on <system_error>
Summary: Depending on C++11 <system_error> introduces a link-time requirement to C++11 symbols. Removing it allows us to depend on header-only C++11 and up libraries. Partially fixes http://llvm.org/PR32274 -- we know there's more invasive work to be done, but we're doing it incrementally. Reviewers: dblaikie, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31233 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_fdr_logging_impl.h')
-rw-r--r--lib/xray/xray_fdr_logging_impl.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/lib/xray/xray_fdr_logging_impl.h b/lib/xray/xray_fdr_logging_impl.h
index 94e446bfc..d65c0f4f4 100644
--- a/lib/xray/xray_fdr_logging_impl.h
+++ b/lib/xray/xray_fdr_logging_impl.h
@@ -133,9 +133,10 @@ public:
static_cast<ptrdiff_t>(MetadataRecSize));
if (auto BQ = Buffers.lock()) {
writeEOBMetadata();
- if (auto EC = BQ->releaseBuffer(Buffer))
+ auto EC = BQ->releaseBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok)
Report("Failed to release buffer at %p; error=%s\n", Buffer.Buffer,
- EC.message().c_str());
+ BufferQueue::getErrorString(EC));
return;
}
}
@@ -170,7 +171,7 @@ static inline bool loggingInitialized(
XRayLogInitStatus::XRAY_LOG_INITIALIZED;
}
-} // namespace anonymous
+} // namespace
static inline void writeNewBufferPreamble(pid_t Tid, timespec TS,
char *&MemPtr) XRAY_NEVER_INSTRUMENT {
@@ -339,20 +340,23 @@ static inline void processFunctionHook(
if (!loggingInitialized(LoggingStatus) || LocalBQ->finalizing()) {
writeEOBMetadata();
- if (auto EC = BQ->releaseBuffer(Buffer)) {
+ auto EC = BQ->releaseBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok) {
Report("Failed to release buffer at %p; error=%s\n", Buffer.Buffer,
- EC.message().c_str());
+ BufferQueue::getErrorString(EC));
return;
}
RecordPtr = nullptr;
}
if (Buffer.Buffer == nullptr) {
- if (auto EC = LocalBQ->getBuffer(Buffer)) {
+ auto EC = LocalBQ->getBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok) {
auto LS = LoggingStatus.load(std::memory_order_acquire);
if (LS != XRayLogInitStatus::XRAY_LOG_FINALIZING &&
LS != XRayLogInitStatus::XRAY_LOG_FINALIZED)
- Report("Failed to acquire a buffer; error=%s\n", EC.message().c_str());
+ Report("Failed to acquire a buffer; error=%s\n",
+ BufferQueue::getErrorString(EC));
return;
}
@@ -406,13 +410,16 @@ static inline void processFunctionHook(
if ((RecordPtr + (MetadataRecSize + FunctionRecSize)) - BufferStart <
static_cast<ptrdiff_t>(MetadataRecSize)) {
writeEOBMetadata();
- if (auto EC = LocalBQ->releaseBuffer(Buffer)) {
+ auto EC = LocalBQ->releaseBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok) {
Report("Failed to release buffer at %p; error=%s\n", Buffer.Buffer,
- EC.message().c_str());
+ BufferQueue::getErrorString(EC));
return;
}
- if (auto EC = LocalBQ->getBuffer(Buffer)) {
- Report("Failed to acquire a buffer; error=%s\n", EC.message().c_str());
+ EC = LocalBQ->getBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok) {
+ Report("Failed to acquire a buffer; error=%s\n",
+ BufferQueue::getErrorString(EC));
return;
}
setupNewBuffer(Buffer, wall_clock_reader);
@@ -471,9 +478,10 @@ static inline void processFunctionHook(
// make sure that other threads may start using this buffer.
if ((RecordPtr + MetadataRecSize) - BufferStart == MetadataRecSize) {
writeEOBMetadata();
- if (auto EC = LocalBQ->releaseBuffer(Buffer)) {
+ auto EC = LocalBQ->releaseBuffer(Buffer);
+ if (EC != BufferQueue::ErrorCode::Ok) {
Report("Failed releasing buffer at %p; error=%s\n", Buffer.Buffer,
- EC.message().c_str());
+ BufferQueue::getErrorString(EC));
return;
}
RecordPtr = nullptr;