1/* 2 * Copyright (C) 2020 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 = "proto3"; 18 19package simpleperf.proto; 20 21message ETMBranchList { 22 23 message Binary { 24 string path = 1; 25 string build_id = 2; 26 27 message Address { 28 // vaddr in binary, instr addr before the first branch 29 uint64 addr = 1; 30 31 message Branch { 32 // Each bit represents a branch: 0 for not branch, 1 for branch. 33 // Bit 0 comes first, bit 7 comes last. 34 bytes branch = 1; 35 uint32 branch_size = 2; 36 uint64 count = 3; 37 } 38 39 repeated Branch branches = 2; 40 } 41 42 repeated Address addrs = 3; 43 44 enum BinaryType { 45 ELF_FILE = 0; 46 KERNEL = 1; 47 KERNEL_MODULE = 2; 48 } 49 BinaryType type = 4; 50 51 message KernelBinaryInfo { 52 // kernel_start_addr is used to convert kernel ip address to vaddr in vmlinux. 53 // If it is zero, the Address in KERNEL binary has been converted to vaddr. Otherwise, 54 // the Address in KERNEL binary is still ip address, and need to be converted later. 55 uint64 kernel_start_addr = 1; 56 } 57 58 KernelBinaryInfo kernel_info = 5; 59 60 } 61 62 // Used to identify format in generated proto files. 63 // Should always be "simpleperf:EtmBranchList". 64 string magic = 1; 65 repeated Binary binaries = 2; 66} 67