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