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