Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Josh Gao | d3df0ae | 2021-02-01 14:35:30 -0800 | [diff] [blame] | 3 | option java_package = "com.android.server.os"; |
| 4 | option java_outer_classname = "TombstoneProtos"; |
| 5 | |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 6 | // NOTE TO OEMS: |
| 7 | // If you add custom fields to this proto, do not use numbers in the reserved range. |
| 8 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 9 | message Tombstone { |
| 10 | Architecture arch = 1; |
| 11 | string build_fingerprint = 2; |
| 12 | string revision = 3; |
| 13 | string timestamp = 4; |
| 14 | |
| 15 | uint32 pid = 5; |
| 16 | uint32 tid = 6; |
| 17 | uint32 uid = 7; |
| 18 | string selinux_label = 8; |
| 19 | |
Josh Gao | 31348a7 | 2021-03-29 21:53:42 -0700 | [diff] [blame] | 20 | repeated string command_line = 9; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 21 | |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 22 | // Process uptime in seconds. |
| 23 | uint32 process_uptime = 20; |
| 24 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 25 | Signal signal_info = 10; |
| 26 | string abort_message = 14; |
Peter Collingbourne | 1a1f7d7 | 2021-03-08 16:53:54 -0800 | [diff] [blame] | 27 | repeated Cause causes = 15; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 28 | |
| 29 | map<uint32, Thread> threads = 16; |
| 30 | repeated MemoryMapping memory_mappings = 17; |
| 31 | repeated LogBuffer log_buffers = 18; |
| 32 | repeated FD open_fds = 19; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 33 | |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 34 | reserved 21 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | enum Architecture { |
| 38 | ARM32 = 0; |
| 39 | ARM64 = 1; |
| 40 | X86 = 2; |
| 41 | X86_64 = 3; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 42 | |
| 43 | reserved 4 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | message Signal { |
| 47 | int32 number = 1; |
| 48 | string name = 2; |
| 49 | |
| 50 | int32 code = 3; |
| 51 | string code_name = 4; |
| 52 | |
| 53 | bool has_sender = 5; |
| 54 | int32 sender_uid = 6; |
| 55 | int32 sender_pid = 7; |
| 56 | |
| 57 | bool has_fault_address = 8; |
| 58 | uint64 fault_address = 9; |
Mitch Phillips | 5ddcea2 | 2021-04-19 09:59:17 -0700 | [diff] [blame] | 59 | // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we |
| 60 | // only include metadata, and not the contents. |
| 61 | MemoryDump fault_adjacent_metadata = 10; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 62 | |
Mitch Phillips | 5ddcea2 | 2021-04-19 09:59:17 -0700 | [diff] [blame] | 63 | reserved 11 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 64 | } |
| 65 | |
Peter Collingbourne | 1a1f7d7 | 2021-03-08 16:53:54 -0800 | [diff] [blame] | 66 | message HeapObject { |
| 67 | uint64 address = 1; |
| 68 | uint64 size = 2; |
| 69 | |
| 70 | uint64 allocation_tid = 3; |
| 71 | repeated BacktraceFrame allocation_backtrace = 4; |
| 72 | |
| 73 | uint64 deallocation_tid = 5; |
| 74 | repeated BacktraceFrame deallocation_backtrace = 6; |
| 75 | } |
| 76 | |
| 77 | message MemoryError { |
| 78 | enum Tool { |
| 79 | GWP_ASAN = 0; |
| 80 | SCUDO = 1; |
| 81 | |
| 82 | reserved 2 to 999; |
| 83 | } |
| 84 | Tool tool = 1; |
| 85 | |
| 86 | enum Type { |
| 87 | UNKNOWN = 0; |
| 88 | USE_AFTER_FREE = 1; |
| 89 | DOUBLE_FREE = 2; |
| 90 | INVALID_FREE = 3; |
| 91 | BUFFER_OVERFLOW = 4; |
| 92 | BUFFER_UNDERFLOW = 5; |
| 93 | |
| 94 | reserved 6 to 999; |
| 95 | } |
| 96 | Type type = 2; |
| 97 | |
| 98 | oneof location { |
| 99 | HeapObject heap = 3; |
| 100 | } |
| 101 | |
| 102 | reserved 4 to 999; |
| 103 | } |
| 104 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 105 | message Cause { |
| 106 | string human_readable = 1; |
Peter Collingbourne | 1a1f7d7 | 2021-03-08 16:53:54 -0800 | [diff] [blame] | 107 | oneof details { |
| 108 | MemoryError memory_error = 2; |
| 109 | } |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 110 | |
Peter Collingbourne | 1a1f7d7 | 2021-03-08 16:53:54 -0800 | [diff] [blame] | 111 | reserved 3 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | message Register { |
| 115 | string name = 1; |
| 116 | uint64 u64 = 2; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 117 | |
| 118 | reserved 3 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | message Thread { |
| 122 | int32 id = 1; |
| 123 | string name = 2; |
| 124 | repeated Register registers = 3; |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 125 | repeated string backtrace_note = 7; |
Christopher Ferris | c95047d | 2022-03-14 15:02:11 -0700 | [diff] [blame] | 126 | repeated string unreadable_elf_files = 9; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 127 | repeated BacktraceFrame current_backtrace = 4; |
| 128 | repeated MemoryDump memory_dump = 5; |
Peter Collingbourne | 1a1f7d7 | 2021-03-08 16:53:54 -0800 | [diff] [blame] | 129 | int64 tagged_addr_ctrl = 6; |
Elliott Hughes | d13ea52 | 2022-01-13 09:20:26 -0800 | [diff] [blame] | 130 | int64 pac_enabled_keys = 8; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 131 | |
Christopher Ferris | c95047d | 2022-03-14 15:02:11 -0700 | [diff] [blame] | 132 | reserved 10 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | message BacktraceFrame { |
| 136 | uint64 rel_pc = 1; |
| 137 | uint64 pc = 2; |
| 138 | uint64 sp = 3; |
| 139 | |
| 140 | string function_name = 4; |
| 141 | uint64 function_offset = 5; |
| 142 | |
| 143 | string file_name = 6; |
| 144 | uint64 file_map_offset = 7; |
| 145 | string build_id = 8; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 146 | |
| 147 | reserved 9 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 148 | } |
| 149 | |
Mitch Phillips | 5ddcea2 | 2021-04-19 09:59:17 -0700 | [diff] [blame] | 150 | message ArmMTEMetadata { |
| 151 | // One memory tag per granule (e.g. every 16 bytes) of regular memory. |
| 152 | bytes memory_tags = 1; |
| 153 | reserved 2 to 999; |
| 154 | } |
| 155 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 156 | message MemoryDump { |
| 157 | string register_name = 1; |
| 158 | string mapping_name = 2; |
| 159 | uint64 begin_address = 3; |
| 160 | bytes memory = 4; |
Mitch Phillips | 5ddcea2 | 2021-04-19 09:59:17 -0700 | [diff] [blame] | 161 | oneof metadata { |
| 162 | ArmMTEMetadata arm_mte_metadata = 6; |
| 163 | } |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 164 | |
Mitch Phillips | 5ddcea2 | 2021-04-19 09:59:17 -0700 | [diff] [blame] | 165 | reserved 5, 7 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | message MemoryMapping { |
| 169 | uint64 begin_address = 1; |
| 170 | uint64 end_address = 2; |
| 171 | uint64 offset = 3; |
| 172 | |
| 173 | bool read = 4; |
| 174 | bool write = 5; |
| 175 | bool execute = 6; |
| 176 | |
| 177 | string mapping_name = 7; |
| 178 | string build_id = 8; |
| 179 | uint64 load_bias = 9; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 180 | |
| 181 | reserved 10 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | message FD { |
| 185 | int32 fd = 1; |
| 186 | string path = 2; |
| 187 | string owner = 3; |
| 188 | uint64 tag = 4; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 189 | |
| 190 | reserved 5 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | message LogBuffer { |
| 194 | string name = 1; |
| 195 | repeated LogMessage logs = 2; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 196 | |
| 197 | reserved 3 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | message LogMessage { |
| 201 | string timestamp = 1; |
| 202 | uint32 pid = 2; |
| 203 | uint32 tid = 3; |
| 204 | uint32 priority = 4; |
| 205 | string tag = 5; |
| 206 | string message = 6; |
Josh Gao | fc4fb21 | 2021-02-10 16:59:50 -0800 | [diff] [blame] | 207 | |
| 208 | reserved 7 to 999; |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 209 | } |