/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ syntax = "proto2"; option java_multiple_files = true; import "frameworks/base/core/proto/android/os/backtrace.proto"; import "frameworks/base/core/proto/android/os/batterytype.proto"; import "frameworks/base/core/proto/android/os/cpufreq.proto"; import "frameworks/base/core/proto/android/os/cpuinfo.proto"; import "frameworks/base/core/proto/android/os/data.proto"; import "frameworks/base/core/proto/android/os/header.proto"; import "frameworks/base/core/proto/android/os/kernelwake.proto"; import "frameworks/base/core/proto/android/os/metadata.proto"; import "frameworks/base/core/proto/android/os/pagetypeinfo.proto"; import "frameworks/base/core/proto/android/os/procrank.proto"; import "frameworks/base/core/proto/android/os/ps.proto"; import "frameworks/base/core/proto/android/os/statsdata.proto"; import "frameworks/base/core/proto/android/os/system_properties.proto"; import "frameworks/base/core/proto/android/providers/settings.proto"; import "frameworks/base/core/proto/android/server/activitymanagerservice.proto"; import "frameworks/base/core/proto/android/server/alarmmanagerservice.proto"; import "frameworks/base/core/proto/android/server/fingerprint.proto"; import "frameworks/base/core/proto/android/server/jobscheduler.proto"; import "frameworks/base/core/proto/android/server/powermanagerservice.proto"; import "frameworks/base/core/proto/android/server/rolemanagerservice.proto"; import "frameworks/base/core/proto/android/server/windowmanagerservice.proto"; import "frameworks/base/core/proto/android/service/appwidget.proto"; import "frameworks/base/core/proto/android/service/battery.proto"; import "frameworks/base/core/proto/android/service/batterystats.proto"; import "frameworks/base/core/proto/android/service/diskstats.proto"; import "frameworks/base/core/proto/android/service/graphicsstats.proto"; import "frameworks/base/core/proto/android/service/netstats.proto"; import "frameworks/base/core/proto/android/service/notification.proto"; import "frameworks/base/core/proto/android/service/package.proto"; import "frameworks/base/core/proto/android/service/print.proto"; import "frameworks/base/core/proto/android/service/procstats.proto"; import "frameworks/base/core/proto/android/service/restricted_image.proto"; import "frameworks/base/core/proto/android/service/usb.proto"; import "frameworks/base/core/proto/android/util/event_log_tags.proto"; import "frameworks/base/core/proto/android/util/log.proto"; import "frameworks/base/core/proto/android/privacy.proto"; import "frameworks/base/core/proto/android/section.proto"; package android.os; // Privacy tag can be marked to override UNSET messages so generic // message type can be handled case by case, e.g. GZippedFileProto. message IncidentProto { reserved 1001; // Incident header from callers repeated IncidentHeaderProto header = 1; // Internal metadata of incidentd optional IncidentMetadata metadata = 2; // Device information optional SystemPropertiesProto system_properties = 1000 [ (section).type = SECTION_COMMAND, (section).args = "getprop" ]; optional string kernel_version = 1002 [ (section).type = SECTION_FILE, (section).args = "/proc/version", (privacy).dest = DEST_AUTOMATIC ]; // Device Logs optional android.util.EventLogTagMapProto event_log_tag_map = 1100 [ (section).type = SECTION_FILE, (section).args = "/system/etc/event-log-tags" ]; optional android.util.LogProto main_logs = 1101 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_MAIN" ]; optional android.util.LogProto radio_logs = 1102 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_RADIO" ]; optional android.util.LogProto events_logs = 1103 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_EVENTS" ]; optional android.util.LogProto system_logs = 1104 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_SYSTEM" ]; optional android.util.LogProto crash_logs = 1105 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_CRASH" ]; optional android.util.LogProto stats_logs = 1106 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_STATS" ]; optional android.util.LogProto security_logs = 1107 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_SECURITY" ]; optional android.util.LogProto kernel_logs = 1108 [ (section).type = SECTION_LOG, (section).args = "LOG_ID_KERNEL" ]; // Stack dumps optional android.os.BackTraceProto native_traces = 1200 [ (section).type = SECTION_TOMBSTONE, (section).args = "native" ]; optional android.os.BackTraceProto hal_traces = 1201 [ (section).type = SECTION_TOMBSTONE, (section).args = "hal" ]; optional android.os.BackTraceProto java_traces = 1202 [ (section).type = SECTION_TOMBSTONE, (section).args = "java" ]; // Linux services optional ProcrankProto procrank = 2000 [ // Disable procrank for reasons below: // 1. incidentd can't execute `procrank` because it don't have DAC perms // since it is running as its own uid, no root access. // 2. the same information is able to be accessed by meminfo dumpsys. // 3. leave this one here to show case of how to disable a section // (no removal allowed if you are familiar with PROTOBUF). (section).type = SECTION_NONE, (section).args = "procrank" ]; optional PageTypeInfoProto page_type_info = 2001 [ (section).type = SECTION_FILE, (section).args = "/proc/pagetypeinfo" ]; optional KernelWakeSourcesProto kernel_wake_sources = 2002 [ (section).type = SECTION_FILE, (section).args = "/d/wakeup_sources" ]; optional CpuInfoProto cpu_info = 2003 [ (section).type = SECTION_COMMAND, (section).args = "top -b -n 1 -H -s 6 -o pid,tid,user,pr,ni,%cpu,s,virt,res,pcy,cmd,name" ]; optional CpuFreqProto cpu_freq = 2004 [ (section).type = SECTION_FILE, (section).args = "/sys/devices/system/cpu/cpufreq/all_time_in_state" ]; optional PsProto processes_and_threads = 2005 [ (section).type = SECTION_COMMAND, (section).args = "ps -A -T -Z -O pri,nice,rtprio,sched,pcy,time" ]; optional BatteryTypeProto battery_type = 2006 [ (section).type = SECTION_FILE, (section).args = "/sys/class/power_supply/bms/battery_type" ]; optional GZippedFileProto last_kmsg = 2007 [ (section).type = SECTION_GZIP, (section).args = "/sys/fs/pstore/console-ramoops /sys/fs/pstore/console-ramoops-0 /proc/last_kmsg", (privacy).dest = DEST_EXPLICIT ]; // System Services optional com.android.server.biometrics.fingerprint.FingerprintServiceDumpProto fingerprint = 3000 [ (section).type = SECTION_DUMPSYS, (section).args = "fingerprint --proto --incident" ]; optional android.service.NetworkStatsServiceDumpProto netstats = 3001 [ (section).type = SECTION_DUMPSYS, (section).args = "netstats --proto" ]; optional android.providers.settings.SettingsServiceDumpProto settings = 3002 [ (section).type = SECTION_DUMPSYS, (section).args = "settings --proto" ]; optional android.service.appwidget.AppWidgetServiceDumpProto appwidget = 3003; optional android.service.notification.NotificationServiceDumpProto notification = 3004 [ (section).type = SECTION_DUMPSYS, (section).args = "notification --proto" ]; optional android.service.batterystats.BatteryStatsServiceDumpProto batterystats = 3005 [ (section).type = SECTION_DUMPSYS, (section).args = "batterystats --proto" ]; optional android.service.battery.BatteryServiceDumpProto battery = 3006 [ (section).type = SECTION_DUMPSYS, (section).args = "battery --proto" ]; optional android.service.diskstats.DiskStatsServiceDumpProto diskstats = 3007 [ (section).type = SECTION_DUMPSYS, (section).args = "diskstats --proto" ]; optional android.service.pm.PackageServiceDumpProto package = 3008 [ (section).type = SECTION_DUMPSYS, (section).args = "package --proto" ]; optional com.android.server.power.PowerManagerServiceDumpProto power = 3009 [ (section).type = SECTION_DUMPSYS, (section).args = "power --proto" ]; optional android.service.print.PrintServiceDumpProto print = 3010 [ (section).type = SECTION_DUMPSYS, (section).args = "print --proto" ]; optional android.service.procstats.ProcessStatsServiceDumpProto procstats = 3011 [ (section).type = SECTION_DUMPSYS, (section).args = "procstats --proto" ]; optional com.android.server.am.ActivityManagerServiceDumpActivitiesProto activities = 3012 [ (section).type = SECTION_DUMPSYS, (section).args = "activity --proto activities" ]; optional com.android.server.am.ActivityManagerServiceDumpBroadcastsProto broadcasts = 3013 [ (section).type = SECTION_DUMPSYS, (section).args = "activity --proto broadcasts" ]; optional com.android.server.am.ActivityManagerServiceDumpServicesProto amservices = 3014 [ (section).type = SECTION_DUMPSYS, (section).args = "activity --proto service" ]; optional com.android.server.am.ActivityManagerServiceDumpProcessesProto amprocesses = 3015 [ (section).type = SECTION_DUMPSYS, (section).args = "activity --proto processes" ]; optional com.android.server.AlarmManagerServiceDumpProto alarm = 3016 [ (section).type = SECTION_DUMPSYS, (section).args = "alarm --proto" ]; optional com.android.server.wm.WindowManagerServiceDumpProto window = 3017 [ (section).type = SECTION_DUMPSYS, (section).args = "window --proto" ]; optional com.android.server.am.MemInfoDumpProto meminfo = 3018 [ (section).type = SECTION_DUMPSYS, (section).args = "meminfo -a --proto" ]; optional android.service.GraphicsStatsServiceDumpProto graphicsstats = 3019 [ (section).type = SECTION_DUMPSYS, (section).args = "graphicsstats --proto" ]; optional com.android.server.job.JobSchedulerServiceDumpProto jobscheduler = 3020 [ (section).type = SECTION_DUMPSYS, (section).args = "jobscheduler --proto" ]; optional android.service.usb.UsbServiceDumpProto usb = 3021 [ (section).type = SECTION_DUMPSYS, (section).args = "usb --proto" ]; // The history can be large and may cause issues in consumers, so put the // history in a separate section to compensate. optional android.service.batterystats.BatteryStatsServiceDumpHistoryProto battery_history = 3022 [ (section).type = SECTION_DUMPSYS, (section).args = "batterystats --proto --history", (section).userdebug_and_eng_only = true ]; optional android.os.StatsDataDumpProto stats_data = 3023 [ (section).type = SECTION_DUMPSYS, (section).args = "stats --proto", (section).userdebug_and_eng_only = true ]; optional com.android.server.role.RoleManagerServiceDumpProto role = 3024 [ (section).type = SECTION_DUMPSYS, (section).args = "role --proto" ]; optional android.service.restricted_image.RestrictedImagesDumpProto restricted_images = 3025 [ (section).type = SECTION_DUMPSYS, (section).userdebug_and_eng_only = true, (section).args = "incidentcompanion --restricted_image" ]; // System trace as a serialized protobuf. optional bytes system_trace = 3026 [ (section).type = SECTION_FILE, (section).args = "/data/misc/perfetto-traces/incident-trace", (privacy).dest = DEST_AUTOMATIC, (section).userdebug_and_eng_only = true ]; // Reserved for OEMs. extensions 50000 to 100000; }