[compiler-rt] r314489 - [XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 21:28:11 PDT 2017


Author: dberris
Date: Thu Sep 28 21:28:11 2017
New Revision: 314489

URL: http://llvm.org/viewvc/llvm-project?rev=314489&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h

Modified: compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h?rev=314489&r1=314488&r2=314489&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h (original)
+++ compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h Thu Sep 28 21:28:11 2017
@@ -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);




More information about the llvm-commits mailing list