Index: lib/tsan/rtl/tsan_rtl.cc =================================================================== --- lib/tsan/rtl/tsan_rtl.cc +++ lib/tsan/rtl/tsan_rtl.cc @@ -172,20 +172,20 @@ } } - u64 last_flush = NanoTime(); + u64 last_flush = MonotonicNanoTime(); uptr last_rss = 0; for (int i = 0; atomic_load(&ctx->stop_background_thread, memory_order_relaxed) == 0; i++) { SleepForMillis(100); - u64 now = NanoTime(); + u64 now = MonotonicNanoTime(); // Flush memory if requested. if (flags()->flush_memory_ms > 0) { if (last_flush + flags()->flush_memory_ms * kMs2Ns < now) { VPrintf(1, "ThreadSanitizer: periodic memory flush\n"); FlushShadowMemory(); - last_flush = NanoTime(); + last_flush = MonotonicNanoTime(); } } // GetRSS can be expensive on huge programs, so don't do it every 100ms. Index: lib/tsan/rtl/tsan_rtl_report.cc =================================================================== --- lib/tsan/rtl/tsan_rtl_report.cc +++ lib/tsan/rtl/tsan_rtl_report.cc @@ -503,7 +503,7 @@ bool OutputReport(ThreadState *thr, const ScopedReport &srep) { if (!flags()->report_bugs || thr->suppress_reports) return false; - atomic_store_relaxed(&ctx->last_symbolize_time_ns, NanoTime()); + atomic_store_relaxed(&ctx->last_symbolize_time_ns, MonotonicNanoTime()); const ReportDesc *rep = srep.GetReport(); CHECK_EQ(thr->current_report, nullptr); thr->current_report = rep;