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 | |
| 19 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 21 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 22 | |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 23 | import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/app/enums.proto"; |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/job/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"; |
Howard Ro | 0546d54 | 2018-08-30 16:23:44 -0700 | [diff] [blame] | 32 | import "frameworks/base/proto/src/stats_enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 33 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 34 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 35 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 36 | * raw stats log events from the Android system, also known as "atoms." |
| 37 | * |
| 38 | * This field contains a single oneof with all of the available messages. |
| 39 | * The stats-log-api-gen tool runs as part of the Android build and |
| 40 | * generates the android.util.StatsLog class, which contains the constants |
| 41 | * and methods that Android uses to log. |
| 42 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 43 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 44 | * Instead, statsd on Android constructs these messages synthetically, |
| 45 | * in the format defined here and in stats_log.proto. |
| 46 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 47 | message Atom { |
| 48 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 49 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 50 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 51 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 52 | ProcessStateChanged process_state_changed = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 53 | BleScanResultReceived ble_scan_result_received = 4; |
| 54 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 55 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 56 | SyncStateChanged sync_state_changed = 7; |
| 57 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 58 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 59 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 60 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 61 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 62 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 63 | ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14; |
| 64 | MemoryFactorStateChanged memory_factor_state_changed = 15; |
| 65 | ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16; |
| 66 | CachedKillReported cached_kill_reported = 17; |
| 67 | ProcessMemoryStatReported process_memory_stat_reported = 18; |
| 68 | // 19 is available |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 69 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 70 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 71 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 72 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 73 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 74 | CameraStateChanged camera_state_changed = 25; |
| 75 | FlashlightStateChanged flashlight_state_changed = 26; |
| 76 | UidProcessStateChanged uid_process_state_changed = 27; |
| 77 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 78 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 79 | BatteryLevelChanged battery_level_changed = 30; |
| 80 | ChargingStateChanged charging_state_changed = 31; |
| 81 | PluggedStateChanged plugged_state_changed = 32; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 82 | // 33 - 34 are available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 83 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 84 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 85 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 86 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 87 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 88 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 89 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 90 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 91 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 92 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 93 | // 45 is available |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 94 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 95 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 96 | AppStartOccurred app_start_occurred = 48; |
| 97 | AppStartCanceled app_start_canceled = 49; |
| 98 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 99 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 100 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 101 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 102 | LmkStateChanged lmk_state_changed = 54; |
| 103 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 104 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 105 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 106 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 107 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 108 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 109 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 110 | KeyguardStateChanged keyguard_state_changed = 62; |
| 111 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 112 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 113 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 114 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 115 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 116 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Tej Singh | 02200f9 | 2018-04-02 19:37:59 -0700 | [diff] [blame] | 117 | // 69 is blank but need not be. |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 118 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 119 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 120 | HardwareFailed hardware_failed = 72; |
| 121 | PhysicalDropDetected physical_drop_detected = 73; |
| 122 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 123 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 124 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 125 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 126 | AppCrashOccurred app_crash_occurred = 78; |
| 127 | ANROccurred anr_occurred = 79; |
| 128 | WTFOccurred wtf_occurred = 80; |
| 129 | LowMemReported low_mem_reported = 81; |
Howard Ro | cb767f6 | 2018-06-19 19:58:05 -0700 | [diff] [blame] | 130 | GenericAtom generic_atom = 82; |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 131 | KeyValuePairsAtom key_value_pairs_atom = 83; |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 132 | VibratorStateChanged vibrator_state_changed = 84; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 133 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 134 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 135 | // Pulled events will start at field 10000. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 136 | // Next: 10025 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 137 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 138 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 139 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 140 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 141 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 142 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 143 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 144 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 145 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 146 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 147 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 148 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 149 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 150 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 151 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 152 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 153 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 154 | CpuActiveTime cpu_active_time = 10016; |
| 155 | CpuClusterTime cpu_cluster_time = 10017; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame^] | 156 | DiskSpace disk_space = 10018 [deprecated=true]; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 157 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 158 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 159 | Temperature temperature = 10021; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 160 | BinderCalls binder_calls = 10022; |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 161 | BinderCallsExceptions binder_calls_exceptions = 10023; |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 162 | LooperStats looper_stats = 10024; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame^] | 163 | DiskStats disk_stats = 10025; |
| 164 | DirectoryUsage directory_usage = 10026; |
| 165 | AppSize app_size = 10027; |
| 166 | CategorySize category_size = 10028; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 167 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 168 | |
| 169 | // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above |
| 170 | // 100,000 are reserved for non-AOSP (e.g. OEMs) to use. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 171 | } |
| 172 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 173 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 174 | * This proto represents a node of an attribution chain. |
| 175 | * Note: All attribution chains are represented as a repeated field of type |
| 176 | * AttributionNode. It is understood that in such arrays, the order is that |
| 177 | * 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] | 178 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 179 | message AttributionNode { |
| 180 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 181 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 182 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 183 | // The (optional) string tag for an element in the attribution chain. If the |
| 184 | // element has no tag, it is encoded as an empty string. |
| 185 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 188 | message KeyValuePair { |
| 189 | optional int32 key = 1; |
| 190 | oneof value { |
| 191 | int64 value_int = 2; |
| 192 | string value_str = 3; |
| 193 | float value_float = 4; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | message KeyValuePairsAtom { |
| 198 | optional int32 uid = 1; |
| 199 | repeated KeyValuePair pairs = 2; |
| 200 | } |
| 201 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 202 | /* |
| 203 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 204 | * 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] | 205 | * |
| 206 | * RULES: |
| 207 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 208 | * Skipping field ids is not allowed. |
| 209 | * - These form an API, so renaming, renumbering or removing fields is |
| 210 | * not allowed between android releases. (This is not currently enforced, |
| 211 | * but there will be a tool to enforce this restriction). |
| 212 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 213 | * are allowed (yet). The bytes type is also not allowed. |
| 214 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 215 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 216 | * - 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] | 217 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 218 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 219 | * annotation. The generated code on android will be represented by UIDs, |
| 220 | * and those UIDs will be translated in xxx to those strings. |
| 221 | * |
| 222 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 223 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 224 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 225 | * ***************************************************************************** |
| 226 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 227 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 228 | /** |
| 229 | * Logs when the screen state changes. |
| 230 | * |
| 231 | * Logged from: |
| 232 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 233 | */ |
| 234 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 235 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 236 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 237 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 238 | |
| 239 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 240 | * Logs that the process state of the uid, as determined by ActivityManager |
| 241 | * (i.e. the highest process state of that uid's processes) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 242 | * |
| 243 | * Logged from: |
| 244 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 245 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 246 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 247 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 248 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 249 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 250 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 254 | * Logs process state change of a process, as per the activity manager. |
| 255 | * |
| 256 | * Logged from: |
| 257 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 258 | */ |
| 259 | message ProcessStateChanged { |
| 260 | optional int32 uid = 1; |
| 261 | optional string process_name = 2; |
| 262 | optional string package_name = 3; |
| 263 | // TODO: remove this when validation is done |
| 264 | optional int64 version = 5; |
| 265 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
| 266 | optional android.app.ProcessStateEnum state = 4; |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * Logs when ActivityManagerService sleep state is changed. |
| 271 | * |
| 272 | * Logged from: |
| 273 | * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java |
| 274 | */ |
| 275 | message ActivityManagerSleepStateChanged { |
| 276 | // TODO: import frameworks proto |
| 277 | enum State { |
| 278 | UNKNOWN = 0; |
| 279 | ASLEEP = 1; |
| 280 | AWAKE = 2; |
| 281 | } |
| 282 | optional State state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * Logs when system memory state changes. |
| 287 | * |
| 288 | * Logged from: |
| 289 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 290 | */ |
| 291 | message MemoryFactorStateChanged { |
| 292 | // TODO: import frameworks proto |
| 293 | enum State { |
| 294 | MEMORY_UNKNOWN = 0; |
| 295 | NORMAL = 1; // normal. |
| 296 | MODERATE = 2; // moderate memory pressure. |
| 297 | LOW = 3; // low memory. |
| 298 | CRITICAL = 4; // critical memory. |
| 299 | |
| 300 | } |
| 301 | optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE]; |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Logs when app is using too much cpu, according to ActivityManagerService. |
| 306 | * |
| 307 | * Logged from: |
| 308 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 309 | */ |
| 310 | message ExcessiveCpuUsageReported { |
| 311 | optional int32 uid = 1; |
| 312 | optional string process_name = 2; |
| 313 | optional string package_name = 3; |
| 314 | // package version. TODO: remove this when validation is done |
| 315 | optional int64 version = 4; |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Logs when a cached process is killed, along with its pss. |
| 320 | * |
| 321 | * Logged from: |
| 322 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 323 | */ |
| 324 | message CachedKillReported { |
| 325 | optional int32 uid = 1; |
| 326 | optional string process_name = 2; |
| 327 | optional string package_name = 3; |
| 328 | // TODO: remove this when validation is done |
| 329 | optional int64 version = 5; |
| 330 | optional int64 pss = 4; |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Logs when memory stats of a process is reported. |
| 335 | * |
| 336 | * Logged from: |
| 337 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 338 | */ |
| 339 | message ProcessMemoryStatReported { |
| 340 | optional int32 uid = 1; |
| 341 | optional string process_name = 2; |
| 342 | optional string package_name = 3; |
| 343 | //TODO: remove this when validation is done |
| 344 | optional int64 version = 9; |
| 345 | optional int64 pss = 4; |
| 346 | optional int64 uss = 5; |
| 347 | optional int64 rss = 6; |
| 348 | enum Type { |
| 349 | ADD_PSS_INTERNAL_SINGLE = 0; |
| 350 | ADD_PSS_INTERNAL_ALL_MEM = 1; |
| 351 | ADD_PSS_INTERNAL_ALL_POLL = 2; |
| 352 | ADD_PSS_EXTERNAL = 3; |
| 353 | ADD_PSS_EXTERNAL_SLOW = 4; |
| 354 | } |
| 355 | optional Type type = 7; |
| 356 | optional int64 duration = 8; |
| 357 | } |
| 358 | |
| 359 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 360 | * Logs that a process started, finished, crashed, or ANRed. |
| 361 | * |
| 362 | * Logged from: |
| 363 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 364 | */ |
| 365 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 366 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 367 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 368 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 369 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 370 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 371 | // What lifecycle state the process changed to. |
| 372 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 373 | enum State { |
| 374 | FINISHED = 0; |
| 375 | STARTED = 1; |
| 376 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 377 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 378 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 379 | } |
| 380 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 381 | /** |
| 382 | * Logs when the ble scan state changes. |
| 383 | * |
| 384 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 385 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 386 | */ |
| 387 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 388 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 389 | |
| 390 | enum State { |
| 391 | OFF = 0; |
| 392 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 393 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 394 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 395 | } |
| 396 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 397 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 398 | // Does the scan have a filter. |
| 399 | optional bool is_filtered = 3; |
| 400 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 401 | optional bool is_first_match = 4; |
| 402 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 403 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Logs reporting of a ble scan finding results. |
| 408 | * |
| 409 | * Logged from: |
| 410 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 411 | */ |
| 412 | // TODO: Consider changing to tracking per-scanner-id (log from AppScanStats). |
| 413 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 414 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 415 | |
| 416 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 417 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | /** |
| 421 | * Logs when a sensor state changes. |
| 422 | * |
| 423 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 424 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 425 | */ |
| 426 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 427 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 428 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 429 | // The id (int) of the sensor. |
| 430 | optional int32 sensor_id = 2; |
| 431 | |
| 432 | enum State { |
| 433 | OFF = 0; |
| 434 | ON = 1; |
| 435 | } |
| 436 | optional State state = 3; |
| 437 | } |
| 438 | |
| 439 | |
| 440 | /** |
| 441 | * Logs when GPS state changes. |
| 442 | * |
| 443 | * Logged from: |
| 444 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 445 | */ |
| 446 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 447 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 448 | |
| 449 | enum State { |
| 450 | OFF = 0; |
| 451 | ON = 1; |
| 452 | } |
| 453 | optional State state = 2; |
| 454 | } |
| 455 | |
| 456 | |
| 457 | /** |
| 458 | * Logs when a sync manager sync state changes. |
| 459 | * |
| 460 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 461 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 462 | */ |
| 463 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 464 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 465 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 466 | // Name of the sync (as named in the app). Can be chosen at run-time. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 467 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 468 | |
| 469 | enum State { |
| 470 | OFF = 0; |
| 471 | ON = 1; |
| 472 | } |
| 473 | optional State state = 3; |
| 474 | } |
| 475 | |
| 476 | /** |
| 477 | * Logs when a job scheduler job state changes. |
| 478 | * |
| 479 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 480 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 481 | */ |
| 482 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 483 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 484 | |
| 485 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 486 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 487 | |
| 488 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 489 | FINISHED = 0; |
| 490 | STARTED = 1; |
| 491 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 492 | } |
| 493 | optional State state = 3; |
| 494 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 495 | // The reason a job has stopped. |
| 496 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 497 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 498 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | /** |
| 502 | * Logs when the audio state changes. |
| 503 | * |
| 504 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 505 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 506 | */ |
| 507 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 508 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 509 | |
| 510 | enum State { |
| 511 | OFF = 0; |
| 512 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 513 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 514 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 515 | } |
| 516 | optional State state = 2; |
| 517 | } |
| 518 | |
| 519 | /** |
| 520 | * Logs when the video codec state changes. |
| 521 | * |
| 522 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 523 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 524 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 525 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 526 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 527 | |
| 528 | enum State { |
| 529 | OFF = 0; |
| 530 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 531 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 532 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 533 | } |
| 534 | optional State state = 2; |
| 535 | } |
| 536 | |
| 537 | /** |
| 538 | * Logs when the flashlight state changes. |
| 539 | * |
| 540 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 541 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 542 | */ |
| 543 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 544 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 545 | |
| 546 | enum State { |
| 547 | OFF = 0; |
| 548 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 549 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 550 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 551 | } |
| 552 | optional State state = 2; |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * Logs when the camera state changes. |
| 557 | * |
| 558 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 559 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 560 | */ |
| 561 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 562 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 563 | |
| 564 | enum State { |
| 565 | OFF = 0; |
| 566 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 567 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 568 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 569 | } |
| 570 | optional State state = 2; |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * 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] | 575 | * |
| 576 | * Logged from: |
| 577 | * TODO |
| 578 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 579 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 580 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 581 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 582 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 583 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 584 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 585 | |
| 586 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 587 | optional string tag = 3; |
| 588 | |
| 589 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 590 | RELEASE = 0; |
| 591 | ACQUIRE = 1; |
| 592 | CHANGE_RELEASE = 2; |
| 593 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 594 | } |
| 595 | optional State state = 4; |
| 596 | } |
| 597 | |
| 598 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 599 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 600 | * |
| 601 | * Logged from: |
| 602 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 603 | */ |
| 604 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 605 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 606 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 607 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 608 | optional string tag = 2; |
| 609 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 610 | // TODO: I have no idea what this is. |
| 611 | optional string history_tag = 3; |
| 612 | |
| 613 | enum State { |
| 614 | OFF = 0; |
| 615 | ON = 1; |
| 616 | } |
| 617 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 618 | } |
| 619 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 620 | /** |
| 621 | * Logs Battery Saver state change. |
| 622 | * |
| 623 | * Logged from: |
| 624 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 625 | */ |
| 626 | message BatterySaverModeStateChanged { |
| 627 | enum State { |
| 628 | OFF = 0; |
| 629 | ON = 1; |
| 630 | } |
| 631 | optional State state = 1; |
| 632 | } |
| 633 | |
| 634 | /** |
| 635 | * Logs Doze mode state change. |
| 636 | * |
| 637 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 638 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 639 | */ |
| 640 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 641 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 642 | } |
| 643 | |
| 644 | |
| 645 | /** |
| 646 | * Logs state change of Doze mode including maintenance windows. |
| 647 | * |
| 648 | * Logged from: |
| 649 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 650 | */ |
| 651 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 652 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 653 | } |
| 654 | |
| 655 | /** |
| 656 | * Logs screen brightness level. |
| 657 | * |
| 658 | * Logged from: |
| 659 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 660 | */ |
| 661 | message ScreenBrightnessChanged { |
| 662 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 663 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 664 | } |
| 665 | |
| 666 | /** |
| 667 | * Logs battery level (percent full, from 0 to 100). |
| 668 | * |
| 669 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 670 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 671 | */ |
| 672 | message BatteryLevelChanged { |
| 673 | // Battery level. Should be in [0, 100]. |
| 674 | optional int32 battery_level = 1; |
| 675 | } |
| 676 | |
| 677 | /** |
| 678 | * Logs change in charging status of the device. |
| 679 | * |
| 680 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 681 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 682 | */ |
| 683 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 684 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 685 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 686 | } |
| 687 | |
| 688 | /** |
| 689 | * Logs whether the device is plugged in, and what power source it is using. |
| 690 | * |
| 691 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 692 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 693 | */ |
| 694 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 695 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 696 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 697 | } |
| 698 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 699 | /** |
| 700 | * Logs when an app's wakeup alarm fires. |
| 701 | * |
| 702 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 703 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 704 | */ |
| 705 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 706 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 707 | |
| 708 | // Name of the wakeup alarm. |
| 709 | optional string tag = 2; |
| 710 | } |
| 711 | |
| 712 | /** |
| 713 | * Logs when an an app causes the mobile radio to change state. |
| 714 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 715 | * |
| 716 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 717 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 718 | */ |
| 719 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 720 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 721 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 722 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 723 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | /** |
| 727 | * Logs when an an app causes the wifi radio to change state. |
| 728 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 729 | * |
| 730 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 731 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 732 | */ |
| 733 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 734 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 735 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 736 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 737 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 738 | } |
| 739 | |
| 740 | /** |
| 741 | * Logs kernel wakeup reasons and aborts. |
| 742 | * |
| 743 | * Logged from: |
| 744 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 745 | */ |
| 746 | message KernelWakeupReported { |
| 747 | // Name of the kernel wakeup reason (or abort). |
| 748 | optional string wakeup_reason_name = 1; |
| 749 | |
| 750 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 751 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | /** |
| 755 | * Logs wifi locks held by an app. |
| 756 | * |
| 757 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 758 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 759 | */ |
| 760 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 761 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 762 | |
| 763 | enum State { |
| 764 | OFF = 0; |
| 765 | ON = 1; |
| 766 | } |
| 767 | optional State state = 2; |
| 768 | } |
| 769 | |
| 770 | /** |
| 771 | * Logs wifi signal strength changes. |
| 772 | * |
| 773 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 774 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 775 | */ |
| 776 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 777 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 778 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 779 | } |
| 780 | |
| 781 | /** |
| 782 | * Logs wifi scans performed by an app. |
| 783 | * |
| 784 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 785 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 786 | */ |
| 787 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 788 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 789 | |
| 790 | enum State { |
| 791 | OFF = 0; |
| 792 | ON = 1; |
| 793 | } |
| 794 | optional State state = 2; |
| 795 | } |
| 796 | |
| 797 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 798 | * Logs wifi multicast locks held by an app |
| 799 | * |
| 800 | * Logged from: |
| 801 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 802 | */ |
| 803 | message WifiMulticastLockStateChanged { |
| 804 | repeated AttributionNode attribution_node = 1; |
| 805 | |
| 806 | enum State { |
| 807 | OFF = 0; |
| 808 | ON = 1; |
| 809 | } |
| 810 | optional State state = 2; |
| 811 | } |
| 812 | |
| 813 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 814 | * Logs shutdown reason and duration on next boot. |
| 815 | * |
| 816 | * Logged from: |
| 817 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 818 | */ |
| 819 | message ShutdownSequenceReported { |
| 820 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 821 | optional bool reboot = 1; |
| 822 | |
| 823 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 824 | optional string reason = 2; |
| 825 | |
| 826 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 827 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 828 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 829 | |
| 830 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 831 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 832 | } |
| 833 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 834 | |
| 835 | /** |
| 836 | * Logs boot reason and duration. |
| 837 | * |
| 838 | * Logged from: |
| 839 | * system/core/bootstat/bootstat.cpp |
| 840 | */ |
| 841 | message BootSequenceReported { |
| 842 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 843 | // Default: "<EMPTY>" if not available. |
| 844 | optional string bootloader_reason = 1; |
| 845 | |
| 846 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 847 | // Default: "<EMPTY>" if not available. |
| 848 | optional string system_reason = 2; |
| 849 | |
| 850 | // 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] | 851 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 852 | |
| 853 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 854 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 855 | |
| 856 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 857 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 858 | |
| 859 | // Time since last boot in ms. Default: 0 if not available. |
| 860 | optional int64 time_since_last_boot = 6; |
| 861 | } |
| 862 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 863 | |
| 864 | /** |
| 865 | * Logs call state and disconnect cause (if applicable). |
| 866 | * |
| 867 | * Logged from: |
| 868 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 869 | */ |
| 870 | message CallStateChanged { |
| 871 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 872 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 873 | optional android.telecom.CallStateEnum call_state = 1; |
| 874 | |
| 875 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 876 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 877 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 878 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 879 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 880 | |
| 881 | // True if the call is self-managed, which are apps that use the |
| 882 | // telecom infrastructure to make their own calls. |
| 883 | optional bool self_managed = 3; |
| 884 | |
| 885 | // True if call is external. External calls are calls on connected Wear |
| 886 | // devices but show up in Telecom so the user can pull them onto the device. |
| 887 | optional bool external_call = 4; |
| 888 | } |
| 889 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 890 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 891 | * Logs keyguard state. The keyguard is the lock screen. |
| 892 | * |
| 893 | * Logged from: |
| 894 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 895 | */ |
| 896 | message KeyguardStateChanged { |
| 897 | enum State { |
| 898 | UNKNOWN = 0; |
| 899 | // The keyguard is hidden when the phone is unlocked. |
| 900 | HIDDEN = 1; |
| 901 | // The keyguard is shown when the phone is locked (screen turns off). |
| 902 | SHOWN= 2; |
| 903 | // The keyguard is occluded when something is overlaying the keyguard. |
| 904 | // Eg. Opening the camera while on the lock screen. |
| 905 | OCCLUDED = 3; |
| 906 | } |
| 907 | optional State state = 1; |
| 908 | } |
| 909 | |
| 910 | /** |
| 911 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 912 | * prompts the user to enter a password (pattern, pin, etc). |
| 913 | * |
| 914 | * Logged from: |
| 915 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 916 | */ |
| 917 | |
| 918 | message KeyguardBouncerStateChanged { |
| 919 | enum State { |
| 920 | UNKNOWN = 0; |
| 921 | // Bouncer is hidden, either as a result of successfully entering the |
| 922 | // password, screen timing out, or user going back to lock screen. |
| 923 | HIDDEN = 1; |
| 924 | // This is when the user is being prompted to enter the password. |
| 925 | SHOWN = 2; |
| 926 | } |
| 927 | optional State state = 1; |
| 928 | } |
| 929 | |
| 930 | /** |
| 931 | * Logs the result of entering a password into the keyguard bouncer. |
| 932 | * |
| 933 | * Logged from: |
| 934 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 935 | */ |
| 936 | message KeyguardBouncerPasswordEntered { |
| 937 | enum BouncerResult { |
| 938 | UNKNOWN = 0; |
| 939 | // The password entered was incorrect. |
| 940 | FAILURE = 1; |
| 941 | // The password entered was correct. |
| 942 | SUCCESS = 2; |
| 943 | } |
| 944 | optional BouncerResult result = 1; |
| 945 | } |
| 946 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 947 | /* |
| 948 | * Logs changes to the configuration of the device. The configuration is defined |
| 949 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 950 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 951 | * Please go there to interpret the possible values each field can be. |
| 952 | * |
| 953 | * Logged from: |
| 954 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 955 | */ |
| 956 | message ResourceConfigurationChanged { |
| 957 | // Bit mask of color capabilities of the screen. |
| 958 | // Contains information about the color gamut and hdr mode of the screen. |
| 959 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 960 | optional int32 colorMode = 1; |
| 961 | |
| 962 | // The target screen density being rendered to. |
| 963 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 964 | optional int32 densityDpi = 2; |
| 965 | |
| 966 | // Current user preference for the scaling factor for fonts, |
| 967 | // relative to the base density scaling. |
| 968 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 969 | optional float fontScale = 3; |
| 970 | |
| 971 | // Flag indicating whether the hard keyboard is hidden. |
| 972 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 973 | optional int32 hardKeyboardHidden = 4; |
| 974 | |
| 975 | // The type of keyboard attached to the device. |
| 976 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 977 | optional int32 keyboard = 5; |
| 978 | |
| 979 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 980 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 981 | optional int32 keyboardHideen = 6; |
| 982 | |
| 983 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 984 | // 0 if undefined. |
| 985 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 986 | optional int32 mcc = 7; |
| 987 | |
| 988 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 989 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 990 | // MNC_ZERO symbol defined in Configuration.java. |
| 991 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 992 | optional int32 mnc = 8; |
| 993 | |
| 994 | // The kind of navigation available on the device. |
| 995 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 996 | optional int32 navigation = 9; |
| 997 | |
| 998 | // Flag indicating whether the navigation is available. |
| 999 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 1000 | optional int32 navigationHidden = 10; |
| 1001 | |
| 1002 | // Overall orientation of the screen. |
| 1003 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 1004 | optional int32 orientation = 11; |
| 1005 | |
| 1006 | // The current height of the available screen space, in dp units. |
| 1007 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 1008 | optional int32 screenHeightDp = 12; |
| 1009 | |
| 1010 | // Bit mask of overall layout of the screen. |
| 1011 | // Contains information about screen size, whether the screen is wider/taller |
| 1012 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 1013 | // and whether the screen has a rounded shape. |
| 1014 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 1015 | optional int32 screenLayout = 13; |
| 1016 | |
| 1017 | // Current width of the available screen space, in dp units. |
| 1018 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 1019 | optional int32 screenWidthDp = 14; |
| 1020 | |
| 1021 | // The smallest screen size an application will see in normal operation. |
| 1022 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 1023 | // in portrait and landscape. |
| 1024 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 1025 | optional int32 smallestScreenWidthDp = 15; |
| 1026 | |
| 1027 | // The type of touch screen attached to the device. |
| 1028 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 1029 | optional int32 touchscreen = 16; |
| 1030 | |
| 1031 | // Bit mask of the ui mode. |
| 1032 | // Contains information about the overall ui mode of the device. |
| 1033 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 1034 | // Also contains information about whether the device is in night mode. |
| 1035 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 1036 | optional int32 uiMode = 17; |
| 1037 | } |
| 1038 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1039 | |
| 1040 | /** |
| 1041 | * Logs changes in the connection state of the mobile radio. |
| 1042 | * |
| 1043 | * Logged from: |
| 1044 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 1045 | */ |
| 1046 | message MobileConnectionStateChanged { |
| 1047 | // States are from the state machine DataConnection.java. |
| 1048 | enum State { |
| 1049 | UNKNOWN = 0; |
| 1050 | // The connection is inactive, or disconnected. |
| 1051 | INACTIVE = 1; |
| 1052 | // The connection is being activated, or connecting. |
| 1053 | ACTIVATING = 2; |
| 1054 | // The connection is active, or connected. |
| 1055 | ACTIVE = 3; |
| 1056 | // The connection is disconnecting. |
| 1057 | DISCONNECTING = 4; |
| 1058 | // The connection is disconnecting after creating a connection. |
| 1059 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 1060 | } |
| 1061 | optional State state = 1; |
| 1062 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1063 | optional int32 sim_slot_index = 2; |
| 1064 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 1065 | // every new network created. Resets whenever the device reboots. |
| 1066 | optional int32 data_connection_id = 3; |
| 1067 | // A bitmask for the capabilities of this connection. |
| 1068 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 1069 | // Default value (if we have no information): 0 |
| 1070 | optional int64 capabilities = 4; |
| 1071 | // If this connection has internet. |
| 1072 | // This just checks if the DEFAULT bit of capabilities is set. |
| 1073 | optional bool has_internet = 5; |
| 1074 | } |
| 1075 | |
| 1076 | /** |
| 1077 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 1078 | * |
| 1079 | * Logged from: |
| 1080 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 1081 | */ |
| 1082 | message MobileRadioTechnologyChanged { |
| 1083 | optional android.telephony.NetworkTypeEnum state = 1; |
| 1084 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1085 | optional int32 sim_slot_index = 2; |
| 1086 | } |
| 1087 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1088 | /** |
| 1089 | * Logs the VID and PID of any connected USB devices. |
| 1090 | * |
| 1091 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 1092 | * |
| 1093 | * Logged by Vendor. |
| 1094 | */ |
| 1095 | message UsbDeviceAttached { |
| 1096 | optional int32 vid = 1; |
| 1097 | optional int32 pid = 2; |
| 1098 | optional bool has_audio = 3; |
| 1099 | optional bool has_hid = 4; |
| 1100 | optional bool has_storage = 5; |
| 1101 | } |
| 1102 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1103 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1104 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1105 | * Logs when Bluetooth is enabled and disabled. |
| 1106 | * |
| 1107 | * Logged from: |
| 1108 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 1109 | */ |
| 1110 | message BluetoothEnabledStateChanged { |
| 1111 | repeated AttributionNode attribution_node = 1; |
| 1112 | // Whether or not bluetooth is enabled on the device. |
| 1113 | enum State { |
| 1114 | UNKNOWN = 0; |
| 1115 | ENABLED = 1; |
| 1116 | DISABLED = 2; |
| 1117 | } |
| 1118 | optional State state = 2; |
| 1119 | // The reason for being enabled/disabled. |
| 1120 | // Eg. Airplane mode, crash, application request. |
| 1121 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 1122 | // If the reason is an application request, this will be the package name. |
| 1123 | optional string pkgName = 4; |
| 1124 | } |
| 1125 | |
| 1126 | /** |
| 1127 | * Logs when a Bluetooth device connects and disconnects. |
| 1128 | * |
| 1129 | * Logged from: |
| 1130 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1131 | */ |
| 1132 | message BluetoothConnectionStateChanged { |
| 1133 | // The state of the connection. |
| 1134 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1135 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1136 | // An identifier that can be used to match connect and disconnect events. |
| 1137 | // Currently is last two bytes of a hash of a device level ID and |
| 1138 | // the mac address of the bluetooth device that is connected. |
| 1139 | optional int32 obfuscated_id = 2; |
| 1140 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1141 | // From android.bluetooth.BluetoothAdapter.java |
| 1142 | optional int32 bt_profile = 3; |
| 1143 | } |
| 1144 | |
| 1145 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1146 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1147 | * |
| 1148 | * Logged from: |
| 1149 | * Vendor USB HAL. |
| 1150 | */ |
| 1151 | message UsbConnectorStateChanged { |
| 1152 | enum State { |
| 1153 | DISCONNECTED = 0; |
| 1154 | CONNECTED = 1; |
| 1155 | } |
| 1156 | optional State state = 1; |
| 1157 | } |
| 1158 | |
| 1159 | /** |
| 1160 | * Logs the reported speaker impedance. |
| 1161 | * |
| 1162 | * Logged from: |
| 1163 | * Vendor audio implementation. |
| 1164 | */ |
| 1165 | message SpeakerImpedanceReported { |
| 1166 | optional int32 speaker_location = 1; |
| 1167 | optional int32 impedance = 2; |
| 1168 | } |
| 1169 | |
| 1170 | /** |
| 1171 | * Logs the report of a failed hardware. |
| 1172 | * |
| 1173 | * Logged from: |
| 1174 | * Vendor HALs. |
| 1175 | * |
| 1176 | */ |
| 1177 | message HardwareFailed { |
| 1178 | enum HardwareType { |
| 1179 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1180 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1181 | HARDWARE_FAILED_CODEC = 2; |
| 1182 | HARDWARE_FAILED_SPEAKER = 3; |
| 1183 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1184 | } |
| 1185 | optional HardwareType hardware_type = 1; |
| 1186 | |
| 1187 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1188 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1189 | * referring to board-specific numbering schemes. |
| 1190 | */ |
| 1191 | optional int32 hardware_location = 2; |
| 1192 | |
| 1193 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1194 | * It should use the enum values defined below. |
| 1195 | */ |
| 1196 | enum MicrophoneFailureCode { |
| 1197 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1198 | } |
| 1199 | enum CodecFailureCode { |
| 1200 | CODEC_FAILURE_COMPLETE = 0; |
| 1201 | } |
| 1202 | enum SpeakerFailureCode { |
| 1203 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1204 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1205 | SPEAKER_FAILURE_SHORT = 2; |
| 1206 | } |
| 1207 | enum FingerprintFailureCode { |
| 1208 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1209 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1210 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1211 | } |
| 1212 | optional int32 failure_code = 3; |
| 1213 | } |
| 1214 | |
| 1215 | /** |
| 1216 | * Log an event when the device has been physically dropped. |
| 1217 | * Reported from the /vendor partition. |
| 1218 | */ |
| 1219 | message PhysicalDropDetected { |
| 1220 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1221 | optional int32 confidence_pctg = 1; |
| 1222 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1223 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1224 | // Duration of freefall in ms |
| 1225 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1226 | } |
| 1227 | |
| 1228 | /** |
| 1229 | * Log bucketed battery charge cycles. |
| 1230 | * |
| 1231 | * Each bucket represents cycles of the battery past |
| 1232 | * a given charge point. For example, bucket 1 is the |
| 1233 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1234 | * |
| 1235 | * Logged from: |
| 1236 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1237 | */ |
| 1238 | message ChargeCyclesReported { |
| 1239 | optional int32 cycle_bucket_1 = 1; |
| 1240 | optional int32 cycle_bucket_2 = 2; |
| 1241 | optional int32 cycle_bucket_3 = 3; |
| 1242 | optional int32 cycle_bucket_4 = 4; |
| 1243 | optional int32 cycle_bucket_5 = 5; |
| 1244 | optional int32 cycle_bucket_6 = 6; |
| 1245 | optional int32 cycle_bucket_7 = 7; |
| 1246 | optional int32 cycle_bucket_8 = 8; |
| 1247 | } |
| 1248 | |
| 1249 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1250 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1251 | * |
| 1252 | * Logged from: |
| 1253 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1254 | */ |
| 1255 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1256 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1257 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1258 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1259 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1260 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1261 | } |
| 1262 | |
| 1263 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1264 | * Logs phone signal strength changes. |
| 1265 | * |
| 1266 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1267 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1268 | */ |
| 1269 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1270 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1271 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1272 | } |
| 1273 | |
| 1274 | /** |
| 1275 | * Logs that a setting was updated. |
| 1276 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1277 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1278 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1279 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1280 | */ |
| 1281 | message SettingChanged { |
| 1282 | // The name of the setting. |
| 1283 | optional string setting = 1; |
| 1284 | |
| 1285 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1286 | optional string value = 2; |
| 1287 | |
| 1288 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1289 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1290 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1291 | // The +/- feature is currently only used for location_providers_allowed. |
| 1292 | optional string new_value = 3; |
| 1293 | |
| 1294 | // The previous value of this setting. |
| 1295 | optional string prev_value = 4; |
| 1296 | |
| 1297 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1298 | optional string tag = 5; |
| 1299 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1300 | // True if this setting with tag should be resettable. |
| 1301 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1302 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1303 | // The associated user (for multi-user feature). Defined in android/os/UserHandle.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1304 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1305 | |
| 1306 | enum ChangeReason { |
| 1307 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1308 | DELETED = 2; |
| 1309 | } |
| 1310 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1311 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1312 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1313 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1314 | * Logs activity going to foreground or background |
| 1315 | * |
| 1316 | * Logged from: |
| 1317 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1318 | */ |
| 1319 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1320 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1321 | optional string pkg_name = 2; |
| 1322 | optional string class_name = 3; |
| 1323 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1324 | enum State { |
| 1325 | BACKGROUND = 0; |
| 1326 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1327 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1328 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1329 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1330 | |
| 1331 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1332 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1333 | * Logged from: |
| 1334 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1335 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1336 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1337 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1338 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1339 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1340 | |
| 1341 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1342 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1343 | optional string process_name = 3; |
| 1344 | |
| 1345 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1346 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1347 | |
| 1348 | optional string package_name = 5; |
| 1349 | |
| 1350 | enum InstantApp { |
| 1351 | UNAVAILABLE = 0; |
| 1352 | FALSE = 1; |
| 1353 | TRUE = 2; |
| 1354 | } |
| 1355 | optional InstantApp is_instant_app = 6; |
| 1356 | |
| 1357 | enum ForegroundState { |
| 1358 | UNKNOWN = 0; |
| 1359 | BACKGROUND = 1; |
| 1360 | FOREGROUND = 2; |
| 1361 | } |
| 1362 | optional ForegroundState foreground_state = 7; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1363 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1364 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1365 | /** |
| 1366 | * Logs when a WTF (What a Terrible Failure) happened. |
| 1367 | * Logged from: |
| 1368 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1369 | */ |
| 1370 | message WTFOccurred { |
| 1371 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1372 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1373 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1374 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1375 | // The name of the process. |
| 1376 | // system_server if it is not by an app |
| 1377 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1378 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1379 | // The pid if available. -1 means not available. |
| 1380 | optional sint32 pid = 4; |
| 1381 | } |
| 1382 | |
| 1383 | /** |
| 1384 | * Logs when system server reports low memory. |
| 1385 | * Logged from: |
| 1386 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1387 | */ |
| 1388 | message LowMemReported { |
| 1389 | } |
| 1390 | |
| 1391 | /** |
| 1392 | * Logs when an app ANR (App Not Responding) occurs. |
| 1393 | * Logged from: |
| 1394 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 1395 | */ |
| 1396 | message ANROccurred { |
| 1397 | optional int32 uid = 1 [(is_uid) = true]; |
| 1398 | |
| 1399 | optional string process_name = 2; |
| 1400 | |
| 1401 | optional string short_component_name = 3; |
| 1402 | |
| 1403 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1404 | |
| 1405 | enum InstantApp { |
| 1406 | UNAVAILABLE = 0; |
| 1407 | FALSE = 1; |
| 1408 | TRUE = 2; |
| 1409 | } |
| 1410 | optional InstantApp is_instant_app = 5; |
| 1411 | |
| 1412 | enum ForegroundState { |
| 1413 | UNKNOWN = 0; |
| 1414 | BACKGROUND = 1; |
| 1415 | FOREGROUND = 2; |
| 1416 | } |
| 1417 | optional ForegroundState foreground_state = 6; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1418 | } |
| 1419 | |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 1420 | /** |
| 1421 | * Logs when the vibrator state changes. |
| 1422 | * Logged from: |
| 1423 | * frameworks/base/services/core/java/com/android/server/VibratorService.java |
| 1424 | */ |
| 1425 | message VibratorStateChanged { |
| 1426 | repeated AttributionNode attribution_node = 1; |
| 1427 | |
| 1428 | enum State { |
| 1429 | OFF = 0; |
| 1430 | ON = 1; |
| 1431 | } |
| 1432 | optional State state = 2; |
| 1433 | |
| 1434 | // Duration (in milliseconds) requested to keep the vibrator on. |
| 1435 | // Only applicable for State == ON. |
| 1436 | optional int64 duration_millis = 3; |
| 1437 | } |
| 1438 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1439 | /* |
| 1440 | * Allows other apps to push events into statsd. |
| 1441 | * Logged from: |
| 1442 | * frameworks/base/core/java/android/util/StatsLog.java |
| 1443 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1444 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1445 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1446 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1447 | |
| 1448 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 1449 | optional int32 label = 2; |
| 1450 | |
| 1451 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 1452 | // predicates for the metrics). |
| 1453 | enum State { |
| 1454 | UNKNOWN = 0; |
| 1455 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 1456 | STOP = 2; |
| 1457 | START = 3; |
| 1458 | } |
| 1459 | optional State state = 3; |
| 1460 | } |
| 1461 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1462 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1463 | * Logs when statsd detects an anomaly. |
| 1464 | * |
| 1465 | * Logged from: |
| 1466 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 1467 | */ |
| 1468 | message AnomalyDetected { |
| 1469 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1470 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1471 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1472 | // Id of the config whose anomaly detection alert fired. |
| 1473 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1474 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1475 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 1476 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1477 | } |
| 1478 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1479 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1480 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1481 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1482 | |
| 1483 | // The app package name. |
| 1484 | optional string pkg_name = 2; |
| 1485 | |
| 1486 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1487 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1488 | WARM = 1; |
| 1489 | HOT = 2; |
| 1490 | COLD = 3; |
| 1491 | } |
| 1492 | // The transition type. |
| 1493 | optional TransitionType type = 3; |
| 1494 | |
| 1495 | // The activity name. |
| 1496 | optional string activity_name = 4; |
| 1497 | |
| 1498 | // The name of the calling app. Empty if not set. |
| 1499 | optional string calling_pkg_name = 5; |
| 1500 | |
| 1501 | // Whether the app is an instant app. |
| 1502 | optional bool is_instant_app = 6; |
| 1503 | |
| 1504 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1505 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1506 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 1507 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1508 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1509 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1510 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1511 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1512 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1513 | optional int32 bind_application_delay_millis = 11; |
| 1514 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1515 | |
| 1516 | // Empty if not set. |
| 1517 | optional string launch_token = 13; |
| 1518 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1519 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1520 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1521 | |
| 1522 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1523 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1524 | } |
| 1525 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1526 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1527 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1528 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1529 | |
| 1530 | // The app package name. |
| 1531 | optional string pkg_name = 2; |
| 1532 | |
| 1533 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1534 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1535 | WARM = 1; |
| 1536 | HOT = 2; |
| 1537 | COLD = 3; |
| 1538 | } |
| 1539 | // The transition type. |
| 1540 | optional TransitionType type = 3; |
| 1541 | |
| 1542 | // The activity name. |
| 1543 | optional string activity_name = 4; |
| 1544 | } |
| 1545 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1546 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1547 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1548 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1549 | |
| 1550 | // The app package name. |
| 1551 | optional string pkg_name = 2; |
| 1552 | |
| 1553 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1554 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1555 | WITH_BUNDLE = 1; |
| 1556 | WITHOUT_BUNDLE = 2; |
| 1557 | } |
| 1558 | // The transition type. |
| 1559 | optional TransitionType type = 3; |
| 1560 | |
| 1561 | // The activity name. |
| 1562 | optional string activity_name = 4; |
| 1563 | |
| 1564 | optional bool transition_process_running = 5; |
| 1565 | |
| 1566 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1567 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1568 | } |
| 1569 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1570 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1571 | * Logs a picture-in-picture action |
| 1572 | * Logged from: |
| 1573 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1574 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 1575 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 1576 | */ |
| 1577 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1578 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1579 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1580 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1581 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1582 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1583 | enum State { |
| 1584 | ENTERED = 1; |
| 1585 | EXPANDED_TO_FULL_SCREEN = 2; |
| 1586 | MINIMIZED = 3; |
| 1587 | DISMISSED = 4; |
| 1588 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1589 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1590 | } |
| 1591 | |
| 1592 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1593 | * Logs overlay action |
| 1594 | * Logged from: |
| 1595 | * services/core/java/com/android/server/wm/Session.java |
| 1596 | */ |
| 1597 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1598 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1599 | |
| 1600 | optional string package_name = 2; |
| 1601 | |
| 1602 | optional bool using_alert_window = 3; |
| 1603 | |
| 1604 | enum State { |
| 1605 | ENTERED = 1; |
| 1606 | EXITED = 2; |
| 1607 | } |
| 1608 | optional State state = 4; |
| 1609 | } |
| 1610 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1611 | /* |
| 1612 | * Logs foreground service starts and stops. |
| 1613 | * Note that this is not when a service starts or stops, but when it is |
| 1614 | * considered foreground. |
| 1615 | * Logged from |
| 1616 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 1617 | */ |
| 1618 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1619 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1620 | // package_name + "/" + class_name |
| 1621 | optional string short_name = 2; |
| 1622 | |
| 1623 | enum State { |
| 1624 | ENTER = 1; |
| 1625 | EXIT = 2; |
| 1626 | } |
| 1627 | optional State state = 3; |
| 1628 | } |
| 1629 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1630 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1631 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1632 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1633 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1634 | * |
| 1635 | * Logged from: |
| 1636 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1637 | */ |
| 1638 | message IsolatedUidChanged { |
| 1639 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1640 | // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd. |
Bookatz | 3c64886 | 2018-05-25 13:32:43 -0700 | [diff] [blame] | 1641 | // This field is ignored when event == REMOVED. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1642 | optional int32 parent_uid = 1; |
| 1643 | |
| 1644 | optional int32 isolated_uid = 2; |
| 1645 | |
| 1646 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1647 | enum Event { |
| 1648 | REMOVED = 0; |
| 1649 | CREATED = 1; |
| 1650 | } |
| 1651 | optional Event event = 3; |
| 1652 | } |
| 1653 | |
| 1654 | /* |
| 1655 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1656 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1657 | * and processed by WakeupController.cpp. |
| 1658 | */ |
| 1659 | message PacketWakeupOccurred { |
| 1660 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1661 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1662 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1663 | // The interface name on which the packet was received. |
| 1664 | optional string iface = 2; |
| 1665 | // The ethertype value of the packet. |
| 1666 | optional int32 ethertype = 3; |
| 1667 | // String representation of the destination MAC address of the packet. |
| 1668 | optional string destination_hardware_address = 4; |
| 1669 | // String representation of the source address of the packet if this was an IP packet. |
| 1670 | optional string source_ip = 5; |
| 1671 | // String representation of the destination address of the packet if this was an IP packet. |
| 1672 | optional string destination_ip = 6; |
| 1673 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1674 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1675 | // families. |
| 1676 | optional int32 ip_next_header = 7; |
| 1677 | // The source port if this was a TCP or UDP packet. |
| 1678 | optional int32 source_port = 8; |
| 1679 | // The destination port if this was a TCP or UDP packet. |
| 1680 | optional int32 destination_port = 9; |
| 1681 | } |
| 1682 | |
| 1683 | /* |
| 1684 | * Logs the memory stats for an app on startup. |
| 1685 | * Logged from: |
| 1686 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1687 | */ |
| 1688 | message AppStartMemoryStateCaptured { |
| 1689 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1690 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1691 | |
| 1692 | // The process name. |
| 1693 | optional string process_name = 2; |
| 1694 | |
| 1695 | // The activity name. |
| 1696 | optional string activity_name = 3; |
| 1697 | |
| 1698 | // # of page-faults |
| 1699 | optional int64 pgfault = 4; |
| 1700 | |
| 1701 | // # of major page-faults |
| 1702 | optional int64 pgmajfault = 5; |
| 1703 | |
| 1704 | // RSS |
| 1705 | optional int64 rss_in_bytes = 6; |
| 1706 | |
| 1707 | // CACHE |
| 1708 | optional int64 cache_in_bytes = 7; |
| 1709 | |
| 1710 | // SWAP |
| 1711 | optional int64 swap_in_bytes = 8; |
| 1712 | } |
| 1713 | |
| 1714 | /* |
| 1715 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1716 | * for LMK event. |
| 1717 | * Logged from: |
| 1718 | * system/core/lmkd/lmkd.c |
| 1719 | */ |
| 1720 | message LmkStateChanged { |
| 1721 | enum State { |
| 1722 | UNKNOWN = 0; |
| 1723 | START = 1; |
| 1724 | STOP = 2; |
| 1725 | } |
| 1726 | optional State state = 1; |
| 1727 | } |
| 1728 | |
| 1729 | /* |
| 1730 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1731 | * Logged from: |
| 1732 | * system/core/lmkd/lmkd.c |
| 1733 | */ |
| 1734 | message LmkKillOccurred { |
| 1735 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1736 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1737 | |
| 1738 | // The process name. |
| 1739 | optional string process_name = 2; |
| 1740 | |
| 1741 | // oom adj score. |
| 1742 | optional int32 oom_score = 3; |
| 1743 | |
| 1744 | // # of page-faults |
| 1745 | optional int64 pgfault = 4; |
| 1746 | |
| 1747 | // # of major page-faults |
| 1748 | optional int64 pgmajfault = 5; |
| 1749 | |
| 1750 | // RSS |
| 1751 | optional int64 rss_in_bytes = 6; |
| 1752 | |
| 1753 | // CACHE |
| 1754 | optional int64 cache_in_bytes = 7; |
| 1755 | |
| 1756 | // SWAP |
| 1757 | optional int64 swap_in_bytes = 8; |
| 1758 | } |
| 1759 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1760 | /* |
| 1761 | * Logs when the ActivityManagerService detects that an app died. |
| 1762 | * |
| 1763 | * Logged from: |
| 1764 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1765 | */ |
| 1766 | message AppDied { |
| 1767 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1768 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1769 | } |
| 1770 | |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 1771 | /** |
| 1772 | * An atom for generic metrics logging. Available from Android Q. |
| 1773 | */ |
| 1774 | message GenericAtom { |
| 1775 | // The uid of the application that sent this custom atom. |
| 1776 | optional int32 uid = 1 [(is_uid) = true]; |
| 1777 | |
| 1778 | // An event_id indicates the type of event. |
Howard Ro | 0546d54 | 2018-08-30 16:23:44 -0700 | [diff] [blame] | 1779 | optional android.os.statsd.EventType event_id = 2; |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 1780 | } |
| 1781 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1782 | ////////////////////////////////////////////////////////////////////// |
| 1783 | // Pulled atoms below this line // |
| 1784 | ////////////////////////////////////////////////////////////////////// |
| 1785 | |
| 1786 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1787 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1788 | * |
| 1789 | * Pulled from: |
| 1790 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1791 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1792 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1793 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1794 | |
| 1795 | optional int64 rx_bytes = 2; |
| 1796 | |
| 1797 | optional int64 rx_packets = 3; |
| 1798 | |
| 1799 | optional int64 tx_bytes = 4; |
| 1800 | |
| 1801 | optional int64 tx_packets = 5; |
| 1802 | } |
| 1803 | |
| 1804 | /** |
| 1805 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1806 | * |
| 1807 | * Pulled from: |
| 1808 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1809 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1810 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1811 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1812 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1813 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1814 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1815 | |
| 1816 | optional int64 rx_bytes = 3; |
| 1817 | |
| 1818 | optional int64 rx_packets = 4; |
| 1819 | |
| 1820 | optional int64 tx_bytes = 5; |
| 1821 | |
| 1822 | optional int64 tx_packets = 6; |
| 1823 | } |
| 1824 | |
| 1825 | /** |
| 1826 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 1827 | * |
| 1828 | * Pulled from: |
| 1829 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1830 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1831 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1832 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1833 | |
| 1834 | optional int64 rx_bytes = 2; |
| 1835 | |
| 1836 | optional int64 rx_packets = 3; |
| 1837 | |
| 1838 | optional int64 tx_bytes = 4; |
| 1839 | |
| 1840 | optional int64 tx_packets = 5; |
| 1841 | } |
| 1842 | |
| 1843 | /** |
| 1844 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1845 | * |
| 1846 | * Pulled from: |
| 1847 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1848 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1849 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1850 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1851 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1852 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 1853 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1854 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1855 | |
| 1856 | optional int64 rx_bytes = 3; |
| 1857 | |
| 1858 | optional int64 rx_packets = 4; |
| 1859 | |
| 1860 | optional int64 tx_bytes = 5; |
| 1861 | |
| 1862 | optional int64 tx_packets = 6; |
| 1863 | } |
| 1864 | |
| 1865 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1866 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 1867 | * |
| 1868 | * Pulled from: |
| 1869 | * StatsCompanionService |
| 1870 | */ |
| 1871 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1872 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1873 | |
| 1874 | optional int64 rx_bytes = 2; |
| 1875 | |
| 1876 | optional int64 tx_bytes = 3; |
| 1877 | } |
| 1878 | |
| 1879 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1880 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1881 | * android/internal/os/KernelWakelockStats.java |
| 1882 | * |
| 1883 | * Pulled from: |
| 1884 | * StatsCompanionService using KernelWakelockReader. |
| 1885 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1886 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1887 | optional string name = 1; |
| 1888 | |
| 1889 | optional int32 count = 2; |
| 1890 | |
| 1891 | optional int32 version = 3; |
| 1892 | |
| 1893 | optional int64 time = 4; |
| 1894 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1895 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1896 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1897 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1898 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1899 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1900 | * hardware/interfaces/power/1.1/types.hal |
| 1901 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1902 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1903 | // Subsystem name |
| 1904 | optional string subsystem_name = 1; |
| 1905 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 1906 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 1907 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1908 | // 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] | 1909 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1910 | // 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] | 1911 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1912 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1913 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1914 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1915 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1916 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1917 | * starts from highest to lowest. The value should be monotonically |
| 1918 | * increasing since boot. However, if there is a cpu |
| 1919 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1920 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1921 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1922 | optional uint32 cluster = 1; |
| 1923 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1924 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1925 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1926 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1927 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1928 | * Pulls Cpu Time Per Uid. |
| 1929 | * Note that isolated process uid time should be attributed to host uids. |
| 1930 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1931 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1932 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1933 | optional uint64 user_time_millis = 2; |
| 1934 | optional uint64 sys_time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1935 | } |
| 1936 | |
| 1937 | /** |
| 1938 | * Pulls Cpu Time Per Uid per frequency. |
| 1939 | * Note that isolated process uid time should be attributed to host uids. |
| 1940 | * For each uid, we order the time by descending frequencies. |
| 1941 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1942 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1943 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 1944 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1945 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1946 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1947 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1948 | /** |
| 1949 | * Pulls Wifi Controller Activity Energy Info |
| 1950 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1951 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1952 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1953 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1954 | // stack reported state |
| 1955 | // TODO: replace this with proto enum |
| 1956 | optional int32 stack_state = 2; |
| 1957 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1958 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1959 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1960 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1961 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1962 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1963 | // product of current(mA), voltage(V) and time(ms) |
| 1964 | optional uint64 controller_energy_used = 6; |
| 1965 | } |
| 1966 | |
| 1967 | /** |
| 1968 | * Pulls Modem Activity Energy Info |
| 1969 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1970 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1971 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1972 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1973 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1974 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1975 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1976 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1977 | /** |
| 1978 | * Tx power index |
| 1979 | * index 0 = tx_power < 0dBm |
| 1980 | * index 1 = 0dBm < tx_power < 5dBm |
| 1981 | * index 2 = 5dBm < tx_power < 15dBm |
| 1982 | * index 3 = 15dBm < tx_power < 20dBm |
| 1983 | * index 4 = tx_power > 20dBm |
| 1984 | */ |
| 1985 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1986 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1987 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1988 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1989 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1990 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1991 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1992 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1993 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1994 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1995 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1996 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1997 | // product of current(mA), voltage(V) and time(ms) |
| 1998 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1999 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2000 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2001 | /** |
| 2002 | * Pulls Bluetooth Activity Energy Info |
| 2003 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 2004 | */ |
| 2005 | message BluetoothActivityInfo { |
| 2006 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2007 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2008 | // bluetooth stack state |
| 2009 | optional int32 bluetooth_stack_state = 2; |
| 2010 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2011 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2012 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2013 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2014 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2015 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2016 | // product of current(mA), voltage(V) and time(ms) |
| 2017 | optional uint64 energy_used = 6; |
| 2018 | } |
| 2019 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2020 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2021 | * Logs the memory stats for a process. |
| 2022 | */ |
| 2023 | message ProcessMemoryState { |
| 2024 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2025 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2026 | |
| 2027 | // The process name. |
| 2028 | optional string process_name = 2; |
| 2029 | |
| 2030 | // oom adj score. |
| 2031 | optional int32 oom_score = 3; |
| 2032 | |
| 2033 | // # of page-faults |
| 2034 | optional int64 pgfault = 4; |
| 2035 | |
| 2036 | // # of major page-faults |
| 2037 | optional int64 pgmajfault = 5; |
| 2038 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2039 | // RSS |
| 2040 | optional int64 rss_in_bytes = 6; |
| 2041 | |
| 2042 | // CACHE |
| 2043 | optional int64 cache_in_bytes = 7; |
| 2044 | |
| 2045 | // SWAP |
| 2046 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2047 | } |
| 2048 | |
| 2049 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2050 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2051 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2052 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2053 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2054 | } |
| 2055 | |
| 2056 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2057 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2058 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2059 | message SystemUptime { |
| 2060 | // Milliseconds since the system was booted. |
| 2061 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2062 | // for external input). |
| 2063 | // 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] | 2064 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2065 | } |
| 2066 | |
| 2067 | /* |
| 2068 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2069 | * active: X (X is # cores) |
| 2070 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2071 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2072 | * ... |
| 2073 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2074 | * The file contains a monotonically increasing count of time for a single boot. |
| 2075 | */ |
| 2076 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2077 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2078 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2079 | } |
| 2080 | |
| 2081 | /** |
| 2082 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2083 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2084 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2085 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2086 | * ... |
| 2087 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2088 | * The file contains a monotonically increasing count of time for a single boot. |
| 2089 | */ |
| 2090 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2091 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2092 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2093 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2094 | } |
| 2095 | |
| 2096 | /* |
| 2097 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2098 | */ |
| 2099 | message DiskSpace { |
| 2100 | // available bytes in data partition |
| 2101 | optional uint64 data_available_bytes = 1; |
| 2102 | // available bytes in system partition |
| 2103 | optional uint64 system_available_bytes = 2; |
| 2104 | // available bytes in download cache or temp directories |
| 2105 | optional uint64 temp_available_bytes = 3; |
| 2106 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2107 | |
| 2108 | /** |
| 2109 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2110 | * Pulled from: |
| 2111 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2112 | */ |
| 2113 | message RemainingBatteryCapacity { |
| 2114 | optional int32 charge_uAh = 1; |
| 2115 | } |
| 2116 | |
| 2117 | /** |
| 2118 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2119 | * Pulled from: |
| 2120 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2121 | */ |
| 2122 | message FullBatteryCapacity { |
| 2123 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2124 | } |
| 2125 | |
| 2126 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2127 | * Pulls the temperature of various parts of the device. |
| 2128 | * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2129 | * |
| 2130 | * Pulled from: |
| 2131 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2132 | */ |
| 2133 | message Temperature { |
| 2134 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 2135 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2136 | |
| 2137 | // The name of the temperature source. Eg. CPU0 |
| 2138 | optional string sensor_name = 2; |
| 2139 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2140 | // Temperature in tenths of a degree C. |
| 2141 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2142 | } |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2143 | |
| 2144 | /** |
| 2145 | * Pulls the statistics of calls to Binder. |
| 2146 | * |
| 2147 | * Binder stats are cumulative from boot unless somebody reset the data using |
| 2148 | * > adb shell dumpsys binder_calls_stats --reset |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 2149 | * |
| 2150 | * Next tag: 14 |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2151 | */ |
| 2152 | message BinderCalls { |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 2153 | optional int32 uid = 1 [(is_uid) = true]; |
| 2154 | // Fully qualified class name of the API call. |
| 2155 | // |
| 2156 | // This is a system server class name. |
| 2157 | // |
| 2158 | // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid |
| 2159 | // gets recycled and we have isolated uids, we might attribute the data incorrectly. |
| 2160 | // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less |
| 2161 | // commonly used APIs. |
| 2162 | optional string service_class_name = 2; |
| 2163 | // Method name of the API call. It can also be a transaction code if we cannot |
| 2164 | // resolve it to a name. See Binder#getTransactionName. |
| 2165 | // |
| 2166 | // This is a system server method name. |
| 2167 | optional string service_method_name = 3; |
| 2168 | // Total number of API calls. |
| 2169 | optional int64 call_count = 4; |
| 2170 | // True if the screen was interactive PowerManager#isInteractive at the end of the call. |
| 2171 | optional bool screen_interactive = 13; |
| 2172 | // Total number of API calls we have data recorded for. If we collected data for all the calls, |
| 2173 | // call_count will be equal to recorded_call_count. |
| 2174 | // |
| 2175 | // If recorded_call_count is different than call_count, it means data collection has been |
| 2176 | // sampled. All the fields below will be sampled in this case. |
| 2177 | optional int64 recorded_call_count = 12; |
| 2178 | // Number of exceptions thrown by the API. |
| 2179 | optional int64 recorded_exception_count = 5; |
| 2180 | // Total latency of all API calls. |
| 2181 | // Average can be computed using total_latency_micros / recorded_call_count. |
| 2182 | optional int64 recorded_total_latency_micros = 6; |
| 2183 | // Maximum latency of one API call. |
| 2184 | optional int64 recorded_max_latency_micros = 7; |
| 2185 | // Total CPU usage of all API calls. |
| 2186 | // Average can be computed using total_cpu_micros / recorded_call_count. |
| 2187 | // Total can be computed using total_cpu_micros / recorded_call_count * call_count. |
| 2188 | optional int64 recorded_total_cpu_micros = 8; |
| 2189 | // Maximum CPU usage of one API call. |
| 2190 | optional int64 recorded_max_cpu_micros = 9; |
| 2191 | // Maximum parcel reply size of one API call. |
| 2192 | optional int64 recorded_max_reply_size_bytes = 10; |
| 2193 | // Maximum parcel request size of one API call. |
| 2194 | optional int64 recorded_max_request_size_bytes = 11; |
| 2195 | } |
| 2196 | |
| 2197 | /** |
| 2198 | * Pulls the statistics of exceptions during calls to Binder. |
| 2199 | * |
| 2200 | * Binder stats are cumulative from boot unless somebody reset the data using |
| 2201 | * > adb shell dumpsys binder_calls_stats --reset |
| 2202 | */ |
| 2203 | message BinderCallsExceptions { |
| 2204 | // Exception class name, e.g. java.lang.IllegalArgumentException. |
| 2205 | // |
| 2206 | // This is an exception class name thrown by the system server. |
| 2207 | optional string exception_class_name = 1; |
| 2208 | // Total number of exceptions. |
| 2209 | optional int64 exception_count = 2; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2210 | } |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 2211 | |
| 2212 | message LooperStats { |
| 2213 | // Currently not collected and always set to 0. |
| 2214 | optional int32 uid = 1 [(is_uid) = true]; |
| 2215 | |
| 2216 | // Fully qualified class name of the handler target class. |
| 2217 | // |
| 2218 | // This field does not contain PII. This is a system server class name. |
| 2219 | optional string handler_class_name = 2; |
| 2220 | |
| 2221 | // The name of the thread that runs the Looper. |
| 2222 | // |
| 2223 | // This field does not contain PII. This is a system server thread name. |
| 2224 | optional string looper_thread_name = 3; |
| 2225 | |
| 2226 | // The name of the dispatched message. |
| 2227 | // |
| 2228 | // This field does not contain PII. This is a system server constant or class |
| 2229 | // name. |
| 2230 | optional string message_name = 4; |
| 2231 | |
| 2232 | // Total number of successfully dispatched messages. |
| 2233 | optional int64 message_count = 5; |
| 2234 | |
| 2235 | // Total number of messages that failed dispatching. |
| 2236 | optional int64 exception_count = 6; |
| 2237 | |
| 2238 | // Total number of processed messages we have data recorded for. If we |
| 2239 | // collected data for all the messages, message_count will be equal to |
| 2240 | // recorded_message_count. |
| 2241 | // |
| 2242 | // If recorded_message_count is different than message_count, it means data |
| 2243 | // collection has been sampled. All the fields below will be sampled in this |
| 2244 | // case. |
| 2245 | optional int64 recorded_message_count = 7; |
| 2246 | |
| 2247 | // Total latency of all processed messages. |
| 2248 | // Average can be computed using recorded_total_latency_micros / |
| 2249 | // recorded_message_count. |
| 2250 | optional int64 recorded_total_latency_micros = 8; |
| 2251 | |
| 2252 | // Total CPU usage of all processed message. |
| 2253 | // Average can be computed using recorded_total_cpu_micros / |
| 2254 | // recorded_message_count. Total can be computed using |
| 2255 | // recorded_total_cpu_micros / recorded_message_count * call_count. |
| 2256 | optional int64 recorded_total_cpu_micros = 9; |
| 2257 | } |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame^] | 2258 | |
| 2259 | /** |
| 2260 | * Pulls disk information, such as write speed and latency. |
| 2261 | */ |
| 2262 | message DiskStats { |
| 2263 | // Time taken to open, write 512B to, and close a file. |
| 2264 | // -1 if error performing the check. |
| 2265 | optional int64 data_write_latency_millis = 1; |
| 2266 | |
| 2267 | optional bool file_based_encryption = 2; |
| 2268 | |
| 2269 | // Recent disk write speed in kB/s. |
| 2270 | // -1 if error querying storageed. |
| 2271 | // 0 if data is unavailable. |
| 2272 | optional int32 recent_disk_write_speed = 3; |
| 2273 | } |
| 2274 | |
| 2275 | |
| 2276 | /** |
| 2277 | * Free and total bytes of the Data, Cache, and System partition. |
| 2278 | */ |
| 2279 | message DirectoryUsage { |
| 2280 | enum Directory { |
| 2281 | UNKNOWN = 0; |
| 2282 | DATA = 1; |
| 2283 | CACHE = 2; |
| 2284 | SYSTEM = 3; |
| 2285 | } |
| 2286 | optional Directory directory = 1; |
| 2287 | optional int64 free_bytes = 2; |
| 2288 | optional int64 total_bytes = 3; |
| 2289 | } |
| 2290 | |
| 2291 | |
| 2292 | /** |
| 2293 | * Size of an application: apk size, data size, and cache size. |
| 2294 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 2295 | * Information is only reported for apps with the primary user (user 0). |
| 2296 | * Sizes are aggregated by package name. |
| 2297 | */ |
| 2298 | message AppSize { |
| 2299 | // Including uids will involve modifying diskstats logic. |
| 2300 | optional string package_name = 1; |
| 2301 | // App size in bytes. -1 if unavailable. |
| 2302 | optional int64 app_size_bytes = 2; |
| 2303 | // App data size in bytes. -1 if unavailable. |
| 2304 | optional int64 app_data_size_bytes = 3; |
| 2305 | // App cache size in bytes. -1 if unavailable. |
| 2306 | optional int64 app_cache_size_bytes = 4; |
| 2307 | // Time that the cache file was produced. |
| 2308 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 2309 | optional int64 cache_time_millis = 5; |
| 2310 | } |
| 2311 | |
| 2312 | |
| 2313 | /** |
| 2314 | * Size of a particular category. Eg: photos, videos. |
| 2315 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 2316 | */ |
| 2317 | message CategorySize { |
| 2318 | enum Category { |
| 2319 | UNKNOWN = 0; |
| 2320 | APP_SIZE = 1; |
| 2321 | APP_DATA_SIZE = 2; |
| 2322 | APP_CACHE_SIZE = 3; |
| 2323 | PHOTOS = 4; |
| 2324 | VIDEOS = 5; |
| 2325 | AUDIO = 6; |
| 2326 | DOWNLOADS = 7; |
| 2327 | SYSTEM = 8; |
| 2328 | OTHER = 9; |
| 2329 | } |
| 2330 | optional Category category = 1; |
| 2331 | // Category size in bytes. |
| 2332 | optional int64 size_bytes = 2; |
| 2333 | // Time that the cache file was produced. |
| 2334 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 2335 | optional int64 cache_time_millis = 3; |
| 2336 | } |