• 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/track_event/debug_annotation.proto";
20import "protos/perfetto/trace/track_event/log_message.proto";
21import "protos/perfetto/trace/track_event/track_event.proto";
22import "protos/perfetto/trace/track_event/source_location.proto";
23import "protos/perfetto/trace/profiling/profile_common.proto";
24
25package perfetto.protos;
26
27// ------------------------------ DATA INTERNING: ------------------------------
28// Interning indexes are built up gradually by adding the entries contained in
29// each TracePacket of the same packet sequence (packets emitted by the same
30// producer and TraceWriter, see |trusted_packet_sequence_id|). Thus, packets
31// can only refer to interned data from other packets in the same sequence.
32//
33// The writer will emit new entries when it encounters new internable values
34// that aren't yet in the index. Data in current and subsequent TracePackets can
35// then refer to the entry by its position (interning ID, abbreviated "iid") in
36// its index. An interning ID with value 0 is considered invalid (not set).
37//
38// Because of the incremental build-up, the interning index will miss data when
39// TracePackets are lost, e.g. because a chunk was overridden in the central
40// ring buffer. To avoid invalidation of the whole trace in such a case, the
41// index is periodically reset (see SEQ_INCREMENTAL_STATE_CLEARED).
42// When packet loss occurs, the reader will only lose interning data up to the
43// next reset.
44// -----------------------------------------------------------------------------
45
46// Message that contains new entries for the interning indices of a packet
47// sequence.
48//
49// The writer will usually emit new entries in the same TracePacket that first
50// refers to them (since the last reset of interning state). They may also be
51// emitted proactively in advance of referring to them in later packets.
52//
53// Next reserved id: 8 (up to 15).
54// Next id: 23.
55message InternedData {
56  // TODO(eseckler): Replace iid fields inside interned messages with
57  // map<iid, message> type fields in InternedData.
58
59  // Each field's message type needs to specify an |iid| field, which is the ID
60  // of the entry in the field's interning index. Each field constructs its own
61  // index, thus interning IDs are scoped to the tracing session and field
62  // (usually as a counter for efficient var-int encoding). It is illegal to
63  // override entries in an index (using the same iid for two different values)
64  // within the same tracing session, even after a reset of the emitted
65  // interning state.
66  repeated EventCategory event_categories = 1;
67  repeated EventName event_names = 2;
68  repeated DebugAnnotationName debug_annotation_names = 3;
69  repeated SourceLocation source_locations = 4;
70  repeated LogMessageBody log_message_body = 20;
71
72  // Note: field IDs up to 15 should be used for frequent data only.
73
74  // Build IDs of exectuable files.
75  repeated InternedString build_ids = 16;
76  // Paths to executable files.
77  repeated InternedString mapping_paths = 17;
78  // Paths to source files.
79  repeated InternedString source_paths = 18;
80  // Names of functions used in frames below.
81  repeated InternedString function_names = 5;
82  // Symbols that were added to this trace after the fact.
83  repeated ProfiledFrameSymbols profiled_frame_symbols = 21;
84
85  // Executable files mapped into processes.
86  repeated Mapping mappings = 19;
87  // Frames of callstacks of a program.
88  repeated Frame frames = 6;
89  // A callstack of a program.
90  repeated Callstack callstacks = 7;
91
92  // Additional Vulkan information sent in a VulkanMemoryEvent message
93  repeated InternedString vulkan_memory_keys = 22;
94}
95