VR-Vantage 2.8 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
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
= 40 };
13
enum
:
uint32_t
{
BroadcastVersion
= 1 };
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
};
56
57
struct
ServerQueryPacket
58
{
59
ServerQuery
type
;
60
uint64_t
ptr
;
61
uint32_t
extra
;
62
};
63
64
enum
{
ServerQueryPacketSize
=
sizeof
(
ServerQueryPacket
) };
65
66
67
enum
CpuArchitecture
:
uint8_t
68
{
69
CpuArchUnknown
,
70
CpuArchX86
,
71
CpuArchX64
,
72
CpuArchArm32
,
73
CpuArchArm64
74
};
75
76
77
struct
WelcomeMessage
78
{
79
double
timerMul
;
80
int64_t
initBegin
;
81
int64_t
initEnd
;
82
uint64_t
delay
;
83
uint64_t
resolution
;
84
uint64_t
epoch
;
85
uint64_t
pid
;
86
int64_t
samplingPeriod
;
87
uint8_t
onDemand
;
88
uint8_t
isApple
;
89
uint8_t
cpuArch
;
90
uint8_t
codeTransfer
;
91
char
cpuManufacturer
[12];
92
uint32_t
cpuId
;
93
char
programName
[
WelcomeMessageProgramNameSize
];
94
char
hostInfo
[
WelcomeMessageHostInfoSize
];
95
};
96
97
enum
{
WelcomeMessageSize
=
sizeof
(
WelcomeMessage
) };
98
99
100
struct
OnDemandPayloadMessage
101
{
102
uint64_t
frames
;
103
uint64_t
currentTime
;
104
};
105
106
enum
{
OnDemandPayloadMessageSize
=
sizeof
(
OnDemandPayloadMessage
) };
107
108
109
struct
BroadcastMessage
110
{
111
uint32_t
broadcastVersion
;
112
uint32_t
protocolVersion
;
113
uint32_t
listenPort
;
114
uint32_t
activeTime
;
// in seconds
115
char
programName
[
WelcomeMessageProgramNameSize
];
116
};
117
118
enum
{
BroadcastMessageSize
=
sizeof
(
BroadcastMessage
) };
119
120
#pragma pack()
121
122
}
123
124
#endif
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (
www.mak.com
)