• 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/notification.proto";
52import "frameworks/base/core/proto/android/service/package.proto";
53import "frameworks/base/core/proto/android/service/print.proto";
54import "frameworks/base/core/proto/android/service/procstats.proto";
55import "frameworks/base/core/proto/android/service/restricted_image.proto";
56import "frameworks/base/core/proto/android/service/sensor_service.proto";
57import "frameworks/base/core/proto/android/service/usb.proto";
58import "frameworks/base/core/proto/android/util/event_log_tags.proto";
59import "frameworks/base/core/proto/android/util/log.proto";
60import "frameworks/base/core/proto/android/util/textdump.proto";
61import "frameworks/base/core/proto/android/privacy.proto";
62import "frameworks/base/core/proto/android/section.proto";
63import "frameworks/base/proto/src/ipconnectivity.proto";
64import "packages/modules/Connectivity/framework/proto/netstats.proto";
65import "packages/modules/Permission/service/proto/role_service.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        (section).userdebug_and_eng_only = true
254    ];
255
256    optional android.providers.settings.SettingsServiceDumpProto settings = 3002 [
257        (section).type = SECTION_DUMPSYS,
258        (section).args = "settings --proto"
259    ];
260
261    optional android.service.appwidget.AppWidgetServiceDumpProto appwidget = 3003;
262    optional android.service.notification.NotificationServiceDumpProto notification = 3004 [
263        (section).type = SECTION_DUMPSYS,
264        (section).args = "notification --proto"
265    ];
266
267    optional android.service.batterystats.BatteryStatsServiceDumpProto batterystats = 3005 [
268        (section).type = SECTION_DUMPSYS,
269        (section).args = "batterystats --proto"
270    ];
271
272    optional android.service.battery.BatteryServiceDumpProto battery = 3006 [
273        (section).type = SECTION_DUMPSYS,
274        (section).args = "battery --proto"
275    ];
276
277    optional android.service.diskstats.DiskStatsServiceDumpProto diskstats = 3007 [
278        (section).type = SECTION_DUMPSYS,
279        (section).args = "diskstats --proto"
280    ];
281
282    optional android.service.pm.PackageServiceDumpProto package = 3008 [
283        (section).type = SECTION_DUMPSYS,
284        (section).args = "package --proto"
285    ];
286
287    optional com.android.server.power.PowerManagerServiceDumpProto power = 3009 [
288        (section).type = SECTION_DUMPSYS,
289        (section).args = "power --proto"
290    ];
291
292    optional android.service.print.PrintServiceDumpProto print = 3010 [
293        (section).type = SECTION_DUMPSYS,
294        (section).args = "print --proto"
295    ];
296
297    optional android.service.procstats.ProcessStatsServiceDumpProto procstats = 3011 [
298        (section).type = SECTION_DUMPSYS,
299        (section).args = "procstats --proto"
300    ];
301
302    optional com.android.server.am.ActivityManagerServiceDumpActivitiesProto activities = 3012 [
303        (section).type = SECTION_DUMPSYS,
304        (section).args = "activity --proto activities"
305    ];
306
307    optional com.android.server.am.ActivityManagerServiceDumpBroadcastsProto broadcasts = 3013 [
308        (section).type = SECTION_DUMPSYS,
309        (section).args = "activity --proto broadcasts"
310    ];
311
312    optional com.android.server.am.ActivityManagerServiceDumpServicesProto amservices = 3014 [
313        (section).type = SECTION_DUMPSYS,
314        (section).args = "activity --proto service"
315    ];
316
317    optional com.android.server.am.ActivityManagerServiceDumpProcessesProto amprocesses = 3015 [
318        (section).type = SECTION_DUMPSYS,
319        (section).args = "activity --proto processes"
320    ];
321
322    optional com.android.server.alarm.AlarmManagerServiceDumpProto alarm = 3016 [
323        (section).type = SECTION_DUMPSYS,
324        (section).args = "alarm --proto"
325    ];
326
327    optional com.android.server.wm.WindowManagerServiceDumpProto window = 3017 [
328        (section).type = SECTION_DUMPSYS,
329        (section).args = "window --proto"
330    ];
331
332    optional com.android.server.am.MemInfoDumpProto meminfo = 3018 [
333        (section).type = SECTION_DUMPSYS,
334        (section).args = "meminfo -a --proto"
335    ];
336
337    optional android.service.GraphicsStatsServiceDumpProto graphicsstats = 3019 [
338        (section).type = SECTION_DUMPSYS,
339        (section).args = "graphicsstats --proto"
340    ];
341
342    optional com.android.server.job.JobSchedulerServiceDumpProto jobscheduler = 3020 [
343        (section).type = SECTION_DUMPSYS,
344        (section).args = "jobscheduler --proto"
345    ];
346
347    optional android.service.usb.UsbServiceDumpProto usb = 3021 [
348        (section).type = SECTION_DUMPSYS,
349        (section).args = "usb --proto"
350    ];
351
352    // The history can be large and may cause issues in consumers, so put the
353    // history in a separate section to compensate.
354    optional android.service.batterystats.BatteryStatsServiceDumpHistoryProto battery_history = 3022 [
355        (section).type = SECTION_DUMPSYS,
356        (section).args = "batterystats --proto --history",
357        (section).userdebug_and_eng_only = true
358    ];
359
360    optional android.os.StatsDataDumpProto stats_data = 3023 [
361        (section).type = SECTION_DUMPSYS,
362        (section).args = "stats --proto",
363        (section).userdebug_and_eng_only = true
364    ];
365
366    optional com.android.role.RoleServiceDumpProto role = 3024 [
367        (section).type = SECTION_DUMPSYS,
368        (section).args = "role --proto"
369    ];
370
371    optional android.service.restricted_image.RestrictedImagesDumpProto restricted_images = 3025 [
372        (section).type = SECTION_DUMPSYS,
373        (section).userdebug_and_eng_only = true,
374        (section).args = "incidentcompanion --restricted_image"
375    ];
376
377    // System trace as a serialized protobuf.
378    optional bytes system_trace = 3026 [
379        (section).type = SECTION_FILE,
380        (section).args = "/data/misc/perfetto-traces/incident-trace",
381        (privacy).dest = DEST_AUTOMATIC
382    ];
383
384    // Dropbox entries split by tags.
385    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_crash = 3027 [
386        (section).type = SECTION_DUMPSYS,
387        (section).args = "dropbox --proto data_app_crash"
388    ];
389
390    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_anr = 3028 [
391        (section).type = SECTION_DUMPSYS,
392        (section).args = "dropbox --proto data_app_anr"
393    ];
394
395    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_native_crash = 3029 [
396        (section).type = SECTION_DUMPSYS,
397        (section).args = "dropbox --proto data_app_native_crash"
398    ];
399
400    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_strictmode = 3030 [
401        (section).type = SECTION_DUMPSYS,
402        (section).args = "dropbox --proto data_app_strictmode"
403    ];
404
405    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_wtf = 3031 [
406        (section).type = SECTION_DUMPSYS,
407        (section).args = "dropbox --proto data_app_wtf"
408    ];
409
410    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_crash = 3032 [
411        (section).type = SECTION_DUMPSYS,
412        (section).args = "dropbox --proto system_app_crash"
413    ];
414
415    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_anr = 3033 [
416        (section).type = SECTION_DUMPSYS,
417        (section).args = "dropbox --proto system_app_anr"
418    ];
419
420    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_native_crash = 3034 [
421        (section).type = SECTION_DUMPSYS,
422        (section).args = "dropbox --proto system_app_native_crash"
423    ];
424
425    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_strictmode = 3035 [
426        (section).type = SECTION_DUMPSYS,
427        (section).args = "dropbox --proto system_app_strictmode"
428    ];
429
430    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_wtf = 3036 [
431        (section).type = SECTION_DUMPSYS,
432        (section).args = "dropbox --proto system_app_wtf"
433    ];
434
435    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_crash = 3037 [
436        (section).type = SECTION_DUMPSYS,
437        (section).args = "dropbox --proto system_server_crash"
438    ];
439
440    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_anr = 3038 [
441        (section).type = SECTION_DUMPSYS,
442        (section).args = "dropbox --proto system_server_anr"
443    ];
444
445    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_native_crash = 3039 [
446        (section).type = SECTION_DUMPSYS,
447        (section).args = "dropbox --proto system_server_native_crash"
448    ];
449
450    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_lowmem= 3040 [
451        (section).type = SECTION_DUMPSYS,
452        (section).args = "dropbox --proto system_server_lowmem"
453    ];
454
455    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_strictmode = 3041 [
456        (section).type = SECTION_DUMPSYS,
457        (section).args = "dropbox --proto system_server_strictmode"
458    ];
459
460    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_watchdog = 3042 [
461        (section).type = SECTION_DUMPSYS,
462        (section).args = "dropbox --proto system_server_watchdog"
463    ];
464
465    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_wtf = 3043 [
466        (section).type = SECTION_DUMPSYS,
467        (section).args = "dropbox --proto system_server_wtf"
468    ];
469
470    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_recovery_log = 3044 [
471        (section).type = SECTION_DUMPSYS,
472        (section).args = "dropbox --proto SYSTEM_RECOVERY_LOG"
473    ];
474
475    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_tombstone = 3045 [
476        (section).type = SECTION_DUMPSYS,
477        (section).args = "dropbox --proto SYSTEM_TOMBSTONE"
478    ];
479
480    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_subsystem_restart = 3046 [
481        (section).type = SECTION_DUMPSYS,
482        (section).args = "dropbox --proto SubsystemRestart"
483    ];
484
485    optional CpuUsageProto process_cpu_usage = 3047 [
486        (section).type = SECTION_DUMPSYS,
487        (section).args = "cpuinfo --proto"
488    ];
489
490    optional .clearcut.connectivity.IpConnectivityLog ip_connectivity_metrics = 3049 [
491        (section).type = SECTION_DUMPSYS,
492        (section).args = "connmetrics --proto"
493    ];
494
495    optional com.android.server.BluetoothManagerServiceDumpProto bluetooth_manager = 3050 [
496        (section).type = SECTION_DUMPSYS,
497        (section).args = "bluetooth_manager --proto"
498    ];
499
500    optional com.android.server.location.ContextHubServiceProto context_hub = 3051 [
501        (section).type = SECTION_DUMPSYS,
502        (section).args = "contexthub --proto"
503    ];
504
505    optional com.android.nfc.NfcServiceDumpProto nfc_service  = 3052 [
506        (section).type = SECTION_DUMPSYS,
507        (section).args = "nfc --proto"
508    ];
509
510    optional android.service.SensorServiceProto sensor_service = 3053 [
511        (section).type = SECTION_DUMPSYS,
512        (section).args = "sensorservice --proto"
513    ];
514
515    optional com.android.server.powerstats.PowerStatsServiceMeterProto powerstats_meter = 3054 [
516        (section).type = SECTION_DUMPSYS,
517        (section).args = "powerstats --proto meter"
518    ];
519
520    optional com.android.server.powerstats.PowerStatsServiceModelProto powerstats_model = 3055 [
521        (section).type = SECTION_DUMPSYS,
522        (section).args = "powerstats --proto model"
523    ];
524
525    optional com.android.server.powerstats.PowerStatsServiceResidencyProto powerstats_residency = 3056 [
526        (section).type = SECTION_DUMPSYS,
527        (section).args = "powerstats --proto residency"
528    ];
529
530    // Dumps in text format (on userdebug and eng builds only): 4000 ~ 4999
531    optional android.util.TextDumpProto textdump_wifi = 4000 [
532        (section).type = SECTION_TEXT_DUMPSYS,
533        (section).args = "wifi"
534    ];
535
536    optional android.util.TextDumpProto textdump_bluetooth = 4001 [
537        (section).type = SECTION_TEXT_DUMPSYS,
538        (section).args = "bluetooth_manager"
539    ];
540
541    // Reserved for OEMs.
542    extensions 50000 to 100000;
543}
544