• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2016 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 = "proto2";
18option java_multiple_files = true;
19
20import "frameworks/base/core/proto/android/nfc/nfc_service.proto";
21import "frameworks/base/core/proto/android/os/backtrace.proto";
22import "frameworks/base/core/proto/android/os/batterytype.proto";
23import "frameworks/base/core/proto/android/os/cpufreq.proto";
24import "frameworks/base/core/proto/android/os/cpuinfo.proto";
25import "frameworks/base/core/proto/android/os/cpu_usage.proto";
26import "frameworks/base/core/proto/android/os/data.proto";
27import "frameworks/base/core/proto/android/os/header.proto";
28import "frameworks/base/core/proto/android/os/kernelwake.proto";
29import "frameworks/base/core/proto/android/os/metadata.proto";
30import "frameworks/base/core/proto/android/os/pagetypeinfo.proto";
31import "frameworks/base/core/proto/android/os/procrank.proto";
32import "frameworks/base/core/proto/android/os/ps.proto";
33import "frameworks/base/core/proto/android/os/statsdata.proto";
34import "frameworks/base/core/proto/android/os/system_properties.proto";
35import "frameworks/base/core/proto/android/providers/settings.proto";
36import "frameworks/base/core/proto/android/server/activitymanagerservice.proto";
37import "frameworks/base/core/proto/android/server/alarm/alarmmanagerservice.proto";
38import "frameworks/base/core/proto/android/server/bluetooth_manager_service.proto";
39import "frameworks/base/core/proto/android/server/fingerprint.proto";
40import "frameworks/base/core/proto/android/server/jobscheduler.proto";
41import "frameworks/base/core/proto/android/server/location/context_hub.proto";
42import "frameworks/base/core/proto/android/server/powermanagerservice.proto";
43import "frameworks/base/core/proto/android/server/powerstatsservice.proto";
44import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
45import "frameworks/base/core/proto/android/service/appwidget.proto";
46import "frameworks/base/core/proto/android/service/battery.proto";
47import "frameworks/base/core/proto/android/service/batterystats.proto";
48import "frameworks/base/core/proto/android/service/diskstats.proto";
49import "frameworks/base/core/proto/android/service/dropbox.proto";
50import "frameworks/base/core/proto/android/service/graphicsstats.proto";
51import "frameworks/base/core/proto/android/service/netstats.proto";
52import "frameworks/base/core/proto/android/service/notification.proto";
53import "frameworks/base/core/proto/android/service/package.proto";
54import "frameworks/base/core/proto/android/service/print.proto";
55import "frameworks/base/core/proto/android/service/procstats.proto";
56import "frameworks/base/core/proto/android/service/restricted_image.proto";
57import "frameworks/base/core/proto/android/service/sensor_service.proto";
58import "frameworks/base/core/proto/android/service/usb.proto";
59import "frameworks/base/core/proto/android/util/event_log_tags.proto";
60import "frameworks/base/core/proto/android/util/log.proto";
61import "frameworks/base/core/proto/android/util/textdump.proto";
62import "frameworks/base/core/proto/android/privacy.proto";
63import "frameworks/base/core/proto/android/section.proto";
64import "frameworks/base/proto/src/ipconnectivity.proto";
65import "packages/modules/Permission/service/proto/com/android/role/roleservice.proto";
66
67package android.os;
68
69// Privacy tag can be marked to override UNSET messages so generic
70// message type can be handled case by case, e.g. GZippedFileProto.
71message IncidentProto {
72    reserved 1001;
73
74    // Incident header from callers
75    repeated IncidentHeaderProto header = 1;
76    // Internal metadata of incidentd
77    optional IncidentMetadata metadata = 2;
78
79    // Device information
80    optional SystemPropertiesProto system_properties = 1000 [
81        (section).type = SECTION_COMMAND,
82        (section).args = "getprop"
83    ];
84
85    optional string kernel_version = 1002 [
86        (section).type = SECTION_FILE,
87        (section).args = "/proc/version",
88        (privacy).dest = DEST_AUTOMATIC
89    ];
90
91    // Device Logs
92    optional android.util.EventLogTagMapProto event_log_tag_map = 1100 [
93        (section).type = SECTION_FILE,
94        (section).args = "/system/etc/event-log-tags"
95    ];
96
97    optional android.util.LogProto main_logs = 1101 [
98        (section).type = SECTION_LOG,
99        (section).args = "main"
100    ];
101
102    optional android.util.LogProto radio_logs = 1102 [
103        (section).type = SECTION_LOG,
104        (section).args = "radio"
105    ];
106
107    optional android.util.LogProto events_logs = 1103 [
108        (section).type = SECTION_LOG,
109        (section).args = "events"
110    ];
111
112    optional android.util.LogProto system_logs = 1104 [
113        (section).type = SECTION_LOG,
114        (section).args = "system"
115    ];
116
117    optional android.util.LogProto crash_logs = 1105 [
118        (section).type = SECTION_LOG,
119        (section).args = "crash"
120    ];
121
122    optional android.util.LogProto stats_logs = 1106 [
123        (section).type = SECTION_LOG,
124        (section).args = "stats"
125    ];
126
127    optional android.util.LogProto security_logs = 1107 [
128        (section).type = SECTION_LOG,
129        (section).args = "security"
130    ];
131
132    optional android.util.LogProto kernel_logs = 1108 [
133        (section).type = SECTION_LOG,
134        (section).args = "kernel"
135    ];
136
137    // Last logcat sections.
138    // Note that kernel logs is not persisted since it's contained in last kmsg.
139    optional android.util.LogProto last_main_logs = 1109 [
140        (section).type = SECTION_LOG,
141        (section).args = "main -L"
142    ];
143
144    optional android.util.LogProto last_radio_logs = 1110 [
145        (section).type = SECTION_LOG,
146        (section).args = "radio -L"
147    ];
148
149    optional android.util.LogProto last_events_logs = 1111 [
150        (section).type = SECTION_LOG,
151        (section).args = "events -L"
152    ];
153
154    optional android.util.LogProto last_system_logs = 1112 [
155        (section).type = SECTION_LOG,
156        (section).args = "system -L"
157    ];
158
159    optional android.util.LogProto last_crash_logs = 1113 [
160        (section).type = SECTION_LOG,
161        (section).args = "crash -L"
162    ];
163
164    optional android.util.LogProto last_stats_logs = 1114 [
165        (section).type = SECTION_LOG,
166        (section).args = "stats -L"
167    ];
168
169    // security logs is only available with "Device Owner" mode
170    optional android.util.LogProto last_security_logs = 1115 [
171        (section).type = SECTION_LOG,
172        (section).args = "security -L"
173    ];
174
175    optional android.util.PersistedLogProto persisted_logs = 1116 [
176        (section).type = SECTION_COMMAND,
177        (section).args = "/system/bin/sh /system/bin/incident-helper-cmd -l run persisted_logs --limit 10MB"
178    ];
179
180    // Stack dumps
181    optional android.os.BackTraceProto native_traces = 1200 [
182        (section).type = SECTION_TOMBSTONE,
183        (section).args = "native"
184    ];
185
186    optional android.os.BackTraceProto hal_traces = 1201 [
187        (section).type = SECTION_TOMBSTONE,
188        (section).args = "hal"
189    ];
190
191    optional android.os.BackTraceProto java_traces = 1202 [
192        (section).type = SECTION_TOMBSTONE,
193        (section).args = "java"
194    ];
195
196    // Linux services
197    optional ProcrankProto procrank = 2000 [
198        // Disable procrank for reasons below:
199        // 1. incidentd can't execute `procrank` because it don't have DAC perms
200        //    since it is running as its own uid, no root access.
201        // 2. the same information is able to be accessed by meminfo dumpsys.
202        // 3. leave this one here to show case of how to disable a section
203        //    (no removal allowed if you are familiar with PROTOBUF).
204        (section).type = SECTION_NONE,
205        (section).args = "procrank"
206    ];
207
208    optional PageTypeInfoProto page_type_info = 2001 [
209        (section).type = SECTION_FILE,
210        (section).args = "/proc/pagetypeinfo"
211    ];
212
213    optional KernelWakeSourcesProto kernel_wake_sources = 2002 [
214        (section).type = SECTION_FILE,
215        (section).args = "/d/wakeup_sources"
216    ];
217
218    optional CpuInfoProto cpu_info = 2003 [
219        (section).type = SECTION_COMMAND,
220        (section).args = "top -b -n 1 -H -s 6 -o pid,tid,user,pr,ni,%cpu,s,virt,res,pcy,cmd,name"
221    ];
222
223    optional CpuFreqProto cpu_freq = 2004 [
224        (section).type = SECTION_FILE,
225        (section).args = "/sys/devices/system/cpu/cpufreq/all_time_in_state"
226    ];
227
228    optional PsProto processes_and_threads = 2005 [
229        (section).type = SECTION_COMMAND,
230        (section).args = "ps -A -T -Z -O pri,nice,rtprio,sched,pcy,time"
231    ];
232
233    optional BatteryTypeProto battery_type = 2006 [
234        (section).type = SECTION_FILE,
235        (section).args = "/sys/class/power_supply/bms/battery_type"
236    ];
237
238    optional GZippedFileProto last_kmsg = 2007 [
239        (section).type = SECTION_GZIP,
240        (section).args = "/sys/fs/pstore/console-ramoops /sys/fs/pstore/console-ramoops-0 /proc/last_kmsg",
241        (privacy).dest = DEST_EXPLICIT
242    ];
243
244    // System Services
245    optional com.android.server.biometrics.fingerprint.FingerprintServiceDumpProto fingerprint = 3000 [
246        (section).type = SECTION_DUMPSYS,
247        (section).args = "fingerprint --proto --incident"
248    ];
249
250    optional android.service.NetworkStatsServiceDumpProto netstats = 3001 [
251        (section).type = SECTION_DUMPSYS,
252        (section).args = "netstats --proto"
253    ];
254
255    optional android.providers.settings.SettingsServiceDumpProto settings = 3002 [
256        (section).type = SECTION_DUMPSYS,
257        (section).args = "settings --proto"
258    ];
259
260    optional android.service.appwidget.AppWidgetServiceDumpProto appwidget = 3003;
261    optional android.service.notification.NotificationServiceDumpProto notification = 3004 [
262        (section).type = SECTION_DUMPSYS,
263        (section).args = "notification --proto"
264    ];
265
266    optional android.service.batterystats.BatteryStatsServiceDumpProto batterystats = 3005 [
267        (section).type = SECTION_DUMPSYS,
268        (section).args = "batterystats --proto"
269    ];
270
271    optional android.service.battery.BatteryServiceDumpProto battery = 3006 [
272        (section).type = SECTION_DUMPSYS,
273        (section).args = "battery --proto"
274    ];
275
276    optional android.service.diskstats.DiskStatsServiceDumpProto diskstats = 3007 [
277        (section).type = SECTION_DUMPSYS,
278        (section).args = "diskstats --proto"
279    ];
280
281    optional android.service.pm.PackageServiceDumpProto package = 3008 [
282        (section).type = SECTION_DUMPSYS,
283        (section).args = "package --proto"
284    ];
285
286    optional com.android.server.power.PowerManagerServiceDumpProto power = 3009 [
287        (section).type = SECTION_DUMPSYS,
288        (section).args = "power --proto"
289    ];
290
291    optional android.service.print.PrintServiceDumpProto print = 3010 [
292        (section).type = SECTION_DUMPSYS,
293        (section).args = "print --proto"
294    ];
295
296    optional android.service.procstats.ProcessStatsServiceDumpProto procstats = 3011 [
297        (section).type = SECTION_DUMPSYS,
298        (section).args = "procstats --proto"
299    ];
300
301    optional com.android.server.am.ActivityManagerServiceDumpActivitiesProto activities = 3012 [
302        (section).type = SECTION_DUMPSYS,
303        (section).args = "activity --proto activities"
304    ];
305
306    optional com.android.server.am.ActivityManagerServiceDumpBroadcastsProto broadcasts = 3013 [
307        (section).type = SECTION_DUMPSYS,
308        (section).args = "activity --proto broadcasts"
309    ];
310
311    optional com.android.server.am.ActivityManagerServiceDumpServicesProto amservices = 3014 [
312        (section).type = SECTION_DUMPSYS,
313        (section).args = "activity --proto service"
314    ];
315
316    optional com.android.server.am.ActivityManagerServiceDumpProcessesProto amprocesses = 3015 [
317        (section).type = SECTION_DUMPSYS,
318        (section).args = "activity --proto processes"
319    ];
320
321    optional com.android.server.alarm.AlarmManagerServiceDumpProto alarm = 3016 [
322        (section).type = SECTION_DUMPSYS,
323        (section).args = "alarm --proto"
324    ];
325
326    optional com.android.server.wm.WindowManagerServiceDumpProto window = 3017 [
327        (section).type = SECTION_DUMPSYS,
328        (section).args = "window --proto"
329    ];
330
331    optional com.android.server.am.MemInfoDumpProto meminfo = 3018 [
332        (section).type = SECTION_DUMPSYS,
333        (section).args = "meminfo -a --proto"
334    ];
335
336    optional android.service.GraphicsStatsServiceDumpProto graphicsstats = 3019 [
337        (section).type = SECTION_DUMPSYS,
338        (section).args = "graphicsstats --proto"
339    ];
340
341    optional com.android.server.job.JobSchedulerServiceDumpProto jobscheduler = 3020 [
342        (section).type = SECTION_DUMPSYS,
343        (section).args = "jobscheduler --proto"
344    ];
345
346    optional android.service.usb.UsbServiceDumpProto usb = 3021 [
347        (section).type = SECTION_DUMPSYS,
348        (section).args = "usb --proto"
349    ];
350
351    // The history can be large and may cause issues in consumers, so put the
352    // history in a separate section to compensate.
353    optional android.service.batterystats.BatteryStatsServiceDumpHistoryProto battery_history = 3022 [
354        (section).type = SECTION_DUMPSYS,
355        (section).args = "batterystats --proto --history",
356        (section).userdebug_and_eng_only = true
357    ];
358
359    optional android.os.StatsDataDumpProto stats_data = 3023 [
360        (section).type = SECTION_DUMPSYS,
361        (section).args = "stats --proto",
362        (section).userdebug_and_eng_only = true
363    ];
364
365    optional com.android.role.RoleServiceDumpProto role = 3024 [
366        (section).type = SECTION_DUMPSYS,
367        (section).args = "role --proto"
368    ];
369
370    optional android.service.restricted_image.RestrictedImagesDumpProto restricted_images = 3025 [
371        (section).type = SECTION_DUMPSYS,
372        (section).userdebug_and_eng_only = true,
373        (section).args = "incidentcompanion --restricted_image"
374    ];
375
376    // System trace as a serialized protobuf.
377    optional bytes system_trace = 3026 [
378        (section).type = SECTION_FILE,
379        (section).args = "/data/misc/perfetto-traces/incident-trace",
380        (privacy).dest = DEST_AUTOMATIC
381    ];
382
383    // Dropbox entries split by tags.
384    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_crash = 3027 [
385        (section).type = SECTION_DUMPSYS,
386        (section).args = "dropbox --proto data_app_crash"
387    ];
388
389    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_anr = 3028 [
390        (section).type = SECTION_DUMPSYS,
391        (section).args = "dropbox --proto data_app_anr"
392    ];
393
394    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_native_crash = 3029 [
395        (section).type = SECTION_DUMPSYS,
396        (section).args = "dropbox --proto data_app_native_crash"
397    ];
398
399    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_strictmode = 3030 [
400        (section).type = SECTION_DUMPSYS,
401        (section).args = "dropbox --proto data_app_strictmode"
402    ];
403
404    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_wtf = 3031 [
405        (section).type = SECTION_DUMPSYS,
406        (section).args = "dropbox --proto data_app_wtf"
407    ];
408
409    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_crash = 3032 [
410        (section).type = SECTION_DUMPSYS,
411        (section).args = "dropbox --proto system_app_crash"
412    ];
413
414    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_anr = 3033 [
415        (section).type = SECTION_DUMPSYS,
416        (section).args = "dropbox --proto system_app_anr"
417    ];
418
419    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_native_crash = 3034 [
420        (section).type = SECTION_DUMPSYS,
421        (section).args = "dropbox --proto system_app_native_crash"
422    ];
423
424    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_strictmode = 3035 [
425        (section).type = SECTION_DUMPSYS,
426        (section).args = "dropbox --proto system_app_strictmode"
427    ];
428
429    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_wtf = 3036 [
430        (section).type = SECTION_DUMPSYS,
431        (section).args = "dropbox --proto system_app_wtf"
432    ];
433
434    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_crash = 3037 [
435        (section).type = SECTION_DUMPSYS,
436        (section).args = "dropbox --proto system_server_crash"
437    ];
438
439    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_anr = 3038 [
440        (section).type = SECTION_DUMPSYS,
441        (section).args = "dropbox --proto system_server_anr"
442    ];
443
444    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_native_crash = 3039 [
445        (section).type = SECTION_DUMPSYS,
446        (section).args = "dropbox --proto system_server_native_crash"
447    ];
448
449    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_lowmem= 3040 [
450        (section).type = SECTION_DUMPSYS,
451        (section).args = "dropbox --proto system_server_lowmem"
452    ];
453
454    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_strictmode = 3041 [
455        (section).type = SECTION_DUMPSYS,
456        (section).args = "dropbox --proto system_server_strictmode"
457    ];
458
459    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_watchdog = 3042 [
460        (section).type = SECTION_DUMPSYS,
461        (section).args = "dropbox --proto system_server_watchdog"
462    ];
463
464    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_wtf = 3043 [
465        (section).type = SECTION_DUMPSYS,
466        (section).args = "dropbox --proto system_server_wtf"
467    ];
468
469    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_recovery_log = 3044 [
470        (section).type = SECTION_DUMPSYS,
471        (section).args = "dropbox --proto SYSTEM_RECOVERY_LOG"
472    ];
473
474    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_tombstone = 3045 [
475        (section).type = SECTION_DUMPSYS,
476        (section).args = "dropbox --proto SYSTEM_TOMBSTONE"
477    ];
478
479    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_subsystem_restart = 3046 [
480        (section).type = SECTION_DUMPSYS,
481        (section).args = "dropbox --proto SubsystemRestart"
482    ];
483
484    optional CpuUsageProto process_cpu_usage = 3047 [
485        (section).type = SECTION_DUMPSYS,
486        (section).args = "cpuinfo --proto"
487    ];
488
489    optional .clearcut.connectivity.IpConnectivityLog ip_connectivity_metrics = 3049 [
490        (section).type = SECTION_DUMPSYS,
491        (section).args = "connmetrics --proto"
492    ];
493
494    optional com.android.server.BluetoothManagerServiceDumpProto bluetooth_manager = 3050 [
495        (section).type = SECTION_DUMPSYS,
496        (section).args = "bluetooth_manager --proto"
497    ];
498
499    optional com.android.server.location.ContextHubServiceProto context_hub = 3051 [
500        (section).type = SECTION_DUMPSYS,
501        (section).args = "contexthub --proto"
502    ];
503
504    optional com.android.nfc.NfcServiceDumpProto nfc_service  = 3052 [
505        (section).type = SECTION_DUMPSYS,
506        (section).args = "nfc --proto"
507    ];
508
509    optional android.service.SensorServiceProto sensor_service = 3053 [
510        (section).type = SECTION_DUMPSYS,
511        (section).args = "sensorservice --proto"
512    ];
513
514    optional com.android.server.powerstats.PowerStatsServiceMeterProto powerstats_meter = 3054 [
515        (section).type = SECTION_DUMPSYS,
516        (section).args = "powerstats --proto meter"
517    ];
518
519    optional com.android.server.powerstats.PowerStatsServiceModelProto powerstats_model = 3055 [
520        (section).type = SECTION_DUMPSYS,
521        (section).args = "powerstats --proto model"
522    ];
523
524    optional com.android.server.powerstats.PowerStatsServiceResidencyProto powerstats_residency = 3056 [
525        (section).type = SECTION_DUMPSYS,
526        (section).args = "powerstats --proto residency"
527    ];
528
529    // Dumps in text format (on userdebug and eng builds only): 4000 ~ 4999
530    optional android.util.TextDumpProto textdump_wifi = 4000 [
531        (section).type = SECTION_TEXT_DUMPSYS,
532        (section).args = "wifi"
533    ];
534
535    optional android.util.TextDumpProto textdump_bluetooth = 4001 [
536        (section).type = SECTION_TEXT_DUMPSYS,
537        (section).args = "bluetooth_manager"
538    ];
539
540    // Reserved for OEMs.
541    extensions 50000 to 100000;
542}
543