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