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"; 18 19package perfetto.protos; 20 21// The wrapping result of any metric builder function in trace processor. This 22// is an internal implementation detail of trace processor so should not be 23// relied on. 24message ProtoBuilderResult { 25 // Whether the result is a singular proto builder result or the result of 26 // a repeated field builder. 27 optional bool is_repeated = 1; 28 oneof result { 29 SingleBuilderResult single = 2; 30 RepeatedBuilderResult repeated = 3; 31 } 32} 33 34// The result of a repeated field function for a metric proto in trace 35// processor. This is an internal implementation detail of trace processor so 36// should not be relied on. 37message RepeatedBuilderResult { 38 repeated sfixed64 int_values = 1 [packed = true]; 39 repeated double double_values = 2 [packed = true]; 40 repeated string string_values = 3; 41 repeated bytes byte_values = 4; 42} 43 44// The result of a builder function for a metric proto in trace processor. This 45// is an internal implementation detail of trace processor so should not be 46// relied on. 47message SingleBuilderResult { 48 // The type of the result. The possible values are given by 49 // FieldDescriptorProto::Type. 50 optional uint32 type = 1; 51 52 // The type name of the result if the result is a message or enum type. 53 optional string type_name = 2; 54 55 // The raw proto bytes of a message. 56 optional bytes protobuf = 3; 57} 58