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 19package perfetto.protos; 20 21// Used to trace the execution of perfetto itself. 22message PerfettoMetatrace { 23 // See base/metatrace_events.h for definitions. 24 oneof record_type { 25 uint32 event_id = 1; 26 uint32 counter_id = 2; 27 28 // For trace processor metatracing. 29 string event_name = 8; 30 uint64 event_name_iid = 11; 31 32 string counter_name = 9; 33 } 34 message Arg { 35 oneof key_or_interned_key { 36 string key = 1; 37 uint64 key_iid = 3; 38 } 39 oneof value_or_interned_value { 40 string value = 2; 41 uint64 value_iid = 4; 42 } 43 } 44 45 // Only when using |event_id|. 46 optional uint64 event_duration_ns = 3; 47 48 // Only when using |counter_id|. 49 optional int32 counter_value = 4; 50 51 // ID of the thread that emitted the event. 52 optional uint32 thread_id = 5; 53 54 // If true the meta-tracing ring buffer had overruns and hence some data is 55 // missing from this point. 56 optional bool has_overruns = 6; 57 58 // Args for the event. 59 repeated Arg args = 7; 60 61 // Interned strings corresponding to the |event_name_iid|, |key_iid| and 62 // |value_iid| above. 63 message InternedString { 64 optional uint64 iid = 1; 65 optional string value = 2; 66 }; 67 repeated InternedString interned_strings = 10; 68} 69