diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 10853401..e0e21eb6 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2141,16 +2141,23 @@ void Profiler::HandleDisconnect() } } +bool Profiler::IsTimerMonotonicRaw() +{ +#if defined TRACY_HW_TIMER && !defined TARGET_OS_IOS && __ARM_ARCH >= 6 + return GetTimeImpl == GetTimeImplFallback; +#else + return false; +#endif +} + void Profiler::CalibrateTimer() { #ifdef TRACY_HW_TIMER -# if __ARM_ARCH >= 6 && !defined TARGET_OS_IOS - if( GetTimeImpl == GetTimeImplFallback ) + if( IsTimerMonotonicRaw() ) { m_timerMul = 1.; return; } -# endif std::atomic_signal_fence( std::memory_order_acq_rel ); const auto t0 = std::chrono::high_resolution_clock::now(); diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 6d80a0b9..415e2576 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -440,6 +440,8 @@ public: void RequestShutdown() { m_shutdown.store( true, std::memory_order_relaxed ); m_shutdownManual.store( true, std::memory_order_relaxed ); } bool HasShutdownFinished() const { return m_shutdownFinished.load( std::memory_order_relaxed ); } + static bool IsTimerMonotonicRaw(); + private: enum class DequeueStatus { Success, ConnectionLost, QueueEmpty };