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