[compiler-rt] r287736 - [XRay][compiler-rt] Add newlines to error messages (NFC).

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 20:47:41 PST 2016


Author: dberris
Date: Tue Nov 22 22:47:41 2016
New Revision: 287736

URL: http://llvm.org/viewvc/llvm-project?rev=287736&view=rev
Log:
[XRay][compiler-rt] Add newlines to error messages (NFC).

This goes through all the calls to `Report(...)` to make sure that each
one would have a newline at the end of the message for readability.

Modified:
    compiler-rt/trunk/lib/xray/xray_inmemory_log.cc
    compiler-rt/trunk/lib/xray/xray_interface.cc

Modified: compiler-rt/trunk/lib/xray/xray_inmemory_log.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_inmemory_log.cc?rev=287736&r1=287735&r2=287736&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_inmemory_log.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_inmemory_log.cc Tue Nov 22 22:47:41 2016
@@ -61,7 +61,7 @@ static void retryingWriteAll(int Fd, cha
     if (Written < 0) {
       if (errno == EINTR)
         continue; // Try again.
-      Report("Failed to write; errno = %d", errno);
+      Report("Failed to write; errno = %d\n", errno);
       return;
     }
     TotalBytes -= Written;
@@ -81,7 +81,7 @@ retryingReadSome(int Fd, char *Begin, ch
     if (BytesRead == -1) {
       if (errno == EINTR)
         continue;
-      Report("Read error; errno = %d", errno);
+      Report("Read error; errno = %d\n", errno);
       return std::make_pair(TotalBytesRead, false);
     }
 
@@ -168,14 +168,14 @@ void __xray_InMemoryRawLog(int32_t FuncI
                               sizeof(TmpFilename) - 10);
     if (static_cast<size_t>((E + 6) - TmpFilename) >
         (sizeof(TmpFilename) - 1)) {
-      Report("XRay log file base too long: %s", flags()->xray_logfile_base);
+      Report("XRay log file base too long: %s\n", flags()->xray_logfile_base);
       return -1;
     }
     internal_strncat(TmpFilename, TmpWildcardPattern,
                      sizeof(TmpWildcardPattern) - 1);
     int Fd = mkstemp(TmpFilename);
     if (Fd == -1) {
-      Report("XRay: Failed opening temporary file '%s'; not logging events.",
+      Report("XRay: Failed opening temporary file '%s'; not logging events.\n",
              TmpFilename);
       return -1;
     }
@@ -193,7 +193,7 @@ void __xray_InMemoryRawLog(int32_t FuncI
                    &CPUFrequency)) {
       CPUFrequency *= 1000;
     } else {
-      Report("Unable to determine CPU frequency for TSC accounting.");
+      Report("Unable to determine CPU frequency for TSC accounting.\n");
     }
 #elif defined(__arm__) || defined(__aarch64__)
     // There is no instruction like RDTSCP in user mode on ARM. ARM's CP15 does
@@ -248,7 +248,7 @@ void __xray_InMemoryRawLog(int32_t FuncI
     timespec TS;
     int result = clock_gettime(CLOCK_REALTIME, &TS);
     if (result != 0) {
-      Report("clock_gettime() returned %d, errno=%d.", result, int(errno));
+      Report("clock_gettime() returned %d, errno=%d.\n", result, int(errno));
       TS.tv_sec = 0;
       TS.tv_nsec = 0;
     }

Modified: compiler-rt/trunk/lib/xray/xray_interface.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_interface.cc?rev=287736&r1=287735&r2=287736&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_interface.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_interface.cc Tue Nov 22 22:47:41 2016
@@ -148,7 +148,7 @@ XRayPatchingStatus ControlPatching(bool
 
   const uint64_t PageSize = GetPageSizeCached();
   if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) {
-    Report("System page size is not a power of two: %lld", PageSize);
+    Report("System page size is not a power of two: %lld\n", PageSize);
     return XRayPatchingStatus::FAILED;
   }
 
@@ -188,7 +188,7 @@ XRayPatchingStatus ControlPatching(bool
       Success = patchFunctionTailExit(Enable, FuncId, Sled);
       break;
     default:
-      Report("Unsupported sled kind: %d", int(Sled.Kind));
+      Report("Unsupported sled kind: %d\n", int(Sled.Kind));
       continue;
     }
     (void)Success;




More information about the llvm-commits mailing list