diff --git a/client/TracyLock.hpp b/client/TracyLock.hpp index 9b095955..a272aaaf 100644 --- a/client/TracyLock.hpp +++ b/client/TracyLock.hpp @@ -32,7 +32,7 @@ public: tracy_force_inline void lock() { - int8_t cpu; + uint32_t cpu; const auto thread = GetThreadHandle(); { Magic magic; @@ -63,7 +63,7 @@ public: { m_lockable.unlock(); - int8_t cpu; + uint32_t cpu; Magic magic; auto& token = s_token; auto item = s_queue.enqueue_begin( token, magic ); @@ -79,7 +79,7 @@ public: const auto ret = m_lockable.try_lock(); if( ret ) { - int8_t cpu; + uint32_t cpu; Magic magic; auto& token = s_token; auto item = s_queue.enqueue_begin( token, magic ); diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 5909192a..0ff4b6a8 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -78,7 +78,7 @@ Profiler::Profiler() CalibrateTimer(); CalibrateDelay(); - int8_t cpu; + uint32_t cpu; m_timeBegin = GetTime( cpu ); m_thread = std::thread( [this] { Worker(); } ); @@ -274,7 +274,7 @@ bool Profiler::HandleServerQuery() void Profiler::CalibrateTimer() { #ifdef TRACY_RDTSCP_SUPPORTED - int8_t cpu; + uint32_t cpu; std::atomic_signal_fence( std::memory_order_acq_rel ); const auto t0 = std::chrono::high_resolution_clock::now(); const auto r0 = tracy_rdtscp( cpu ); @@ -310,7 +310,7 @@ void Profiler::CalibrateDelay() enum { Events = Iterations * 2 }; // start + end static_assert( Events * 2 < QueuePrealloc, "Delay calibration loop will allocate memory in queue" ); - int8_t cpu; + uint32_t cpu; moodycamel::ProducerToken ptoken( s_queue ); for( int i=0; i( std::chrono::high_resolution_clock::now().time_since_epoch() ).count(); #endif } static tracy_force_inline void FrameMark() { - int8_t cpu; + uint32_t cpu; Magic magic; auto& token = s_token; auto item = s_queue.enqueue_begin( token, magic ); diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 4b1a2965..e657dee3 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -32,14 +32,14 @@ struct QueueZoneBegin int64_t time; uint64_t thread; uint64_t srcloc; // ptr - int8_t cpu; + uint32_t cpu; }; struct QueueZoneEnd { int64_t time; uint64_t thread; - int8_t cpu; + uint32_t cpu; }; struct QueueStringTransfer diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ffdb8fd3..4dcf1d6a 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -446,7 +446,8 @@ void View::ProcessZoneBegin( const QueueZoneBegin& ev ) zone->start = ev.time * m_timerMul; zone->end = -1; zone->srcloc = ev.srcloc; - zone->cpu_start = ev.cpu; + assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits::max() ); + zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu; zone->text = nullptr; std::unique_lock lock( m_lock ); @@ -464,7 +465,8 @@ void View::ProcessZoneEnd( const QueueZoneEnd& ev ) assert( zone->end == -1 ); std::unique_lock lock( m_lock ); zone->end = ev.time * m_timerMul; - zone->cpu_end = ev.cpu; + assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits::max() ); + zone->cpu_end = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu; lock.unlock(); assert( zone->end >= zone->start ); UpdateZone( zone );