• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow.profiler;
4
5option cc_enable_arenas = true;
6
7// A container of parallel XPlanes, generated by one or more profiling sources.
8// Next ID: 2
9message XSpace {
10  repeated XPlane planes = 1;
11}
12
13// An XPlane is a container of parallel timelines (XLines), generated by a
14// profiling source or by post-processing one or more XPlanes.
15// Next ID: 7
16message XPlane {
17  int64 id = 1;
18
19  // Name of this line.
20  string name = 2;
21
22  // Parallel timelines grouped in this plane. XLines with the same id
23  // are effectively the same timeline.
24  repeated XLine lines = 3;
25
26  // XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
27  // should be used for events that share the same ID over the whole XPlane.
28  map<int64, XEventMetadata> event_metadata = 4;
29
30  // XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
31  // should be used for stats that share the same ID over the whole XPlane.
32  map<int64, XStatMetadata> stat_metadata = 5;
33
34  // XStats associated with this plane, e.g. device capabilities.
35  repeated XStat stats = 6;
36}
37
38// An XLine is a timeline of trace events (XEvents).
39// Next ID: 12
40message XLine {
41  // Id of this line, can be repeated within an XPlane. All XLines with the
42  // same id are effectively the same timeline.
43  int64 id = 1;
44
45  // Display id of this line. Multiple lines with the same display_id are
46  // grouped together in the same trace viewer row.
47  int64 display_id = 10;
48
49  // Name of this XLine.
50  string name = 2;
51
52  // Name of this XLine to display in trace viewer.
53  string display_name = 11;
54
55  // Start time of this line in nanoseconds since the UNIX epoch.
56  // XEvent.offset_ps is relative to this timestamp.
57  int64 timestamp_ns = 3;
58
59  // Profiling duration for this line in picoseconds.
60  int64 duration_ps = 9;
61
62  // XEvents within the same XLine should not overlap in time, but they can be
63  // nested.
64  repeated XEvent events = 4;
65
66  reserved 5, 6, 7, 8;
67}
68
69// An XEvent is a trace event, optionally annotated with XStats.
70// Next ID: 6
71message XEvent {
72  // XEventMetadata.id of corresponding metadata.
73  int64 metadata_id = 1;
74
75  oneof data {
76    // Start time of the event in picoseconds, as offset from
77    // XLine.timestamp_ns().
78    int64 offset_ps = 2;
79
80    // Number of occurrences of the event, if aggregated.
81    int64 num_occurrences = 5;
82  }
83
84  // Duration of the event in picoseconds. Can be zero for an instant event.
85  int64 duration_ps = 3;
86
87  // XStats associated with the event.
88  repeated XStat stats = 4;
89}
90
91// An XStat is a named value associated with an XEvent, e.g., a performance
92// counter value, a metric computed by a formula applied over nested XEvents
93// and XStats.
94// Next ID: 6
95message XStat {
96  // XStatMetadata.id of corresponding metadata.
97  int64 metadata_id = 1;
98
99  // Value of this stat.
100  oneof value {
101    double double_value = 2;
102    uint64 uint64_value = 3;
103    int64 int64_value = 4;
104    string str_value = 5;
105  }
106}
107
108// Metadata for an XEvent, shared by all instances of the same event.
109// Next ID: 5
110message XEventMetadata {
111  // XPlane.event_metadata map key.
112  int64 id = 1;
113
114  // Name of the event.
115  string name = 2;
116
117  // Name of the event shown in trace viewer.
118  string display_name = 4;
119
120  // Additional metadata in serialized format.
121  bytes metadata = 3;
122}
123
124// Metadata for an XStat, shared by all instances of the same stat.
125// Next ID: 4
126message XStatMetadata {
127  // XPlane.stat_metadata map key.
128  int64 id = 1;
129
130  // Name of the stat (should be short).
131  string name = 2;
132
133  // Description of the stat (might be long).
134  string description = 3;
135}
136