mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Send signed active time in broadcast message.
This allows special treatment of negative values.
This commit is contained in:
parent
f9c1b63a3b
commit
5c826c2723
@ -1390,7 +1390,8 @@ void Profiler::Worker()
|
||||
{
|
||||
lastBroadcast = t;
|
||||
const auto ts = std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
|
||||
broadcastMsg.activeTime = uint32_t( ts - m_epoch );
|
||||
broadcastMsg.activeTime = int32_t( ts - m_epoch );
|
||||
assert( broadcastMsg.activeTime >= 0 );
|
||||
m_broadcast->Send( broadcastPort, &broadcastMsg, broadcastLen );
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace tracy
|
||||
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
|
||||
|
||||
enum : uint32_t { ProtocolVersion = 40 };
|
||||
enum : uint32_t { BroadcastVersion = 1 };
|
||||
enum : uint32_t { BroadcastVersion = 2 };
|
||||
|
||||
using lz4sz_t = uint32_t;
|
||||
|
||||
@ -111,7 +111,7 @@ struct BroadcastMessage
|
||||
uint32_t broadcastVersion;
|
||||
uint32_t protocolVersion;
|
||||
uint32_t listenPort;
|
||||
uint32_t activeTime; // in seconds
|
||||
int32_t activeTime; // in seconds
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
};
|
||||
|
||||
|
@ -106,7 +106,7 @@ struct ClientData
|
||||
{
|
||||
int64_t time;
|
||||
uint32_t protocolVersion;
|
||||
uint32_t activeTime;
|
||||
int32_t activeTime;
|
||||
uint32_t port;
|
||||
std::string procName;
|
||||
std::string address;
|
||||
|
Loading…
Reference in New Issue
Block a user