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"; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame^] | 27 | import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/net/networkcapabilities.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 31 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 32 | import "frameworks/base/core/proto/android/stats/launcher/launcher.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 34 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 35 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 36 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 37 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 38 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 39 | * raw stats log events from the Android system, also known as "atoms." |
| 40 | * |
| 41 | * This field contains a single oneof with all of the available messages. |
| 42 | * The stats-log-api-gen tool runs as part of the Android build and |
| 43 | * generates the android.util.StatsLog class, which contains the constants |
| 44 | * and methods that Android uses to log. |
| 45 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 46 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 47 | * Instead, statsd on Android constructs these messages synthetically, |
| 48 | * in the format defined here and in stats_log.proto. |
| 49 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 50 | message Atom { |
| 51 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 52 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 53 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 54 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 55 | // 3 is available for use |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 56 | BleScanResultReceived ble_scan_result_received = 4; |
| 57 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 58 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 59 | SyncStateChanged sync_state_changed = 7; |
| 60 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 61 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 62 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 63 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 64 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 65 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 66 | // 14 - 18 are available |
| 67 | LauncherUIChanged launcher_event = 19; |
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; |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 128 | PhoneServiceStateChanged phone_service_state_changed = 94; |
| 129 | PhoneStateChanged phone_state_changed = 95; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 130 | LowMemReported low_mem_reported = 81; |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 131 | NetworkDnsEventReported network_dns_event_reported = 116; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 132 | DataStallEvent data_stall_event = 121; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame^] | 133 | BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 134 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 135 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 136 | // Pulled events will start at field 10000. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 137 | // Next: 10022 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 138 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 139 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 140 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 141 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 142 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 143 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 144 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 145 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 146 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 147 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 148 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 149 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 150 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 151 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 152 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 153 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 154 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 155 | CpuActiveTime cpu_active_time = 10016; |
| 156 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 157 | DiskSpace disk_space = 10018; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 158 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 159 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 160 | Temperature temperature = 10021; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 161 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 162 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 163 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 164 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 165 | // Field numbers 200,000 and above are reserved for future use; do not use them at all. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 166 | } |
| 167 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 168 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 169 | * This proto represents a node of an attribution chain. |
| 170 | * Note: All attribution chains are represented as a repeated field of type |
| 171 | * AttributionNode. It is understood that in such arrays, the order is that |
| 172 | * 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] | 173 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 174 | message AttributionNode { |
| 175 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 176 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 177 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 178 | // The (optional) string tag for an element in the attribution chain. If the |
| 179 | // element has no tag, it is encoded as an empty string. |
| 180 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 181 | } |
| 182 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 183 | /* |
| 184 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 185 | * 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] | 186 | * |
| 187 | * RULES: |
| 188 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 189 | * Skipping field ids is not allowed. |
| 190 | * - These form an API, so renaming, renumbering or removing fields is |
| 191 | * not allowed between android releases. (This is not currently enforced, |
| 192 | * but there will be a tool to enforce this restriction). |
| 193 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 194 | * are allowed (yet). The bytes type is also not allowed. |
| 195 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 196 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 197 | * - 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] | 198 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 199 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 200 | * annotation. The generated code on android will be represented by UIDs, |
| 201 | * and those UIDs will be translated in xxx to those strings. |
| 202 | * |
| 203 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 204 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 205 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 206 | * ***************************************************************************** |
| 207 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 208 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 209 | /** |
| 210 | * Logs when the screen state changes. |
| 211 | * |
| 212 | * Logged from: |
| 213 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 214 | */ |
| 215 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 216 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 217 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 218 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 219 | |
| 220 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 221 | * Logs that the state of a process state, as per the activity manager, has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 222 | * |
| 223 | * Logged from: |
| 224 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 225 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 226 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 227 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 228 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 229 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 230 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 234 | * Logs that a process started, finished, crashed, or ANRed. |
| 235 | * |
| 236 | * Logged from: |
| 237 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 238 | */ |
| 239 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 240 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 241 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 242 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 243 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 244 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 245 | // What lifecycle state the process changed to. |
| 246 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 247 | enum State { |
| 248 | FINISHED = 0; |
| 249 | STARTED = 1; |
| 250 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 251 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 252 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 253 | } |
| 254 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 255 | /** |
| 256 | * Logs when the ble scan state changes. |
| 257 | * |
| 258 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 259 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 260 | */ |
| 261 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 262 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 263 | |
| 264 | enum State { |
| 265 | OFF = 0; |
| 266 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 267 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 268 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 269 | } |
| 270 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 271 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 272 | // Does the scan have a filter. |
| 273 | optional bool is_filtered = 3; |
| 274 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 275 | optional bool is_first_match = 4; |
| 276 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 277 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | /** |
| 281 | * Logs reporting of a ble scan finding results. |
| 282 | * |
| 283 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 284 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 285 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 286 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 287 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 288 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 289 | |
| 290 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 291 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | /** |
| 295 | * Logs when a sensor state changes. |
| 296 | * |
| 297 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 298 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 299 | */ |
| 300 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 301 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 302 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 303 | // The id (int) of the sensor. |
| 304 | optional int32 sensor_id = 2; |
| 305 | |
| 306 | enum State { |
| 307 | OFF = 0; |
| 308 | ON = 1; |
| 309 | } |
| 310 | optional State state = 3; |
| 311 | } |
| 312 | |
| 313 | |
| 314 | /** |
| 315 | * Logs when GPS state changes. |
| 316 | * |
| 317 | * Logged from: |
| 318 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 319 | */ |
| 320 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 321 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 322 | |
| 323 | enum State { |
| 324 | OFF = 0; |
| 325 | ON = 1; |
| 326 | } |
| 327 | optional State state = 2; |
| 328 | } |
| 329 | |
| 330 | |
| 331 | /** |
| 332 | * Logs when a sync manager sync state changes. |
| 333 | * |
| 334 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 335 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 336 | */ |
| 337 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 338 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 339 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 340 | // 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] | 341 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 342 | |
| 343 | enum State { |
| 344 | OFF = 0; |
| 345 | ON = 1; |
| 346 | } |
| 347 | optional State state = 3; |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Logs when a job scheduler job state changes. |
| 352 | * |
| 353 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 354 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 355 | */ |
| 356 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 357 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 358 | |
| 359 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 360 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 361 | |
| 362 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 363 | FINISHED = 0; |
| 364 | STARTED = 1; |
| 365 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 366 | } |
| 367 | optional State state = 3; |
| 368 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 369 | // The reason a job has stopped. |
| 370 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 371 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 372 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | /** |
| 376 | * Logs when the audio state changes. |
| 377 | * |
| 378 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 379 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 380 | */ |
| 381 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 382 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 383 | |
| 384 | enum State { |
| 385 | OFF = 0; |
| 386 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 387 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 388 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 389 | } |
| 390 | optional State state = 2; |
| 391 | } |
| 392 | |
| 393 | /** |
| 394 | * Logs when the video codec state changes. |
| 395 | * |
| 396 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 397 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 398 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 399 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 400 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 401 | |
| 402 | enum State { |
| 403 | OFF = 0; |
| 404 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 405 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 406 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 407 | } |
| 408 | optional State state = 2; |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * Logs when the flashlight state changes. |
| 413 | * |
| 414 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 415 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 416 | */ |
| 417 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 418 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 419 | |
| 420 | enum State { |
| 421 | OFF = 0; |
| 422 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 423 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 424 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 425 | } |
| 426 | optional State state = 2; |
| 427 | } |
| 428 | |
| 429 | /** |
| 430 | * Logs when the camera state changes. |
| 431 | * |
| 432 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 433 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 434 | */ |
| 435 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 436 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 437 | |
| 438 | enum State { |
| 439 | OFF = 0; |
| 440 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 441 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 442 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 443 | } |
| 444 | optional State state = 2; |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * 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] | 449 | * |
| 450 | * Logged from: |
| 451 | * TODO |
| 452 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 453 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 454 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 455 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 456 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 457 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 458 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 459 | |
| 460 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 461 | optional string tag = 3; |
| 462 | |
| 463 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 464 | RELEASE = 0; |
| 465 | ACQUIRE = 1; |
| 466 | CHANGE_RELEASE = 2; |
| 467 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 468 | } |
| 469 | optional State state = 4; |
| 470 | } |
| 471 | |
| 472 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 473 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 474 | * |
| 475 | * Logged from: |
| 476 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 477 | */ |
| 478 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 479 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 480 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 481 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 482 | optional string tag = 2; |
| 483 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 484 | // TODO: I have no idea what this is. |
| 485 | optional string history_tag = 3; |
| 486 | |
| 487 | enum State { |
| 488 | OFF = 0; |
| 489 | ON = 1; |
| 490 | } |
| 491 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 492 | } |
| 493 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 494 | /** |
| 495 | * Logs Battery Saver state change. |
| 496 | * |
| 497 | * Logged from: |
| 498 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 499 | */ |
| 500 | message BatterySaverModeStateChanged { |
| 501 | enum State { |
| 502 | OFF = 0; |
| 503 | ON = 1; |
| 504 | } |
| 505 | optional State state = 1; |
| 506 | } |
| 507 | |
| 508 | /** |
| 509 | * Logs Doze mode state change. |
| 510 | * |
| 511 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 512 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 513 | */ |
| 514 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 515 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 516 | } |
| 517 | |
| 518 | |
| 519 | /** |
| 520 | * Logs state change of Doze mode including maintenance windows. |
| 521 | * |
| 522 | * Logged from: |
| 523 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 524 | */ |
| 525 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 526 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 527 | } |
| 528 | |
| 529 | /** |
| 530 | * Logs screen brightness level. |
| 531 | * |
| 532 | * Logged from: |
| 533 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 534 | */ |
| 535 | message ScreenBrightnessChanged { |
| 536 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 537 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | /** |
| 541 | * Logs battery level (percent full, from 0 to 100). |
| 542 | * |
| 543 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 544 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 545 | */ |
| 546 | message BatteryLevelChanged { |
| 547 | // Battery level. Should be in [0, 100]. |
| 548 | optional int32 battery_level = 1; |
| 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Logs change in charging status of the device. |
| 553 | * |
| 554 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 555 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 556 | */ |
| 557 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 558 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 559 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | /** |
| 563 | * Logs whether the device is plugged in, and what power source it is using. |
| 564 | * |
| 565 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 566 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 567 | */ |
| 568 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 569 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 570 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 571 | } |
| 572 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 573 | /** |
| 574 | * Logs when an app's wakeup alarm fires. |
| 575 | * |
| 576 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 577 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 578 | */ |
| 579 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 580 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 581 | |
| 582 | // Name of the wakeup alarm. |
| 583 | optional string tag = 2; |
| 584 | } |
| 585 | |
| 586 | /** |
| 587 | * Logs when an an app causes the mobile radio to change state. |
| 588 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 589 | * |
| 590 | * Logged from: |
| 591 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 592 | */ |
| 593 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 594 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 595 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 596 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 597 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Logs when an an app causes the wifi radio to change state. |
| 602 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 603 | * |
| 604 | * Logged from: |
| 605 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 606 | */ |
| 607 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 608 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 609 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 610 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 611 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | /** |
| 615 | * Logs kernel wakeup reasons and aborts. |
| 616 | * |
| 617 | * Logged from: |
| 618 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 619 | */ |
| 620 | message KernelWakeupReported { |
| 621 | // Name of the kernel wakeup reason (or abort). |
| 622 | optional string wakeup_reason_name = 1; |
| 623 | |
| 624 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 625 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 626 | } |
| 627 | |
| 628 | /** |
| 629 | * Logs wifi locks held by an app. |
| 630 | * |
| 631 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 632 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 633 | */ |
| 634 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 635 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 636 | |
| 637 | enum State { |
| 638 | OFF = 0; |
| 639 | ON = 1; |
| 640 | } |
| 641 | optional State state = 2; |
| 642 | } |
| 643 | |
| 644 | /** |
| 645 | * Logs wifi signal strength changes. |
| 646 | * |
| 647 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 648 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 649 | */ |
| 650 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 651 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 652 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 653 | } |
| 654 | |
| 655 | /** |
| 656 | * Logs wifi scans performed by an app. |
| 657 | * |
| 658 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 659 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 660 | */ |
| 661 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 662 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 663 | |
| 664 | enum State { |
| 665 | OFF = 0; |
| 666 | ON = 1; |
| 667 | } |
| 668 | optional State state = 2; |
| 669 | } |
| 670 | |
| 671 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 672 | * Logs wifi multicast locks held by an app |
| 673 | * |
| 674 | * Logged from: |
| 675 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 676 | */ |
| 677 | message WifiMulticastLockStateChanged { |
| 678 | repeated AttributionNode attribution_node = 1; |
| 679 | |
| 680 | enum State { |
| 681 | OFF = 0; |
| 682 | ON = 1; |
| 683 | } |
| 684 | optional State state = 2; |
| 685 | } |
| 686 | |
| 687 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 688 | * Logs shutdown reason and duration on next boot. |
| 689 | * |
| 690 | * Logged from: |
| 691 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 692 | */ |
| 693 | message ShutdownSequenceReported { |
| 694 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 695 | optional bool reboot = 1; |
| 696 | |
| 697 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 698 | optional string reason = 2; |
| 699 | |
| 700 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 701 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 702 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 703 | |
| 704 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 705 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 706 | } |
| 707 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 708 | |
| 709 | /** |
| 710 | * Logs boot reason and duration. |
| 711 | * |
| 712 | * Logged from: |
| 713 | * system/core/bootstat/bootstat.cpp |
| 714 | */ |
| 715 | message BootSequenceReported { |
| 716 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 717 | // Default: "<EMPTY>" if not available. |
| 718 | optional string bootloader_reason = 1; |
| 719 | |
| 720 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 721 | // Default: "<EMPTY>" if not available. |
| 722 | optional string system_reason = 2; |
| 723 | |
| 724 | // 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] | 725 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 726 | |
| 727 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 728 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 729 | |
| 730 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 731 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 732 | |
| 733 | // Time since last boot in ms. Default: 0 if not available. |
| 734 | optional int64 time_since_last_boot = 6; |
| 735 | } |
| 736 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 737 | |
| 738 | /** |
| 739 | * Logs call state and disconnect cause (if applicable). |
| 740 | * |
| 741 | * Logged from: |
| 742 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 743 | */ |
| 744 | message CallStateChanged { |
| 745 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 746 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 747 | optional android.telecom.CallStateEnum call_state = 1; |
| 748 | |
| 749 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 750 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 751 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 752 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 753 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 754 | |
| 755 | // True if the call is self-managed, which are apps that use the |
| 756 | // telecom infrastructure to make their own calls. |
| 757 | optional bool self_managed = 3; |
| 758 | |
| 759 | // True if call is external. External calls are calls on connected Wear |
| 760 | // devices but show up in Telecom so the user can pull them onto the device. |
| 761 | optional bool external_call = 4; |
| 762 | } |
| 763 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 764 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 765 | * Logs keyguard state. The keyguard is the lock screen. |
| 766 | * |
| 767 | * Logged from: |
| 768 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 769 | */ |
| 770 | message KeyguardStateChanged { |
| 771 | enum State { |
| 772 | UNKNOWN = 0; |
| 773 | // The keyguard is hidden when the phone is unlocked. |
| 774 | HIDDEN = 1; |
| 775 | // The keyguard is shown when the phone is locked (screen turns off). |
| 776 | SHOWN= 2; |
| 777 | // The keyguard is occluded when something is overlaying the keyguard. |
| 778 | // Eg. Opening the camera while on the lock screen. |
| 779 | OCCLUDED = 3; |
| 780 | } |
| 781 | optional State state = 1; |
| 782 | } |
| 783 | |
| 784 | /** |
| 785 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 786 | * prompts the user to enter a password (pattern, pin, etc). |
| 787 | * |
| 788 | * Logged from: |
| 789 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 790 | */ |
| 791 | |
| 792 | message KeyguardBouncerStateChanged { |
| 793 | enum State { |
| 794 | UNKNOWN = 0; |
| 795 | // Bouncer is hidden, either as a result of successfully entering the |
| 796 | // password, screen timing out, or user going back to lock screen. |
| 797 | HIDDEN = 1; |
| 798 | // This is when the user is being prompted to enter the password. |
| 799 | SHOWN = 2; |
| 800 | } |
| 801 | optional State state = 1; |
| 802 | } |
| 803 | |
| 804 | /** |
| 805 | * Logs the result of entering a password into the keyguard bouncer. |
| 806 | * |
| 807 | * Logged from: |
| 808 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 809 | */ |
| 810 | message KeyguardBouncerPasswordEntered { |
| 811 | enum BouncerResult { |
| 812 | UNKNOWN = 0; |
| 813 | // The password entered was incorrect. |
| 814 | FAILURE = 1; |
| 815 | // The password entered was correct. |
| 816 | SUCCESS = 2; |
| 817 | } |
| 818 | optional BouncerResult result = 1; |
| 819 | } |
| 820 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 821 | /* |
| 822 | * Logs changes to the configuration of the device. The configuration is defined |
| 823 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 824 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 825 | * Please go there to interpret the possible values each field can be. |
| 826 | * |
| 827 | * Logged from: |
| 828 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 829 | */ |
| 830 | message ResourceConfigurationChanged { |
| 831 | // Bit mask of color capabilities of the screen. |
| 832 | // Contains information about the color gamut and hdr mode of the screen. |
| 833 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 834 | optional int32 colorMode = 1; |
| 835 | |
| 836 | // The target screen density being rendered to. |
| 837 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 838 | optional int32 densityDpi = 2; |
| 839 | |
| 840 | // Current user preference for the scaling factor for fonts, |
| 841 | // relative to the base density scaling. |
| 842 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 843 | optional float fontScale = 3; |
| 844 | |
| 845 | // Flag indicating whether the hard keyboard is hidden. |
| 846 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 847 | optional int32 hardKeyboardHidden = 4; |
| 848 | |
| 849 | // The type of keyboard attached to the device. |
| 850 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 851 | optional int32 keyboard = 5; |
| 852 | |
| 853 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 854 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 855 | optional int32 keyboardHideen = 6; |
| 856 | |
| 857 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 858 | // 0 if undefined. |
| 859 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 860 | optional int32 mcc = 7; |
| 861 | |
| 862 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 863 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 864 | // MNC_ZERO symbol defined in Configuration.java. |
| 865 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 866 | optional int32 mnc = 8; |
| 867 | |
| 868 | // The kind of navigation available on the device. |
| 869 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 870 | optional int32 navigation = 9; |
| 871 | |
| 872 | // Flag indicating whether the navigation is available. |
| 873 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 874 | optional int32 navigationHidden = 10; |
| 875 | |
| 876 | // Overall orientation of the screen. |
| 877 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 878 | optional int32 orientation = 11; |
| 879 | |
| 880 | // The current height of the available screen space, in dp units. |
| 881 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 882 | optional int32 screenHeightDp = 12; |
| 883 | |
| 884 | // Bit mask of overall layout of the screen. |
| 885 | // Contains information about screen size, whether the screen is wider/taller |
| 886 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 887 | // and whether the screen has a rounded shape. |
| 888 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 889 | optional int32 screenLayout = 13; |
| 890 | |
| 891 | // Current width of the available screen space, in dp units. |
| 892 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 893 | optional int32 screenWidthDp = 14; |
| 894 | |
| 895 | // The smallest screen size an application will see in normal operation. |
| 896 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 897 | // in portrait and landscape. |
| 898 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 899 | optional int32 smallestScreenWidthDp = 15; |
| 900 | |
| 901 | // The type of touch screen attached to the device. |
| 902 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 903 | optional int32 touchscreen = 16; |
| 904 | |
| 905 | // Bit mask of the ui mode. |
| 906 | // Contains information about the overall ui mode of the device. |
| 907 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 908 | // Also contains information about whether the device is in night mode. |
| 909 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 910 | optional int32 uiMode = 17; |
| 911 | } |
| 912 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 913 | |
| 914 | /** |
| 915 | * Logs changes in the connection state of the mobile radio. |
| 916 | * |
| 917 | * Logged from: |
| 918 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 919 | */ |
| 920 | message MobileConnectionStateChanged { |
| 921 | // States are from the state machine DataConnection.java. |
| 922 | enum State { |
| 923 | UNKNOWN = 0; |
| 924 | // The connection is inactive, or disconnected. |
| 925 | INACTIVE = 1; |
| 926 | // The connection is being activated, or connecting. |
| 927 | ACTIVATING = 2; |
| 928 | // The connection is active, or connected. |
| 929 | ACTIVE = 3; |
| 930 | // The connection is disconnecting. |
| 931 | DISCONNECTING = 4; |
| 932 | // The connection is disconnecting after creating a connection. |
| 933 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 934 | } |
| 935 | optional State state = 1; |
| 936 | // For multi-sim phones, this distinguishes between the sim cards. |
| 937 | optional int32 sim_slot_index = 2; |
| 938 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 939 | // every new network created. Resets whenever the device reboots. |
| 940 | optional int32 data_connection_id = 3; |
| 941 | // A bitmask for the capabilities of this connection. |
| 942 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 943 | // Default value (if we have no information): 0 |
| 944 | optional int64 capabilities = 4; |
| 945 | // If this connection has internet. |
| 946 | // This just checks if the DEFAULT bit of capabilities is set. |
| 947 | optional bool has_internet = 5; |
| 948 | } |
| 949 | |
| 950 | /** |
| 951 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 952 | * |
| 953 | * Logged from: |
| 954 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 955 | */ |
| 956 | message MobileRadioTechnologyChanged { |
| 957 | optional android.telephony.NetworkTypeEnum state = 1; |
| 958 | // For multi-sim phones, this distinguishes between the sim cards. |
| 959 | optional int32 sim_slot_index = 2; |
| 960 | } |
| 961 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 962 | /** |
| 963 | * Logs the VID and PID of any connected USB devices. |
| 964 | * |
| 965 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 966 | * |
| 967 | * Logged by Vendor. |
| 968 | */ |
| 969 | message UsbDeviceAttached { |
| 970 | optional int32 vid = 1; |
| 971 | optional int32 pid = 2; |
| 972 | optional bool has_audio = 3; |
| 973 | optional bool has_hid = 4; |
| 974 | optional bool has_storage = 5; |
| 975 | } |
| 976 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 977 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 978 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 979 | * Logs when Bluetooth is enabled and disabled. |
| 980 | * |
| 981 | * Logged from: |
| 982 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 983 | */ |
| 984 | message BluetoothEnabledStateChanged { |
| 985 | repeated AttributionNode attribution_node = 1; |
| 986 | // Whether or not bluetooth is enabled on the device. |
| 987 | enum State { |
| 988 | UNKNOWN = 0; |
| 989 | ENABLED = 1; |
| 990 | DISABLED = 2; |
| 991 | } |
| 992 | optional State state = 2; |
| 993 | // The reason for being enabled/disabled. |
| 994 | // Eg. Airplane mode, crash, application request. |
| 995 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 996 | // If the reason is an application request, this will be the package name. |
| 997 | optional string pkgName = 4; |
| 998 | } |
| 999 | |
| 1000 | /** |
| 1001 | * Logs when a Bluetooth device connects and disconnects. |
| 1002 | * |
| 1003 | * Logged from: |
| 1004 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1005 | */ |
| 1006 | message BluetoothConnectionStateChanged { |
| 1007 | // The state of the connection. |
| 1008 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1009 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1010 | // An identifier that can be used to match connect and disconnect events. |
| 1011 | // Currently is last two bytes of a hash of a device level ID and |
| 1012 | // the mac address of the bluetooth device that is connected. |
| 1013 | optional int32 obfuscated_id = 2; |
| 1014 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1015 | // From android.bluetooth.BluetoothAdapter.java |
| 1016 | optional int32 bt_profile = 3; |
| 1017 | } |
| 1018 | |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame^] | 1019 | // Logs when there is an event affecting Bluetooth device's link layer connection. |
| 1020 | // - This event is triggered when there is a related HCI command or event |
| 1021 | // - Users of this metrics can deduce Bluetooth device's connection state from these events |
| 1022 | // - HCI commands are logged before the command is sent, after receiving command status, and after |
| 1023 | // receiving command complete |
| 1024 | // - HCI events are logged when they arrive |
| 1025 | // |
| 1026 | // Low level log from system/bt |
| 1027 | // |
| 1028 | // Bluetooth classic commands: |
| 1029 | // - CMD_CREATE_CONNECTION |
| 1030 | // - CMD_DISCONNECT |
| 1031 | // - CMD_CREATE_CONNECTION_CANCEL |
| 1032 | // - CMD_ACCEPT_CONNECTION_REQUEST |
| 1033 | // - CMD_REJECT_CONNECTION_REQUEST |
| 1034 | // - CMD_SETUP_ESCO_CONNECTION |
| 1035 | // - CMD_ACCEPT_ESCO_CONNECTION |
| 1036 | // - CMD_REJECT_ESCO_CONNECTION |
| 1037 | // - CMD_ENH_SETUP_ESCO_CONNECTION |
| 1038 | // - CMD_ENH_ACCEPT_ESCO_CONNECTION |
| 1039 | // |
| 1040 | // Bluetooth low energy commands: |
| 1041 | // - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00] |
| 1042 | // - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error] |
| 1043 | // - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00] |
| 1044 | // - CMD_BLE_CLEAR_WHITE_LIST |
| 1045 | // - CMD_BLE_ADD_WHITE_LIST |
| 1046 | // - CMD_BLE_REMOVE_WHITE_LIST |
| 1047 | // |
| 1048 | // Bluetooth classic events: |
| 1049 | // - EVT_CONNECTION_COMP |
| 1050 | // - EVT_CONNECTION_REQUEST |
| 1051 | // - EVT_DISCONNECTION_COMP |
| 1052 | // - EVT_ESCO_CONNECTION_COMP |
| 1053 | // - EVT_ESCO_CONNECTION_CHANGED |
| 1054 | // |
| 1055 | // Bluetooth low energy meta events: |
| 1056 | // - BLE_EVT_CONN_COMPLETE_EVT |
| 1057 | // - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT |
| 1058 | // |
| 1059 | // Next tag: 10 |
| 1060 | message BluetoothLinkLayerConnectionEvent { |
| 1061 | // An identifier that can be used to match events for this device. |
| 1062 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1063 | // Salt: Randomly generated 256 bit value |
| 1064 | // Hash algorithm: HMAC-SHA256 |
| 1065 | // Size: 32 byte |
| 1066 | // Default: null or empty if the device identifier is not known |
| 1067 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1068 | // Connection handle of this connection if available |
| 1069 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1070 | // Default: 0xFFFF if the handle is unknown |
| 1071 | optional int32 connection_handle = 2; |
| 1072 | // Direction of the link |
| 1073 | // Default: DIRECTION_UNKNOWN |
| 1074 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1075 | // Type of this link |
| 1076 | // Default: LINK_TYPE_UNKNOWN |
| 1077 | optional android.bluetooth.LinkTypeEnum type = 4; |
| 1078 | |
| 1079 | // Reason metadata for this link layer connection event, rules for interpretation: |
| 1080 | // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or |
| 1081 | // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case |
| 1082 | // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is |
| 1083 | // set and valid, ignore hci_ble_event |
| 1084 | |
| 1085 | // HCI command associated with this event |
| 1086 | // Default: CMD_UNKNOWN |
| 1087 | optional android.bluetooth.hci.CommandEnum hci_cmd = 5; |
| 1088 | // HCI event associated with this event |
| 1089 | // Default: EVT_UNKNOWN |
| 1090 | optional android.bluetooth.hci.EventEnum hci_event = 6; |
| 1091 | // HCI BLE meta event associated with this event |
| 1092 | // Default: BLE_EVT_UNKNOWN |
| 1093 | optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7; |
| 1094 | // HCI command status code if this is triggerred by hci_cmd |
| 1095 | // Default: STATUS_UNKNOWN |
| 1096 | optional android.bluetooth.hci.StatusEnum cmd_status = 8; |
| 1097 | // HCI reason code associated with this event |
| 1098 | // Default: STATUS_UNKNOWN |
| 1099 | optional android.bluetooth.hci.StatusEnum reason_code = 9; |
| 1100 | } |
| 1101 | |
| 1102 | |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1103 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1104 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1105 | * |
| 1106 | * Logged from: |
| 1107 | * Vendor USB HAL. |
| 1108 | */ |
| 1109 | message UsbConnectorStateChanged { |
| 1110 | enum State { |
| 1111 | DISCONNECTED = 0; |
| 1112 | CONNECTED = 1; |
| 1113 | } |
| 1114 | optional State state = 1; |
| 1115 | } |
| 1116 | |
| 1117 | /** |
| 1118 | * Logs the reported speaker impedance. |
| 1119 | * |
| 1120 | * Logged from: |
| 1121 | * Vendor audio implementation. |
| 1122 | */ |
| 1123 | message SpeakerImpedanceReported { |
| 1124 | optional int32 speaker_location = 1; |
| 1125 | optional int32 impedance = 2; |
| 1126 | } |
| 1127 | |
| 1128 | /** |
| 1129 | * Logs the report of a failed hardware. |
| 1130 | * |
| 1131 | * Logged from: |
| 1132 | * Vendor HALs. |
| 1133 | * |
| 1134 | */ |
| 1135 | message HardwareFailed { |
| 1136 | enum HardwareType { |
| 1137 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1138 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1139 | HARDWARE_FAILED_CODEC = 2; |
| 1140 | HARDWARE_FAILED_SPEAKER = 3; |
| 1141 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1142 | } |
| 1143 | optional HardwareType hardware_type = 1; |
| 1144 | |
| 1145 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1146 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1147 | * referring to board-specific numbering schemes. |
| 1148 | */ |
| 1149 | optional int32 hardware_location = 2; |
| 1150 | |
| 1151 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1152 | * It should use the enum values defined below. |
| 1153 | */ |
| 1154 | enum MicrophoneFailureCode { |
| 1155 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1156 | } |
| 1157 | enum CodecFailureCode { |
| 1158 | CODEC_FAILURE_COMPLETE = 0; |
| 1159 | } |
| 1160 | enum SpeakerFailureCode { |
| 1161 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1162 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1163 | SPEAKER_FAILURE_SHORT = 2; |
| 1164 | } |
| 1165 | enum FingerprintFailureCode { |
| 1166 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1167 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1168 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1169 | } |
| 1170 | optional int32 failure_code = 3; |
| 1171 | } |
| 1172 | |
| 1173 | /** |
| 1174 | * Log an event when the device has been physically dropped. |
| 1175 | * Reported from the /vendor partition. |
| 1176 | */ |
| 1177 | message PhysicalDropDetected { |
| 1178 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1179 | optional int32 confidence_pctg = 1; |
| 1180 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1181 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1182 | // Duration of freefall in ms |
| 1183 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1184 | } |
| 1185 | |
| 1186 | /** |
| 1187 | * Log bucketed battery charge cycles. |
| 1188 | * |
| 1189 | * Each bucket represents cycles of the battery past |
| 1190 | * a given charge point. For example, bucket 1 is the |
| 1191 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1192 | * |
| 1193 | * Logged from: |
| 1194 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1195 | */ |
| 1196 | message ChargeCyclesReported { |
| 1197 | optional int32 cycle_bucket_1 = 1; |
| 1198 | optional int32 cycle_bucket_2 = 2; |
| 1199 | optional int32 cycle_bucket_3 = 3; |
| 1200 | optional int32 cycle_bucket_4 = 4; |
| 1201 | optional int32 cycle_bucket_5 = 5; |
| 1202 | optional int32 cycle_bucket_6 = 6; |
| 1203 | optional int32 cycle_bucket_7 = 7; |
| 1204 | optional int32 cycle_bucket_8 = 8; |
| 1205 | } |
| 1206 | |
| 1207 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1208 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1209 | * |
| 1210 | * Logged from: |
| 1211 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1212 | */ |
| 1213 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1214 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1215 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1216 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1217 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1218 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1219 | } |
| 1220 | |
| 1221 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1222 | * Logs phone signal strength changes. |
| 1223 | * |
| 1224 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1225 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1226 | */ |
| 1227 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1228 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1229 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1230 | } |
| 1231 | |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 1232 | |
| 1233 | /** |
| 1234 | * Logs when the phone state, sim state or signal strength changes |
| 1235 | * |
| 1236 | * Logged from: |
| 1237 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1238 | */ |
| 1239 | message PhoneServiceStateChanged { |
| 1240 | optional android.telephony.ServiceStateEnum state = 1; |
| 1241 | optional android.telephony.SimStateEnum sim_state = 2; |
| 1242 | optional android.telephony.SignalStrengthEnum signal_strength = 3; |
| 1243 | } |
| 1244 | |
| 1245 | /** |
| 1246 | * Logs when the phone becomes on or off. |
| 1247 | * |
| 1248 | * Logged from: |
| 1249 | * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java |
| 1250 | */ |
| 1251 | message PhoneStateChanged { |
| 1252 | enum State { |
| 1253 | OFF = 0; |
| 1254 | ON = 1; |
| 1255 | } |
| 1256 | optional State state = 1; |
| 1257 | } |
| 1258 | |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1259 | message LauncherUIChanged { |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 1260 | optional android.stats.launcher.LauncherAction action = 1; |
| 1261 | optional android.stats.launcher.LauncherState src_state = 2; |
| 1262 | optional android.stats.launcher.LauncherState dst_state = 3; |
| 1263 | optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES]; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1264 | optional bool is_swipe_up_enabled = 5; |
| 1265 | } |
| 1266 | |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 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 | f17bf62f | 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 | f17bf62f | 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. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1615 | optional int32 parent_uid = 1; |
| 1616 | |
| 1617 | optional int32 isolated_uid = 2; |
| 1618 | |
| 1619 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1620 | enum Event { |
| 1621 | REMOVED = 0; |
| 1622 | CREATED = 1; |
| 1623 | } |
| 1624 | optional Event event = 3; |
| 1625 | } |
| 1626 | |
| 1627 | /* |
| 1628 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1629 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1630 | * and processed by WakeupController.cpp. |
| 1631 | */ |
| 1632 | message PacketWakeupOccurred { |
| 1633 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1634 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1635 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1636 | // The interface name on which the packet was received. |
| 1637 | optional string iface = 2; |
| 1638 | // The ethertype value of the packet. |
| 1639 | optional int32 ethertype = 3; |
| 1640 | // String representation of the destination MAC address of the packet. |
| 1641 | optional string destination_hardware_address = 4; |
| 1642 | // String representation of the source address of the packet if this was an IP packet. |
| 1643 | optional string source_ip = 5; |
| 1644 | // String representation of the destination address of the packet if this was an IP packet. |
| 1645 | optional string destination_ip = 6; |
| 1646 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1647 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1648 | // families. |
| 1649 | optional int32 ip_next_header = 7; |
| 1650 | // The source port if this was a TCP or UDP packet. |
| 1651 | optional int32 source_port = 8; |
| 1652 | // The destination port if this was a TCP or UDP packet. |
| 1653 | optional int32 destination_port = 9; |
| 1654 | } |
| 1655 | |
| 1656 | /* |
| 1657 | * Logs the memory stats for an app on startup. |
| 1658 | * Logged from: |
| 1659 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1660 | */ |
| 1661 | message AppStartMemoryStateCaptured { |
| 1662 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1663 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1664 | |
| 1665 | // The process name. |
| 1666 | optional string process_name = 2; |
| 1667 | |
| 1668 | // The activity name. |
| 1669 | optional string activity_name = 3; |
| 1670 | |
| 1671 | // # of page-faults |
| 1672 | optional int64 pgfault = 4; |
| 1673 | |
| 1674 | // # of major page-faults |
| 1675 | optional int64 pgmajfault = 5; |
| 1676 | |
| 1677 | // RSS |
| 1678 | optional int64 rss_in_bytes = 6; |
| 1679 | |
| 1680 | // CACHE |
| 1681 | optional int64 cache_in_bytes = 7; |
| 1682 | |
| 1683 | // SWAP |
| 1684 | optional int64 swap_in_bytes = 8; |
| 1685 | } |
| 1686 | |
| 1687 | /* |
| 1688 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1689 | * for LMK event. |
| 1690 | * Logged from: |
| 1691 | * system/core/lmkd/lmkd.c |
| 1692 | */ |
| 1693 | message LmkStateChanged { |
| 1694 | enum State { |
| 1695 | UNKNOWN = 0; |
| 1696 | START = 1; |
| 1697 | STOP = 2; |
| 1698 | } |
| 1699 | optional State state = 1; |
| 1700 | } |
| 1701 | |
| 1702 | /* |
| 1703 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1704 | * Logged from: |
| 1705 | * system/core/lmkd/lmkd.c |
| 1706 | */ |
| 1707 | message LmkKillOccurred { |
| 1708 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1709 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1710 | |
| 1711 | // The process name. |
| 1712 | optional string process_name = 2; |
| 1713 | |
| 1714 | // oom adj score. |
| 1715 | optional int32 oom_score = 3; |
| 1716 | |
| 1717 | // # of page-faults |
| 1718 | optional int64 pgfault = 4; |
| 1719 | |
| 1720 | // # of major page-faults |
| 1721 | optional int64 pgmajfault = 5; |
| 1722 | |
| 1723 | // RSS |
| 1724 | optional int64 rss_in_bytes = 6; |
| 1725 | |
| 1726 | // CACHE |
| 1727 | optional int64 cache_in_bytes = 7; |
| 1728 | |
| 1729 | // SWAP |
| 1730 | optional int64 swap_in_bytes = 8; |
Jim Blackler | 972a5c5 | 2018-11-21 15:24:48 +0000 | [diff] [blame] | 1731 | |
| 1732 | // The elapsed real time of start of the process. |
| 1733 | optional int64 process_start_time_nanos = 9; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1734 | } |
| 1735 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1736 | /* |
| 1737 | * Logs when the ActivityManagerService detects that an app died. |
| 1738 | * |
| 1739 | * Logged from: |
| 1740 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1741 | */ |
| 1742 | message AppDied { |
| 1743 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1744 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1745 | } |
| 1746 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1747 | ////////////////////////////////////////////////////////////////////// |
| 1748 | // Pulled atoms below this line // |
| 1749 | ////////////////////////////////////////////////////////////////////// |
| 1750 | |
| 1751 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1752 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1753 | * |
| 1754 | * Pulled from: |
| 1755 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1756 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1757 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1758 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1759 | |
| 1760 | optional int64 rx_bytes = 2; |
| 1761 | |
| 1762 | optional int64 rx_packets = 3; |
| 1763 | |
| 1764 | optional int64 tx_bytes = 4; |
| 1765 | |
| 1766 | optional int64 tx_packets = 5; |
| 1767 | } |
| 1768 | |
| 1769 | /** |
| 1770 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1771 | * |
| 1772 | * Pulled from: |
| 1773 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1774 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1775 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1776 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1777 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1778 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1779 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1780 | |
| 1781 | optional int64 rx_bytes = 3; |
| 1782 | |
| 1783 | optional int64 rx_packets = 4; |
| 1784 | |
| 1785 | optional int64 tx_bytes = 5; |
| 1786 | |
| 1787 | optional int64 tx_packets = 6; |
| 1788 | } |
| 1789 | |
| 1790 | /** |
| 1791 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 1792 | * |
| 1793 | * Pulled from: |
| 1794 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1795 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1796 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1797 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1798 | |
| 1799 | optional int64 rx_bytes = 2; |
| 1800 | |
| 1801 | optional int64 rx_packets = 3; |
| 1802 | |
| 1803 | optional int64 tx_bytes = 4; |
| 1804 | |
| 1805 | optional int64 tx_packets = 5; |
| 1806 | } |
| 1807 | |
| 1808 | /** |
| 1809 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1810 | * |
| 1811 | * Pulled from: |
| 1812 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1813 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1814 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1815 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1816 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1817 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 1818 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1819 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1820 | |
| 1821 | optional int64 rx_bytes = 3; |
| 1822 | |
| 1823 | optional int64 rx_packets = 4; |
| 1824 | |
| 1825 | optional int64 tx_bytes = 5; |
| 1826 | |
| 1827 | optional int64 tx_packets = 6; |
| 1828 | } |
| 1829 | |
| 1830 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1831 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 1832 | * |
| 1833 | * Pulled from: |
| 1834 | * StatsCompanionService |
| 1835 | */ |
| 1836 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1837 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1838 | |
| 1839 | optional int64 rx_bytes = 2; |
| 1840 | |
| 1841 | optional int64 tx_bytes = 3; |
| 1842 | } |
| 1843 | |
| 1844 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1845 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1846 | * android/internal/os/KernelWakelockStats.java |
| 1847 | * |
| 1848 | * Pulled from: |
| 1849 | * StatsCompanionService using KernelWakelockReader. |
| 1850 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1851 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1852 | optional string name = 1; |
| 1853 | |
| 1854 | optional int32 count = 2; |
| 1855 | |
| 1856 | optional int32 version = 3; |
| 1857 | |
| 1858 | optional int64 time = 4; |
| 1859 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1860 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1861 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1862 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1863 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1864 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1865 | * hardware/interfaces/power/1.1/types.hal |
| 1866 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1867 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1868 | // Subsystem name |
| 1869 | optional string subsystem_name = 1; |
| 1870 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 1871 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 1872 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1873 | // 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] | 1874 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1875 | // 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] | 1876 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1877 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1878 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1879 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1880 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1881 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1882 | * starts from highest to lowest. The value should be monotonically |
| 1883 | * increasing since boot. However, if there is a cpu |
| 1884 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1885 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1886 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1887 | optional uint32 cluster = 1; |
| 1888 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1889 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1890 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1891 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1892 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1893 | * Pulls Cpu Time Per Uid. |
| 1894 | * Note that isolated process uid time should be attributed to host uids. |
| 1895 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1896 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1897 | optional int32 uid = 1 [(is_uid) = true]; |
Misha Wagner | 6bc6c91 | 2018-11-16 13:19:54 +0000 | [diff] [blame] | 1898 | optional uint64 user_time_micros = 2; |
| 1899 | optional uint64 sys_time_micros = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1900 | } |
| 1901 | |
| 1902 | /** |
| 1903 | * Pulls Cpu Time Per Uid per frequency. |
| 1904 | * Note that isolated process uid time should be attributed to host uids. |
| 1905 | * For each uid, we order the time by descending frequencies. |
| 1906 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1907 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1908 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 1909 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1910 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1911 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1912 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1913 | /** |
| 1914 | * Pulls Wifi Controller Activity Energy Info |
| 1915 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1916 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1917 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1918 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1919 | // stack reported state |
| 1920 | // TODO: replace this with proto enum |
| 1921 | optional int32 stack_state = 2; |
| 1922 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1923 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1924 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1925 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1926 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1927 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1928 | // product of current(mA), voltage(V) and time(ms) |
| 1929 | optional uint64 controller_energy_used = 6; |
| 1930 | } |
| 1931 | |
| 1932 | /** |
| 1933 | * Pulls Modem Activity Energy Info |
| 1934 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1935 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1936 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1937 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1938 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1939 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1940 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1941 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1942 | /** |
| 1943 | * Tx power index |
| 1944 | * index 0 = tx_power < 0dBm |
| 1945 | * index 1 = 0dBm < tx_power < 5dBm |
| 1946 | * index 2 = 5dBm < tx_power < 15dBm |
| 1947 | * index 3 = 15dBm < tx_power < 20dBm |
| 1948 | * index 4 = tx_power > 20dBm |
| 1949 | */ |
| 1950 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1951 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1952 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1953 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1954 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1955 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1956 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1957 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1958 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1959 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1960 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1961 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1962 | // product of current(mA), voltage(V) and time(ms) |
| 1963 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1964 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1965 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1966 | /** |
| 1967 | * Pulls Bluetooth Activity Energy Info |
| 1968 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 1969 | */ |
| 1970 | message BluetoothActivityInfo { |
| 1971 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1972 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1973 | // bluetooth stack state |
| 1974 | optional int32 bluetooth_stack_state = 2; |
| 1975 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1976 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1977 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1978 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1979 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1980 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1981 | // product of current(mA), voltage(V) and time(ms) |
| 1982 | optional uint64 energy_used = 6; |
| 1983 | } |
| 1984 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1985 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1986 | * Logs the memory stats for a process. |
| 1987 | */ |
| 1988 | message ProcessMemoryState { |
| 1989 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1990 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1991 | |
| 1992 | // The process name. |
| 1993 | optional string process_name = 2; |
| 1994 | |
| 1995 | // oom adj score. |
| 1996 | optional int32 oom_score = 3; |
| 1997 | |
| 1998 | // # of page-faults |
| 1999 | optional int64 pgfault = 4; |
| 2000 | |
| 2001 | // # of major page-faults |
| 2002 | optional int64 pgmajfault = 5; |
| 2003 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2004 | // RSS |
| 2005 | optional int64 rss_in_bytes = 6; |
| 2006 | |
| 2007 | // CACHE |
| 2008 | optional int64 cache_in_bytes = 7; |
| 2009 | |
| 2010 | // SWAP |
| 2011 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2012 | } |
| 2013 | |
| 2014 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2015 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2016 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2017 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2018 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2019 | } |
| 2020 | |
| 2021 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2022 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2023 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2024 | message SystemUptime { |
| 2025 | // Milliseconds since the system was booted. |
| 2026 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2027 | // for external input). |
| 2028 | // 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] | 2029 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2030 | } |
| 2031 | |
| 2032 | /* |
| 2033 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2034 | * active: X (X is # cores) |
| 2035 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2036 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2037 | * ... |
| 2038 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2039 | * The file contains a monotonically increasing count of time for a single boot. |
| 2040 | */ |
| 2041 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2042 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2043 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2044 | } |
| 2045 | |
| 2046 | /** |
| 2047 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2048 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2049 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2050 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2051 | * ... |
| 2052 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2053 | * The file contains a monotonically increasing count of time for a single boot. |
| 2054 | */ |
| 2055 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2056 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2057 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2058 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2059 | } |
| 2060 | |
| 2061 | /* |
| 2062 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2063 | */ |
| 2064 | message DiskSpace { |
| 2065 | // available bytes in data partition |
| 2066 | optional uint64 data_available_bytes = 1; |
| 2067 | // available bytes in system partition |
| 2068 | optional uint64 system_available_bytes = 2; |
| 2069 | // available bytes in download cache or temp directories |
| 2070 | optional uint64 temp_available_bytes = 3; |
| 2071 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2072 | |
| 2073 | /** |
| 2074 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2075 | * Pulled from: |
| 2076 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2077 | */ |
| 2078 | message RemainingBatteryCapacity { |
| 2079 | optional int32 charge_uAh = 1; |
| 2080 | } |
| 2081 | |
| 2082 | /** |
| 2083 | * Pulls battery capacity, which is the battery capacity when full 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 FullBatteryCapacity { |
| 2088 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2089 | } |
| 2090 | |
| 2091 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2092 | * Pulls the temperature of various parts of the device. |
| 2093 | * 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] | 2094 | * |
| 2095 | * Pulled from: |
| 2096 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2097 | */ |
| 2098 | message Temperature { |
| 2099 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 2100 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2101 | |
| 2102 | // The name of the temperature source. Eg. CPU0 |
| 2103 | optional string sensor_name = 2; |
| 2104 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2105 | // Temperature in tenths of a degree C. |
| 2106 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2107 | } |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 2108 | |
| 2109 | /** |
| 2110 | * Logs the latency period(in microseconds) and the return code of |
| 2111 | * the DNS(Domain Name System) lookups. |
| 2112 | * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND) |
| 2113 | * to get info(address or hostname) from DNS server(or DNS cache). |
| 2114 | * Logged from: |
| 2115 | * /system/netd/server/DnsProxyListener.cpp |
| 2116 | */ |
| 2117 | message NetworkDnsEventReported { |
| 2118 | // The types of the DNS lookups, as defined in |
| 2119 | //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl |
| 2120 | enum EventType { |
| 2121 | EVENT_UNKNOWN = 0; |
| 2122 | EVENT_GETADDRINFO = 1; |
| 2123 | EVENT_GETHOSTBYNAME = 2; |
| 2124 | EVENT_GETHOSTBYADDR = 3; |
| 2125 | EVENT_RES_NSEND = 4; |
| 2126 | } |
| 2127 | optional EventType event_type = 1; |
| 2128 | |
| 2129 | // The return value of the DNS resolver for each DNS lookups. |
| 2130 | //bionic/libc/include/netdb.h |
| 2131 | //system/netd/resolv/include/netd_resolv/resolv.h |
| 2132 | enum ReturnCode { |
| 2133 | EAI_NO_ERROR = 0; |
| 2134 | EAI_ADDRFAMILY = 1; |
| 2135 | EAI_AGAIN = 2; |
| 2136 | EAI_BADFLAGS = 3; |
| 2137 | EAI_FAIL = 4; |
| 2138 | EAI_FAMILY = 5; |
| 2139 | EAI_MEMORY = 6; |
| 2140 | EAI_NODATA = 7; |
| 2141 | EAI_NONAME = 8; |
| 2142 | EAI_SERVICE = 9; |
| 2143 | EAI_SOCKTYPE = 10; |
| 2144 | EAI_SYSTEM = 11; |
| 2145 | EAI_BADHINTS = 12; |
| 2146 | EAI_PROTOCOL = 13; |
| 2147 | EAI_OVERFLOW = 14; |
| 2148 | RESOLV_TIMEOUT = 255; |
| 2149 | EAI_MAX = 256; |
| 2150 | } |
| 2151 | optional ReturnCode return_code = 2; |
| 2152 | |
| 2153 | // The latency period(in microseconds) it took for this DNS lookup to complete. |
| 2154 | optional int32 latency_micros = 3; |
| 2155 | } |
| 2156 | |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 2157 | /** |
| 2158 | * Logs when a data stall event occurs. |
| 2159 | * |
| 2160 | * Log from: |
| 2161 | * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2162 | */ |
| 2163 | message DataStallEvent { |
| 2164 | // Data stall evaluation type. |
| 2165 | // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2166 | // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*. |
| 2167 | optional int32 evaluation_type = 1; |
| 2168 | // See definition in data_stall_event.proto. |
| 2169 | optional com.android.server.connectivity.ProbeResult validation_result = 2; |
| 2170 | // See definition in data_stall_event.proto. |
| 2171 | optional android.net.NetworkCapabilitiesProto.Transport network_type = 3; |
| 2172 | // See definition in data_stall_event.proto. |
| 2173 | optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES]; |
| 2174 | // See definition in data_stall_event.proto. |
| 2175 | optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES]; |
| 2176 | // See definition in data_stall_event.proto. |
| 2177 | optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES]; |
| 2178 | } |