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