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