tracy/common/TracyProtocol.hpp

49 lines
1012 B
C++
Raw Normal View History

#ifndef __TRACYPROTOCOL_HPP__
#define __TRACYPROTOCOL_HPP__
#include <limits>
#include <stdint.h>
#include "../common/tracy_lz4.hpp"
namespace tracy
{
2017-09-13 20:58:04 +00:00
using lz4sz_t = uint16_t;
enum { TargetFrameSize = 64000 };
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
2017-09-13 20:58:04 +00:00
static_assert( LZ4Size <= std::numeric_limits<lz4sz_t>::max(), "LZ4Size greater than lz4sz_t" );
static_assert( TargetFrameSize * 2 >= 64 * 1024, "Not enough space for LZ4 stream buffer" );
enum ServerQuery : uint8_t
{
ServerQueryString,
ServerQueryThreadString,
2017-09-27 00:18:17 +00:00
ServerQueryCustomString,
ServerQuerySourceLocation,
2017-10-13 01:36:59 +00:00
ServerQueryPlotName,
2017-10-14 12:28:04 +00:00
ServerQueryMessage,
};
2017-10-03 21:17:58 +00:00
enum { WelcomeMessageProgramNameSize = 64 };
#pragma pack( 1 )
struct WelcomeMessage
{
uint8_t lz4;
double timerMul;
uint64_t timeBegin;
uint64_t delay;
2017-09-29 16:32:07 +00:00
uint64_t resolution;
uint64_t epoch;
2017-10-03 21:17:58 +00:00
char programName[WelcomeMessageProgramNameSize];
};
#pragma pack()
2017-10-03 21:17:58 +00:00
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
}
#endif