mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Send program name in welcome message.
This commit is contained in:
parent
6485457518
commit
cf07383db8
@ -114,6 +114,9 @@ void Profiler::Worker()
|
||||
}
|
||||
|
||||
{
|
||||
const auto procname = GetProcessName();
|
||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||
|
||||
WelcomeMessage welcome;
|
||||
#ifdef DISABLE_LZ4
|
||||
// notify client that lz4 compression is disabled (too slow in debug builds)
|
||||
@ -125,6 +128,8 @@ void Profiler::Worker()
|
||||
welcome.timeBegin = m_timeBegin;
|
||||
welcome.delay = m_delay;
|
||||
welcome.resolution = m_resolution;
|
||||
memcpy( welcome.programName, procname, pnsz );
|
||||
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||
|
||||
m_sock->Send( &welcome, sizeof( welcome ) );
|
||||
}
|
||||
|
@ -24,6 +24,8 @@ enum ServerQuery : uint8_t
|
||||
ServerQuerySourceLocation,
|
||||
};
|
||||
|
||||
enum { WelcomeMessageProgramNameSize = 64 };
|
||||
|
||||
#pragma pack( 1 )
|
||||
struct WelcomeMessage
|
||||
{
|
||||
@ -32,9 +34,12 @@ struct WelcomeMessage
|
||||
uint64_t timeBegin;
|
||||
uint64_t delay;
|
||||
uint64_t resolution;
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user