-
Notifications
You must be signed in to change notification settings - Fork 8
/
trace.proto
202 lines (161 loc) · 4.12 KB
/
trace.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
* Copyright(c) 2012-2020 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
syntax = "proto3";
option cc_generic_services = true;
import "google/protobuf/timestamp.proto";
package octf.proto.trace;
/**
* @brief Generic trace event
*/
message EventHeader {
/** Event sequence ID */
uint64 sid = 1;
/** Time stamp */
uint64 timestamp = 2;
}
/**
* @brief Device description event - provides mapping between
* device id and name
*/
message EventDeviceDescription {
/** Device Id */
uint64 id = 1;
/** Device Name */
string name = 2;
/** Device size in sectors */
uint64 size = 3;
/** Device Model */
string model = 4;
}
/** @brief IO operation direction */
enum IoType {
UnknownIoType = 0;
Read = 1;
Write = 2;
Discard = 3;
}
enum FsEventType {
UnknownFsEventType = 0;
Create = 1;
Delete = 2;
MoveTo = 3;
MoveFrom = 4;
Access = 5;
}
/**
* @brief Structure describing a given inode
*
* Combines inode file id with its creation date and partition for more unambigious
* identification of specific file.
*/
message FileId {
uint64 partitionId = 1;
uint64 id = 2;
google.protobuf.Timestamp creationDate = 3;
}
/**
* @brief IO trace event
*/
message EventIo {
/** Address of IO in sectors */
uint64 lba = 1;
/** Size of IO in sectors */
uint32 len = 2;
/**
* IO class of IO
* @deprecated since version 2, replaced by: metadata and direct flags, and file size
*/
uint32 ioClass = 3;
/** Device ID */
uint64 deviceId = 4;
/** Operation type: read, write, trim */
IoType operation = 5;
/** Flush flag */
bool flush = 6;
/** FUA flag */
bool fua = 7;
/** Write (lifetime) hint */
uint32 writeHint = 8;
/**
* This ID can be used by the tracing environment to assign an ID to the IO.
* Zero means not set.
*/
uint64 id = 9;
/** Metadata IO, for example filesystem one */
bool metadata = 10;
/** Direct IO, for example IO which bypasses memory cache */
bool direct = 11;
/** Read ahead IO, for example triggered by page cache */
bool readahead = 12;
}
/**
* @brief IO completion trace event
*/
message EventIoCompletion {
/** Address of completed IO in sectors */
uint64 lba = 1;
/** Size of completed IO in sectors */
uint32 len = 2;
/** Flags indicates if IO ended with an error */
bool error = 3;
/** Device ID */
uint64 deviceId = 4;
/**
* The ID of an IO which is completed. Environment can set ID of IO which is
* completed.
*/
uint64 refId = 5;
}
/**
* @brief IO trace event metadata (e.g. filesystem meta information)
*
* If an application works on top of a filesystem it may perform IO operations
* to files. This structure contains meta information about IO in domain of
* filesystem. For example it provides information about file size,
* file offset of IO, etc.
*/
message EventIoFilesystemMeta {
/**
* Event sequence ID reference to IO trace event associated with this event
* @deprecated since version 2, replaced by: refId
*/
uint64 refSid = 1;
/** File ID */
FileId fileId = 2;
/** File offset in sectors */
uint64 fileOffset = 3;
/** File size in sectors */
uint64 fileSize = 4;
/**
* Event ID reference to IO trace event associated with this event
*/
uint64 refId = 5;
};
message EventIoFilesystemFileName {
/** File ID */
FileId fileId = 1;
/** File parent ID */
FileId fileParentId = 2;
/** File Name */
string fileName = 3;
}
message EventIoFilesystemFileEvent {
/** File ID */
FileId fileId = 1;
/** Type of FS event */
FsEventType fsEventType = 2;
}
message Event {
/** Trace event header */
EventHeader header = 1;
oneof EventType {
EventIo io = 2;
EventDeviceDescription deviceDescription = 3;
EventIoFilesystemMeta filesystemMeta = 4;
EventIoCompletion ioCompletion = 5;
EventIoFilesystemFileName filesystemFileName = 6;
EventIoFilesystemFileEvent filesystemFileEvent = 7;
}
}