Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 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 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 17 | syntax = "proto2"; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 18 | option java_multiple_files = true; |
Joe Onorato | 7669012 | 2016-12-20 08:18:32 -0800 | [diff] [blame] | 19 | option java_outer_classname = "IncidentProtoMetadata"; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 20 | |
Kweku Adams | 59e6fd7 | 2017-12-27 15:48:14 -0800 | [diff] [blame] | 21 | import "frameworks/base/core/proto/android/os/batterytype.proto"; |
Yi Jin | 0eb2234 | 2017-11-06 17:17:27 -0800 | [diff] [blame] | 22 | import "frameworks/base/core/proto/android/os/cpufreq.proto"; |
Yi Jin | e2f7f79 | 2017-11-01 17:08:27 -0700 | [diff] [blame] | 23 | import "frameworks/base/core/proto/android/os/cpuinfo.proto"; |
Kweku Adams | fd257d6 | 2017-10-25 17:53:50 -0700 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/os/incidentheader.proto"; |
| 25 | import "frameworks/base/core/proto/android/os/kernelwake.proto"; |
| 26 | import "frameworks/base/core/proto/android/os/pagetypeinfo.proto"; |
| 27 | import "frameworks/base/core/proto/android/os/procrank.proto"; |
Kweku Adams | f5cc575 | 2017-12-20 17:59:17 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/os/ps.proto"; |
Yi Jin | 0dfa752 | 2017-11-06 17:43:47 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/os/system_properties.proto"; |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/providers/settings.proto"; |
Kweku Adams | fd257d6 | 2017-10-25 17:53:50 -0700 | [diff] [blame] | 31 | import "frameworks/base/core/proto/android/server/activitymanagerservice.proto"; |
| 32 | import "frameworks/base/core/proto/android/server/alarmmanagerservice.proto"; |
| 33 | import "frameworks/base/core/proto/android/server/fingerprint.proto"; |
Kweku Adams | e6b00c2 | 2017-10-23 16:46:45 -0700 | [diff] [blame] | 34 | import "frameworks/base/core/proto/android/server/powermanagerservice.proto"; |
Kweku Adams | 9a478d2 | 2017-12-14 12:56:28 -0800 | [diff] [blame] | 35 | import "frameworks/base/core/proto/android/server/windowmanagerservice.proto"; |
Mario Bertschler | 86882f4 | 2017-01-25 15:36:55 -0800 | [diff] [blame] | 36 | import "frameworks/base/core/proto/android/service/appwidget.proto"; |
Makoto Onuki | 9b1613d | 2017-04-17 15:31:31 -0700 | [diff] [blame] | 37 | import "frameworks/base/core/proto/android/service/battery.proto"; |
Kweku Adams | 2f73ecd | 2017-09-27 16:59:19 -0700 | [diff] [blame] | 38 | import "frameworks/base/core/proto/android/service/batterystats.proto"; |
Makoto Onuki | 9b1613d | 2017-04-17 15:31:31 -0700 | [diff] [blame] | 39 | import "frameworks/base/core/proto/android/service/diskstats.proto"; |
Kweku Adams | 9a478d2 | 2017-12-14 12:56:28 -0800 | [diff] [blame] | 40 | import "frameworks/base/core/proto/android/service/graphicsstats.proto"; |
Makoto Onuki | da65a52 | 2017-01-13 10:23:30 -0800 | [diff] [blame] | 41 | import "frameworks/base/core/proto/android/service/netstats.proto"; |
Julia Reynolds | c9842c1 | 2017-02-07 12:46:41 -0500 | [diff] [blame] | 42 | import "frameworks/base/core/proto/android/service/notification.proto"; |
Makoto Onuki | 9b1613d | 2017-04-17 15:31:31 -0700 | [diff] [blame] | 43 | import "frameworks/base/core/proto/android/service/package.proto"; |
Philip P. Moltmann | c0a128d | 2017-06-19 10:55:09 -0700 | [diff] [blame] | 44 | import "frameworks/base/core/proto/android/service/print.proto"; |
Yi Jin | 9680cfa | 2017-09-15 15:14:43 -0700 | [diff] [blame] | 45 | import "frameworks/base/core/proto/android/service/procstats.proto"; |
Yi Jin | 3c034c9 | 2017-12-22 17:36:47 -0800 | [diff] [blame] | 46 | import "frameworks/base/core/proto/android/util/event_log_tags.proto"; |
| 47 | import "frameworks/base/core/proto/android/util/log.proto"; |
Yi Jin | bdf5894 | 2017-11-14 17:58:19 -0800 | [diff] [blame] | 48 | import "frameworks/base/libs/incident/proto/android/privacy.proto"; |
| 49 | import "frameworks/base/libs/incident/proto/android/section.proto"; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 50 | |
| 51 | package android.os; |
| 52 | |
Yi Jin | f5ef0ac | 2017-12-04 14:29:37 -0800 | [diff] [blame] | 53 | // This field contains internal metadata associated with an incident report, |
| 54 | // such as the section ids and privacy policy specs from caller as well as how long |
| 55 | // and how many bytes a section takes, etc. |
| 56 | message IncidentMetadata { |
| 57 | |
| 58 | } |
| 59 | |
Yi Jin | 0ed9b68 | 2017-08-18 14:51:20 -0700 | [diff] [blame] | 60 | // privacy field options must not be set at this level because all |
| 61 | // the sections are able to be controlled and configured by section ids. |
| 62 | // Instead privacy field options need to be configured in each section proto message. |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 63 | message IncidentProto { |
Yi Jin | 3c034c9 | 2017-12-22 17:36:47 -0800 | [diff] [blame] | 64 | reserved 1001; |
| 65 | |
Yi Jin | f5ef0ac | 2017-12-04 14:29:37 -0800 | [diff] [blame] | 66 | // Incident header from callers |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 67 | repeated IncidentHeaderProto header = 1; |
Yi Jin | f5ef0ac | 2017-12-04 14:29:37 -0800 | [diff] [blame] | 68 | // Internal metadata of incidentd |
| 69 | optional IncidentMetadata metadata = 2; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 70 | |
| 71 | // Device information |
Yi Jin | 0dfa752 | 2017-11-06 17:43:47 -0800 | [diff] [blame] | 72 | optional SystemPropertiesProto system_properties = 1000 [ |
| 73 | (section).type = SECTION_COMMAND, |
Kweku Adams | f5cc575 | 2017-12-20 17:59:17 -0800 | [diff] [blame] | 74 | (section).args = "getprop" |
Yi Jin | 0dfa752 | 2017-11-06 17:43:47 -0800 | [diff] [blame] | 75 | ]; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 76 | |
Yi Jin | 3c034c9 | 2017-12-22 17:36:47 -0800 | [diff] [blame] | 77 | // Device Logs |
| 78 | optional android.util.EventLogTagMapProto event_log_tag_map = 1100 [ |
| 79 | (section).type = SECTION_FILE, |
| 80 | (section).args = "/system/etc/event-log-tags" |
| 81 | ]; |
| 82 | |
| 83 | optional android.util.LogProto main_logs = 1101 [ |
| 84 | (section).type = SECTION_LOG, |
| 85 | (section).args = "LOG_ID_MAIN" |
| 86 | ]; |
| 87 | |
| 88 | optional android.util.LogProto radio_logs = 1102 [ |
| 89 | (section).type = SECTION_LOG, |
| 90 | (section).args = "LOG_ID_RADIO" |
| 91 | ]; |
| 92 | |
| 93 | optional android.util.LogProto events_logs = 1103 [ |
| 94 | (section).type = SECTION_LOG, |
| 95 | (section).args = "LOG_ID_EVENTS" |
| 96 | ]; |
| 97 | |
| 98 | optional android.util.LogProto system_logs = 1104 [ |
| 99 | (section).type = SECTION_LOG, |
| 100 | (section).args = "LOG_ID_SYSTEM" |
| 101 | ]; |
| 102 | |
| 103 | optional android.util.LogProto crash_logs = 1105 [ |
| 104 | (section).type = SECTION_LOG, |
| 105 | (section).args = "LOG_ID_CRASH" |
| 106 | ]; |
| 107 | |
| 108 | optional android.util.LogProto stats_logs = 1106 [ |
| 109 | (section).type = SECTION_LOG, |
| 110 | (section).args = "LOG_ID_STATS" |
| 111 | ]; |
| 112 | |
| 113 | optional android.util.LogProto security_logs = 1107 [ |
| 114 | (section).type = SECTION_LOG, |
| 115 | (section).args = "LOG_ID_SECURITY" |
| 116 | ]; |
| 117 | |
| 118 | optional android.util.LogProto kernel_logs = 1108 [ |
| 119 | (section).type = SECTION_LOG, |
| 120 | (section).args = "LOG_ID_KERNEL" |
| 121 | ]; |
| 122 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 123 | // Linux services |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 124 | optional Procrank procrank = 2000 [ |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 125 | (section).type = SECTION_COMMAND, |
| 126 | (section).args = "/system/xbin/procrank" |
| 127 | ]; |
Yi Jin | 810b14f | 2017-09-11 19:01:08 -0700 | [diff] [blame] | 128 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 129 | optional PageTypeInfo page_type_info = 2001 [ |
Yi Jin | 810b14f | 2017-09-11 19:01:08 -0700 | [diff] [blame] | 130 | (section).type = SECTION_FILE, |
| 131 | (section).args = "/proc/pagetypeinfo" |
| 132 | ]; |
| 133 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 134 | optional KernelWakeSources kernel_wake_sources = 2002 [ |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 135 | (section).type = SECTION_FILE, |
| 136 | (section).args = "/d/wakeup_sources" |
| 137 | ]; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 138 | |
Yi Jin | e2f7f79 | 2017-11-01 17:08:27 -0700 | [diff] [blame] | 139 | optional CpuInfo cpu_info = 2003 [ |
| 140 | (section).type = SECTION_COMMAND, |
Kweku Adams | f5cc575 | 2017-12-20 17:59:17 -0800 | [diff] [blame] | 141 | (section).args = "top -b -n 1 -H -s 6 -o pid,tid,user,pr,ni,%cpu,s,virt,res,pcy,cmd,name" |
Yi Jin | e2f7f79 | 2017-11-01 17:08:27 -0700 | [diff] [blame] | 142 | ]; |
| 143 | |
Yi Jin | 0eb2234 | 2017-11-06 17:17:27 -0800 | [diff] [blame] | 144 | optional CpuFreq cpu_freq = 2004 [ |
| 145 | (section).type = SECTION_FILE, |
| 146 | (section).args = "/sys/devices/system/cpu/cpufreq/all_time_in_state" |
| 147 | ]; |
Yi Jin | 810b14f | 2017-09-11 19:01:08 -0700 | [diff] [blame] | 148 | |
Kweku Adams | f5cc575 | 2017-12-20 17:59:17 -0800 | [diff] [blame] | 149 | optional PsDumpProto processes_and_threads = 2005 [ |
| 150 | (section).type = SECTION_COMMAND, |
| 151 | (section).args = "ps -A -T -Z -O pri,nice,rtprio,sched,pcy,time" |
| 152 | ]; |
| 153 | |
Kweku Adams | 59e6fd7 | 2017-12-27 15:48:14 -0800 | [diff] [blame] | 154 | optional BatteryTypeProto battery_type = 2006 [ |
| 155 | (section).type = SECTION_FILE, |
| 156 | (section).args = "/sys/class/power_supply/bms/battery_type" |
| 157 | ]; |
| 158 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 159 | // System Services |
Kweku Adams | fd257d6 | 2017-10-25 17:53:50 -0700 | [diff] [blame] | 160 | optional com.android.server.fingerprint.FingerprintServiceDumpProto fingerprint = 3000 [ |
Yi Jin | f860184 | 2017-08-15 22:01:41 -0700 | [diff] [blame] | 161 | (section).type = SECTION_DUMPSYS, |
| 162 | (section).args = "fingerprint --proto --incident" |
| 163 | ]; |
Yi Jin | 810b14f | 2017-09-11 19:01:08 -0700 | [diff] [blame] | 164 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 165 | optional android.service.NetworkStatsServiceDumpProto netstats = 3001 [ |
Yi Jin | fe18682 | 2017-09-28 13:45:12 -0700 | [diff] [blame] | 166 | (section).type = SECTION_DUMPSYS, |
| 167 | (section).args = "netstats --proto" |
| 168 | ]; |
| 169 | |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 170 | optional android.providers.settings.SettingsServiceDumpProto settings = 3002 [ |
| 171 | (section).type = SECTION_DUMPSYS, |
| 172 | (section).args = "settings --proto" |
| 173 | ]; |
| 174 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 175 | optional android.service.appwidget.AppWidgetServiceDumpProto appwidget = 3003; |
| 176 | optional android.service.notification.NotificationServiceDumpProto notification = 3004 [ |
Kweku Adams | 93304b6 | 2017-09-20 17:03:00 -0700 | [diff] [blame] | 177 | (section).type = SECTION_DUMPSYS, |
| 178 | (section).args = "notification --proto" |
| 179 | ]; |
Yi Jin | a5c5e8a | 2017-09-27 18:24:58 -0700 | [diff] [blame] | 180 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 181 | optional android.service.batterystats.BatteryStatsServiceDumpProto batterystats = 3005 [ |
Kweku Adams | 2f73ecd | 2017-09-27 16:59:19 -0700 | [diff] [blame] | 182 | (section).type = SECTION_DUMPSYS, |
| 183 | (section).args = "batterystats --proto" |
| 184 | ]; |
| 185 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 186 | optional android.service.battery.BatteryServiceDumpProto battery = 3006 [ |
Kweku Adams | c22b1c4 | 2017-09-27 12:01:02 -0700 | [diff] [blame] | 187 | (section).type = SECTION_DUMPSYS, |
| 188 | (section).args = "battery --proto" |
| 189 | ]; |
Yi Jin | a5c5e8a | 2017-09-27 18:24:58 -0700 | [diff] [blame] | 190 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 191 | optional android.service.diskstats.DiskStatsServiceDumpProto diskstats = 3007 [ |
Yi Jin | a5c5e8a | 2017-09-27 18:24:58 -0700 | [diff] [blame] | 192 | (section).type = SECTION_DUMPSYS, |
| 193 | (section).args = "diskstats --proto" |
| 194 | ]; |
| 195 | |
Yi Jin | d6759d4 | 2017-10-12 15:08:49 -0700 | [diff] [blame] | 196 | optional android.service.pm.PackageServiceDumpProto package = 3008 [ |
| 197 | (section).type = SECTION_DUMPSYS, |
| 198 | (section).args = "package --proto" |
| 199 | ]; |
| 200 | |
Kweku Adams | e6b00c2 | 2017-10-23 16:46:45 -0700 | [diff] [blame] | 201 | optional com.android.server.power.PowerManagerServiceDumpProto power = 3009 [ |
| 202 | (section).type = SECTION_DUMPSYS, |
| 203 | (section).args = "power --proto" |
| 204 | ]; |
| 205 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 206 | optional android.service.print.PrintServiceDumpProto print = 3010; |
Yi Jin | 9680cfa | 2017-09-15 15:14:43 -0700 | [diff] [blame] | 207 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 208 | optional android.service.procstats.ProcessStatsServiceDumpProto procstats = 3011 [ |
Yi Jin | 9680cfa | 2017-09-15 15:14:43 -0700 | [diff] [blame] | 209 | (section).type = SECTION_DUMPSYS, |
| 210 | (section).args = "procstats --proto" |
| 211 | ]; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 212 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 213 | optional com.android.server.am.proto.ActivityStackSupervisorProto activities = 3012 [ |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 214 | (section).type = SECTION_DUMPSYS, |
| 215 | (section).args = "activity --proto activities" |
| 216 | ]; |
| 217 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 218 | optional com.android.server.am.proto.BroadcastProto broadcasts = 3013 [ |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 219 | (section).type = SECTION_DUMPSYS, |
| 220 | (section).args = "activity --proto broadcasts" |
| 221 | ]; |
| 222 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame] | 223 | optional com.android.server.am.proto.ActiveServicesProto amservices = 3014 [ |
| 224 | (section).type = SECTION_DUMPSYS, |
| 225 | (section).args = "activity --proto service" |
| 226 | ]; |
| 227 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 228 | optional com.android.server.am.proto.ProcessProto amprocesses = 3015; |
Kweku Adams | 61e0329 | 2017-10-19 14:27:12 -0700 | [diff] [blame] | 229 | |
| 230 | optional com.android.server.AlarmManagerServiceProto alarm = 3016 [ |
| 231 | (section).type = SECTION_DUMPSYS, |
| 232 | (section).args = "alarm --proto" |
| 233 | ]; |
Yi Jin | be6de30 | 2017-10-24 12:30:24 -0700 | [diff] [blame] | 234 | |
| 235 | optional com.android.server.wm.proto.WindowManagerServiceProto window = 3017 [ |
| 236 | (section).type = SECTION_DUMPSYS, |
| 237 | (section).args = "window --proto" |
| 238 | ]; |
Kweku Adams | 598e9a2 | 2017-11-02 17:12:20 -0700 | [diff] [blame] | 239 | |
| 240 | optional com.android.server.am.proto.MemInfoProto meminfo = 3018 [ |
| 241 | (section).type = SECTION_DUMPSYS, |
Kweku Adams | 983829f | 2017-12-06 14:53:50 -0800 | [diff] [blame] | 242 | (section).args = "meminfo -a --proto" |
Kweku Adams | 598e9a2 | 2017-11-02 17:12:20 -0700 | [diff] [blame] | 243 | ]; |
Kweku Adams | 9a478d2 | 2017-12-14 12:56:28 -0800 | [diff] [blame] | 244 | |
| 245 | optional android.service.GraphicsStatsServiceDumpProto graphicsstats = 3019 [ |
| 246 | (section).type = SECTION_DUMPSYS, |
| 247 | (section).args = "graphicsstats --proto" |
| 248 | ]; |
Yi Jin | 3c034c9 | 2017-12-22 17:36:47 -0800 | [diff] [blame] | 249 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 250 | } |