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