From fd9fc880a6dfadcdfb55660ede7bfb7f8d2e37b3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 21 Jun 2019 19:34:34 +0200 Subject: [PATCH] Send current time in on-demand welcome message. --- client/TracyProfiler.cpp | 2 ++ common/TracyProtocol.hpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 5cbc19e9..57c065d5 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1188,6 +1188,7 @@ void Profiler::Worker() } #ifdef TRACY_ON_DEMAND + const auto currentTime = GetTime(); ClearQueues( token ); m_connectionId.fetch_add( 1, std::memory_order_release ); m_isConnected.store( true, std::memory_order_release ); @@ -1202,6 +1203,7 @@ void Profiler::Worker() #ifdef TRACY_ON_DEMAND OnDemandPayloadMessage onDemand; onDemand.frames = m_frameCount.load( std::memory_order_relaxed ); + onDemand.currentTime = currentTime; m_sock->Send( &onDemand, sizeof( onDemand ) ); diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 7949aed0..f816ca70 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -9,7 +9,7 @@ namespace tracy { -enum : uint32_t { ProtocolVersion = 8 }; +enum : uint32_t { ProtocolVersion = 9 }; enum : uint32_t { BroadcastVersion = 0 }; using lz4sz_t = uint32_t; @@ -76,6 +76,7 @@ enum { WelcomeMessageSize = sizeof( WelcomeMessage ) }; struct OnDemandPayloadMessage { uint64_t frames; + uint64_t currentTime; }; enum { OnDemandPayloadMessageSize = sizeof( OnDemandPayloadMessage ) };