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