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