summaryrefslogtreecommitdiff
path: root/simpleperf/branch_list.proto
blob: 29247933c7f2fa159f1dd418c7f56949f5b9be8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// The branch list file format is generated by the inject command. It contains
// a single BranchList message.

syntax = "proto3";

package simpleperf.proto;

message BranchList {
  // Used to identify format in generated proto files.
  // Should always be "simpleperf:EtmBranchList".
  string magic = 1;
  repeated ETMBinary etm_data = 2;
}

message ETMBinary {
  string path = 1;
  string build_id = 2;

  message Address {
    // vaddr in binary, instr addr before the first branch
    uint64 addr = 1;

    message Branch {
      // Each bit represents a branch: 0 for not branch, 1 for branch.
      // Bit 0 comes first, bit 7 comes last.
      bytes branch = 1;
      uint32 branch_size = 2;
      uint64 count = 3;
    }

    repeated Branch branches = 2;
  }

  repeated Address addrs = 3;

  enum BinaryType {
    ELF_FILE = 0;
    KERNEL = 1;
    KERNEL_MODULE = 2;
  }
  BinaryType type = 4;

  message KernelBinaryInfo {
    // kernel_start_addr is used to convert kernel ip address to vaddr in vmlinux.
    // If it is zero, the Address in KERNEL binary has been converted to vaddr. Otherwise,
    // the Address in KERNEL binary is still ip address, and need to be converted later.
    uint64 kernel_start_addr = 1;
  }

  KernelBinaryInfo kernel_info = 5;
}