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 | |
Calin Juravle | 0a8bea8 | 2018-02-13 12:01:41 -0800 | [diff] [blame] | 943 | // The compiler filter used when when the package was optimized. |
| 944 | optional string package_optimization_compilation_filter = 14; |
| 945 | |
| 946 | // The reason why the package was optimized. |
| 947 | optional string package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 948 | } |
| 949 | |
| 950 | message AppStartCancelChanged { |
| 951 | // The uid if available. -1 means not available. |
| 952 | optional int32 uid = 1; |
| 953 | |
| 954 | // The app package name. |
| 955 | optional string pkg_name = 2; |
| 956 | |
| 957 | enum TransitionType { |
| 958 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 959 | WARM = 1; |
| 960 | HOT = 2; |
| 961 | COLD = 3; |
| 962 | } |
| 963 | // The transition type. |
| 964 | optional TransitionType type = 3; |
| 965 | |
| 966 | // The activity name. |
| 967 | optional string activity_name = 4; |
| 968 | } |
| 969 | |
| 970 | message AppStartFullyDrawnChanged { |
| 971 | // The uid if available. -1 means not available. |
| 972 | optional int32 uid = 1; |
| 973 | |
| 974 | // The app package name. |
| 975 | optional string pkg_name = 2; |
| 976 | |
| 977 | enum TransitionType { |
| 978 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 979 | WITH_BUNDLE = 1; |
| 980 | WITHOUT_BUNDLE = 2; |
| 981 | } |
| 982 | // The transition type. |
| 983 | optional TransitionType type = 3; |
| 984 | |
| 985 | // The activity name. |
| 986 | optional string activity_name = 4; |
| 987 | |
| 988 | optional bool transition_process_running = 5; |
| 989 | |
| 990 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 991 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 992 | } |
| 993 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 994 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 995 | * Logs a picture-in-picture action |
| 996 | * Logged from: |
| 997 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 998 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 999 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 1000 | */ |
| 1001 | message PictureInPictureStateChanged { |
| 1002 | optional int32 uid = 1; |
| 1003 | |
| 1004 | optional string package_name = 2; |
| 1005 | |
| 1006 | optional string class_name = 3; |
| 1007 | |
| 1008 | // Picture-in-Picture action occurred, similar to |
| 1009 | // frameworks/base/proto/src/metrics_constants.proto |
| 1010 | enum State { |
| 1011 | ENTERED = 1; |
| 1012 | EXPANDED_TO_FULL_SCREEN = 2; |
| 1013 | MINIMIZED = 3; |
| 1014 | DISMISSED = 4; |
| 1015 | } |
| 1016 | optional State state = 4; |
| 1017 | } |
| 1018 | |
| 1019 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1020 | * Logs overlay action |
| 1021 | * Logged from: |
| 1022 | * services/core/java/com/android/server/wm/Session.java |
| 1023 | */ |
| 1024 | message OverlayStateChanged { |
| 1025 | optional int32 uid = 1; |
| 1026 | |
| 1027 | optional string package_name = 2; |
| 1028 | |
| 1029 | optional bool using_alert_window = 3; |
| 1030 | |
| 1031 | enum State { |
| 1032 | ENTERED = 1; |
| 1033 | EXITED = 2; |
| 1034 | } |
| 1035 | optional State state = 4; |
| 1036 | } |
| 1037 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1038 | /* |
| 1039 | * Logs foreground service starts and stops. |
| 1040 | * Note that this is not when a service starts or stops, but when it is |
| 1041 | * considered foreground. |
| 1042 | * Logged from |
| 1043 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 1044 | */ |
| 1045 | message ForegroundServiceStateChanged { |
| 1046 | optional int32 uid = 1; |
| 1047 | // package_name + "/" + class_name |
| 1048 | optional string short_name = 2; |
| 1049 | |
| 1050 | enum State { |
| 1051 | ENTER = 1; |
| 1052 | EXIT = 2; |
| 1053 | } |
| 1054 | optional State state = 3; |
| 1055 | } |
| 1056 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1057 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1058 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1059 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1060 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1061 | * |
| 1062 | * Logged from: |
| 1063 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1064 | */ |
| 1065 | message IsolatedUidChanged { |
| 1066 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
| 1067 | optional int32 parent_uid = 1; |
| 1068 | |
| 1069 | optional int32 isolated_uid = 2; |
| 1070 | |
| 1071 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1072 | enum Event { |
| 1073 | REMOVED = 0; |
| 1074 | CREATED = 1; |
| 1075 | } |
| 1076 | optional Event event = 3; |
| 1077 | } |
| 1078 | |
| 1079 | /* |
| 1080 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1081 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1082 | * and processed by WakeupController.cpp. |
| 1083 | */ |
| 1084 | message PacketWakeupOccurred { |
| 1085 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1086 | // delivered nowhere. |
| 1087 | optional int32 uid = 1; |
| 1088 | // The interface name on which the packet was received. |
| 1089 | optional string iface = 2; |
| 1090 | // The ethertype value of the packet. |
| 1091 | optional int32 ethertype = 3; |
| 1092 | // String representation of the destination MAC address of the packet. |
| 1093 | optional string destination_hardware_address = 4; |
| 1094 | // String representation of the source address of the packet if this was an IP packet. |
| 1095 | optional string source_ip = 5; |
| 1096 | // String representation of the destination address of the packet if this was an IP packet. |
| 1097 | optional string destination_ip = 6; |
| 1098 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1099 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1100 | // families. |
| 1101 | optional int32 ip_next_header = 7; |
| 1102 | // The source port if this was a TCP or UDP packet. |
| 1103 | optional int32 source_port = 8; |
| 1104 | // The destination port if this was a TCP or UDP packet. |
| 1105 | optional int32 destination_port = 9; |
| 1106 | } |
| 1107 | |
| 1108 | /* |
| 1109 | * Logs the memory stats for an app on startup. |
| 1110 | * Logged from: |
| 1111 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1112 | */ |
| 1113 | message AppStartMemoryStateCaptured { |
| 1114 | // The uid if available. -1 means not available. |
| 1115 | optional int32 uid = 1; |
| 1116 | |
| 1117 | // The process name. |
| 1118 | optional string process_name = 2; |
| 1119 | |
| 1120 | // The activity name. |
| 1121 | optional string activity_name = 3; |
| 1122 | |
| 1123 | // # of page-faults |
| 1124 | optional int64 pgfault = 4; |
| 1125 | |
| 1126 | // # of major page-faults |
| 1127 | optional int64 pgmajfault = 5; |
| 1128 | |
| 1129 | // RSS |
| 1130 | optional int64 rss_in_bytes = 6; |
| 1131 | |
| 1132 | // CACHE |
| 1133 | optional int64 cache_in_bytes = 7; |
| 1134 | |
| 1135 | // SWAP |
| 1136 | optional int64 swap_in_bytes = 8; |
| 1137 | } |
| 1138 | |
| 1139 | /* |
| 1140 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1141 | * for LMK event. |
| 1142 | * Logged from: |
| 1143 | * system/core/lmkd/lmkd.c |
| 1144 | */ |
| 1145 | message LmkStateChanged { |
| 1146 | enum State { |
| 1147 | UNKNOWN = 0; |
| 1148 | START = 1; |
| 1149 | STOP = 2; |
| 1150 | } |
| 1151 | optional State state = 1; |
| 1152 | } |
| 1153 | |
| 1154 | /* |
| 1155 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1156 | * Logged from: |
| 1157 | * system/core/lmkd/lmkd.c |
| 1158 | */ |
| 1159 | message LmkKillOccurred { |
| 1160 | // The uid if available. -1 means not available. |
| 1161 | optional int32 uid = 1; |
| 1162 | |
| 1163 | // The process name. |
| 1164 | optional string process_name = 2; |
| 1165 | |
| 1166 | // oom adj score. |
| 1167 | optional int32 oom_score = 3; |
| 1168 | |
| 1169 | // # of page-faults |
| 1170 | optional int64 pgfault = 4; |
| 1171 | |
| 1172 | // # of major page-faults |
| 1173 | optional int64 pgmajfault = 5; |
| 1174 | |
| 1175 | // RSS |
| 1176 | optional int64 rss_in_bytes = 6; |
| 1177 | |
| 1178 | // CACHE |
| 1179 | optional int64 cache_in_bytes = 7; |
| 1180 | |
| 1181 | // SWAP |
| 1182 | optional int64 swap_in_bytes = 8; |
| 1183 | } |
| 1184 | |
| 1185 | ////////////////////////////////////////////////////////////////////// |
| 1186 | // Pulled atoms below this line // |
| 1187 | ////////////////////////////////////////////////////////////////////// |
| 1188 | |
| 1189 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1190 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1191 | * |
| 1192 | * Pulled from: |
| 1193 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1194 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1195 | message WifiBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1196 | optional int32 uid = 1; |
| 1197 | |
| 1198 | optional int64 rx_bytes = 2; |
| 1199 | |
| 1200 | optional int64 rx_packets = 3; |
| 1201 | |
| 1202 | optional int64 tx_bytes = 4; |
| 1203 | |
| 1204 | optional int64 tx_packets = 5; |
| 1205 | } |
| 1206 | |
| 1207 | /** |
| 1208 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1209 | * |
| 1210 | * Pulled from: |
| 1211 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1212 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1213 | message WifiBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1214 | optional int32 uid = 1; |
| 1215 | |
| 1216 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1217 | optional int32 is_foreground = 2; |
| 1218 | |
| 1219 | optional int64 rx_bytes = 3; |
| 1220 | |
| 1221 | optional int64 rx_packets = 4; |
| 1222 | |
| 1223 | optional int64 tx_bytes = 5; |
| 1224 | |
| 1225 | optional int64 tx_packets = 6; |
| 1226 | } |
| 1227 | |
| 1228 | /** |
| 1229 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 1230 | * |
| 1231 | * Pulled from: |
| 1232 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1233 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1234 | message MobileBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1235 | optional int32 uid = 1; |
| 1236 | |
| 1237 | optional int64 rx_bytes = 2; |
| 1238 | |
| 1239 | optional int64 rx_packets = 3; |
| 1240 | |
| 1241 | optional int64 tx_bytes = 4; |
| 1242 | |
| 1243 | optional int64 tx_packets = 5; |
| 1244 | } |
| 1245 | |
| 1246 | /** |
| 1247 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1248 | * |
| 1249 | * Pulled from: |
| 1250 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1251 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1252 | message MobileBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1253 | optional int32 uid = 1; |
| 1254 | |
| 1255 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1256 | optional int32 is_foreground = 2; |
| 1257 | |
| 1258 | optional int64 rx_bytes = 3; |
| 1259 | |
| 1260 | optional int64 rx_packets = 4; |
| 1261 | |
| 1262 | optional int64 tx_bytes = 5; |
| 1263 | |
| 1264 | optional int64 tx_packets = 6; |
| 1265 | } |
| 1266 | |
| 1267 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1268 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 1269 | * |
| 1270 | * Pulled from: |
| 1271 | * StatsCompanionService |
| 1272 | */ |
| 1273 | message BluetoothBytesTransfer { |
| 1274 | optional int32 uid = 1; |
| 1275 | |
| 1276 | optional int64 rx_bytes = 2; |
| 1277 | |
| 1278 | optional int64 tx_bytes = 3; |
| 1279 | } |
| 1280 | |
| 1281 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1282 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1283 | * android/internal/os/KernelWakelockStats.java |
| 1284 | * |
| 1285 | * Pulled from: |
| 1286 | * StatsCompanionService using KernelWakelockReader. |
| 1287 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1288 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1289 | optional string name = 1; |
| 1290 | |
| 1291 | optional int32 count = 2; |
| 1292 | |
| 1293 | optional int32 version = 3; |
| 1294 | |
| 1295 | optional int64 time = 4; |
| 1296 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1297 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1298 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1299 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1300 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1301 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1302 | * hardware/interfaces/power/1.1/types.hal |
| 1303 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1304 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1305 | // Subsystem name |
| 1306 | optional string subsystem_name = 1; |
| 1307 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 1308 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 1309 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1310 | // 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] | 1311 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1312 | // 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] | 1313 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1314 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1315 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1316 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1317 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1318 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1319 | * starts from highest to lowest. The value should be monotonically |
| 1320 | * increasing since boot. However, if there is a cpu |
| 1321 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1322 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1323 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1324 | optional uint32 cluster = 1; |
| 1325 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1326 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1327 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1328 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1329 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1330 | * Pulls Cpu Time Per Uid. |
| 1331 | * Note that isolated process uid time should be attributed to host uids. |
| 1332 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1333 | message CpuTimePerUid { |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1334 | optional uint64 uid = 1; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1335 | optional uint64 user_time_millis = 2; |
| 1336 | optional uint64 sys_time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1337 | } |
| 1338 | |
| 1339 | /** |
| 1340 | * Pulls Cpu Time Per Uid per frequency. |
| 1341 | * Note that isolated process uid time should be attributed to host uids. |
| 1342 | * For each uid, we order the time by descending frequencies. |
| 1343 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1344 | message CpuTimePerUidFreq { |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1345 | optional uint64 uid = 1; |
| 1346 | optional uint64 freq_idx = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1347 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1348 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1349 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1350 | /** |
| 1351 | * Pulls Wifi Controller Activity Energy Info |
| 1352 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1353 | message WifiActivityEnergyInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1354 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1355 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1356 | // stack reported state |
| 1357 | // TODO: replace this with proto enum |
| 1358 | optional int32 stack_state = 2; |
| 1359 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1360 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1361 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1362 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1363 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1364 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1365 | // product of current(mA), voltage(V) and time(ms) |
| 1366 | optional uint64 controller_energy_used = 6; |
| 1367 | } |
| 1368 | |
| 1369 | /** |
| 1370 | * Pulls Modem Activity Energy Info |
| 1371 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1372 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1373 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1374 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1375 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1376 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1377 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1378 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1379 | /** |
| 1380 | * Tx power index |
| 1381 | * index 0 = tx_power < 0dBm |
| 1382 | * index 1 = 0dBm < tx_power < 5dBm |
| 1383 | * index 2 = 5dBm < tx_power < 15dBm |
| 1384 | * index 3 = 15dBm < tx_power < 20dBm |
| 1385 | * index 4 = tx_power > 20dBm |
| 1386 | */ |
| 1387 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1388 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1389 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1390 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1391 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1392 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1393 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1394 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1395 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1396 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1397 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1398 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1399 | // product of current(mA), voltage(V) and time(ms) |
| 1400 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1401 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1402 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1403 | /** |
| 1404 | * Pulls Bluetooth Activity Energy Info |
| 1405 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 1406 | */ |
| 1407 | message BluetoothActivityInfo { |
| 1408 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1409 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1410 | // bluetooth stack state |
| 1411 | optional int32 bluetooth_stack_state = 2; |
| 1412 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1413 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1414 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1415 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1416 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1417 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1418 | // product of current(mA), voltage(V) and time(ms) |
| 1419 | optional uint64 energy_used = 6; |
| 1420 | } |
| 1421 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1422 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1423 | * Logs the memory stats for a process. |
| 1424 | */ |
| 1425 | message ProcessMemoryState { |
| 1426 | // The uid if available. -1 means not available. |
| 1427 | optional int32 uid = 1; |
| 1428 | |
| 1429 | // The process name. |
| 1430 | optional string process_name = 2; |
| 1431 | |
| 1432 | // oom adj score. |
| 1433 | optional int32 oom_score = 3; |
| 1434 | |
| 1435 | // # of page-faults |
| 1436 | optional int64 pgfault = 4; |
| 1437 | |
| 1438 | // # of major page-faults |
| 1439 | optional int64 pgmajfault = 5; |
| 1440 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 1441 | // RSS |
| 1442 | optional int64 rss_in_bytes = 6; |
| 1443 | |
| 1444 | // CACHE |
| 1445 | optional int64 cache_in_bytes = 7; |
| 1446 | |
| 1447 | // SWAP |
| 1448 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1449 | } |
| 1450 | |
| 1451 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1452 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1453 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1454 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1455 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1456 | } |
| 1457 | |
| 1458 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1459 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1460 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1461 | message SystemUptime { |
| 1462 | // Milliseconds since the system was booted. |
| 1463 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 1464 | // for external input). |
| 1465 | // 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] | 1466 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1467 | } |
| 1468 | |
| 1469 | /* |
| 1470 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 1471 | * active: X (X is # cores) |
| 1472 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 1473 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 1474 | * ... |
| 1475 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 1476 | * The file contains a monotonically increasing count of time for a single boot. |
| 1477 | */ |
| 1478 | message CpuActiveTime { |
| 1479 | optional uint64 uid = 1; |
David Chen | b639d14 | 2018-02-14 17:29:54 -0800 | [diff] [blame] | 1480 | optional uint32 cluster_number = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1481 | optional uint64 idx = 3; |
| 1482 | optional uint64 time_millis = 4; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1483 | } |
| 1484 | |
| 1485 | /** |
| 1486 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 1487 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 1488 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1489 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1490 | * ... |
| 1491 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 1492 | * The file contains a monotonically increasing count of time for a single boot. |
| 1493 | */ |
| 1494 | message CpuClusterTime { |
| 1495 | optional uint64 uid = 1; |
| 1496 | optional uint64 idx = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1497 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 1498 | } |
| 1499 | |
| 1500 | /* |
| 1501 | * Pulls free disk space, for data, system partition and temporary directory. |
| 1502 | */ |
| 1503 | message DiskSpace { |
| 1504 | // available bytes in data partition |
| 1505 | optional uint64 data_available_bytes = 1; |
| 1506 | // available bytes in system partition |
| 1507 | optional uint64 system_available_bytes = 2; |
| 1508 | // available bytes in download cache or temp directories |
| 1509 | optional uint64 temp_available_bytes = 3; |
| 1510 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1511 | |
| 1512 | /** |
| 1513 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
| 1514 | * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
| 1515 | */ |
| 1516 | message RemainingBatteryCapacity { |
| 1517 | optional int32 charge_uAh = 1; |
| 1518 | } |
| 1519 | |
| 1520 | /** |
| 1521 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
| 1522 | * Logged from: frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
| 1523 | */ |
| 1524 | message FullBatteryCapacity { |
| 1525 | optional int32 capacity_uAh = 1; |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame^] | 1526 | } |