1/* 2 * Copyright (C) 2018 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"; 18package perfetto.protos; 19 20message ChromeTracedValue { 21 enum NestedType { 22 DICT = 0; 23 ARRAY = 1; 24 } 25 optional NestedType nested_type = 1; 26 27 repeated string dict_keys = 2; 28 repeated ChromeTracedValue dict_values = 3; 29 repeated ChromeTracedValue array_values = 4; 30 optional int32 int_value = 5; 31 optional double double_value = 6; 32 optional bool bool_value = 7; 33 optional string string_value = 8; 34} 35 36message ChromeStringTableEntry { 37 optional string value = 1; 38 optional int32 index = 2; 39} 40 41// Deprecated, use TrackEvent protos instead. 42message ChromeTraceEvent { 43 message Arg { 44 optional string name = 1; 45 46 oneof value { 47 bool bool_value = 2; 48 uint64 uint_value = 3; 49 int64 int_value = 4; 50 double double_value = 5; 51 string string_value = 6; 52 // Pointers are stored in a separate type as the JSON output treats them 53 // differently from other uint64 values. 54 uint64 pointer_value = 7; 55 string json_value = 8; 56 ChromeTracedValue traced_value = 10; 57 } 58 59 // Takes precedence over |name| if set, 60 // and is an index into |string_table|. 61 optional uint32 name_index = 9; 62 } 63 64 optional string name = 1; 65 optional int64 timestamp = 2; 66 optional int32 phase = 3; 67 optional int32 thread_id = 4; 68 optional int64 duration = 5; 69 optional int64 thread_duration = 6; 70 optional string scope = 7; 71 optional uint64 id = 8; 72 optional uint32 flags = 9; 73 optional string category_group_name = 10; 74 optional int32 process_id = 11; 75 optional int64 thread_timestamp = 12; 76 optional uint64 bind_id = 13; 77 78 repeated Arg args = 14; 79 80 // Takes precedence over respectively |name| and 81 // |category_group_name_index| if set, 82 // and are indices into |string_table|. 83 optional uint32 name_index = 15; 84 optional uint32 category_group_name_index = 16; 85} 86 87message ChromeMetadata { 88 optional string name = 1; 89 90 oneof value { 91 string string_value = 2; 92 bool bool_value = 3; 93 int64 int_value = 4; 94 string json_value = 5; 95 } 96} 97 98// Subtraces produced in legacy json format by Chrome tracing agents not yet 99// updated to support the new binary format, e.g. ETW and CrOS ARC. 100// TODO(eseckler): Update these agents to become perfetto producers. 101message ChromeLegacyJsonTrace { 102 enum TraceType { 103 USER_TRACE = 0; 104 105 // Deprecated. 106 SYSTEM_TRACE = 1; 107 } 108 optional TraceType type = 1; 109 optional string data = 2; 110} 111 112message ChromeEventBundle { 113 // Deprecated, use TrackEvent protos instead. 114 repeated ChromeTraceEvent trace_events = 1 [deprecated = true]; 115 // TODO(ssid): This should be deprecated in favor of ChromeMetadataPacket 116 // which contains typed fields. 117 repeated ChromeMetadata metadata = 2; 118 // ftrace output from CrOS and Cast system tracing agents. 119 // TODO(eseckler): Replace system traces with native perfetto service. 120 repeated string legacy_ftrace_output = 4; 121 repeated ChromeLegacyJsonTrace legacy_json_trace = 5; 122 123 // Contents of a string table that's valid for 124 // the whole ChromeEventBundle entry. 125 repeated ChromeStringTableEntry string_table = 3 [deprecated = true]; 126} 127