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