From 3e0e1202228b1970ef541a4ffbdf0749a0938202 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 25 Mar 2020 20:04:01 +0100 Subject: [PATCH] Add extra parameter to server queries. --- client/TracyProfiler.cpp | 6 ++++-- common/TracyProtocol.hpp | 1 + server/TracyWorker.cpp | 6 +++--- server/TracyWorker.hpp | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index a8715306..f999d764 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2304,10 +2304,12 @@ static bool DontExit() { return false; } bool Profiler::HandleServerQuery() { uint8_t type; - if( !m_sock->Read( &type, sizeof( type ), 10, DontExit ) ) return false; - uint64_t ptr; + uint32_t extra; + + if( !m_sock->Read( &type, sizeof( type ), 10, DontExit ) ) return false; if( !m_sock->Read( &ptr, sizeof( ptr ), 10, DontExit ) ) return false; + if( !m_sock->Read( &extra, sizeof( extra ), 10, DontExit ) ) return false; switch( type ) { diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 28fcc2a2..80744c6a 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -55,6 +55,7 @@ struct ServerQueryPacket { ServerQuery type; uint64_t ptr; + uint32_t extra; }; enum { ServerQueryPacketSize = sizeof( ServerQueryPacket ) }; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index fd51a26a..bd166fbf 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2790,9 +2790,9 @@ close: m_connected.store( false, std::memory_order_relaxed ); } -void Worker::Query( ServerQuery type, uint64_t data ) +void Worker::Query( ServerQuery type, uint64_t data, uint32_t extra ) { - ServerQueryPacket query { type, data }; + ServerQueryPacket query { type, data, extra }; if( m_serverQuerySpaceLeft > 0 ) { m_serverQuerySpaceLeft--; @@ -2806,7 +2806,7 @@ void Worker::Query( ServerQuery type, uint64_t data ) void Worker::QueryTerminate() { - ServerQueryPacket query { ServerQueryTerminate, 0 }; + ServerQueryPacket query { ServerQueryTerminate, 0, 0 }; m_sock.Send( &query, ServerQueryPacketSize ); } diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index b7ac5414..9e5397c5 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -515,7 +515,7 @@ public: private: void Network(); void Exec(); - void Query( ServerQuery type, uint64_t data ); + void Query( ServerQuery type, uint64_t data, uint32_t extra = 0 ); void QueryTerminate(); tracy_force_inline bool DispatchProcess( const QueueItem& ev, const char*& ptr );