diff options
author | Dean Michael Berris <dberris@google.com> | 2017-09-29 04:28:11 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-09-29 04:28:11 +0000 |
commit | 283e436ec89b4b4a293870e83343f9cab9822f44 (patch) | |
tree | 77490a8b2bc3a8abf75752c7b7f4a63558cb0a1b | |
parent | c76c49014f5b65f316833358d89d6c8c8325a900 (diff) |
[XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function
The function was introduced as a convenience that used to be called in
multiple places. Recent refactorings have removed the need to call this
function in multiple places, so inlined the implementation in the single
place it's defined.
Broken out from D38119.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314489 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/xray/xray_fdr_logging_impl.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/xray/xray_fdr_logging_impl.h b/lib/xray/xray_fdr_logging_impl.h index d23c95041..4c9c46e03 100644 --- a/lib/xray/xray_fdr_logging_impl.h +++ b/lib/xray/xray_fdr_logging_impl.h @@ -195,13 +195,6 @@ public: } }; -inline bool loggingInitialized( - const __sanitizer::atomic_sint32_t &LoggingStatus) XRAY_NEVER_INSTRUMENT { - return __sanitizer::atomic_load(&LoggingStatus, - __sanitizer::memory_order_acquire) == - XRayLogInitStatus::XRAY_LOG_INITIALIZED; -} - } // namespace inline void writeNewBufferPreamble(pid_t Tid, timespec TS, @@ -528,7 +521,10 @@ inline bool isLogInitializedAndReady( return false; } - if (!loggingInitialized(LoggingStatus) || LBQ->finalizing()) { + if (__sanitizer::atomic_load(&LoggingStatus, + __sanitizer::memory_order_acquire) != + XRayLogInitStatus::XRAY_LOG_INITIALIZED || + LBQ->finalizing()) { writeEOBMetadata(); if (!releaseThreadLocalBuffer(*LBQ)) return false; @@ -578,7 +574,8 @@ inline bool isLogInitializedAndReady( // - The TSC delta is representable within the 32 bits we can store in a // FunctionRecord. In this case we write down just a FunctionRecord with // the correct TSC delta. -inline uint32_t writeCurrentCPUTSC(ThreadLocalData &TLD, uint64_t TSC, uint8_t CPU) { +inline uint32_t writeCurrentCPUTSC(ThreadLocalData &TLD, uint64_t TSC, + uint8_t CPU) { if (CPU != TLD.CurrentCPU) { // We've moved to a new CPU. writeNewCPUIdMetadata(CPU, TSC); |