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