[llvm-branch-commits] [compiler-rt] d7e71b5 - [compiler-rt santizer] Use clock_gettime instead of timespec_get

Teresa Johnson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 8 10:15:09 PST 2020


Author: Jeroen Dobbelaere
Date: 2020-12-08T10:10:17-08:00
New Revision: d7e71b5db8427309ad12249633ea86cccdc5a701

URL: https://github.com/llvm/llvm-project/commit/d7e71b5db8427309ad12249633ea86cccdc5a701
DIFF: https://github.com/llvm/llvm-project/commit/d7e71b5db8427309ad12249633ea86cccdc5a701.diff

LOG: [compiler-rt santizer] Use clock_gettime instead of timespec_get

On RH66, timespec_get is not available. Use clock_gettime instead.

This problem was introduced with D87120

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D91687

Added: 
    

Modified: 
    compiler-rt/lib/memprof/memprof_allocator.cpp
    compiler-rt/lib/memprof/memprof_rtl.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/memprof/memprof_allocator.cpp b/compiler-rt/lib/memprof/memprof_allocator.cpp
index 0f9263e66fe0..259c7c144ab7 100644
--- a/compiler-rt/lib/memprof/memprof_allocator.cpp
+++ b/compiler-rt/lib/memprof/memprof_allocator.cpp
@@ -52,7 +52,7 @@ static int GetTimestamp(void) {
     return 0;
   }
   timespec ts;
-  timespec_get(&ts, TIME_UTC);
+  clock_gettime(CLOCK_REALTIME, &ts);
   return (ts.tv_sec - memprof_init_timestamp_s) * 1000 + ts.tv_nsec / 1000000;
 }
 

diff  --git a/compiler-rt/lib/memprof/memprof_rtl.cpp b/compiler-rt/lib/memprof/memprof_rtl.cpp
index 8e1335aea875..d6d606f666ee 100644
--- a/compiler-rt/lib/memprof/memprof_rtl.cpp
+++ b/compiler-rt/lib/memprof/memprof_rtl.cpp
@@ -234,7 +234,7 @@ void MemprofInitTime() {
   if (LIKELY(memprof_timestamp_inited))
     return;
   timespec ts;
-  timespec_get(&ts, TIME_UTC);
+  clock_gettime(CLOCK_REALTIME, &ts);
   memprof_init_timestamp_s = ts.tv_sec;
   memprof_timestamp_inited = 1;
 }


        


More information about the llvm-branch-commits mailing list