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