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