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