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