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