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