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