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