[compiler-rt] r334000 - [XRay][compiler-rt] Remove __xray:: in some places (NFC)

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 5 03:12:58 PDT 2018


Author: dberris
Date: Tue Jun  5 03:12:58 2018
New Revision: 334000

URL: http://llvm.org/viewvc/llvm-project?rev=334000&view=rev
Log:
[XRay][compiler-rt] Remove __xray:: in some places (NFC)

This is a cosmetic change to remove unnecessary full-qualifications of
types/functions that are already in the __xray:: namespace.

Modified:
    compiler-rt/trunk/lib/xray/xray_basic_logging.cc
    compiler-rt/trunk/lib/xray/xray_fdr_logging.cc

Modified: compiler-rt/trunk/lib/xray/xray_basic_logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_basic_logging.cc?rev=334000&r1=333999&r2=334000&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_basic_logging.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_basic_logging.cc Tue Jun  5 03:12:58 2018
@@ -75,7 +75,7 @@ thread_local volatile bool RecursionGuar
 static uint64_t thresholdTicks() XRAY_NEVER_INSTRUMENT {
   static uint64_t TicksPerSec = probeRequiredCPUFeatures()
                                     ? getTSCFrequency()
-                                    : __xray::NanosecondsPerSecond;
+                                    : NanosecondsPerSecond;
   static const uint64_t ThresholdTicks =
       TicksPerSec * GlobalOptions.DurationFilterMicros / 1000000;
   return ThresholdTicks;
@@ -89,7 +89,7 @@ static int openLogFile() XRAY_NEVER_INST
   // Test for required CPU features and cache the cycle frequency
   static bool TSCSupported = probeRequiredCPUFeatures();
   static uint64_t CycleFrequency =
-      TSCSupported ? getTSCFrequency() : __xray::NanosecondsPerSecond;
+      TSCSupported ? getTSCFrequency() : NanosecondsPerSecond;
 
   // Since we're here, we get to write the header. We set it up so that the
   // header will only be written once, at the start, and let the threads
@@ -233,14 +233,14 @@ void InMemoryRawLog(int32_t FuncId, XRay
 
   // First determine whether the delta between the function's enter record and
   // the exit record is higher than the threshold.
-  __xray::XRayRecord R;
+  XRayRecord R;
   R.RecordType = RecordTypes::NORMAL;
   R.CPU = CPU;
   R.TSC = TSC;
   R.TId = TLD.TID;
   R.Type = Type;
   R.FuncId = FuncId;
-  auto FirstEntry = reinterpret_cast<__xray::XRayRecord *>(TLD.InMemoryBuffer);
+  auto FirstEntry = reinterpret_cast<XRayRecord *>(TLD.InMemoryBuffer);
   internal_memcpy(FirstEntry + TLD.BufferOffset, &R, sizeof(R));
   if (++TLD.BufferOffset == TLD.BufferSize) {
     SpinMutexLock L(&LogMutex);
@@ -256,7 +256,7 @@ void InMemoryRawLogWithArg(int32_t FuncI
                            RDTSC ReadTSC) XRAY_NEVER_INSTRUMENT {
   auto &TLD = getThreadLocalData();
   auto FirstEntry =
-      reinterpret_cast<__xray::XRayArgPayload *>(TLD.InMemoryBuffer);
+      reinterpret_cast<XRayArgPayload *>(TLD.InMemoryBuffer);
   const auto &BuffLen = TLD.BufferSize;
   int Fd = getGlobalFd();
   if (Fd == -1)
@@ -282,7 +282,7 @@ void InMemoryRawLogWithArg(int32_t FuncI
   auto ExitGuard = at_scope_exit([] { RecursionGuard = false; });
 
   // And from here on write the arg payload.
-  __xray::XRayArgPayload R;
+  XRayArgPayload R;
   R.RecordType = RecordTypes::ARG_PAYLOAD;
   R.FuncId = FuncId;
   R.TId = TLD.TID;
@@ -299,7 +299,7 @@ void InMemoryRawLogWithArg(int32_t FuncI
 
 void basicLoggingHandleArg0RealTSC(int32_t FuncId,
                                    XRayEntryType Type) XRAY_NEVER_INSTRUMENT {
-  InMemoryRawLog(FuncId, Type, __xray::readTSC);
+  InMemoryRawLog(FuncId, Type, readTSC);
 }
 
 void basicLoggingHandleArg0EmulateTSC(int32_t FuncId, XRayEntryType Type)
@@ -312,13 +312,13 @@ void basicLoggingHandleArg0EmulateTSC(in
       TS = {0, 0};
     }
     CPU = 0;
-    return TS.tv_sec * __xray::NanosecondsPerSecond + TS.tv_nsec;
+    return TS.tv_sec * NanosecondsPerSecond + TS.tv_nsec;
   });
 }
 
 void basicLoggingHandleArg1RealTSC(int32_t FuncId, XRayEntryType Type,
                                    uint64_t Arg1) XRAY_NEVER_INSTRUMENT {
-  InMemoryRawLogWithArg(FuncId, Type, Arg1, __xray::readTSC);
+  InMemoryRawLogWithArg(FuncId, Type, Arg1, readTSC);
 }
 
 void basicLoggingHandleArg1EmulateTSC(int32_t FuncId, XRayEntryType Type,
@@ -332,7 +332,7 @@ void basicLoggingHandleArg1EmulateTSC(in
           TS = {0, 0};
         }
         CPU = 0;
-        return TS.tv_sec * __xray::NanosecondsPerSecond + TS.tv_nsec;
+        return TS.tv_sec * NanosecondsPerSecond + TS.tv_nsec;
       });
 }
 
@@ -359,7 +359,7 @@ static void TLDDestructor(void *P) XRAY_
     SpinMutexLock L(&LogMutex);
     retryingWriteAll(TLD.Fd, reinterpret_cast<char *>(TLD.InMemoryBuffer),
                      reinterpret_cast<char *>(TLD.InMemoryBuffer) +
-                         (sizeof(__xray::XRayRecord) * TLD.BufferOffset));
+                         (sizeof(XRayRecord) * TLD.BufferOffset));
   }
 
   // Because this thread's exit could be the last one trying to write to

Modified: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_fdr_logging.cc?rev=334000&r1=333999&r2=334000&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc Tue Jun  5 03:12:58 2018
@@ -25,6 +25,7 @@
 #include <time.h>
 #include <unistd.h>
 
+#include "sanitizer_common/sanitizer_allocator_internal.h"
 #include "sanitizer_common/sanitizer_atomic.h"
 #include "sanitizer_common/sanitizer_common.h"
 #include "xray/xray_interface.h"
@@ -1170,7 +1171,6 @@ XRayLogInitStatus fdrLoggingInit(size_t
 }
 
 bool fdrLogDynamicInitializer() XRAY_NEVER_INSTRUMENT {
-  using namespace __xray;
   XRayLogImpl Impl{
       fdrLoggingInit,
       fdrLoggingFinalize,




More information about the llvm-commits mailing list