2017-09-13 20:56:55 +00:00
|
|
|
#ifndef __TRACYPROTOCOL_HPP__
|
|
|
|
#define __TRACYPROTOCOL_HPP__
|
|
|
|
|
|
|
|
#include <limits>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "../common/tracy_lz4.hpp"
|
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
2017-10-19 21:48:16 +00:00
|
|
|
using lz4sz_t = uint32_t;
|
2017-09-13 20:58:04 +00:00
|
|
|
|
2017-10-19 21:48:16 +00:00
|
|
|
enum { TargetFrameSize = 256 * 1024 };
|
2017-09-13 20:56:55 +00:00
|
|
|
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" );
|
2017-09-17 11:24:50 +00:00
|
|
|
static_assert( TargetFrameSize * 2 >= 64 * 1024, "Not enough space for LZ4 stream buffer" );
|
2017-09-13 20:56:55 +00:00
|
|
|
|
2017-09-21 23:51:24 +00:00
|
|
|
enum ServerQuery : uint8_t
|
|
|
|
{
|
2017-10-18 16:48:51 +00:00
|
|
|
ServerQueryTerminate,
|
2017-09-21 23:51:24 +00:00
|
|
|
ServerQueryString,
|
2017-09-26 00:28:14 +00:00
|
|
|
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-15 11:06:49 +00:00
|
|
|
ServerQueryMessageLiteral,
|
2017-09-21 23:51:24 +00:00
|
|
|
};
|
|
|
|
|
2017-10-03 21:17:58 +00:00
|
|
|
enum { WelcomeMessageProgramNameSize = 64 };
|
|
|
|
|
2017-09-24 14:10:28 +00:00
|
|
|
#pragma pack( 1 )
|
|
|
|
struct WelcomeMessage
|
|
|
|
{
|
|
|
|
uint8_t lz4;
|
2017-09-25 22:13:24 +00:00
|
|
|
double timerMul;
|
2017-10-16 23:10:38 +00:00
|
|
|
uint64_t initBegin;
|
|
|
|
uint64_t initEnd;
|
2017-09-24 14:10:28 +00:00
|
|
|
uint64_t delay;
|
2017-09-29 16:32:07 +00:00
|
|
|
uint64_t resolution;
|
2017-10-03 21:26:41 +00:00
|
|
|
uint64_t epoch;
|
2017-10-03 21:17:58 +00:00
|
|
|
char programName[WelcomeMessageProgramNameSize];
|
2017-09-24 14:10:28 +00:00
|
|
|
};
|
|
|
|
#pragma pack()
|
|
|
|
|
2017-10-03 21:17:58 +00:00
|
|
|
enum { WelcomeMessageSize = sizeof( WelcomeMessage ) };
|
|
|
|
|
2017-09-13 20:56:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|