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