VR-Vantage 3.0 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
TracyClient
common
TracyProtocol.hpp
Go to the documentation of this file.
1
#ifndef __TRACYPROTOCOL_HPP__
2
#define __TRACYPROTOCOL_HPP__
3
4
#include <limits>
5
#include <
stdint.h
>
6
7
namespace
tracy
8
{
9
10
constexpr
unsigned
Lz4CompressBound
(
unsigned
isize
) {
return
isize + ( isize / 255 ) + 16; }
11
12
enum
:
uint32_t
{
ProtocolVersion
= 46 };
13
enum
:
uint16_t
{
BroadcastVersion
= 2 };
14
15
using
lz4sz_t =
uint32_t
;
16
17
enum
{
TargetFrameSize
= 256 * 1024 };
18
enum
{
LZ4Size
=
Lz4CompressBound
(
TargetFrameSize
) };
19
static_assert
(
LZ4Size
<=
std::numeric_limits<lz4sz_t>::max
(),
"LZ4Size greater than lz4sz_t"
);
20
static_assert
(
TargetFrameSize
* 2 >= 64 * 1024,
"Not enough space for LZ4 stream buffer"
);
21
22
enum
{
HandshakeShibbolethSize
= 8 };
23
static
const
char
HandshakeShibboleth
[
HandshakeShibbolethSize
] = {
'T'
,
'r'
,
'a'
,
'c'
,
'y'
,
'P'
,
'r'
,
'f'
};
24
25
enum
HandshakeStatus
:
uint8_t
26
{
27
HandshakePending
,
28
HandshakeWelcome
,
29
HandshakeProtocolMismatch
,
30
HandshakeNotAvailable
,
31
HandshakeDropped
32
};
33
34
enum
{
WelcomeMessageProgramNameSize
= 64 };
35
enum
{
WelcomeMessageHostInfoSize
= 1024 };
36
37
#pragma pack( 1 )
38
39
// Must increase left query space after handling!
40
enum
ServerQuery
:
uint8_t
41
{
42
ServerQueryTerminate
,
43
ServerQueryString
,
44
ServerQueryThreadString
,
45
ServerQuerySourceLocation
,
46
ServerQueryPlotName
,
47
ServerQueryCallstackFrame
,
48
ServerQueryFrameName
,
49
ServerQueryDisconnect
,
50
ServerQueryExternalName
,
51
ServerQueryParameter
,
52
ServerQuerySymbol
,
53
ServerQuerySymbolCode
,
54
ServerQueryCodeLocation
,
55
ServerQuerySourceCode
,
56
ServerQueryDataTransfer
,
57
ServerQueryDataTransferPart
58
};
59
60
struct
ServerQueryPacket
61
{
62
ServerQuery
type
;
63
uint64_t
ptr
;
64
uint32_t
extra
;
65
};
66
67
enum
{
ServerQueryPacketSize
=
sizeof
(
ServerQueryPacket
) };
68
69
70
enum
CpuArchitecture
:
uint8_t
71
{
72
CpuArchUnknown
,
73
CpuArchX86
,
74
CpuArchX64
,
75
CpuArchArm32
,
76
CpuArchArm64
77
};
78
79
80
struct
WelcomeMessage
81
{
82
double
timerMul
;
83
int64_t
initBegin
;
84
int64_t
initEnd
;
85
uint64_t
delay
;
86
uint64_t
resolution
;
87
uint64_t
epoch
;
88
uint64_t
exectime
;
89
uint64_t
pid
;
90
int64_t
samplingPeriod
;
91
uint8_t
onDemand
;
92
uint8_t
isApple
;
93
uint8_t
cpuArch
;
94
uint8_t
codeTransfer
;
95
char
cpuManufacturer
[12];
96
uint32_t
cpuId
;
97
char
programName
[
WelcomeMessageProgramNameSize
];
98
char
hostInfo
[
WelcomeMessageHostInfoSize
];
99
};
100
101
enum
{
WelcomeMessageSize
=
sizeof
(
WelcomeMessage
) };
102
103
104
struct
OnDemandPayloadMessage
105
{
106
uint64_t
frames
;
107
uint64_t
currentTime
;
108
};
109
110
enum
{
OnDemandPayloadMessageSize
=
sizeof
(
OnDemandPayloadMessage
) };
111
112
113
struct
BroadcastMessage
114
{
115
uint16_t
broadcastVersion
;
116
uint16_t
listenPort
;
117
uint32_t
protocolVersion
;
118
int32_t
activeTime
;
// in seconds
119
char
programName
[
WelcomeMessageProgramNameSize
];
120
};
121
122
enum
{
BroadcastMessageSize
=
sizeof
(
BroadcastMessage
) };
123
124
#pragma pack()
125
126
}
127
128
#endif
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (
www.mak.com
)