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