mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Send on-demand initial payload message.
This commit is contained in:
parent
32ca54a523
commit
6a9caabc63
@ -299,8 +299,15 @@ void Profiler::Worker()
|
|||||||
m_isConnected.store( true, std::memory_order_relaxed );
|
m_isConnected.store( true, std::memory_order_relaxed );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_sock->Send( &welcome, sizeof( welcome ) );
|
|
||||||
LZ4_resetStream( m_stream );
|
LZ4_resetStream( m_stream );
|
||||||
|
m_sock->Send( &welcome, sizeof( welcome ) );
|
||||||
|
|
||||||
|
#ifdef TRACY_ON_DEMAND
|
||||||
|
OnDemandPayloadMessage onDemand;
|
||||||
|
onDemand.frames = m_frameCount.load( std::memory_order_relaxed );
|
||||||
|
|
||||||
|
m_sock->Send( &onDemand, sizeof( onDemand ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
int keepAlive = 0;
|
int keepAlive = 0;
|
||||||
for(;;)
|
for(;;)
|
||||||
|
@ -44,6 +44,14 @@ struct WelcomeMessage
|
|||||||
|
|
||||||
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
||||||
|
|
||||||
|
|
||||||
|
struct OnDemandPayloadMessage
|
||||||
|
{
|
||||||
|
uint64_t frames;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum { OnDemandPayloadMessageSize = sizeof( OnDemandPayloadMessage ) };
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -990,6 +990,12 @@ void Worker::Exec()
|
|||||||
char tmp[1024];
|
char tmp[1024];
|
||||||
sprintf( tmp, "%s @ %s", welcome.programName, dtmp );
|
sprintf( tmp, "%s @ %s", welcome.programName, dtmp );
|
||||||
m_captureName = tmp;
|
m_captureName = tmp;
|
||||||
|
|
||||||
|
if( welcome.onDemand != 0 )
|
||||||
|
{
|
||||||
|
OnDemandPayloadMessage onDemand;
|
||||||
|
if( !m_sock.Read( &onDemand, sizeof( onDemand ), &tv, ShouldExit ) ) goto close;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hasData.store( true, std::memory_order_release );
|
m_hasData.store( true, std::memory_order_release );
|
||||||
|
Loading…
Reference in New Issue
Block a user