@@ -30,15 +30,17 @@ std::atomic<TimelineMicrosSource> gTimelineMicrosSource = DefaultMicrosSource;
30
30
inline void FlutterTimelineEvent (const char * label,
31
31
int64_t timestamp0,
32
32
int64_t timestamp1_or_async_id,
33
+ intptr_t flow_id_count,
34
+ const int64_t * flow_ids,
33
35
Dart_Timeline_Event_Type type,
34
36
intptr_t argument_count,
35
37
const char ** argument_names,
36
38
const char ** argument_values) {
37
39
TimelineEventHandler handler =
38
40
gTimelineEventHandler .load (std::memory_order_relaxed);
39
41
if (handler && gAllowlist .Query (label)) {
40
- handler (label, timestamp0, timestamp1_or_async_id, type, argument_count ,
41
- argument_names, argument_values);
42
+ handler (label, timestamp0, timestamp1_or_async_id, flow_id_count, flow_ids ,
43
+ type, argument_count, argument_names, argument_values);
42
44
}
43
45
}
44
46
} // namespace
@@ -73,6 +75,8 @@ void TraceTimelineEvent(TraceArg category_group,
73
75
TraceArg name,
74
76
int64_t timestamp_micros,
75
77
TraceIDArg identifier,
78
+ size_t flow_id_count,
79
+ const uint64_t * flow_ids,
76
80
Dart_Timeline_Event_Type type,
77
81
const std::vector<const char *>& c_names,
78
82
const std::vector<std::string>& values) {
@@ -86,36 +90,47 @@ void TraceTimelineEvent(TraceArg category_group,
86
90
}
87
91
88
92
FlutterTimelineEvent (
89
- name, // label
90
- timestamp_micros, // timestamp0
91
- identifier, // timestamp1_or_async_id
92
- type, // event type
93
- argument_count, // argument_count
94
- const_cast <const char **>(c_names.data ()), // argument_names
95
- c_values.data () // argument_values
93
+ name, // label
94
+ timestamp_micros, // timestamp0
95
+ identifier, // timestamp1_or_async_id
96
+ flow_id_count, // flow_id_count
97
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
98
+ type, // event type
99
+ argument_count, // argument_count
100
+ const_cast <const char **>(c_names.data ()), // argument_names
101
+ c_values.data () // argument_values
96
102
);
97
103
}
98
104
99
105
void TraceTimelineEvent (TraceArg category_group,
100
106
TraceArg name,
101
107
TraceIDArg identifier,
108
+ size_t flow_id_count,
109
+ const uint64_t * flow_ids,
102
110
Dart_Timeline_Event_Type type,
103
111
const std::vector<const char *>& c_names,
104
112
const std::vector<std::string>& values) {
105
113
TraceTimelineEvent (category_group, // group
106
114
name, // name
107
115
gTimelineMicrosSource .load ()(), // timestamp_micros
108
116
identifier, // identifier
117
+ flow_id_count, // flow_id_count
118
+ flow_ids, // flow_ids
109
119
type, // type
110
120
c_names, // names
111
121
values // values
112
122
);
113
123
}
114
124
115
- void TraceEvent0 (TraceArg category_group, TraceArg name) {
125
+ void TraceEvent0 (TraceArg category_group,
126
+ TraceArg name,
127
+ size_t flow_id_count,
128
+ const uint64_t * flow_ids) {
116
129
FlutterTimelineEvent (name, // label
117
130
gTimelineMicrosSource .load ()(), // timestamp0
118
- 0 , // timestamp1_or_async_id
131
+ 0 , // timestamp1_or_async_id
132
+ flow_id_count, // flow_id_count
133
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
119
134
Dart_Timeline_Event_Begin, // event type
120
135
0 , // argument_count
121
136
nullptr , // argument_names
@@ -125,13 +140,17 @@ void TraceEvent0(TraceArg category_group, TraceArg name) {
125
140
126
141
void TraceEvent1 (TraceArg category_group,
127
142
TraceArg name,
143
+ size_t flow_id_count,
144
+ const uint64_t * flow_ids,
128
145
TraceArg arg1_name,
129
146
TraceArg arg1_val) {
130
147
const char * arg_names[] = {arg1_name};
131
148
const char * arg_values[] = {arg1_val};
132
149
FlutterTimelineEvent (name, // label
133
150
gTimelineMicrosSource .load ()(), // timestamp0
134
- 0 , // timestamp1_or_async_id
151
+ 0 , // timestamp1_or_async_id
152
+ flow_id_count, // flow_id_count
153
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
135
154
Dart_Timeline_Event_Begin, // event type
136
155
1 , // argument_count
137
156
arg_names, // argument_names
@@ -141,6 +160,8 @@ void TraceEvent1(TraceArg category_group,
141
160
142
161
void TraceEvent2 (TraceArg category_group,
143
162
TraceArg name,
163
+ size_t flow_id_count,
164
+ const uint64_t * flow_ids,
144
165
TraceArg arg1_name,
145
166
TraceArg arg1_val,
146
167
TraceArg arg2_name,
@@ -149,7 +170,9 @@ void TraceEvent2(TraceArg category_group,
149
170
const char * arg_values[] = {arg1_val, arg2_val};
150
171
FlutterTimelineEvent (name, // label
151
172
gTimelineMicrosSource .load ()(), // timestamp0
152
- 0 , // timestamp1_or_async_id
173
+ 0 , // timestamp1_or_async_id
174
+ flow_id_count, // flow_id_count
175
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
153
176
Dart_Timeline_Event_Begin, // event type
154
177
2 , // argument_count
155
178
arg_names, // argument_names
@@ -161,6 +184,8 @@ void TraceEventEnd(TraceArg name) {
161
184
FlutterTimelineEvent (name, // label
162
185
gTimelineMicrosSource .load ()(), // timestamp0
163
186
0 , // timestamp1_or_async_id
187
+ 0 , // flow_id_count
188
+ nullptr , // flow_ids
164
189
Dart_Timeline_Event_End, // event type
165
190
0 , // argument_count
166
191
nullptr , // argument_names
@@ -170,10 +195,14 @@ void TraceEventEnd(TraceArg name) {
170
195
171
196
void TraceEventAsyncBegin0 (TraceArg category_group,
172
197
TraceArg name,
173
- TraceIDArg id) {
198
+ TraceIDArg id,
199
+ size_t flow_id_count,
200
+ const uint64_t * flow_ids) {
174
201
FlutterTimelineEvent (name, // label
175
202
gTimelineMicrosSource .load ()(), // timestamp0
176
- id, // timestamp1_or_async_id
203
+ id, // timestamp1_or_async_id
204
+ flow_id_count, // flow_id_count
205
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
177
206
Dart_Timeline_Event_Async_Begin, // event type
178
207
0 , // argument_count
179
208
nullptr , // argument_names
@@ -187,6 +216,8 @@ void TraceEventAsyncEnd0(TraceArg category_group,
187
216
FlutterTimelineEvent (name, // label
188
217
gTimelineMicrosSource .load ()(), // timestamp0
189
218
id, // timestamp1_or_async_id
219
+ 0 , // flow_id_count
220
+ nullptr , // flow_ids
190
221
Dart_Timeline_Event_Async_End, // event type
191
222
0 , // argument_count
192
223
nullptr , // argument_names
@@ -197,13 +228,17 @@ void TraceEventAsyncEnd0(TraceArg category_group,
197
228
void TraceEventAsyncBegin1 (TraceArg category_group,
198
229
TraceArg name,
199
230
TraceIDArg id,
231
+ size_t flow_id_count,
232
+ const uint64_t * flow_ids,
200
233
TraceArg arg1_name,
201
234
TraceArg arg1_val) {
202
235
const char * arg_names[] = {arg1_name};
203
236
const char * arg_values[] = {arg1_val};
204
237
FlutterTimelineEvent (name, // label
205
238
gTimelineMicrosSource .load ()(), // timestamp0
206
- id, // timestamp1_or_async_id
239
+ id, // timestamp1_or_async_id
240
+ flow_id_count, // flow_id_count
241
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
207
242
Dart_Timeline_Event_Async_Begin, // event type
208
243
1 , // argument_count
209
244
arg_names, // argument_names
@@ -221,17 +256,24 @@ void TraceEventAsyncEnd1(TraceArg category_group,
221
256
FlutterTimelineEvent (name, // label
222
257
gTimelineMicrosSource .load ()(), // timestamp0
223
258
id, // timestamp1_or_async_id
259
+ 0 , // flow_id_count
260
+ nullptr , // flow_ids
224
261
Dart_Timeline_Event_Async_End, // event type
225
262
1 , // argument_count
226
263
arg_names, // argument_names
227
264
arg_values // argument_values
228
265
);
229
266
}
230
267
231
- void TraceEventInstant0 (TraceArg category_group, TraceArg name) {
268
+ void TraceEventInstant0 (TraceArg category_group,
269
+ TraceArg name,
270
+ size_t flow_id_count,
271
+ const uint64_t * flow_ids) {
232
272
FlutterTimelineEvent (name, // label
233
273
gTimelineMicrosSource .load ()(), // timestamp0
234
- 0 , // timestamp1_or_async_id
274
+ 0 , // timestamp1_or_async_id
275
+ flow_id_count, // flow_id_count
276
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
235
277
Dart_Timeline_Event_Instant, // event type
236
278
0 , // argument_count
237
279
nullptr , // argument_names
@@ -241,13 +283,17 @@ void TraceEventInstant0(TraceArg category_group, TraceArg name) {
241
283
242
284
void TraceEventInstant1 (TraceArg category_group,
243
285
TraceArg name,
286
+ size_t flow_id_count,
287
+ const uint64_t * flow_ids,
244
288
TraceArg arg1_name,
245
289
TraceArg arg1_val) {
246
290
const char * arg_names[] = {arg1_name};
247
291
const char * arg_values[] = {arg1_val};
248
292
FlutterTimelineEvent (name, // label
249
293
gTimelineMicrosSource .load ()(), // timestamp0
250
- 0 , // timestamp1_or_async_id
294
+ 0 , // timestamp1_or_async_id
295
+ flow_id_count, // flow_id_count
296
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
251
297
Dart_Timeline_Event_Instant, // event type
252
298
1 , // argument_count
253
299
arg_names, // argument_names
@@ -257,6 +303,8 @@ void TraceEventInstant1(TraceArg category_group,
257
303
258
304
void TraceEventInstant2 (TraceArg category_group,
259
305
TraceArg name,
306
+ size_t flow_id_count,
307
+ const uint64_t * flow_ids,
260
308
TraceArg arg1_name,
261
309
TraceArg arg1_val,
262
310
TraceArg arg2_name,
@@ -265,7 +313,9 @@ void TraceEventInstant2(TraceArg category_group,
265
313
const char * arg_values[] = {arg1_val, arg2_val};
266
314
FlutterTimelineEvent (name, // label
267
315
gTimelineMicrosSource .load ()(), // timestamp0
268
- 0 , // timestamp1_or_async_id
316
+ 0 , // timestamp1_or_async_id
317
+ flow_id_count, // flow_id_count
318
+ reinterpret_cast <const int64_t *>(flow_ids), // flow_ids
269
319
Dart_Timeline_Event_Instant, // event type
270
320
2 , // argument_count
271
321
arg_names, // argument_names
@@ -278,7 +328,9 @@ void TraceEventFlowBegin0(TraceArg category_group,
278
328
TraceIDArg id) {
279
329
FlutterTimelineEvent (name, // label
280
330
gTimelineMicrosSource .load ()(), // timestamp0
281
- id, // timestamp1_or_async_id
331
+ id, // timestamp1_or_async_id
332
+ 0 , // flow_id_count
333
+ nullptr , // flow_ids
282
334
Dart_Timeline_Event_Flow_Begin, // event type
283
335
0 , // argument_count
284
336
nullptr , // argument_names
@@ -292,6 +344,8 @@ void TraceEventFlowStep0(TraceArg category_group,
292
344
FlutterTimelineEvent (name, // label
293
345
gTimelineMicrosSource .load ()(), // timestamp0
294
346
id, // timestamp1_or_async_id
347
+ 0 , // flow_id_count
348
+ nullptr , // flow_ids
295
349
Dart_Timeline_Event_Flow_Step, // event type
296
350
0 , // argument_count
297
351
nullptr , // argument_names
@@ -303,6 +357,8 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id) {
303
357
FlutterTimelineEvent (name, // label
304
358
gTimelineMicrosSource .load ()(), // timestamp0
305
359
id, // timestamp1_or_async_id
360
+ 0 , // flow_id_count
361
+ nullptr , // flow_ids
306
362
Dart_Timeline_Event_Flow_End, // event type
307
363
0 , // argument_count
308
364
nullptr , // argument_names
0 commit comments