Add extra parameter to server queries.

This commit is contained in:
Bartosz Taudul 2020-03-25 20:04:01 +01:00
parent 383918bca4
commit 3e0e120222
4 changed files with 9 additions and 6 deletions

View File

@ -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 )
{

View File

@ -55,6 +55,7 @@ struct ServerQueryPacket
{
ServerQuery type;
uint64_t ptr;
uint32_t extra;
};
enum { ServerQueryPacketSize = sizeof( ServerQueryPacket ) };

View File

@ -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 );
}

View File

@ -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 );