blob: 40a942e5b63582d9c1ff7048ebac06afa45aeb52 [file] [log] [blame]
Josh Gao76e1e302021-01-26 15:53:11 -08001syntax = "proto3";
2
Josh Gaod3df0ae2021-02-01 14:35:30 -08003option java_package = "com.android.server.os";
4option java_outer_classname = "TombstoneProtos";
5
Josh Gaofc4fb212021-02-10 16:59:50 -08006// NOTE TO OEMS:
7// If you add custom fields to this proto, do not use numbers in the reserved range.
8
Josh Gao76e1e302021-01-26 15:53:11 -08009message 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 Gao31348a72021-03-29 21:53:42 -070020 repeated string command_line = 9;
Josh Gao76e1e302021-01-26 15:53:11 -080021
Josh Gaodbb83de2021-03-01 23:13:13 -080022 // Process uptime in seconds.
23 uint32 process_uptime = 20;
24
Josh Gao76e1e302021-01-26 15:53:11 -080025 Signal signal_info = 10;
26 string abort_message = 14;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080027 repeated Cause causes = 15;
Josh Gao76e1e302021-01-26 15:53:11 -080028
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 Gaofc4fb212021-02-10 16:59:50 -080033
Josh Gaodbb83de2021-03-01 23:13:13 -080034 reserved 21 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080035}
36
37enum Architecture {
38 ARM32 = 0;
39 ARM64 = 1;
40 X86 = 2;
41 X86_64 = 3;
Josh Gaofc4fb212021-02-10 16:59:50 -080042
43 reserved 4 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080044}
45
46message 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 Phillips5ddcea22021-04-19 09:59:17 -070059 // 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 Gaofc4fb212021-02-10 16:59:50 -080062
Mitch Phillips5ddcea22021-04-19 09:59:17 -070063 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080064}
65
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080066message 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
77message 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 Gao76e1e302021-01-26 15:53:11 -0800105message Cause {
106 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800107 oneof details {
108 MemoryError memory_error = 2;
109 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800110
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800111 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800112}
113
114message Register {
115 string name = 1;
116 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800117
118 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800119}
120
121message Thread {
122 int32 id = 1;
123 string name = 2;
124 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700125 repeated string backtrace_note = 7;
Josh Gao76e1e302021-01-26 15:53:11 -0800126 repeated BacktraceFrame current_backtrace = 4;
127 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800128 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800129 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800130
Elliott Hughesd13ea522022-01-13 09:20:26 -0800131 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800132}
133
134message BacktraceFrame {
135 uint64 rel_pc = 1;
136 uint64 pc = 2;
137 uint64 sp = 3;
138
139 string function_name = 4;
140 uint64 function_offset = 5;
141
142 string file_name = 6;
143 uint64 file_map_offset = 7;
144 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800145
146 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800147}
148
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700149message ArmMTEMetadata {
150 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
151 bytes memory_tags = 1;
152 reserved 2 to 999;
153}
154
Josh Gao76e1e302021-01-26 15:53:11 -0800155message MemoryDump {
156 string register_name = 1;
157 string mapping_name = 2;
158 uint64 begin_address = 3;
159 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700160 oneof metadata {
161 ArmMTEMetadata arm_mte_metadata = 6;
162 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800163
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700164 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800165}
166
167message MemoryMapping {
168 uint64 begin_address = 1;
169 uint64 end_address = 2;
170 uint64 offset = 3;
171
172 bool read = 4;
173 bool write = 5;
174 bool execute = 6;
175
176 string mapping_name = 7;
177 string build_id = 8;
178 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800179
180 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800181}
182
183message FD {
184 int32 fd = 1;
185 string path = 2;
186 string owner = 3;
187 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800188
189 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800190}
191
192message LogBuffer {
193 string name = 1;
194 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800195
196 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800197}
198
199message LogMessage {
200 string timestamp = 1;
201 uint32 pid = 2;
202 uint32 tid = 3;
203 uint32 priority = 4;
204 string tag = 5;
205 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800206
207 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800208}