Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
| 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 19 | // TODO: Not the right package and class name |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 21 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 22 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 23 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/app/activitymanager.proto"; |
| 25 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 26 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 27 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 28 | * raw stats log events from the Android system, also known as "atoms." |
| 29 | * |
| 30 | * This field contains a single oneof with all of the available messages. |
| 31 | * The stats-log-api-gen tool runs as part of the Android build and |
| 32 | * generates the android.util.StatsLog class, which contains the constants |
| 33 | * and methods that Android uses to log. |
| 34 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 35 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 36 | * Instead, statsd on Android constructs these messages synthetically, |
| 37 | * in the format defined here and in stats_log.proto. |
| 38 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 39 | message Atom { |
| 40 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 41 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 42 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 43 | BleScanStateChanged ble_scan_state_changed = 2; |
| 44 | BleUnoptimizedScanStateChanged ble_unoptimized_scan_state_changed = 3; |
| 45 | BleScanResultReceived ble_scan_result_received = 4; |
| 46 | SensorStateChanged sensor_state_changed = 5; |
| 47 | GpsScanStateChanged gps_scan_state_changed = 6; // TODO: untested |
| 48 | SyncStateChanged sync_state_changed = 7; |
| 49 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 50 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 51 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 52 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 53 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 54 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
| 55 | // TODO: 14-19 are blank, but need not be |
| 56 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 57 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 58 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 59 | AudioStateChanged audio_state_changed = 23; |
| 60 | MediaCodecActivityChanged media_codec_activity_changed = 24; |
| 61 | CameraStateChanged camera_state_changed = 25; |
| 62 | FlashlightStateChanged flashlight_state_changed = 26; |
| 63 | UidProcessStateChanged uid_process_state_changed = 27; |
| 64 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 65 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 66 | BatteryLevelChanged battery_level_changed = 30; |
| 67 | ChargingStateChanged charging_state_changed = 31; |
| 68 | PluggedStateChanged plugged_state_changed = 32; |
| 69 | DeviceTemperatureReported device_temperature_reported = 33; |
| 70 | DeviceOnStatusChanged device_on_status_changed = 34; |
| 71 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 72 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 73 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 74 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 75 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 76 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 77 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 78 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 79 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 80 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 81 | DropboxErrorChanged dropbox_error_changed = 45; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 82 | AnomalyDetected anomaly_detected = 46; |
| 83 | AppHook app_hook = 47; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 84 | AppStartChanged app_start_changed = 48; |
| 85 | AppStartCancelChanged app_start_cancel_changed = 49; |
| 86 | AppStartFullyDrawnChanged app_start_fully_drawn_changed = 50; |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 87 | LmkEventOccurred lmk_event_occurred = 51; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 88 | // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 89 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 90 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 91 | // Pulled events will start at field 10000. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 92 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 93 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 94 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 95 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 96 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
| 97 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 98 | SubsystemSleepState subsystem_sleep_state = 10005; |
| 99 | // 10006 and 10007 are free to use. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 100 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 101 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 102 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
| 103 | WifiActivityEnergyInfo wifi_activity_energy_info = 10011; |
| 104 | ModemActivityInfo modem_activity_info = 10012; |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 105 | MemoryStat memory_stat = 10013; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 106 | CpuSuspendTime cpu_suspend_time = 10014; |
| 107 | CpuIdleTime cpu_idle_time = 10015; |
| 108 | CpuActiveTime cpu_active_time = 10016; |
| 109 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame^] | 110 | DiskSpace disk_space = 10018; |
| 111 | SystemUptime system_uptime = 10019; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 112 | } |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 113 | } |
| 114 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 115 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 116 | * This proto represents a node of an attribution chain. |
| 117 | * Note: All attribution chains are represented as a repeated field of type |
| 118 | * AttributionNode. It is understood that in such arrays, the order is that |
| 119 | * of calls, that is [A, B, C] if A calls B that calls C. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 120 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 121 | message AttributionNode { |
| 122 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 123 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 124 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 125 | // The (optional) string tag for an element in the attribution chain. If the |
| 126 | // element has no tag, it is encoded as an empty string. |
| 127 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 128 | } |
| 129 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 130 | /* |
| 131 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 132 | * Below are all of the individual atoms that are logged by Android via statsd. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 133 | * |
| 134 | * RULES: |
| 135 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 136 | * Skipping field ids is not allowed. |
| 137 | * - These form an API, so renaming, renumbering or removing fields is |
| 138 | * not allowed between android releases. (This is not currently enforced, |
| 139 | * but there will be a tool to enforce this restriction). |
| 140 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 141 | * are allowed (yet). The bytes type is also not allowed. |
| 142 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 143 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 144 | * - If an atom represents work that can be attributed to an app, there can |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 145 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 146 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 147 | * annotation. The generated code on android will be represented by UIDs, |
| 148 | * and those UIDs will be translated in xxx to those strings. |
| 149 | * |
| 150 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 151 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 152 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 153 | * ***************************************************************************** |
| 154 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 155 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 156 | /** |
| 157 | * Logs when the screen state changes. |
| 158 | * |
| 159 | * Logged from: |
| 160 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 161 | */ |
| 162 | message ScreenStateChanged { |
| 163 | // TODO: Use the real screen state. |
| 164 | enum State { |
| 165 | STATE_UNKNOWN = 0; |
| 166 | STATE_OFF = 1; |
| 167 | STATE_ON = 2; |
| 168 | STATE_DOZE = 3; |
| 169 | STATE_DOZE_SUSPEND = 4; |
| 170 | STATE_VR = 5; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 171 | STATE_ON_SUSPEND = 6; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 172 | } |
| 173 | // New screen state. |
| 174 | optional State display_state = 1; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 175 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 176 | |
| 177 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 178 | * Logs that the state of a process state, as per the activity manager, has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 179 | * |
| 180 | * Logged from: |
| 181 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 182 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 183 | message UidProcessStateChanged { |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 184 | optional int32 uid = 1; // TODO: should be a string tagged w/ uid annotation |
| 185 | |
| 186 | // The state. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 187 | // TODO: Use the real (mapped) process states. |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 188 | optional android.app.ProcessState state = 2; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 192 | * Logs that a process started, finished, crashed, or ANRed. |
| 193 | * |
| 194 | * Logged from: |
| 195 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 196 | */ |
| 197 | message ProcessLifeCycleStateChanged { |
| 198 | // TODO: Use the real (mapped) process states. |
| 199 | optional int32 uid = 1; // TODO: should be a string tagged w/ uid annotation |
| 200 | |
| 201 | // TODO: What is this? |
| 202 | optional string name = 2; |
| 203 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 204 | // What lifecycle state the process changed to. |
| 205 | // This enum is specific to atoms.proto. |
| 206 | enum Event { |
| 207 | PROCESS_FINISHED = 0; |
| 208 | PROCESS_STARTED = 1; |
| 209 | PROCESS_CRASHED = 2; |
| 210 | PROCESS_ANRED = 3; |
| 211 | } |
| 212 | optional Event event = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 213 | } |
| 214 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 215 | /** |
| 216 | * Logs when the ble scan state changes. |
| 217 | * |
| 218 | * Logged from: |
| 219 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 220 | */ |
| 221 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 222 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 223 | |
| 224 | enum State { |
| 225 | OFF = 0; |
| 226 | ON = 1; |
| 227 | } |
| 228 | optional State state = 2; |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Logs when an unoptimized ble scan state changes. |
| 233 | * |
| 234 | * Logged from: |
| 235 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 236 | */ |
| 237 | // TODO: Consider changing to tracking per-scanner-id (log from AppScanStats). |
| 238 | message BleUnoptimizedScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 239 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 240 | |
| 241 | enum State { |
| 242 | OFF = 0; |
| 243 | ON = 1; |
| 244 | } |
| 245 | optional State state = 2; |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Logs reporting of a ble scan finding results. |
| 250 | * |
| 251 | * Logged from: |
| 252 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 253 | */ |
| 254 | // TODO: Consider changing to tracking per-scanner-id (log from AppScanStats). |
| 255 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 256 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 257 | |
| 258 | // Number of ble scan results returned. |
| 259 | optional int32 num_of_results = 2; |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Logs when a sensor state changes. |
| 264 | * |
| 265 | * Logged from: |
| 266 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 267 | */ |
| 268 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 269 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 270 | |
| 271 | // TODO: Is there a way to get the actual name of the sensor? |
| 272 | // The id (int) of the sensor. |
| 273 | optional int32 sensor_id = 2; |
| 274 | |
| 275 | enum State { |
| 276 | OFF = 0; |
| 277 | ON = 1; |
| 278 | } |
| 279 | optional State state = 3; |
| 280 | } |
| 281 | |
| 282 | |
| 283 | /** |
| 284 | * Logs when GPS state changes. |
| 285 | * |
| 286 | * Logged from: |
| 287 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 288 | */ |
| 289 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 290 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 291 | |
| 292 | enum State { |
| 293 | OFF = 0; |
| 294 | ON = 1; |
| 295 | } |
| 296 | optional State state = 2; |
| 297 | } |
| 298 | |
| 299 | |
| 300 | /** |
| 301 | * Logs when a sync manager sync state changes. |
| 302 | * |
| 303 | * Logged from: |
| 304 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 305 | */ |
| 306 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 307 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 308 | |
| 309 | // Name of the sync (as named in the app) |
| 310 | optional string name = 2; |
| 311 | |
| 312 | enum State { |
| 313 | OFF = 0; |
| 314 | ON = 1; |
| 315 | } |
| 316 | optional State state = 3; |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Logs when a job scheduler job state changes. |
| 321 | * |
| 322 | * Logged from: |
| 323 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 324 | */ |
| 325 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 326 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 327 | |
| 328 | // Name of the job (as named in the app) |
| 329 | optional string name = 2; |
| 330 | |
| 331 | enum State { |
| 332 | OFF = 0; |
| 333 | ON = 1; |
| 334 | } |
| 335 | optional State state = 3; |
| 336 | |
| 337 | // TODO: Consider adding the stopReason (int) |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Logs when the audio state changes. |
| 342 | * |
| 343 | * Logged from: |
| 344 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 345 | */ |
| 346 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 347 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 348 | |
| 349 | enum State { |
| 350 | OFF = 0; |
| 351 | ON = 1; |
| 352 | } |
| 353 | optional State state = 2; |
| 354 | } |
| 355 | |
| 356 | /** |
| 357 | * Logs when the video codec state changes. |
| 358 | * |
| 359 | * Logged from: |
| 360 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 361 | */ |
| 362 | message MediaCodecActivityChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 363 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 364 | |
| 365 | enum State { |
| 366 | OFF = 0; |
| 367 | ON = 1; |
| 368 | } |
| 369 | optional State state = 2; |
| 370 | } |
| 371 | |
| 372 | /** |
| 373 | * Logs when the flashlight state changes. |
| 374 | * |
| 375 | * Logged from: |
| 376 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 377 | */ |
| 378 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 379 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 380 | |
| 381 | enum State { |
| 382 | OFF = 0; |
| 383 | ON = 1; |
| 384 | } |
| 385 | optional State state = 2; |
| 386 | } |
| 387 | |
| 388 | /** |
| 389 | * Logs when the camera state changes. |
| 390 | * |
| 391 | * Logged from: |
| 392 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 393 | */ |
| 394 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 395 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 396 | |
| 397 | enum State { |
| 398 | OFF = 0; |
| 399 | ON = 1; |
| 400 | } |
| 401 | optional State state = 2; |
| 402 | } |
| 403 | |
| 404 | /** |
| 405 | * Logs that the state of a wakelock (per app and per wakelock name) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 406 | * |
| 407 | * Logged from: |
| 408 | * TODO |
| 409 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 410 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 411 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 412 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 413 | // Type of wakelock. |
| 414 | enum Type { |
| 415 | PARTIAL = 0; |
| 416 | FULL = 1; |
| 417 | WINDOW = 2; |
| 418 | } |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 419 | optional Type type = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 420 | |
| 421 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 422 | optional string tag = 3; |
| 423 | |
| 424 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 425 | RELEASE = 0; |
| 426 | ACQUIRE = 1; |
| 427 | CHANGE_RELEASE = 2; |
| 428 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 429 | } |
| 430 | optional State state = 4; |
| 431 | } |
| 432 | |
| 433 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 434 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 435 | * |
| 436 | * Logged from: |
| 437 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 438 | */ |
| 439 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 440 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 441 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 442 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 443 | optional string tag = 2; |
| 444 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 445 | // TODO: I have no idea what this is. |
| 446 | optional string history_tag = 3; |
| 447 | |
| 448 | enum State { |
| 449 | OFF = 0; |
| 450 | ON = 1; |
| 451 | } |
| 452 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 453 | } |
| 454 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 455 | /** |
| 456 | * Logs Battery Saver state change. |
| 457 | * |
| 458 | * Logged from: |
| 459 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 460 | */ |
| 461 | message BatterySaverModeStateChanged { |
| 462 | enum State { |
| 463 | OFF = 0; |
| 464 | ON = 1; |
| 465 | } |
| 466 | optional State state = 1; |
| 467 | } |
| 468 | |
| 469 | /** |
| 470 | * Logs Doze mode state change. |
| 471 | * |
| 472 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 473 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 474 | */ |
| 475 | message DeviceIdleModeStateChanged { |
| 476 | // TODO: Use the enum matching BatteryStats.DEVICE_IDLE_MODE_. |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 477 | enum State { |
| 478 | DEVICE_IDLE_MODE_OFF = 0; |
| 479 | DEVICE_IDLE_MODE_LIGHT = 1; |
| 480 | DEVICE_IDLE_MODE_DEEP = 2; |
| 481 | } |
| 482 | optional State state = 1; |
| 483 | } |
| 484 | |
| 485 | |
| 486 | /** |
| 487 | * Logs state change of Doze mode including maintenance windows. |
| 488 | * |
| 489 | * Logged from: |
| 490 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 491 | */ |
| 492 | message DeviceIdlingModeStateChanged { |
| 493 | // TODO: Use the enum matching BatteryStats.DEVICE_IDLE_MODE_. |
| 494 | enum State { |
| 495 | DEVICE_IDLE_MODE_OFF = 0; |
| 496 | DEVICE_IDLE_MODE_LIGHT = 1; |
| 497 | DEVICE_IDLE_MODE_DEEP = 2; |
| 498 | } |
| 499 | optional State state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Logs screen brightness level. |
| 504 | * |
| 505 | * Logged from: |
| 506 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 507 | */ |
| 508 | message ScreenBrightnessChanged { |
| 509 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 510 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 511 | } |
| 512 | |
| 513 | /** |
| 514 | * Logs battery level (percent full, from 0 to 100). |
| 515 | * |
| 516 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 517 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 518 | */ |
| 519 | message BatteryLevelChanged { |
| 520 | // Battery level. Should be in [0, 100]. |
| 521 | optional int32 battery_level = 1; |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Logs change in charging status of the device. |
| 526 | * |
| 527 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 528 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 529 | */ |
| 530 | message ChargingStateChanged { |
| 531 | // TODO: Link directly to BatteryManager.java's constants (via a proto). |
| 532 | enum State { |
| 533 | BATTERY_STATUS_UNKNOWN = 1; |
| 534 | BATTERY_STATUS_CHARGING = 2; |
| 535 | BATTERY_STATUS_DISCHARGING = 3; |
| 536 | BATTERY_STATUS_NOT_CHARGING = 4; |
| 537 | BATTERY_STATUS_FULL = 5; |
| 538 | } |
| 539 | optional State charging_state = 1; |
| 540 | } |
| 541 | |
| 542 | /** |
| 543 | * Logs whether the device is plugged in, and what power source it is using. |
| 544 | * |
| 545 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 546 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 547 | */ |
| 548 | message PluggedStateChanged { |
| 549 | // TODO: Link directly to BatteryManager.java's constants (via a proto). |
| 550 | enum State { |
| 551 | // Note that NONE is not in BatteryManager.java's constants. |
| 552 | BATTERY_PLUGGED_NONE = 0; |
| 553 | // Power source is an AC charger. |
| 554 | BATTERY_PLUGGED_AC = 1; |
| 555 | // Power source is a USB port. |
| 556 | BATTERY_PLUGGED_USB = 2; |
| 557 | // Power source is wireless. |
| 558 | BATTERY_PLUGGED_WIRELESS = 4; |
| 559 | } |
| 560 | optional State plugged_state = 1; |
| 561 | } |
| 562 | |
| 563 | /** |
| 564 | * Logs the temperature of the device, in tenths of a degree Celsius. |
| 565 | * |
| 566 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 567 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 568 | */ |
| 569 | message DeviceTemperatureReported { |
| 570 | // Temperature in tenths of a degree C. |
| 571 | optional int32 temperature = 1; |
| 572 | } |
| 573 | |
| 574 | // TODO: Define this more precisely. |
| 575 | // TODO: Log the ON state somewhere. It isn't currently logged anywhere. |
| 576 | /** |
| 577 | * Logs when the device turns off or on. |
| 578 | * |
| 579 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 580 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 581 | */ |
| 582 | message DeviceOnStatusChanged { |
| 583 | enum State { |
| 584 | OFF = 0; |
| 585 | ON = 1; |
| 586 | } |
| 587 | optional State state = 1; |
| 588 | } |
| 589 | |
| 590 | /** |
| 591 | * Logs when an app's wakeup alarm fires. |
| 592 | * |
| 593 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 594 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 595 | */ |
| 596 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 597 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 598 | |
| 599 | // Name of the wakeup alarm. |
| 600 | optional string tag = 2; |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * Logs when an an app causes the mobile radio to change state. |
| 605 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 606 | * |
| 607 | * Logged from: |
| 608 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 609 | */ |
| 610 | message MobileRadioPowerStateChanged { |
| 611 | // TODO: Add attribution instead of uid? |
| 612 | optional int32 uid = 1; |
| 613 | |
| 614 | // TODO: Reference telephony/java/android/telephony/DataConnectionRealTimeInfo.java states. |
| 615 | enum PowerState { |
| 616 | DC_POWER_STATE_LOW = 1; |
| 617 | DC_POWER_STATE_MEDIUM = 2; |
| 618 | DC_POWER_STATE_HIGH = 3; |
| 619 | } |
| 620 | optional PowerState power_state = 2; |
| 621 | } |
| 622 | |
| 623 | /** |
| 624 | * Logs when an an app causes the wifi radio to change state. |
| 625 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 626 | * |
| 627 | * Logged from: |
| 628 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 629 | */ |
| 630 | message WifiRadioPowerStateChanged { |
| 631 | // TODO: Add attribution instead of uid? |
| 632 | optional int32 uid = 1; |
| 633 | |
| 634 | // TODO: Reference telephony/java/android/telephony/DataConnectionRealTimeInfo.java states. |
| 635 | enum PowerState { |
| 636 | DC_POWER_STATE_LOW = 1; |
| 637 | DC_POWER_STATE_MEDIUM = 2; |
| 638 | DC_POWER_STATE_HIGH = 3; |
| 639 | } |
| 640 | optional PowerState power_state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 641 | } |
| 642 | |
| 643 | /** |
| 644 | * Logs kernel wakeup reasons and aborts. |
| 645 | * |
| 646 | * Logged from: |
| 647 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 648 | */ |
| 649 | message KernelWakeupReported { |
| 650 | // Name of the kernel wakeup reason (or abort). |
| 651 | optional string wakeup_reason_name = 1; |
| 652 | |
| 653 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
| 654 | optional int64 duration_usec = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 655 | } |
| 656 | |
| 657 | /** |
| 658 | * Logs wifi locks held by an app. |
| 659 | * |
| 660 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 661 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 662 | */ |
| 663 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 664 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 665 | |
| 666 | enum State { |
| 667 | OFF = 0; |
| 668 | ON = 1; |
| 669 | } |
| 670 | optional State state = 2; |
| 671 | } |
| 672 | |
| 673 | /** |
| 674 | * Logs wifi signal strength changes. |
| 675 | * |
| 676 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 677 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 678 | */ |
| 679 | message WifiSignalStrengthChanged { |
| 680 | // TODO: Reference the actual telephony/java/android/telephony/SignalStrength.java states. |
| 681 | enum SignalStrength { |
| 682 | SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0; |
| 683 | SIGNAL_STRENGTH_POOR = 1; |
| 684 | SIGNAL_STRENGTH_MODERATE = 2; |
| 685 | SIGNAL_STRENGTH_GOOD = 3; |
| 686 | SIGNAL_STRENGTH_GREAT = 4; |
| 687 | } |
| 688 | optional SignalStrength signal_strength = 1; |
| 689 | } |
| 690 | |
| 691 | /** |
| 692 | * Logs wifi scans performed by an app. |
| 693 | * |
| 694 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 695 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 696 | */ |
| 697 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 698 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 699 | |
| 700 | enum State { |
| 701 | OFF = 0; |
| 702 | ON = 1; |
| 703 | } |
| 704 | optional State state = 2; |
| 705 | } |
| 706 | |
| 707 | /** |
| 708 | * Logs phone signal strength changes. |
| 709 | * |
| 710 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 711 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 712 | */ |
| 713 | message PhoneSignalStrengthChanged { |
| 714 | // TODO: Reference the actual telephony/java/android/telephony/SignalStrength.java states. |
| 715 | enum SignalStrength { |
| 716 | SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0; |
| 717 | SIGNAL_STRENGTH_POOR = 1; |
| 718 | SIGNAL_STRENGTH_MODERATE = 2; |
| 719 | SIGNAL_STRENGTH_GOOD = 3; |
| 720 | SIGNAL_STRENGTH_GREAT = 4; |
| 721 | } |
| 722 | optional SignalStrength signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 723 | } |
| 724 | |
| 725 | /** |
| 726 | * Logs that a setting was updated. |
| 727 | * Logged from: |
| 728 | * frameworks/base/core/java/android/provider/Settings.java |
| 729 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 730 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 731 | */ |
| 732 | message SettingChanged { |
| 733 | // The name of the setting. |
| 734 | optional string setting = 1; |
| 735 | |
| 736 | // The change being imposed on this setting. May represent a number, eg "3". |
| 737 | optional string value = 2; |
| 738 | |
| 739 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 740 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 741 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 742 | // The +/- feature is currently only used for location_providers_allowed. |
| 743 | optional string new_value = 3; |
| 744 | |
| 745 | // The previous value of this setting. |
| 746 | optional string prev_value = 4; |
| 747 | |
| 748 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 749 | optional string tag = 5; |
| 750 | |
| 751 | // 1 indicates that this setting with tag should be resettable. |
| 752 | optional int32 is_default = 6; |
| 753 | |
| 754 | // The user ID associated. Defined in android/os/UserHandle.java |
| 755 | optional int32 user = 7; |
| 756 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 757 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 758 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 759 | * Logs activity going to foreground or background |
| 760 | * |
| 761 | * Logged from: |
| 762 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 763 | */ |
| 764 | message ActivityForegroundStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 765 | optional int32 uid = 1; |
| 766 | optional string pkg_name = 2; |
| 767 | optional string class_name = 3; |
| 768 | |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 769 | enum Activity { |
| 770 | MOVE_TO_BACKGROUND = 0; |
| 771 | MOVE_TO_FOREGROUND = 1; |
| 772 | } |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 773 | optional Activity activity = 4; |
| 774 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 775 | |
| 776 | /** |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 777 | * Logs when an error is written to dropbox. |
| 778 | * Logged from: |
| 779 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 780 | */ |
| 781 | message DropboxErrorChanged { |
| 782 | // The uid if available. -1 means not available. |
| 783 | optional int32 uid = 1; |
| 784 | |
| 785 | // Tag used when recording this error to dropbox. Contains data_ or system_ prefix. |
| 786 | optional string tag = 2; |
| 787 | |
| 788 | // The name of the process. |
| 789 | optional string process_name = 3; |
| 790 | |
| 791 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 792 | optional sint32 pid = 4; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 793 | |
| 794 | // 1 indicates is instant app. -1 indicates Not applicable. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 795 | optional sint32 is_instant_app = 5; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 796 | |
| 797 | // The activity name if available. |
| 798 | optional string activity_name = 6; |
| 799 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 800 | // The package name if available. |
| 801 | optional string package_name = 7; |
| 802 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 803 | // 1 indicates in foreground. -1 indicates not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 804 | optional sint32 is_foreground = 8; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 805 | } |
| 806 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 807 | /* |
| 808 | * Allows other apps to push events into statsd. |
| 809 | * Logged from: |
| 810 | * frameworks/base/core/java/android/util/StatsLog.java |
| 811 | */ |
| 812 | message AppHook { |
| 813 | // The uid of the application that sent this custom atom. |
| 814 | optional int32 uid = 1; |
| 815 | |
| 816 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 817 | optional int32 label = 2; |
| 818 | |
| 819 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 820 | // predicates for the metrics). |
| 821 | enum State { |
| 822 | UNKNOWN = 0; |
| 823 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 824 | STOP = 2; |
| 825 | START = 3; |
| 826 | } |
| 827 | optional State state = 3; |
| 828 | } |
| 829 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 830 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 831 | * Logs when statsd detects an anomaly. |
| 832 | * |
| 833 | * Logged from: |
| 834 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 835 | */ |
| 836 | message AnomalyDetected { |
| 837 | // Uid that owns the config whose anomaly detection alert fired. |
| 838 | optional int32 config_uid = 1; |
| 839 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 840 | // Id of the config whose anomaly detection alert fired. |
| 841 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 842 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 843 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 844 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 845 | } |
| 846 | |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 847 | message AppStartChanged { |
| 848 | // The uid if available. -1 means not available. |
| 849 | optional int32 uid = 1; |
| 850 | |
| 851 | // The app package name. |
| 852 | optional string pkg_name = 2; |
| 853 | |
| 854 | enum TransitionType { |
| 855 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 856 | WARM = 1; |
| 857 | HOT = 2; |
| 858 | COLD = 3; |
| 859 | } |
| 860 | // The transition type. |
| 861 | optional TransitionType type = 3; |
| 862 | |
| 863 | // The activity name. |
| 864 | optional string activity_name = 4; |
| 865 | |
| 866 | // The name of the calling app. Empty if not set. |
| 867 | optional string calling_pkg_name = 5; |
| 868 | |
| 869 | // Whether the app is an instant app. |
| 870 | optional bool is_instant_app = 6; |
| 871 | |
| 872 | // Device uptime when activity started. |
| 873 | optional int64 activity_start_msec = 7; |
| 874 | |
| 875 | // TODO: Update android/app/ActivityManagerInternal.java constants to depend on our proto enum. |
| 876 | enum TransitionReason { |
| 877 | APP_START_TRANSITION_REASON_UNKNOWN = 0; |
| 878 | SPLASH_SCREEN = 1; |
| 879 | WINDOWS_DRAWN = 2; |
| 880 | TIMEOUT = 3; |
| 881 | SNAPSHOT = 4; |
| 882 | } |
| 883 | optional TransitionReason reason = 8; |
| 884 | |
| 885 | optional int32 transition_delay_msec = 9; |
| 886 | // -1 if not set. |
| 887 | optional int32 starting_window_delay_msec = 10; |
| 888 | // -1 if not set. |
| 889 | optional int32 bind_application_delay_msec = 11; |
| 890 | optional int32 windows_drawn_delay_msec = 12; |
| 891 | |
| 892 | // Empty if not set. |
| 893 | optional string launch_token = 13; |
| 894 | |
| 895 | } |
| 896 | |
| 897 | message AppStartCancelChanged { |
| 898 | // The uid if available. -1 means not available. |
| 899 | optional int32 uid = 1; |
| 900 | |
| 901 | // The app package name. |
| 902 | optional string pkg_name = 2; |
| 903 | |
| 904 | enum TransitionType { |
| 905 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 906 | WARM = 1; |
| 907 | HOT = 2; |
| 908 | COLD = 3; |
| 909 | } |
| 910 | // The transition type. |
| 911 | optional TransitionType type = 3; |
| 912 | |
| 913 | // The activity name. |
| 914 | optional string activity_name = 4; |
| 915 | } |
| 916 | |
| 917 | message AppStartFullyDrawnChanged { |
| 918 | // The uid if available. -1 means not available. |
| 919 | optional int32 uid = 1; |
| 920 | |
| 921 | // The app package name. |
| 922 | optional string pkg_name = 2; |
| 923 | |
| 924 | enum TransitionType { |
| 925 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 926 | WITH_BUNDLE = 1; |
| 927 | WITHOUT_BUNDLE = 2; |
| 928 | } |
| 929 | // The transition type. |
| 930 | optional TransitionType type = 3; |
| 931 | |
| 932 | // The activity name. |
| 933 | optional string activity_name = 4; |
| 934 | |
| 935 | optional bool transition_process_running = 5; |
| 936 | |
| 937 | // App startup time (until call to Activity#reportFullyDrawn()). |
| 938 | optional int64 app_startup_time_ms = 6; |
| 939 | } |
| 940 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 941 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 942 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 943 | * |
| 944 | * Pulled from: |
| 945 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 946 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 947 | message WifiBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 948 | optional int32 uid = 1; |
| 949 | |
| 950 | optional int64 rx_bytes = 2; |
| 951 | |
| 952 | optional int64 rx_packets = 3; |
| 953 | |
| 954 | optional int64 tx_bytes = 4; |
| 955 | |
| 956 | optional int64 tx_packets = 5; |
| 957 | } |
| 958 | |
| 959 | /** |
| 960 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 961 | * |
| 962 | * Pulled from: |
| 963 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 964 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 965 | message WifiBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 966 | optional int32 uid = 1; |
| 967 | |
| 968 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 969 | optional int32 is_foreground = 2; |
| 970 | |
| 971 | optional int64 rx_bytes = 3; |
| 972 | |
| 973 | optional int64 rx_packets = 4; |
| 974 | |
| 975 | optional int64 tx_bytes = 5; |
| 976 | |
| 977 | optional int64 tx_packets = 6; |
| 978 | } |
| 979 | |
| 980 | /** |
| 981 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 982 | * |
| 983 | * Pulled from: |
| 984 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 985 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 986 | message MobileBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 987 | optional int32 uid = 1; |
| 988 | |
| 989 | optional int64 rx_bytes = 2; |
| 990 | |
| 991 | optional int64 rx_packets = 3; |
| 992 | |
| 993 | optional int64 tx_bytes = 4; |
| 994 | |
| 995 | optional int64 tx_packets = 5; |
| 996 | } |
| 997 | |
| 998 | /** |
| 999 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1000 | * |
| 1001 | * Pulled from: |
| 1002 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1003 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1004 | message MobileBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1005 | optional int32 uid = 1; |
| 1006 | |
| 1007 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1008 | optional int32 is_foreground = 2; |
| 1009 | |
| 1010 | optional int64 rx_bytes = 3; |
| 1011 | |
| 1012 | optional int64 rx_packets = 4; |
| 1013 | |
| 1014 | optional int64 tx_bytes = 5; |
| 1015 | |
| 1016 | optional int64 tx_packets = 6; |
| 1017 | } |
| 1018 | |
| 1019 | /** |
| 1020 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1021 | * android/internal/os/KernelWakelockStats.java |
| 1022 | * |
| 1023 | * Pulled from: |
| 1024 | * StatsCompanionService using KernelWakelockReader. |
| 1025 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1026 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1027 | optional string name = 1; |
| 1028 | |
| 1029 | optional int32 count = 2; |
| 1030 | |
| 1031 | optional int32 version = 3; |
| 1032 | |
| 1033 | optional int64 time = 4; |
| 1034 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1035 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1036 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1037 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1038 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1039 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1040 | * hardware/interfaces/power/1.1/types.hal |
| 1041 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1042 | message SubsystemSleepState { |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1043 | // Name should be in the format of XXX.YYY where XXX is subsystem name, |
| 1044 | // YYY is corresponding voter name. |
| 1045 | // If there are no voters, the format should just be XXX (with no dot). |
| 1046 | // XXX and YYY should not contain a "." in it. |
| 1047 | optional string name = 1; |
| 1048 | // The number of times it entered, or voted for entering the sleep state |
| 1049 | optional uint64 count = 2; |
| 1050 | // The length of time spent in, or spent voting for, the sleep state |
| 1051 | optional uint64 timeMs = 3; |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1052 | } |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1053 | |
| 1054 | /** |
| 1055 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1056 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1057 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1058 | * |
| 1059 | * Logged from: |
| 1060 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1061 | */ |
| 1062 | message IsolatedUidChanged { |
| 1063 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
| 1064 | optional int32 parent_uid = 1; |
| 1065 | |
| 1066 | optional int32 isolated_uid = 2; |
| 1067 | |
| 1068 | // 1 denotes we're creating an isolated uid and 0 denotes removal. We expect an isolated uid to |
| 1069 | // be removed before if it's used for another parent uid. |
| 1070 | optional int32 is_create = 3; |
| 1071 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1072 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1073 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1074 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1075 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1076 | * starts from highest to lowest. The value should be monotonically |
| 1077 | * increasing since boot. However, if there is a cpu |
| 1078 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1079 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1080 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1081 | optional uint32 cluster = 1; |
| 1082 | optional uint32 freq_index = 2; |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1083 | optional uint64 time_ms = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1084 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1085 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1086 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1087 | * Pulls Cpu Time Per Uid. |
| 1088 | * Note that isolated process uid time should be attributed to host uids. |
| 1089 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1090 | message CpuTimePerUid { |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1091 | optional uint64 uid = 1; |
| 1092 | optional uint64 user_time_ms = 2; |
| 1093 | optional uint64 sys_time_ms = 3; |
| 1094 | } |
| 1095 | |
| 1096 | /** |
| 1097 | * Pulls Cpu Time Per Uid per frequency. |
| 1098 | * Note that isolated process uid time should be attributed to host uids. |
| 1099 | * For each uid, we order the time by descending frequencies. |
| 1100 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1101 | message CpuTimePerUidFreq { |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1102 | optional uint64 uid = 1; |
| 1103 | optional uint64 freq_idx = 2; |
| 1104 | optional uint64 time_ms = 3; |
| 1105 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1106 | |
| 1107 | /* |
| 1108 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1109 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1110 | * and processed by WakeupController.cpp. |
| 1111 | */ |
| 1112 | message PacketWakeupOccurred { |
| 1113 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1114 | // delivered nowhere. |
| 1115 | optional int32 uid = 1; |
| 1116 | // The interface name on which the packet was received. |
| 1117 | optional string iface = 2; |
| 1118 | // The ethertype value of the packet. |
| 1119 | optional int32 ethertype = 3; |
| 1120 | // String representation of the destination MAC address of the packet. |
| 1121 | optional string destination_hardware_address = 4; |
| 1122 | // String representation of the source address of the packet if this was an IP packet. |
| 1123 | optional string source_ip = 5; |
| 1124 | // String representation of the destination address of the packet if this was an IP packet. |
| 1125 | optional string destination_ip = 6; |
| 1126 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1127 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1128 | // families. |
| 1129 | optional int32 ip_next_header = 7; |
| 1130 | // The source port if this was a TCP or UDP packet. |
| 1131 | optional int32 source_port = 8; |
| 1132 | // The destination port if this was a TCP or UDP packet. |
| 1133 | optional int32 destination_port = 9; |
| 1134 | } |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1135 | |
| 1136 | /** |
| 1137 | * Pulls Wifi Controller Activity Energy Info |
| 1138 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1139 | message WifiActivityEnergyInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1140 | // timestamp(wall clock) of record creation |
| 1141 | optional uint64 timestamp_ms = 1; |
| 1142 | // stack reported state |
| 1143 | // TODO: replace this with proto enum |
| 1144 | optional int32 stack_state = 2; |
| 1145 | // tx time in ms |
| 1146 | optional uint64 controller_tx_time_ms = 3; |
| 1147 | // rx time in ms |
| 1148 | optional uint64 controller_rx_time_ms = 4; |
| 1149 | // idle time in ms |
| 1150 | optional uint64 controller_idle_time_ms = 5; |
| 1151 | // product of current(mA), voltage(V) and time(ms) |
| 1152 | optional uint64 controller_energy_used = 6; |
| 1153 | } |
| 1154 | |
| 1155 | /** |
| 1156 | * Pulls Modem Activity Energy Info |
| 1157 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1158 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1159 | // timestamp(wall clock) of record creation |
| 1160 | optional uint64 timestamp_ms = 1; |
| 1161 | // sleep time in ms. |
| 1162 | optional uint64 sleep_time_ms = 2; |
| 1163 | // idle time in ms |
| 1164 | optional uint64 controller_idle_time_ms = 3; |
| 1165 | /** |
| 1166 | * Tx power index |
| 1167 | * index 0 = tx_power < 0dBm |
| 1168 | * index 1 = 0dBm < tx_power < 5dBm |
| 1169 | * index 2 = 5dBm < tx_power < 15dBm |
| 1170 | * index 3 = 15dBm < tx_power < 20dBm |
| 1171 | * index 4 = tx_power > 20dBm |
| 1172 | */ |
| 1173 | // tx time in ms at power level 0 |
| 1174 | optional uint64 controller_tx_time_pl0_ms = 4; |
| 1175 | // tx time in ms at power level 1 |
| 1176 | optional uint64 controller_tx_time_pl1_ms = 5; |
| 1177 | // tx time in ms at power level 2 |
| 1178 | optional uint64 controller_tx_time_pl2_ms = 6; |
| 1179 | // tx time in ms at power level 3 |
| 1180 | optional uint64 controller_tx_time_pl3_ms = 7; |
| 1181 | // tx time in ms at power level 4 |
| 1182 | optional uint64 controller_tx_time_pl4_ms = 8; |
| 1183 | // rx time in ms at power level 5 |
| 1184 | optional uint64 controller_rx_time_ms = 9; |
| 1185 | // product of current(mA), voltage(V) and time(ms) |
| 1186 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1187 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1188 | |
| 1189 | /* |
| 1190 | * Logs the memory stats for a process |
| 1191 | */ |
| 1192 | message MemoryStat { |
| 1193 | // The uid if available. -1 means not available. |
| 1194 | optional int32 uid = 1; |
| 1195 | |
| 1196 | // The app package name. |
| 1197 | optional string pkg_name = 2; |
| 1198 | |
| 1199 | // # of page-faults |
| 1200 | optional int64 pgfault = 3; |
| 1201 | |
| 1202 | // # of major page-faults |
| 1203 | optional int64 pgmajfault = 4; |
| 1204 | |
| 1205 | // RSS+CACHE(+SWAP) |
| 1206 | optional int64 usage_in_bytes = 5; |
| 1207 | } |
| 1208 | |
| 1209 | /* |
| 1210 | * Logs the event when LMKD kills a process to reduce memory pressure |
| 1211 | * Logged from: |
| 1212 | * system/core/lmkd/lmkd.c |
| 1213 | */ |
| 1214 | message LmkEventOccurred { |
| 1215 | // The uid if available. -1 means not available. |
| 1216 | optional int32 uid = 1; |
| 1217 | |
| 1218 | // The app package name. |
| 1219 | optional string pkg_name = 2; |
| 1220 | |
| 1221 | // oom adj score. |
| 1222 | optional int32 oom_score = 3; |
| 1223 | |
| 1224 | // Used as start/stop boundaries for the event |
| 1225 | enum State { |
| 1226 | UNKNOWN = 0; |
| 1227 | START = 1; |
| 1228 | END = 2; |
| 1229 | } |
| 1230 | optional State state = 4; |
| 1231 | } |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1232 | |
| 1233 | /* |
| 1234 | * Cpu syspend time for cpu power calculation. |
| 1235 | */ |
| 1236 | message CpuSuspendTime { |
| 1237 | optional uint64 time = 1; |
| 1238 | } |
| 1239 | |
| 1240 | /* |
| 1241 | * Cpu idle time for cpu power calculation. |
| 1242 | */ |
| 1243 | message CpuIdleTime { |
| 1244 | optional uint64 time = 1; |
| 1245 | } |
| 1246 | |
| 1247 | /* |
| 1248 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 1249 | * active: X (X is # cores) |
| 1250 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 1251 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 1252 | * ... |
| 1253 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 1254 | * The file contains a monotonically increasing count of time for a single boot. |
| 1255 | */ |
| 1256 | message CpuActiveTime { |
| 1257 | optional uint64 uid = 1; |
| 1258 | optional uint64 idx = 2; |
| 1259 | optional uint64 time_ms = 3; |
| 1260 | } |
| 1261 | |
| 1262 | /** |
| 1263 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 1264 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 1265 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1266 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1267 | * ... |
| 1268 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 1269 | * The file contains a monotonically increasing count of time for a single boot. |
| 1270 | */ |
| 1271 | message CpuClusterTime { |
| 1272 | optional uint64 uid = 1; |
| 1273 | optional uint64 idx = 2; |
| 1274 | optional uint64 time_ms = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame^] | 1275 | } |
| 1276 | |
| 1277 | /* |
| 1278 | * Pulls free disk space, for data, system partition and temporary directory. |
| 1279 | */ |
| 1280 | message DiskSpace { |
| 1281 | // available bytes in data partition |
| 1282 | optional uint64 data_available_bytes = 1; |
| 1283 | // available bytes in system partition |
| 1284 | optional uint64 system_available_bytes = 2; |
| 1285 | // available bytes in download cache or temp directories |
| 1286 | optional uint64 temp_available_bytes = 3; |
| 1287 | } |
| 1288 | |
| 1289 | /* |
| 1290 | * Pulls system up time. |
| 1291 | */ |
| 1292 | message SystemUptime { |
| 1293 | // Milliseconds since the system was booted. |
| 1294 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 1295 | // for external input). |
| 1296 | // It is not affected by clock scaling, idle, or other power saving mechanisms. |
| 1297 | optional uint64 uptime_ms = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1298 | } |