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