mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Send host info in welcome message.
This commit is contained in:
parent
9c0e6620b3
commit
bd76f4cd10
@ -448,6 +448,7 @@ void Profiler::Worker()
|
||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||
|
||||
const auto hostinfo = GetHostInfo();
|
||||
const auto hisz = std::min<size_t>( strlen( hostinfo ), WelcomeMessageHostInfoSize - 1 );
|
||||
|
||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
|
||||
@ -467,6 +468,8 @@ void Profiler::Worker()
|
||||
MemWrite( &welcome.onDemand, onDemand );
|
||||
memcpy( welcome.programName, procname, pnsz );
|
||||
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||
memcpy( welcome.hostInfo, hostinfo, hisz );
|
||||
memset( welcome.hostInfo + hisz, 0, WelcomeMessageHostInfoSize - hisz );
|
||||
|
||||
moodycamel::ConsumerToken token( s_queue );
|
||||
|
||||
|
@ -28,6 +28,7 @@ enum ServerQuery : uint8_t
|
||||
};
|
||||
|
||||
enum { WelcomeMessageProgramNameSize = 64 };
|
||||
enum { WelcomeMessageHostInfoSize = 1024 };
|
||||
|
||||
#pragma pack( 1 )
|
||||
|
||||
@ -41,6 +42,7 @@ struct WelcomeMessage
|
||||
uint64_t epoch;
|
||||
uint8_t onDemand;
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
char hostInfo[WelcomeMessageHostInfoSize];
|
||||
};
|
||||
|
||||
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
||||
|
Loading…
Reference in New Issue
Block a user