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