Include PID in broadcast message.

This commit is contained in:
Bartosz Taudul 2022-10-09 21:54:16 +02:00
parent ff36c9004f
commit f509ed1561
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 3 additions and 1 deletions

View File

@ -732,6 +732,7 @@ static BroadcastMessage& GetBroadcastMessage( const char* procname, size_t pnsz,
msg.broadcastVersion = BroadcastVersion;
msg.protocolVersion = ProtocolVersion;
msg.listenPort = port;
msg.pid = GetPid();
memcpy( msg.programName, procname, pnsz );
memset( msg.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );

View File

@ -10,7 +10,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 60 };
enum : uint16_t { BroadcastVersion = 2 };
enum : uint16_t { BroadcastVersion = 3 };
using lz4sz_t = uint32_t;
@ -127,6 +127,7 @@ struct BroadcastMessage
uint16_t broadcastVersion;
uint16_t listenPort;
uint32_t protocolVersion;
uint64_t pid;
int32_t activeTime; // in seconds
char programName[WelcomeMessageProgramNameSize];
};