[clang] [compiler-rt] [XRay][Darwin] Enable XRay runtime on macOS (arm64/x86_64) (PR #196848)

Dan Blackwell via cfe-commits cfe-commits at lists.llvm.org
Tue May 12 02:40:33 PDT 2026


================
@@ -67,7 +67,13 @@ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT { return true; }
 
 ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
   timespec TS;
-  int result = clock_gettime(CLOCK_REALTIME, &TS);
+  int result = clock_gettime(
+#if SANITIZER_APPLE
+      CLOCK_MONOTONIC_RAW,
----------------
DanBlackwell wrote:

Why not use `CLOCK_REALTIME` on apple?

https://github.com/llvm/llvm-project/pull/196848


More information about the cfe-commits mailing list