1/* 2 * Copyright (C) 2021 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 17// message types used in perf.data. 18 19syntax = "proto3"; 20 21// This is in perfetto.third_party to avoid clashing with potential other 22// copies of this proto. 23package perfetto.third_party.simpleperf.proto; 24 25message DebugUnwindFeature { 26 message File { 27 string path = 1; 28 uint64 size = 2; 29 } 30 31 repeated File file = 1; 32} 33 34message FileFeature { 35 // This enum is not defined in the original simpleperf proto file. 36 // We added it here for convenience. Simpleperf uses a regular c++ enum 37 // instead. See comment in type field. 38 enum DsoType { 39 DSO_KERNEL = 0; 40 DSO_KERNEL_MODULE = 1; 41 DSO_ELF_FILE = 2; 42 DSO_DEX_FILE = 3; 43 DSO_SYMBOL_MAP_FILE = 4; 44 DSO_UNKNOWN_FILE = 5; 45 } 46 string path = 1; 47 // The original simpleperf proto defines this field as a uint32. We use an 48 // enum here instead for convenience. enum fields are encoded as if they were 49 // int32 values, and both uint32 and int32 values have the same proto wire 50 // format, so using the enum here is fine. 51 DsoType type = 2; 52 uint64 min_vaddr = 3; 53 54 message Symbol { 55 uint64 vaddr = 1; 56 uint32 len = 2; 57 string name = 3; 58 } 59 repeated Symbol symbol = 4; 60 61 message DexFile { 62 repeated uint64 dex_file_offset = 1; 63 } 64 message ElfFile { 65 uint64 file_offset_of_min_vaddr = 1; 66 } 67 message KernelModule { 68 uint64 memory_offset_of_min_vaddr = 1; 69 } 70 71 oneof type_specific_msg { 72 DexFile dex_file = 5; // Only when type = DSO_DEX_FILE 73 ElfFile elf_file = 6; // Only when type = DSO_ELF_FILE 74 KernelModule kernel_module = 7; // Only when type = DSO_KERNEL_MODULE 75 } 76}