mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 05:03:53 +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;
|
WelcomeMessage welcome;
|
||||||
#ifdef DISABLE_LZ4
|
#ifdef DISABLE_LZ4
|
||||||
// notify client that lz4 compression is disabled (too slow in debug builds)
|
// notify client that lz4 compression is disabled (too slow in debug builds)
|
||||||
@ -125,6 +128,8 @@ void Profiler::Worker()
|
|||||||
welcome.timeBegin = m_timeBegin;
|
welcome.timeBegin = m_timeBegin;
|
||||||
welcome.delay = m_delay;
|
welcome.delay = m_delay;
|
||||||
welcome.resolution = m_resolution;
|
welcome.resolution = m_resolution;
|
||||||
|
memcpy( welcome.programName, procname, pnsz );
|
||||||
|
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||||
|
|
||||||
m_sock->Send( &welcome, sizeof( welcome ) );
|
m_sock->Send( &welcome, sizeof( welcome ) );
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ enum ServerQuery : uint8_t
|
|||||||
ServerQuerySourceLocation,
|
ServerQuerySourceLocation,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum { WelcomeMessageProgramNameSize = 64 };
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( 1 )
|
||||||
struct WelcomeMessage
|
struct WelcomeMessage
|
||||||
{
|
{
|
||||||
@ -32,9 +34,12 @@ struct WelcomeMessage
|
|||||||
uint64_t timeBegin;
|
uint64_t timeBegin;
|
||||||
uint64_t delay;
|
uint64_t delay;
|
||||||
uint64_t resolution;
|
uint64_t resolution;
|
||||||
|
char programName[WelcomeMessageProgramNameSize];
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user