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