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