Skip to content

Commit 10e0828

Browse files
committed
[dns] color key for track event for discussion
1 parent d15aa8f commit 10e0828

File tree

11 files changed

+471
-298
lines changed

11 files changed

+471
-298
lines changed

include/perfetto/public/protos/trace/interned_data/interned_data.pzc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,5 +213,10 @@ PERFETTO_PB_FIELD(perfetto_protos_InternedData,
213213
perfetto_protos_AppWakelockInfo,
214214
app_wakelock_info,
215215
42);
216+
PERFETTO_PB_FIELD(perfetto_protos_InternedData,
217+
MSG,
218+
perfetto_protos_InternedString,
219+
correlation_id_str,
220+
43);
216221

217222
#endif // INCLUDE_PERFETTO_PUBLIC_PROTOS_TRACE_INTERNED_DATA_INTERNED_DATA_PZC_H_

include/perfetto/public/protos/trace/track_event/track_event.pzc.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,21 @@ PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
170170
uint64_t,
171171
terminating_flow_ids,
172172
48);
173+
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
174+
VARINT,
175+
uint64_t,
176+
correlation_id,
177+
52);
178+
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
179+
STRING,
180+
const char*,
181+
correlation_id_str,
182+
53);
183+
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
184+
VARINT,
185+
uint64_t,
186+
correlation_id_str_iid,
187+
54);
173188
PERFETTO_PB_FIELD(perfetto_protos_TrackEvent,
174189
MSG,
175190
perfetto_protos_DebugAnnotation,

protos/perfetto/trace/interned_data/interned_data.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ package perfetto.protos;
5656
// emitted proactively in advance of referring to them in later packets.
5757
//
5858
// Next reserved id: 8 (up to 15).
59-
// Next id: 43.
59+
// Next id: 44.
6060
message InternedData {
6161
// TODO(eseckler): Replace iid fields inside interned messages with
6262
// map<iid, message> type fields in InternedData.
@@ -145,6 +145,9 @@ message InternedData {
145145
// Interned context for android.app_wakelocks.
146146
repeated AppWakelockInfo app_wakelock_info = 42;
147147

148+
// Interned correlation ids in track_event.
149+
repeated InternedString correlation_id_str = 43;
150+
148151
// removed ProfiledFrameSymbols profiled_frame_symbols
149152
reserved 21;
150153
}

protos/perfetto/trace/perfetto_trace.proto

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13717,7 +13717,7 @@ message TaskExecution {
1371713717
// their default track association) can be emitted as part of a
1371813718
// TrackEventDefaults message.
1371913719
//
13720-
// Next reserved id: 13 (up to 15). Next id: 52.
13720+
// Next reserved id: 13 (up to 15). Next id: 55.
1372113721
message TrackEvent {
1372213722
// Names of categories of the event. In the client library, categories are a
1372313723
// way to turn groups of individual events on or off.
@@ -13846,6 +13846,46 @@ message TrackEvent {
1384613846
// "terminating_flow_ids" to reduce memory consumption.
1384713847
repeated fixed64 terminating_flow_ids = 48;
1384813848

13849+
// An opaque identifier to correlate this slice with other slices that are
13850+
// considered part of the same logical operation, even if they are not
13851+
// causally connected. Examples uses of a correlation id might be the number
13852+
// of frame going through various stages of rendering in a GPU, the id for an
13853+
// RPC request going through a distributed system, or the id of a network
13854+
// request going through various stages of processing by the kernel.
13855+
//
13856+
// NOTE: if the events *are* causually connected, you probably want to use
13857+
// flows instead of OR in addition to correlation ids.
13858+
//
13859+
// UIs can use this identifier to visually link these slices, for instance,
13860+
// by assigning them a consistent color or highlighting the entire correlated
13861+
// set when one slice is hovered.
13862+
//
13863+
// Only one field within this 'oneof' should be set to define the correlation.
13864+
oneof correlation_id_field {
13865+
// A 64-bit unsigned integer used as the correlation ID.
13866+
//
13867+
// Best for performance and compact traces if the identifier is naturally
13868+
// numerical or can be easily mapped to one by the trace producer.
13869+
uint64 correlation_id = 52;
13870+
13871+
// A string value used as the correlation ID.
13872+
//
13873+
// Offers maximum flexibility for human-readable or complex identifiers
13874+
// (e.g., GUIDs). Note: Using many unique, long strings may increase trace
13875+
// size. For frequently repeated string identifiers, consider
13876+
// 'correlation_id_string_iid'.
13877+
string correlation_id_str = 53;
13878+
13879+
// An interned string identifier (an IID) for correlation.
13880+
//
13881+
// This 64-bit ID refers to a string defined in the 'correlation_id_str'
13882+
// field within the packet sequence's InternedData. This approach combines
13883+
// the descriptiveness and uniqueness of strings with the efficiency of
13884+
// integer IDs for storage and comparison, especially for identifiers that
13885+
// repeat across many events.
13886+
uint64 correlation_id_str_iid = 54;
13887+
}
13888+
1384913889
// ---------------------------------------------------------------------------
1385013890
// TrackEvent arguments:
1385113891
// ---------------------------------------------------------------------------
@@ -14086,7 +14126,7 @@ message EventName {
1408614126
// emitted proactively in advance of referring to them in later packets.
1408714127
//
1408814128
// Next reserved id: 8 (up to 15).
14089-
// Next id: 43.
14129+
// Next id: 44.
1409014130
message InternedData {
1409114131
// TODO(eseckler): Replace iid fields inside interned messages with
1409214132
// map<iid, message> type fields in InternedData.
@@ -14175,6 +14215,9 @@ message InternedData {
1417514215
// Interned context for android.app_wakelocks.
1417614216
repeated AppWakelockInfo app_wakelock_info = 42;
1417714217

14218+
// Interned correlation ids in track_event.
14219+
repeated InternedString correlation_id_str = 43;
14220+
1417814221
// removed ProfiledFrameSymbols profiled_frame_symbols
1417914222
reserved 21;
1418014223
}

protos/perfetto/trace/track_event/track_descriptor.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ message TrackDescriptor {
110110
// |extra_counter_values|).
111111
optional CounterDescriptor counter = 8;
112112

113+
// Deprecated: prefer use of `sbling_merge_behavior` instead: this option
114+
// is equvaient to `SIBLING_MERGE_BEHAVIOR_NONE` or
115+
// `SIBLING_MERGE_BEHAVIOR_BY_MERGE_KEY` with a unique key.
116+
//
113117
// If true, forces Trace Processor to use separate tracks for track events
114118
// and system events for the same thread.
115119
// Track events timestamps in Chrome have microsecond resolution, while
116120
// system events use nanoseconds. It results in broken event nesting when
117121
// track events and system events share a track.
118-
optional bool disallow_merging_with_system_tracks = 9;
122+
optional bool disallow_merging_with_system_tracks = 9 [deprecated = true];
119123

120124
// Specifies how the UI should display child tracks of this track (i.e. tracks
121125
// where `parent_uuid` is specified to this track `uuid`). Note that this

protos/perfetto/trace/track_event/track_event.proto

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ package perfetto.protos;
103103
// their default track association) can be emitted as part of a
104104
// TrackEventDefaults message.
105105
//
106-
// Next reserved id: 13 (up to 15). Next id: 52.
106+
// Next reserved id: 13 (up to 15). Next id: 55.
107107
message TrackEvent {
108108
// Names of categories of the event. In the client library, categories are a
109109
// way to turn groups of individual events on or off.
@@ -232,6 +232,46 @@ message TrackEvent {
232232
// "terminating_flow_ids" to reduce memory consumption.
233233
repeated fixed64 terminating_flow_ids = 48;
234234

235+
// An opaque identifier to correlate this slice with other slices that are
236+
// considered part of the same logical operation, even if they are not
237+
// causally connected. Examples uses of a correlation id might be the number
238+
// of frame going through various stages of rendering in a GPU, the id for an
239+
// RPC request going through a distributed system, or the id of a network
240+
// request going through various stages of processing by the kernel.
241+
//
242+
// NOTE: if the events *are* causually connected, you probably want to use
243+
// flows instead of OR in addition to correlation ids.
244+
//
245+
// UIs can use this identifier to visually link these slices, for instance,
246+
// by assigning them a consistent color or highlighting the entire correlated
247+
// set when one slice is hovered.
248+
//
249+
// Only one field within this 'oneof' should be set to define the correlation.
250+
oneof correlation_id_field {
251+
// A 64-bit unsigned integer used as the correlation ID.
252+
//
253+
// Best for performance and compact traces if the identifier is naturally
254+
// numerical or can be easily mapped to one by the trace producer.
255+
uint64 correlation_id = 52;
256+
257+
// A string value used as the correlation ID.
258+
//
259+
// Offers maximum flexibility for human-readable or complex identifiers
260+
// (e.g., GUIDs). Note: Using many unique, long strings may increase trace
261+
// size. For frequently repeated string identifiers, consider
262+
// 'correlation_id_string_iid'.
263+
string correlation_id_str = 53;
264+
265+
// An interned string identifier (an IID) for correlation.
266+
//
267+
// This 64-bit ID refers to a string defined in the 'correlation_id_str'
268+
// field within the packet sequence's InternedData. This approach combines
269+
// the descriptiveness and uniqueness of strings with the efficiency of
270+
// integer IDs for storage and comparison, especially for identifiers that
271+
// repeat across many events.
272+
uint64 correlation_id_str_iid = 54;
273+
}
274+
235275
// ---------------------------------------------------------------------------
236276
// TrackEvent arguments:
237277
// ---------------------------------------------------------------------------

python/perfetto/protos/perfetto/trace/perfetto_trace_pb2.py

Lines changed: 290 additions & 286 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)