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