• 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/network_trace.proto";
20import "protos/perfetto/trace/gpu/gpu_render_stage_event.proto";
21import "protos/perfetto/trace/track_event/chrome_histogram_sample.proto";
22import "protos/perfetto/trace/track_event/debug_annotation.proto";
23import "protos/perfetto/trace/track_event/log_message.proto";
24import "protos/perfetto/trace/track_event/track_event.proto";
25import "protos/perfetto/trace/track_event/source_location.proto";
26import "protos/perfetto/trace/profiling/profile_common.proto";
27
28package perfetto.protos;
29
30// ------------------------------ DATA INTERNING: ------------------------------
31// Interning indexes are built up gradually by adding the entries contained in
32// each TracePacket of the same packet sequence (packets emitted by the same
33// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
34// can only refer to interned data from other packets in the same sequence.
35//
36// The writer will emit new entries when it encounters new internable values
37// that aren't yet in the index. Data in current and subsequent TracePackets can
38// then refer to the entry by its position (interning ID, abbreviated "iid") in
39// its index. An interning ID with value 0 is considered invalid (not set).
40//
41// Because of the incremental build-up, the interning index will miss data when
42// TracePackets are lost, e.g. because a chunk was overridden in the central
43// ring buffer. To avoid invalidation of the whole trace in such a case, the
44// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
45// When packet loss occurs, the reader will only lose interning data up to the
46// next reset.
47// -----------------------------------------------------------------------------
48
49// Message that contains new entries for the interning indices of a packet
50// sequence.
51//
52// The writer will usually emit new entries in the same TracePacket that first
53// refers to them (since the last reset of interning state). They may also be
54// emitted proactively in advance of referring to them in later packets.
55//
56// Next reserved id: 8 (up to 15).
57// Next id: 31.
58message InternedData {
59  // TODO(eseckler): Replace iid fields inside interned messages with
60  // map<iid, message> type fields in InternedData.
61
62  // Each field's message type needs to specify an |iid| field, which is the ID
63  // of the entry in the field's interning index. Each field constructs its own
64  // index, thus interning IDs are scoped to the tracing session and field
65  // (usually as a counter for efficient var-int encoding). It is illegal to
66  // override entries in an index (using the same iid for two different values)
67  // within the same tracing session, even after a reset of the emitted
68  // interning state.
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