• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19import "protos/perfetto/trace/android/app_wakelock_data.proto";
20import "protos/perfetto/trace/android/network_trace.proto";
21import "protos/perfetto/trace/chrome/v8.proto";
22import "protos/perfetto/trace/gpu/gpu_render_stage_event.proto";
23import "protos/perfetto/trace/track_event/chrome_histogram_sample.proto";
24import "protos/perfetto/trace/track_event/debug_annotation.proto";
25import "protos/perfetto/trace/track_event/log_message.proto";
26import "protos/perfetto/trace/track_event/track_event.proto";
27import "protos/perfetto/trace/track_event/source_location.proto";
28import "protos/perfetto/trace/profiling/profile_common.proto";
29
30package perfetto.protos;
31
32// ------------------------------ DATA INTERNING: ------------------------------
33// Interning indexes are built up gradually by adding the entries contained in
34// each TracePacket of the same packet sequence (packets emitted by the same
35// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
36// can only refer to interned data from other packets in the same sequence.
37//
38// The writer will emit new entries when it encounters new internable values
39// that aren't yet in the index. Data in current and subsequent TracePackets can
40// then refer to the entry by its position (interning ID, abbreviated "iid") in
41// its index. An interning ID with value 0 is considered invalid (not set).
42//
43// Because of the incremental build-up, the interning index will miss data when
44// TracePackets are lost, e.g. because a chunk was overridden in the central
45// ring buffer. To avoid invalidation of the whole trace in such a case, the
46// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
47// When packet loss occurs, the reader will only lose interning data up to the
48// next reset.
49// -----------------------------------------------------------------------------
50
51// Message that contains new entries for the interning indices of a packet
52// sequence.
53//
54// The writer will usually emit new entries in the same TracePacket that first
55// refers to them (since the last reset of interning state). They may also be
56// emitted proactively in advance of referring to them in later packets.
57//
58// Next reserved id: 8 (up to 15).
59// Next id: 43.
60message InternedData {
61  // TODO(eseckler): Replace iid fields inside interned messages with
62  // map<iid, message> type fields in InternedData.
63
64  // Each field's message type needs to specify an |iid| field, which is the ID
65  // of the entry in the field's interning index. Each field constructs its own
66  // index, thus interning IDs are scoped to the tracing session and field
67  // (usually as a counter for efficient var-int encoding), and optionally to
68  // the incremental state generation of the packet sequence.
69  repeated EventCategory event_categories = 1;
70  repeated EventName event_names = 2;
71  repeated DebugAnnotationName debug_annotation_names = 3;
72  repeated DebugAnnotationValueTypeName debug_annotation_value_type_names = 27;
73  repeated SourceLocation source_locations = 4;
74  repeated UnsymbolizedSourceLocation unsymbolized_source_locations = 28;
75  repeated LogMessageBody log_message_body = 20;
76  repeated HistogramName histogram_names = 25;
77
78  // Note: field IDs up to 15 should be used for frequent data only.
79
80  // Build IDs of exectuable files.
81  repeated InternedString build_ids = 16;
82  // Paths to executable files.
83  repeated InternedString mapping_paths = 17;
84  // Paths to source files.
85  repeated InternedString source_paths = 18;
86  // Names of functions used in frames below.
87  repeated InternedString function_names = 5;
88  // Symbols that were added to this trace after the fact.
89  repeated ProfiledFrameSymbols profiled_frame_symbols = 21;
90
91  // Executable files mapped into processes.
92  repeated Mapping mappings = 19;
93  // Frames of callstacks of a program.
94  repeated Frame frames = 6;
95  // A callstack of a program.
96  repeated Callstack callstacks = 7;
97
98  // Additional Vulkan information sent in a VulkanMemoryEvent message
99  repeated InternedString vulkan_memory_keys = 22;
100
101  // Graphics context of a render stage event.  This represent the GL
102  // context for an OpenGl app or the VkDevice for a Vulkan app.
103  repeated InternedGraphicsContext graphics_contexts = 23;
104
105  // Description of a GPU hardware queue or render stage.
106  repeated InternedGpuRenderStageSpecification gpu_specifications = 24;
107
108  // This is set when FtraceConfig.symbolize_ksyms = true.
109  // The id of each symbol the number that will be reported in ftrace events
110  // like sched_block_reason.caller and is obtained from a monotonic counter.
111  // The same symbol can have different indexes in different bundles.
112  // This is is NOT the real address. This is to avoid disclosing KASLR through
113  // traces.
114  repeated InternedString kernel_symbols = 26;
115
116  // Interned string values in the DebugAnnotation proto.
117  repeated InternedString debug_annotation_string_values = 29;
118
119  // Interned packet context for android.network_packets.
120  repeated NetworkPacketContext packet_context = 30;
121
122  // Interned name of a js function. We only intern js functions as there is a
123  // lot of duplication for them, but less so for other strings in the V8 data
124  // source.
125  repeated InternedV8String v8_js_function_name = 31;
126  // Js functions can be emitted multiple times for various compilation tiers,
127  // so it makes sense to deduplicate all this.
128  repeated InternedV8JsFunction v8_js_function = 32;
129  // Interned JS script (there is one associated with each JS function)
130  repeated InternedV8JsScript v8_js_script = 33;
131  // Interned Wasm script (there is one associated with each Wasm function)
132  repeated InternedV8WasmScript v8_wasm_script = 34;
133  // Every V8 event is associated with an isolate, intern the isolate to remove
134  // duplication.
135  repeated InternedV8Isolate v8_isolate = 35;
136
137  // Interned protolog strings args.
138  repeated InternedString protolog_string_args = 36;
139  // Interned protolog stacktraces.
140  repeated InternedString protolog_stacktrace = 37;
141
142  // viewcapture
143  repeated InternedString viewcapture_package_name = 38;
144  repeated InternedString viewcapture_window_name = 39;
145  repeated InternedString viewcapture_view_id = 40;
146  repeated InternedString viewcapture_class_name = 41;
147
148  // Interned context for android.app_wakelocks.
149  repeated AppWakelockInfo app_wakelock_info = 42;
150}
151