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"; |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/job/enums.proto"; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/bluetooth/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 31 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Howard Ro | 0546d54 | 2018-08-30 16:23:44 -0700 | [diff] [blame] | 32 | import "frameworks/base/proto/src/stats_enums.proto"; |
Chenjie Yu | 159e4f8 | 2018-08-29 11:49:11 -0700 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/service/procstats.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 34 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 35 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 36 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 37 | * raw stats log events from the Android system, also known as "atoms." |
| 38 | * |
| 39 | * This field contains a single oneof with all of the available messages. |
| 40 | * The stats-log-api-gen tool runs as part of the Android build and |
| 41 | * generates the android.util.StatsLog class, which contains the constants |
| 42 | * and methods that Android uses to log. |
| 43 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 44 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 45 | * Instead, statsd on Android constructs these messages synthetically, |
| 46 | * in the format defined here and in stats_log.proto. |
| 47 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 48 | message Atom { |
| 49 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 50 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 51 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 52 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 53 | ProcessStateChanged process_state_changed = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 54 | BleScanResultReceived ble_scan_result_received = 4; |
| 55 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 56 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 57 | SyncStateChanged sync_state_changed = 7; |
| 58 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 59 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 60 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 61 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 62 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 63 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 64 | ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14; |
| 65 | MemoryFactorStateChanged memory_factor_state_changed = 15; |
| 66 | ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16; |
| 67 | CachedKillReported cached_kill_reported = 17; |
| 68 | ProcessMemoryStatReported process_memory_stat_reported = 18; |
| 69 | // 19 is available |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 70 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 71 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 72 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 73 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 74 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 75 | CameraStateChanged camera_state_changed = 25; |
| 76 | FlashlightStateChanged flashlight_state_changed = 26; |
| 77 | UidProcessStateChanged uid_process_state_changed = 27; |
| 78 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 79 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 80 | BatteryLevelChanged battery_level_changed = 30; |
| 81 | ChargingStateChanged charging_state_changed = 31; |
| 82 | PluggedStateChanged plugged_state_changed = 32; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 83 | // 33 - 34 are available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 84 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 85 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 86 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 87 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 88 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 89 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 90 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 91 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 92 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 93 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Bookatz | 7948c87 | 2018-09-04 12:58:33 -0700 | [diff] [blame] | 94 | WallClockTimeShifted wall_clock_time_shifted = 45; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 95 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 96 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 97 | AppStartOccurred app_start_occurred = 48; |
| 98 | AppStartCanceled app_start_canceled = 49; |
| 99 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 100 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 101 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 102 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 103 | LmkStateChanged lmk_state_changed = 54; |
| 104 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 105 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 106 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 107 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 108 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 109 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 110 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 111 | KeyguardStateChanged keyguard_state_changed = 62; |
| 112 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 113 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 114 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 115 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 116 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 117 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Tej Singh | 02200f9 | 2018-04-02 19:37:59 -0700 | [diff] [blame] | 118 | // 69 is blank but need not be. |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 119 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 120 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 121 | HardwareFailed hardware_failed = 72; |
| 122 | PhysicalDropDetected physical_drop_detected = 73; |
| 123 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 124 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 125 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 126 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 127 | AppCrashOccurred app_crash_occurred = 78; |
| 128 | ANROccurred anr_occurred = 79; |
| 129 | WTFOccurred wtf_occurred = 80; |
| 130 | LowMemReported low_mem_reported = 81; |
Howard Ro | cb767f6 | 2018-06-19 19:58:05 -0700 | [diff] [blame] | 131 | GenericAtom generic_atom = 82; |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 132 | KeyValuePairsAtom key_value_pairs_atom = 83; |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 133 | VibratorStateChanged vibrator_state_changed = 84; |
Yangster-mac | 9635300 | 2018-09-05 11:18:55 -0700 | [diff] [blame] | 134 | DeferredJobStatsReported deferred_job_stats_reported = 85; |
Yangster-mac | e16189a | 2018-08-26 12:20:16 -0700 | [diff] [blame] | 135 | ThermalThrottlingStateChanged thermal_throttling = 86; |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 136 | FingerprintAcquired fingerprint_acquired = 87; |
| 137 | FingerprintAuthenticated fingerprint_authenticated = 88; |
| 138 | FingerprintErrorOccurred fingerprint_error_occurred = 89; |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 139 | Notification notification = 90; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 140 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 141 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 142 | // Pulled events will start at field 10000. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 143 | // Next: 10025 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 144 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 145 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 146 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 147 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 148 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 149 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 150 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 151 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 152 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 153 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 154 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 155 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 156 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 157 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 158 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 159 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 160 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 161 | CpuActiveTime cpu_active_time = 10016; |
| 162 | CpuClusterTime cpu_cluster_time = 10017; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 163 | DiskSpace disk_space = 10018 [deprecated=true]; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 164 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 165 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 166 | Temperature temperature = 10021; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 167 | BinderCalls binder_calls = 10022; |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 168 | BinderCallsExceptions binder_calls_exceptions = 10023; |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 169 | LooperStats looper_stats = 10024; |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 170 | DiskStats disk_stats = 10025; |
| 171 | DirectoryUsage directory_usage = 10026; |
| 172 | AppSize app_size = 10027; |
| 173 | CategorySize category_size = 10028; |
Bookatz | 17f0d8a | 2018-09-13 12:56:32 -0700 | [diff] [blame] | 174 | BatteryVoltage battery_voltage = 10030; |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 175 | NumFingerprints num_fingerprints = 10031; |
Chenjie Yu | 12e5e67 | 2018-09-14 15:54:59 -0700 | [diff] [blame] | 176 | ProcStats proc_stats = 10029; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 177 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 178 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 179 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 180 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 181 | // 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] | 182 | } |
| 183 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 184 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 185 | * This proto represents a node of an attribution chain. |
| 186 | * Note: All attribution chains are represented as a repeated field of type |
| 187 | * AttributionNode. It is understood that in such arrays, the order is that |
| 188 | * 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] | 189 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 190 | message AttributionNode { |
| 191 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 192 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 193 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 194 | // The (optional) string tag for an element in the attribution chain. If the |
| 195 | // element has no tag, it is encoded as an empty string. |
| 196 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 197 | } |
| 198 | |
Yangster-mac | 48b3d62 | 2018-08-18 12:38:11 -0700 | [diff] [blame] | 199 | message KeyValuePair { |
| 200 | optional int32 key = 1; |
| 201 | oneof value { |
| 202 | int64 value_int = 2; |
| 203 | string value_str = 3; |
| 204 | float value_float = 4; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | message KeyValuePairsAtom { |
| 209 | optional int32 uid = 1; |
| 210 | repeated KeyValuePair pairs = 2; |
| 211 | } |
| 212 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 213 | /* |
| 214 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 215 | * 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] | 216 | * |
| 217 | * RULES: |
| 218 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 219 | * Skipping field ids is not allowed. |
| 220 | * - These form an API, so renaming, renumbering or removing fields is |
| 221 | * not allowed between android releases. (This is not currently enforced, |
| 222 | * but there will be a tool to enforce this restriction). |
| 223 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 224 | * are allowed (yet). The bytes type is also not allowed. |
| 225 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 226 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 227 | * - 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] | 228 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 229 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 230 | * annotation. The generated code on android will be represented by UIDs, |
| 231 | * and those UIDs will be translated in xxx to those strings. |
| 232 | * |
| 233 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 234 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 235 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 236 | * ***************************************************************************** |
| 237 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 238 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 239 | /** |
Yangster-mac | e16189a | 2018-08-26 12:20:16 -0700 | [diff] [blame] | 240 | * Logs when the Thermal service HAL notifies the throttling start/stop events. |
| 241 | * |
| 242 | * Logged from: |
| 243 | * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java |
| 244 | */ |
| 245 | message ThermalThrottlingStateChanged { |
| 246 | optional android.os.TemperatureTypeEnum sensor_type = 1; |
| 247 | |
| 248 | enum State { |
| 249 | UNKNOWN = 0; |
| 250 | START = 1; |
| 251 | STOP = 2; |
| 252 | } |
| 253 | |
| 254 | optional State state = 2; |
| 255 | |
| 256 | optional float temperature = 3; |
| 257 | } |
| 258 | |
| 259 | /** |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 260 | * Logs when the screen state changes. |
| 261 | * |
| 262 | * Logged from: |
| 263 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 264 | */ |
| 265 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 266 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 267 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 268 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 269 | |
| 270 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 271 | * Logs that the process state of the uid, as determined by ActivityManager |
| 272 | * (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] | 273 | * |
| 274 | * Logged from: |
| 275 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 276 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 277 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 278 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 279 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 280 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 281 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | /** |
Chenjie Yu | bd1a28f | 2018-07-17 14:55:19 -0700 | [diff] [blame] | 285 | * Logs process state change of a process, as per the activity manager. |
| 286 | * |
| 287 | * Logged from: |
| 288 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 289 | */ |
| 290 | message ProcessStateChanged { |
| 291 | optional int32 uid = 1; |
| 292 | optional string process_name = 2; |
| 293 | optional string package_name = 3; |
| 294 | // TODO: remove this when validation is done |
| 295 | optional int64 version = 5; |
| 296 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
| 297 | optional android.app.ProcessStateEnum state = 4; |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * Logs when ActivityManagerService sleep state is changed. |
| 302 | * |
| 303 | * Logged from: |
| 304 | * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java |
| 305 | */ |
| 306 | message ActivityManagerSleepStateChanged { |
| 307 | // TODO: import frameworks proto |
| 308 | enum State { |
| 309 | UNKNOWN = 0; |
| 310 | ASLEEP = 1; |
| 311 | AWAKE = 2; |
| 312 | } |
| 313 | optional State state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Logs when system memory state changes. |
| 318 | * |
| 319 | * Logged from: |
| 320 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 321 | */ |
| 322 | message MemoryFactorStateChanged { |
| 323 | // TODO: import frameworks proto |
| 324 | enum State { |
| 325 | MEMORY_UNKNOWN = 0; |
| 326 | NORMAL = 1; // normal. |
| 327 | MODERATE = 2; // moderate memory pressure. |
| 328 | LOW = 3; // low memory. |
| 329 | CRITICAL = 4; // critical memory. |
| 330 | |
| 331 | } |
| 332 | optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE]; |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Logs when app is using too much cpu, according to ActivityManagerService. |
| 337 | * |
| 338 | * Logged from: |
| 339 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 340 | */ |
| 341 | message ExcessiveCpuUsageReported { |
| 342 | optional int32 uid = 1; |
| 343 | optional string process_name = 2; |
| 344 | optional string package_name = 3; |
| 345 | // package version. TODO: remove this when validation is done |
| 346 | optional int64 version = 4; |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * Logs when a cached process is killed, along with its pss. |
| 351 | * |
| 352 | * Logged from: |
| 353 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 354 | */ |
| 355 | message CachedKillReported { |
| 356 | optional int32 uid = 1; |
| 357 | optional string process_name = 2; |
| 358 | optional string package_name = 3; |
| 359 | // TODO: remove this when validation is done |
| 360 | optional int64 version = 5; |
| 361 | optional int64 pss = 4; |
| 362 | } |
| 363 | |
| 364 | /** |
| 365 | * Logs when memory stats of a process is reported. |
| 366 | * |
| 367 | * Logged from: |
| 368 | * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java |
| 369 | */ |
| 370 | message ProcessMemoryStatReported { |
| 371 | optional int32 uid = 1; |
| 372 | optional string process_name = 2; |
| 373 | optional string package_name = 3; |
| 374 | //TODO: remove this when validation is done |
| 375 | optional int64 version = 9; |
| 376 | optional int64 pss = 4; |
| 377 | optional int64 uss = 5; |
| 378 | optional int64 rss = 6; |
| 379 | enum Type { |
| 380 | ADD_PSS_INTERNAL_SINGLE = 0; |
| 381 | ADD_PSS_INTERNAL_ALL_MEM = 1; |
| 382 | ADD_PSS_INTERNAL_ALL_POLL = 2; |
| 383 | ADD_PSS_EXTERNAL = 3; |
| 384 | ADD_PSS_EXTERNAL_SLOW = 4; |
| 385 | } |
| 386 | optional Type type = 7; |
| 387 | optional int64 duration = 8; |
| 388 | } |
| 389 | |
| 390 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 391 | * Logs that a process started, finished, crashed, or ANRed. |
| 392 | * |
| 393 | * Logged from: |
| 394 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 395 | */ |
| 396 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 397 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 398 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 399 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 400 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 401 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 402 | // What lifecycle state the process changed to. |
| 403 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 404 | enum State { |
| 405 | FINISHED = 0; |
| 406 | STARTED = 1; |
| 407 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 408 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 409 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 410 | } |
| 411 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 412 | /** |
| 413 | * Logs when the ble scan state changes. |
| 414 | * |
| 415 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 416 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 417 | */ |
| 418 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 419 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 420 | |
| 421 | enum State { |
| 422 | OFF = 0; |
| 423 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 424 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 425 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 426 | } |
| 427 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 428 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 429 | // Does the scan have a filter. |
| 430 | optional bool is_filtered = 3; |
| 431 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 432 | optional bool is_first_match = 4; |
| 433 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 434 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | /** |
| 438 | * Logs reporting of a ble scan finding results. |
| 439 | * |
| 440 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 441 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 442 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 443 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 444 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 445 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 446 | |
| 447 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 448 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Logs when a sensor state changes. |
| 453 | * |
| 454 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 455 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 456 | */ |
| 457 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 458 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 459 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 460 | // The id (int) of the sensor. |
| 461 | optional int32 sensor_id = 2; |
| 462 | |
| 463 | enum State { |
| 464 | OFF = 0; |
| 465 | ON = 1; |
| 466 | } |
| 467 | optional State state = 3; |
| 468 | } |
| 469 | |
| 470 | |
| 471 | /** |
| 472 | * Logs when GPS state changes. |
| 473 | * |
| 474 | * Logged from: |
| 475 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 476 | */ |
| 477 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 478 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 479 | |
| 480 | enum State { |
| 481 | OFF = 0; |
| 482 | ON = 1; |
| 483 | } |
| 484 | optional State state = 2; |
| 485 | } |
| 486 | |
| 487 | |
| 488 | /** |
| 489 | * Logs when a sync manager sync state changes. |
| 490 | * |
| 491 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 492 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 493 | */ |
| 494 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 495 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 496 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 497 | // 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] | 498 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 499 | |
| 500 | enum State { |
| 501 | OFF = 0; |
| 502 | ON = 1; |
| 503 | } |
| 504 | optional State state = 3; |
| 505 | } |
| 506 | |
Yangster-mac | 9635300 | 2018-09-05 11:18:55 -0700 | [diff] [blame] | 507 | /* |
| 508 | * Deferred job stats. |
| 509 | * |
| 510 | * Logged from: |
| 511 | * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java |
| 512 | */ |
| 513 | message DeferredJobStatsReported { |
| 514 | repeated AttributionNode attribution_node = 1; |
| 515 | |
| 516 | // Number of jobs deferred. |
| 517 | optional int32 num_jobs_deferred = 2; |
| 518 | |
| 519 | // Time since the last job runs. |
| 520 | optional int64 time_since_last_job_millis = 3; |
| 521 | } |
| 522 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 523 | /** |
| 524 | * Logs when a job scheduler job state changes. |
| 525 | * |
| 526 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 527 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 528 | */ |
| 529 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 530 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 531 | |
| 532 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 533 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 534 | |
| 535 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 536 | FINISHED = 0; |
| 537 | STARTED = 1; |
| 538 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 539 | } |
| 540 | optional State state = 3; |
| 541 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 542 | // The reason a job has stopped. |
| 543 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 544 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 545 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | /** |
| 549 | * Logs when the audio state changes. |
| 550 | * |
| 551 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 552 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 553 | */ |
| 554 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 555 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 556 | |
| 557 | enum State { |
| 558 | OFF = 0; |
| 559 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 560 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 561 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 562 | } |
| 563 | optional State state = 2; |
| 564 | } |
| 565 | |
| 566 | /** |
| 567 | * Logs when the video codec state changes. |
| 568 | * |
| 569 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 570 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 571 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 572 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 573 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 574 | |
| 575 | enum State { |
| 576 | OFF = 0; |
| 577 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 578 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 579 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 580 | } |
| 581 | optional State state = 2; |
| 582 | } |
| 583 | |
| 584 | /** |
| 585 | * Logs when the flashlight state changes. |
| 586 | * |
| 587 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 588 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 589 | */ |
| 590 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 591 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 592 | |
| 593 | enum State { |
| 594 | OFF = 0; |
| 595 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 596 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 597 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 598 | } |
| 599 | optional State state = 2; |
| 600 | } |
| 601 | |
| 602 | /** |
| 603 | * Logs when the camera state changes. |
| 604 | * |
| 605 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 606 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 607 | */ |
| 608 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 609 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 610 | |
| 611 | enum State { |
| 612 | OFF = 0; |
| 613 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 614 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 615 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 616 | } |
| 617 | optional State state = 2; |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * 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] | 622 | * |
| 623 | * Logged from: |
| 624 | * TODO |
| 625 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 626 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 627 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 628 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 629 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 630 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 631 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 632 | |
| 633 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 634 | optional string tag = 3; |
| 635 | |
| 636 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 637 | RELEASE = 0; |
| 638 | ACQUIRE = 1; |
| 639 | CHANGE_RELEASE = 2; |
| 640 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 641 | } |
| 642 | optional State state = 4; |
| 643 | } |
| 644 | |
| 645 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 646 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 647 | * |
| 648 | * Logged from: |
| 649 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 650 | */ |
| 651 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 652 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 653 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 654 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 655 | optional string tag = 2; |
| 656 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 657 | // TODO: I have no idea what this is. |
| 658 | optional string history_tag = 3; |
| 659 | |
| 660 | enum State { |
| 661 | OFF = 0; |
| 662 | ON = 1; |
| 663 | } |
| 664 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 665 | } |
| 666 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 667 | /** |
| 668 | * Logs Battery Saver state change. |
| 669 | * |
| 670 | * Logged from: |
| 671 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 672 | */ |
| 673 | message BatterySaverModeStateChanged { |
| 674 | enum State { |
| 675 | OFF = 0; |
| 676 | ON = 1; |
| 677 | } |
| 678 | optional State state = 1; |
| 679 | } |
| 680 | |
| 681 | /** |
| 682 | * Logs Doze mode state change. |
| 683 | * |
| 684 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 685 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 686 | */ |
| 687 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 688 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 689 | } |
| 690 | |
| 691 | |
| 692 | /** |
| 693 | * Logs state change of Doze mode including maintenance windows. |
| 694 | * |
| 695 | * Logged from: |
| 696 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 697 | */ |
| 698 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 699 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | /** |
| 703 | * Logs screen brightness level. |
| 704 | * |
| 705 | * Logged from: |
| 706 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 707 | */ |
| 708 | message ScreenBrightnessChanged { |
| 709 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 710 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 711 | } |
| 712 | |
| 713 | /** |
| 714 | * Logs battery level (percent full, from 0 to 100). |
| 715 | * |
| 716 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 717 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 718 | */ |
| 719 | message BatteryLevelChanged { |
| 720 | // Battery level. Should be in [0, 100]. |
| 721 | optional int32 battery_level = 1; |
| 722 | } |
| 723 | |
| 724 | /** |
| 725 | * Logs change in charging status of the device. |
| 726 | * |
| 727 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 728 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 729 | */ |
| 730 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 731 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 732 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | /** |
| 736 | * Logs whether the device is plugged in, and what power source it is using. |
| 737 | * |
| 738 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 739 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 740 | */ |
| 741 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 742 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 743 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 744 | } |
| 745 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 746 | /** |
| 747 | * Logs when an app's wakeup alarm fires. |
| 748 | * |
| 749 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 750 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 751 | */ |
| 752 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 753 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 754 | |
| 755 | // Name of the wakeup alarm. |
| 756 | optional string tag = 2; |
| 757 | } |
| 758 | |
| 759 | /** |
| 760 | * Logs when an an app causes the mobile radio to change state. |
| 761 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 762 | * |
| 763 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 764 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 765 | */ |
| 766 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 767 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 768 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 769 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 770 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 771 | } |
| 772 | |
| 773 | /** |
| 774 | * Logs when an an app causes the wifi radio to change state. |
| 775 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 776 | * |
| 777 | * Logged from: |
Bookatz | 0b028b1 | 2018-05-31 16:51:17 -0700 | [diff] [blame] | 778 | * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 779 | */ |
| 780 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 781 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 782 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 783 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 784 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 785 | } |
| 786 | |
| 787 | /** |
| 788 | * Logs kernel wakeup reasons and aborts. |
| 789 | * |
| 790 | * Logged from: |
Bookatz | 56585ca | 2018-09-07 11:38:45 -0700 | [diff] [blame] | 791 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 792 | */ |
| 793 | message KernelWakeupReported { |
| 794 | // Name of the kernel wakeup reason (or abort). |
| 795 | optional string wakeup_reason_name = 1; |
| 796 | |
| 797 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 798 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 799 | } |
| 800 | |
| 801 | /** |
| 802 | * Logs wifi locks held by an app. |
| 803 | * |
| 804 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 805 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 806 | */ |
| 807 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 808 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 809 | |
| 810 | enum State { |
| 811 | OFF = 0; |
| 812 | ON = 1; |
| 813 | } |
| 814 | optional State state = 2; |
| 815 | } |
| 816 | |
| 817 | /** |
| 818 | * Logs wifi signal strength changes. |
| 819 | * |
| 820 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 821 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 822 | */ |
| 823 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 824 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 825 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 826 | } |
| 827 | |
| 828 | /** |
| 829 | * Logs wifi scans performed by an app. |
| 830 | * |
| 831 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 832 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 833 | */ |
| 834 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 835 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 836 | |
| 837 | enum State { |
| 838 | OFF = 0; |
| 839 | ON = 1; |
| 840 | } |
| 841 | optional State state = 2; |
| 842 | } |
| 843 | |
| 844 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 845 | * Logs wifi multicast locks held by an app |
| 846 | * |
| 847 | * Logged from: |
| 848 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 849 | */ |
| 850 | message WifiMulticastLockStateChanged { |
| 851 | repeated AttributionNode attribution_node = 1; |
| 852 | |
| 853 | enum State { |
| 854 | OFF = 0; |
| 855 | ON = 1; |
| 856 | } |
| 857 | optional State state = 2; |
| 858 | } |
| 859 | |
| 860 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 861 | * Logs shutdown reason and duration on next boot. |
| 862 | * |
| 863 | * Logged from: |
| 864 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 865 | */ |
| 866 | message ShutdownSequenceReported { |
| 867 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 868 | optional bool reboot = 1; |
| 869 | |
| 870 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 871 | optional string reason = 2; |
| 872 | |
| 873 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 874 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 875 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 876 | |
| 877 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 878 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 879 | } |
| 880 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 881 | |
| 882 | /** |
| 883 | * Logs boot reason and duration. |
| 884 | * |
| 885 | * Logged from: |
| 886 | * system/core/bootstat/bootstat.cpp |
| 887 | */ |
| 888 | message BootSequenceReported { |
| 889 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 890 | // Default: "<EMPTY>" if not available. |
| 891 | optional string bootloader_reason = 1; |
| 892 | |
| 893 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 894 | // Default: "<EMPTY>" if not available. |
| 895 | optional string system_reason = 2; |
| 896 | |
| 897 | // 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] | 898 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 899 | |
| 900 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 901 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 902 | |
| 903 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 904 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 905 | |
| 906 | // Time since last boot in ms. Default: 0 if not available. |
| 907 | optional int64 time_since_last_boot = 6; |
| 908 | } |
| 909 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 910 | |
| 911 | /** |
| 912 | * Logs call state and disconnect cause (if applicable). |
| 913 | * |
| 914 | * Logged from: |
| 915 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 916 | */ |
| 917 | message CallStateChanged { |
| 918 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 919 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 920 | optional android.telecom.CallStateEnum call_state = 1; |
| 921 | |
| 922 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 923 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 924 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 925 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 926 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 927 | |
| 928 | // True if the call is self-managed, which are apps that use the |
| 929 | // telecom infrastructure to make their own calls. |
| 930 | optional bool self_managed = 3; |
| 931 | |
| 932 | // True if call is external. External calls are calls on connected Wear |
| 933 | // devices but show up in Telecom so the user can pull them onto the device. |
| 934 | optional bool external_call = 4; |
| 935 | } |
| 936 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 937 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 938 | * Logs keyguard state. The keyguard is the lock screen. |
| 939 | * |
| 940 | * Logged from: |
| 941 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 942 | */ |
| 943 | message KeyguardStateChanged { |
| 944 | enum State { |
| 945 | UNKNOWN = 0; |
| 946 | // The keyguard is hidden when the phone is unlocked. |
| 947 | HIDDEN = 1; |
| 948 | // The keyguard is shown when the phone is locked (screen turns off). |
| 949 | SHOWN= 2; |
| 950 | // The keyguard is occluded when something is overlaying the keyguard. |
| 951 | // Eg. Opening the camera while on the lock screen. |
| 952 | OCCLUDED = 3; |
| 953 | } |
| 954 | optional State state = 1; |
| 955 | } |
| 956 | |
| 957 | /** |
| 958 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 959 | * prompts the user to enter a password (pattern, pin, etc). |
| 960 | * |
| 961 | * Logged from: |
| 962 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 963 | */ |
| 964 | |
| 965 | message KeyguardBouncerStateChanged { |
| 966 | enum State { |
| 967 | UNKNOWN = 0; |
| 968 | // Bouncer is hidden, either as a result of successfully entering the |
| 969 | // password, screen timing out, or user going back to lock screen. |
| 970 | HIDDEN = 1; |
| 971 | // This is when the user is being prompted to enter the password. |
| 972 | SHOWN = 2; |
| 973 | } |
| 974 | optional State state = 1; |
| 975 | } |
| 976 | |
| 977 | /** |
| 978 | * Logs the result of entering a password into the keyguard bouncer. |
| 979 | * |
| 980 | * Logged from: |
| 981 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 982 | */ |
| 983 | message KeyguardBouncerPasswordEntered { |
| 984 | enum BouncerResult { |
| 985 | UNKNOWN = 0; |
| 986 | // The password entered was incorrect. |
| 987 | FAILURE = 1; |
| 988 | // The password entered was correct. |
| 989 | SUCCESS = 2; |
| 990 | } |
| 991 | optional BouncerResult result = 1; |
| 992 | } |
| 993 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 994 | /* |
| 995 | * Logs changes to the configuration of the device. The configuration is defined |
| 996 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 997 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 998 | * Please go there to interpret the possible values each field can be. |
| 999 | * |
| 1000 | * Logged from: |
| 1001 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1002 | */ |
| 1003 | message ResourceConfigurationChanged { |
| 1004 | // Bit mask of color capabilities of the screen. |
| 1005 | // Contains information about the color gamut and hdr mode of the screen. |
| 1006 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 1007 | optional int32 colorMode = 1; |
| 1008 | |
| 1009 | // The target screen density being rendered to. |
| 1010 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 1011 | optional int32 densityDpi = 2; |
| 1012 | |
| 1013 | // Current user preference for the scaling factor for fonts, |
| 1014 | // relative to the base density scaling. |
| 1015 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 1016 | optional float fontScale = 3; |
| 1017 | |
| 1018 | // Flag indicating whether the hard keyboard is hidden. |
| 1019 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 1020 | optional int32 hardKeyboardHidden = 4; |
| 1021 | |
| 1022 | // The type of keyboard attached to the device. |
| 1023 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 1024 | optional int32 keyboard = 5; |
| 1025 | |
| 1026 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 1027 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 1028 | optional int32 keyboardHideen = 6; |
| 1029 | |
| 1030 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 1031 | // 0 if undefined. |
| 1032 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 1033 | optional int32 mcc = 7; |
| 1034 | |
| 1035 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 1036 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 1037 | // MNC_ZERO symbol defined in Configuration.java. |
| 1038 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 1039 | optional int32 mnc = 8; |
| 1040 | |
| 1041 | // The kind of navigation available on the device. |
| 1042 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 1043 | optional int32 navigation = 9; |
| 1044 | |
| 1045 | // Flag indicating whether the navigation is available. |
| 1046 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 1047 | optional int32 navigationHidden = 10; |
| 1048 | |
| 1049 | // Overall orientation of the screen. |
| 1050 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 1051 | optional int32 orientation = 11; |
| 1052 | |
| 1053 | // The current height of the available screen space, in dp units. |
| 1054 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 1055 | optional int32 screenHeightDp = 12; |
| 1056 | |
| 1057 | // Bit mask of overall layout of the screen. |
| 1058 | // Contains information about screen size, whether the screen is wider/taller |
| 1059 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 1060 | // and whether the screen has a rounded shape. |
| 1061 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 1062 | optional int32 screenLayout = 13; |
| 1063 | |
| 1064 | // Current width of the available screen space, in dp units. |
| 1065 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 1066 | optional int32 screenWidthDp = 14; |
| 1067 | |
| 1068 | // The smallest screen size an application will see in normal operation. |
| 1069 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 1070 | // in portrait and landscape. |
| 1071 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 1072 | optional int32 smallestScreenWidthDp = 15; |
| 1073 | |
| 1074 | // The type of touch screen attached to the device. |
| 1075 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 1076 | optional int32 touchscreen = 16; |
| 1077 | |
| 1078 | // Bit mask of the ui mode. |
| 1079 | // Contains information about the overall ui mode of the device. |
| 1080 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 1081 | // Also contains information about whether the device is in night mode. |
| 1082 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 1083 | optional int32 uiMode = 17; |
| 1084 | } |
| 1085 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1086 | |
| 1087 | /** |
| 1088 | * Logs changes in the connection state of the mobile radio. |
| 1089 | * |
| 1090 | * Logged from: |
| 1091 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 1092 | */ |
| 1093 | message MobileConnectionStateChanged { |
| 1094 | // States are from the state machine DataConnection.java. |
| 1095 | enum State { |
| 1096 | UNKNOWN = 0; |
| 1097 | // The connection is inactive, or disconnected. |
| 1098 | INACTIVE = 1; |
| 1099 | // The connection is being activated, or connecting. |
| 1100 | ACTIVATING = 2; |
| 1101 | // The connection is active, or connected. |
| 1102 | ACTIVE = 3; |
| 1103 | // The connection is disconnecting. |
| 1104 | DISCONNECTING = 4; |
| 1105 | // The connection is disconnecting after creating a connection. |
| 1106 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 1107 | } |
| 1108 | optional State state = 1; |
| 1109 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1110 | optional int32 sim_slot_index = 2; |
| 1111 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 1112 | // every new network created. Resets whenever the device reboots. |
| 1113 | optional int32 data_connection_id = 3; |
| 1114 | // A bitmask for the capabilities of this connection. |
| 1115 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 1116 | // Default value (if we have no information): 0 |
| 1117 | optional int64 capabilities = 4; |
| 1118 | // If this connection has internet. |
| 1119 | // This just checks if the DEFAULT bit of capabilities is set. |
| 1120 | optional bool has_internet = 5; |
| 1121 | } |
| 1122 | |
| 1123 | /** |
| 1124 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 1125 | * |
| 1126 | * Logged from: |
| 1127 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 1128 | */ |
| 1129 | message MobileRadioTechnologyChanged { |
| 1130 | optional android.telephony.NetworkTypeEnum state = 1; |
| 1131 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1132 | optional int32 sim_slot_index = 2; |
| 1133 | } |
| 1134 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1135 | /** |
| 1136 | * Logs the VID and PID of any connected USB devices. |
| 1137 | * |
| 1138 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 1139 | * |
| 1140 | * Logged by Vendor. |
| 1141 | */ |
| 1142 | message UsbDeviceAttached { |
| 1143 | optional int32 vid = 1; |
| 1144 | optional int32 pid = 2; |
| 1145 | optional bool has_audio = 3; |
| 1146 | optional bool has_hid = 4; |
| 1147 | optional bool has_storage = 5; |
| 1148 | } |
| 1149 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1150 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1151 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1152 | * Logs when Bluetooth is enabled and disabled. |
| 1153 | * |
| 1154 | * Logged from: |
| 1155 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 1156 | */ |
| 1157 | message BluetoothEnabledStateChanged { |
| 1158 | repeated AttributionNode attribution_node = 1; |
| 1159 | // Whether or not bluetooth is enabled on the device. |
| 1160 | enum State { |
| 1161 | UNKNOWN = 0; |
| 1162 | ENABLED = 1; |
| 1163 | DISABLED = 2; |
| 1164 | } |
| 1165 | optional State state = 2; |
| 1166 | // The reason for being enabled/disabled. |
| 1167 | // Eg. Airplane mode, crash, application request. |
| 1168 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 1169 | // If the reason is an application request, this will be the package name. |
| 1170 | optional string pkgName = 4; |
| 1171 | } |
| 1172 | |
| 1173 | /** |
| 1174 | * Logs when a Bluetooth device connects and disconnects. |
| 1175 | * |
| 1176 | * Logged from: |
| 1177 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1178 | */ |
| 1179 | message BluetoothConnectionStateChanged { |
| 1180 | // The state of the connection. |
| 1181 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1182 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1183 | // An identifier that can be used to match connect and disconnect events. |
| 1184 | // Currently is last two bytes of a hash of a device level ID and |
| 1185 | // the mac address of the bluetooth device that is connected. |
| 1186 | optional int32 obfuscated_id = 2; |
| 1187 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1188 | // From android.bluetooth.BluetoothAdapter.java |
| 1189 | optional int32 bt_profile = 3; |
| 1190 | } |
| 1191 | |
| 1192 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1193 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1194 | * |
| 1195 | * Logged from: |
| 1196 | * Vendor USB HAL. |
| 1197 | */ |
| 1198 | message UsbConnectorStateChanged { |
| 1199 | enum State { |
| 1200 | DISCONNECTED = 0; |
| 1201 | CONNECTED = 1; |
| 1202 | } |
| 1203 | optional State state = 1; |
| 1204 | } |
| 1205 | |
| 1206 | /** |
| 1207 | * Logs the reported speaker impedance. |
| 1208 | * |
| 1209 | * Logged from: |
| 1210 | * Vendor audio implementation. |
| 1211 | */ |
| 1212 | message SpeakerImpedanceReported { |
| 1213 | optional int32 speaker_location = 1; |
| 1214 | optional int32 impedance = 2; |
| 1215 | } |
| 1216 | |
| 1217 | /** |
| 1218 | * Logs the report of a failed hardware. |
| 1219 | * |
| 1220 | * Logged from: |
| 1221 | * Vendor HALs. |
| 1222 | * |
| 1223 | */ |
| 1224 | message HardwareFailed { |
| 1225 | enum HardwareType { |
| 1226 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1227 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1228 | HARDWARE_FAILED_CODEC = 2; |
| 1229 | HARDWARE_FAILED_SPEAKER = 3; |
| 1230 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1231 | } |
| 1232 | optional HardwareType hardware_type = 1; |
| 1233 | |
| 1234 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1235 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1236 | * referring to board-specific numbering schemes. |
| 1237 | */ |
| 1238 | optional int32 hardware_location = 2; |
| 1239 | |
| 1240 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1241 | * It should use the enum values defined below. |
| 1242 | */ |
| 1243 | enum MicrophoneFailureCode { |
| 1244 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1245 | } |
| 1246 | enum CodecFailureCode { |
| 1247 | CODEC_FAILURE_COMPLETE = 0; |
| 1248 | } |
| 1249 | enum SpeakerFailureCode { |
| 1250 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1251 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1252 | SPEAKER_FAILURE_SHORT = 2; |
| 1253 | } |
| 1254 | enum FingerprintFailureCode { |
| 1255 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1256 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1257 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1258 | } |
| 1259 | optional int32 failure_code = 3; |
| 1260 | } |
| 1261 | |
| 1262 | /** |
| 1263 | * Log an event when the device has been physically dropped. |
| 1264 | * Reported from the /vendor partition. |
| 1265 | */ |
| 1266 | message PhysicalDropDetected { |
| 1267 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1268 | optional int32 confidence_pctg = 1; |
| 1269 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1270 | optional int32 accel_peak_thousandths_g = 2; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1271 | // Duration of freefall in ms |
| 1272 | optional int32 freefall_time_millis = 3; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1273 | } |
| 1274 | |
| 1275 | /** |
| 1276 | * Log bucketed battery charge cycles. |
| 1277 | * |
| 1278 | * Each bucket represents cycles of the battery past |
| 1279 | * a given charge point. For example, bucket 1 is the |
| 1280 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1281 | * |
| 1282 | * Logged from: |
| 1283 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1284 | */ |
| 1285 | message ChargeCyclesReported { |
| 1286 | optional int32 cycle_bucket_1 = 1; |
| 1287 | optional int32 cycle_bucket_2 = 2; |
| 1288 | optional int32 cycle_bucket_3 = 3; |
| 1289 | optional int32 cycle_bucket_4 = 4; |
| 1290 | optional int32 cycle_bucket_5 = 5; |
| 1291 | optional int32 cycle_bucket_6 = 6; |
| 1292 | optional int32 cycle_bucket_7 = 7; |
| 1293 | optional int32 cycle_bucket_8 = 8; |
| 1294 | } |
| 1295 | |
| 1296 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1297 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 1298 | * |
| 1299 | * Logged from: |
| 1300 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1301 | */ |
| 1302 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1303 | // The UID that logged this atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1304 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1305 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1306 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1307 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1308 | } |
| 1309 | |
| 1310 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1311 | * Logs phone signal strength changes. |
| 1312 | * |
| 1313 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1314 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1315 | */ |
| 1316 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1317 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1318 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1319 | } |
| 1320 | |
| 1321 | /** |
| 1322 | * Logs that a setting was updated. |
| 1323 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1324 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1325 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1326 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1327 | */ |
| 1328 | message SettingChanged { |
| 1329 | // The name of the setting. |
| 1330 | optional string setting = 1; |
| 1331 | |
| 1332 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1333 | optional string value = 2; |
| 1334 | |
| 1335 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1336 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1337 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1338 | // The +/- feature is currently only used for location_providers_allowed. |
| 1339 | optional string new_value = 3; |
| 1340 | |
| 1341 | // The previous value of this setting. |
| 1342 | optional string prev_value = 4; |
| 1343 | |
| 1344 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1345 | optional string tag = 5; |
| 1346 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1347 | // True if this setting with tag should be resettable. |
| 1348 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1349 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1350 | // 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] | 1351 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1352 | |
| 1353 | enum ChangeReason { |
| 1354 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1355 | DELETED = 2; |
| 1356 | } |
| 1357 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1358 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1359 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1360 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1361 | * Logs activity going to foreground or background |
| 1362 | * |
| 1363 | * Logged from: |
| 1364 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1365 | */ |
| 1366 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1367 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1368 | optional string pkg_name = 2; |
| 1369 | optional string class_name = 3; |
| 1370 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1371 | enum State { |
| 1372 | BACKGROUND = 0; |
| 1373 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1374 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1375 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1376 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1377 | |
| 1378 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1379 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1380 | * Logged from: |
| 1381 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1382 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1383 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1384 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1385 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1386 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1387 | |
| 1388 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1389 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1390 | optional string process_name = 3; |
| 1391 | |
| 1392 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1393 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1394 | |
| 1395 | optional string package_name = 5; |
| 1396 | |
| 1397 | enum InstantApp { |
| 1398 | UNAVAILABLE = 0; |
| 1399 | FALSE = 1; |
| 1400 | TRUE = 2; |
| 1401 | } |
| 1402 | optional InstantApp is_instant_app = 6; |
| 1403 | |
| 1404 | enum ForegroundState { |
| 1405 | UNKNOWN = 0; |
| 1406 | BACKGROUND = 1; |
| 1407 | FOREGROUND = 2; |
| 1408 | } |
| 1409 | optional ForegroundState foreground_state = 7; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1410 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1411 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1412 | /** |
| 1413 | * Logs when a WTF (What a Terrible Failure) happened. |
| 1414 | * Logged from: |
| 1415 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1416 | */ |
| 1417 | message WTFOccurred { |
| 1418 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1419 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1420 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1421 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1422 | // The name of the process. |
| 1423 | // system_server if it is not by an app |
| 1424 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1425 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1426 | // The pid if available. -1 means not available. |
| 1427 | optional sint32 pid = 4; |
| 1428 | } |
| 1429 | |
| 1430 | /** |
| 1431 | * Logs when system server reports low memory. |
| 1432 | * Logged from: |
| 1433 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1434 | */ |
| 1435 | message LowMemReported { |
| 1436 | } |
| 1437 | |
| 1438 | /** |
| 1439 | * Logs when an app ANR (App Not Responding) occurs. |
| 1440 | * Logged from: |
| 1441 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 1442 | */ |
| 1443 | message ANROccurred { |
| 1444 | optional int32 uid = 1 [(is_uid) = true]; |
| 1445 | |
| 1446 | optional string process_name = 2; |
| 1447 | |
| 1448 | optional string short_component_name = 3; |
| 1449 | |
| 1450 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 1451 | |
| 1452 | enum InstantApp { |
| 1453 | UNAVAILABLE = 0; |
| 1454 | FALSE = 1; |
| 1455 | TRUE = 2; |
| 1456 | } |
| 1457 | optional InstantApp is_instant_app = 5; |
| 1458 | |
| 1459 | enum ForegroundState { |
| 1460 | UNKNOWN = 0; |
| 1461 | BACKGROUND = 1; |
| 1462 | FOREGROUND = 2; |
| 1463 | } |
| 1464 | optional ForegroundState foreground_state = 6; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1465 | } |
| 1466 | |
Bookatz | a7020bd | 2018-08-28 16:29:35 -0700 | [diff] [blame] | 1467 | /** |
| 1468 | * Logs when the vibrator state changes. |
| 1469 | * Logged from: |
| 1470 | * frameworks/base/services/core/java/com/android/server/VibratorService.java |
| 1471 | */ |
| 1472 | message VibratorStateChanged { |
| 1473 | repeated AttributionNode attribution_node = 1; |
| 1474 | |
| 1475 | enum State { |
| 1476 | OFF = 0; |
| 1477 | ON = 1; |
| 1478 | } |
| 1479 | optional State state = 2; |
| 1480 | |
| 1481 | // Duration (in milliseconds) requested to keep the vibrator on. |
| 1482 | // Only applicable for State == ON. |
| 1483 | optional int64 duration_millis = 3; |
| 1484 | } |
| 1485 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1486 | /* |
| 1487 | * Allows other apps to push events into statsd. |
| 1488 | * Logged from: |
| 1489 | * frameworks/base/core/java/android/util/StatsLog.java |
| 1490 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1491 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1492 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1493 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1494 | |
| 1495 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 1496 | optional int32 label = 2; |
| 1497 | |
| 1498 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 1499 | // predicates for the metrics). |
| 1500 | enum State { |
| 1501 | UNKNOWN = 0; |
| 1502 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 1503 | STOP = 2; |
| 1504 | START = 3; |
| 1505 | } |
| 1506 | optional State state = 3; |
| 1507 | } |
| 1508 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1509 | /** |
Bookatz | 7948c87 | 2018-09-04 12:58:33 -0700 | [diff] [blame] | 1510 | * Logs the wall-clock time when a significant wall-clock time shift occurs. |
| 1511 | * For example, this could be due to the user manually changing the time. |
| 1512 | * |
| 1513 | * Logged from: |
| 1514 | * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java |
| 1515 | */ |
| 1516 | message WallClockTimeShifted { |
| 1517 | // New wall-clock time in milliseconds, according to System.currentTimeMillis(). |
| 1518 | optional int64 wall_clock_timestamp_millis = 1; |
| 1519 | } |
| 1520 | |
| 1521 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1522 | * Logs when statsd detects an anomaly. |
| 1523 | * |
| 1524 | * Logged from: |
| 1525 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 1526 | */ |
| 1527 | message AnomalyDetected { |
| 1528 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1529 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1530 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1531 | // Id of the config whose anomaly detection alert fired. |
| 1532 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1533 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1534 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 1535 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1536 | } |
| 1537 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1538 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1539 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1540 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1541 | |
| 1542 | // The app package name. |
| 1543 | optional string pkg_name = 2; |
| 1544 | |
| 1545 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1546 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1547 | WARM = 1; |
| 1548 | HOT = 2; |
| 1549 | COLD = 3; |
| 1550 | } |
| 1551 | // The transition type. |
| 1552 | optional TransitionType type = 3; |
| 1553 | |
| 1554 | // The activity name. |
| 1555 | optional string activity_name = 4; |
| 1556 | |
| 1557 | // The name of the calling app. Empty if not set. |
| 1558 | optional string calling_pkg_name = 5; |
| 1559 | |
| 1560 | // Whether the app is an instant app. |
| 1561 | optional bool is_instant_app = 6; |
| 1562 | |
| 1563 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1564 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1565 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 1566 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1567 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1568 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1569 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1570 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1571 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1572 | optional int32 bind_application_delay_millis = 11; |
| 1573 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1574 | |
| 1575 | // Empty if not set. |
| 1576 | optional string launch_token = 13; |
| 1577 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1578 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1579 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1580 | |
| 1581 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 1582 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1583 | } |
| 1584 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1585 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1586 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1587 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1588 | |
| 1589 | // The app package name. |
| 1590 | optional string pkg_name = 2; |
| 1591 | |
| 1592 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1593 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1594 | WARM = 1; |
| 1595 | HOT = 2; |
| 1596 | COLD = 3; |
| 1597 | } |
| 1598 | // The transition type. |
| 1599 | optional TransitionType type = 3; |
| 1600 | |
| 1601 | // The activity name. |
| 1602 | optional string activity_name = 4; |
| 1603 | } |
| 1604 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1605 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1606 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1607 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1608 | |
| 1609 | // The app package name. |
| 1610 | optional string pkg_name = 2; |
| 1611 | |
| 1612 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1613 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1614 | WITH_BUNDLE = 1; |
| 1615 | WITHOUT_BUNDLE = 2; |
| 1616 | } |
| 1617 | // The transition type. |
| 1618 | optional TransitionType type = 3; |
| 1619 | |
| 1620 | // The activity name. |
| 1621 | optional string activity_name = 4; |
| 1622 | |
| 1623 | optional bool transition_process_running = 5; |
| 1624 | |
| 1625 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1626 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1627 | } |
| 1628 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1629 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1630 | * Logs a picture-in-picture action |
| 1631 | * Logged from: |
| 1632 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1633 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 1634 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 1635 | */ |
| 1636 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1637 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1638 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1639 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1640 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1641 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1642 | enum State { |
| 1643 | ENTERED = 1; |
| 1644 | EXPANDED_TO_FULL_SCREEN = 2; |
| 1645 | MINIMIZED = 3; |
| 1646 | DISMISSED = 4; |
| 1647 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1648 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1649 | } |
| 1650 | |
| 1651 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1652 | * Logs overlay action |
| 1653 | * Logged from: |
| 1654 | * services/core/java/com/android/server/wm/Session.java |
| 1655 | */ |
| 1656 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1657 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1658 | |
| 1659 | optional string package_name = 2; |
| 1660 | |
| 1661 | optional bool using_alert_window = 3; |
| 1662 | |
| 1663 | enum State { |
| 1664 | ENTERED = 1; |
| 1665 | EXITED = 2; |
| 1666 | } |
| 1667 | optional State state = 4; |
| 1668 | } |
| 1669 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1670 | /* |
| 1671 | * Logs foreground service starts and stops. |
| 1672 | * Note that this is not when a service starts or stops, but when it is |
| 1673 | * considered foreground. |
| 1674 | * Logged from |
| 1675 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 1676 | */ |
| 1677 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1678 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1679 | // package_name + "/" + class_name |
| 1680 | optional string short_name = 2; |
| 1681 | |
| 1682 | enum State { |
| 1683 | ENTER = 1; |
| 1684 | EXIT = 2; |
| 1685 | } |
| 1686 | optional State state = 3; |
| 1687 | } |
| 1688 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1689 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1690 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1691 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1692 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1693 | * |
| 1694 | * Logged from: |
| 1695 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1696 | */ |
| 1697 | message IsolatedUidChanged { |
| 1698 | // 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] | 1699 | // 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] | 1700 | // This field is ignored when event == REMOVED. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1701 | optional int32 parent_uid = 1; |
| 1702 | |
| 1703 | optional int32 isolated_uid = 2; |
| 1704 | |
| 1705 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1706 | enum Event { |
| 1707 | REMOVED = 0; |
| 1708 | CREATED = 1; |
| 1709 | } |
| 1710 | optional Event event = 3; |
| 1711 | } |
| 1712 | |
| 1713 | /* |
| 1714 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1715 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1716 | * and processed by WakeupController.cpp. |
| 1717 | */ |
| 1718 | message PacketWakeupOccurred { |
| 1719 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1720 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1721 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1722 | // The interface name on which the packet was received. |
| 1723 | optional string iface = 2; |
| 1724 | // The ethertype value of the packet. |
| 1725 | optional int32 ethertype = 3; |
| 1726 | // String representation of the destination MAC address of the packet. |
| 1727 | optional string destination_hardware_address = 4; |
| 1728 | // String representation of the source address of the packet if this was an IP packet. |
| 1729 | optional string source_ip = 5; |
| 1730 | // String representation of the destination address of the packet if this was an IP packet. |
| 1731 | optional string destination_ip = 6; |
| 1732 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1733 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1734 | // families. |
| 1735 | optional int32 ip_next_header = 7; |
| 1736 | // The source port if this was a TCP or UDP packet. |
| 1737 | optional int32 source_port = 8; |
| 1738 | // The destination port if this was a TCP or UDP packet. |
| 1739 | optional int32 destination_port = 9; |
| 1740 | } |
| 1741 | |
| 1742 | /* |
| 1743 | * Logs the memory stats for an app on startup. |
| 1744 | * Logged from: |
| 1745 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1746 | */ |
| 1747 | message AppStartMemoryStateCaptured { |
| 1748 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1749 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1750 | |
| 1751 | // The process name. |
| 1752 | optional string process_name = 2; |
| 1753 | |
| 1754 | // The activity name. |
| 1755 | optional string activity_name = 3; |
| 1756 | |
| 1757 | // # of page-faults |
| 1758 | optional int64 pgfault = 4; |
| 1759 | |
| 1760 | // # of major page-faults |
| 1761 | optional int64 pgmajfault = 5; |
| 1762 | |
| 1763 | // RSS |
| 1764 | optional int64 rss_in_bytes = 6; |
| 1765 | |
| 1766 | // CACHE |
| 1767 | optional int64 cache_in_bytes = 7; |
| 1768 | |
| 1769 | // SWAP |
| 1770 | optional int64 swap_in_bytes = 8; |
| 1771 | } |
| 1772 | |
| 1773 | /* |
| 1774 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1775 | * for LMK event. |
| 1776 | * Logged from: |
| 1777 | * system/core/lmkd/lmkd.c |
| 1778 | */ |
| 1779 | message LmkStateChanged { |
| 1780 | enum State { |
| 1781 | UNKNOWN = 0; |
| 1782 | START = 1; |
| 1783 | STOP = 2; |
| 1784 | } |
| 1785 | optional State state = 1; |
| 1786 | } |
| 1787 | |
| 1788 | /* |
| 1789 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1790 | * Logged from: |
| 1791 | * system/core/lmkd/lmkd.c |
| 1792 | */ |
| 1793 | message LmkKillOccurred { |
| 1794 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1795 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1796 | |
| 1797 | // The process name. |
| 1798 | optional string process_name = 2; |
| 1799 | |
| 1800 | // oom adj score. |
| 1801 | optional int32 oom_score = 3; |
| 1802 | |
| 1803 | // # of page-faults |
| 1804 | optional int64 pgfault = 4; |
| 1805 | |
| 1806 | // # of major page-faults |
| 1807 | optional int64 pgmajfault = 5; |
| 1808 | |
| 1809 | // RSS |
| 1810 | optional int64 rss_in_bytes = 6; |
| 1811 | |
| 1812 | // CACHE |
| 1813 | optional int64 cache_in_bytes = 7; |
| 1814 | |
| 1815 | // SWAP |
| 1816 | optional int64 swap_in_bytes = 8; |
| 1817 | } |
| 1818 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1819 | /* |
| 1820 | * Logs when the ActivityManagerService detects that an app died. |
| 1821 | * |
| 1822 | * Logged from: |
| 1823 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1824 | */ |
| 1825 | message AppDied { |
| 1826 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1827 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1828 | } |
| 1829 | |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 1830 | /** |
| 1831 | * An atom for generic metrics logging. Available from Android Q. |
| 1832 | */ |
| 1833 | message GenericAtom { |
| 1834 | // The uid of the application that sent this custom atom. |
| 1835 | optional int32 uid = 1 [(is_uid) = true]; |
| 1836 | |
| 1837 | // An event_id indicates the type of event. |
Howard Ro | 0546d54 | 2018-08-30 16:23:44 -0700 | [diff] [blame] | 1838 | optional android.os.statsd.EventType event_id = 2; |
Howard Ro | 21a039c | 2018-08-06 14:55:47 -0700 | [diff] [blame] | 1839 | } |
| 1840 | |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 1841 | /** |
| 1842 | * Logs when a fingerprint acquire event occurs. |
| 1843 | * |
| 1844 | * Logged from: |
| 1845 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 1846 | */ |
| 1847 | message FingerprintAcquired { |
| 1848 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 1849 | // Defined in android/os/UserHandle.java |
| 1850 | optional int32 user = 1; |
| 1851 | // If this acquire is for a crypto fingerprint. |
| 1852 | // e.g. Secure purchases, unlock password storage. |
| 1853 | optional bool is_crypto = 2; |
| 1854 | } |
| 1855 | |
| 1856 | /** |
| 1857 | * Logs when a fingerprint authentication event occurs. |
| 1858 | * |
| 1859 | * Logged from: |
| 1860 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 1861 | */ |
| 1862 | message FingerprintAuthenticated { |
| 1863 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 1864 | // Defined in android/os/UserHandle.java |
| 1865 | optional int32 user = 1; |
| 1866 | // If this authentication is for a crypto fingerprint. |
| 1867 | // e.g. Secure purchases, unlock password storage. |
| 1868 | optional bool is_crypto = 2; |
| 1869 | // Whether or not this authentication was successful. |
| 1870 | optional bool is_authenticated = 3; |
| 1871 | } |
| 1872 | |
| 1873 | /** |
| 1874 | * Logs when a fingerprint error occurs. |
| 1875 | * |
| 1876 | * Logged from: |
| 1877 | * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java |
| 1878 | */ |
| 1879 | message FingerprintErrorOccurred { |
| 1880 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 1881 | // Defined in android/os/UserHandle.java |
| 1882 | optional int32 user = 1; |
| 1883 | // If this error is for a crypto fingerprint. |
| 1884 | // e.g. Secure purchases, unlock password storage. |
| 1885 | optional bool is_crypto = 2; |
| 1886 | |
| 1887 | enum Error { |
| 1888 | UNKNOWN = 0; |
| 1889 | LOCKOUT = 1; |
| 1890 | PERMANENT_LOCKOUT = 2; |
| 1891 | } |
| 1892 | // The type of error. |
| 1893 | optional Error error = 3; |
| 1894 | } |
Howard Ro | 688ae18 | 2018-09-25 00:09:36 -0700 | [diff] [blame] | 1895 | |
| 1896 | message Notification { |
| 1897 | |
| 1898 | // Type of notification event. |
| 1899 | enum Type { |
| 1900 | TYPE_UNKNOWN = 0; |
| 1901 | // Notification became visible to the user. |
| 1902 | TYPE_OPEN = 1; |
| 1903 | // Notification became hidden. |
| 1904 | TYPE_CLOSE = 2; |
| 1905 | // Notification switched to detail mode. |
| 1906 | TYPE_DETAIL = 3; |
| 1907 | // Notification was clicked. |
| 1908 | TYPE_ACTION = 4; |
| 1909 | // Notification was dismissed. |
| 1910 | TYPE_DISMISS = 5; |
| 1911 | // Notification switched to summary mode. The enum value of 14 is to |
| 1912 | // match that of metrics_constants. |
| 1913 | TYPE_COLLAPSE = 14; |
| 1914 | } |
| 1915 | optional Type type = 1; |
| 1916 | |
| 1917 | // Package name associated with the notification. |
| 1918 | optional string package_name = 2; |
| 1919 | |
| 1920 | // Tag associated with notification. |
| 1921 | optional string tag = 3; |
| 1922 | |
| 1923 | // Application-supplied ID associated with the notification. |
| 1924 | optional int32 id = 4; |
| 1925 | |
| 1926 | // Index of notification in the notification panel. |
| 1927 | optional int32 shade_index = 5; |
| 1928 | |
| 1929 | // The number of notifications in the notification panel. |
| 1930 | optional int32 shade_count = 6; |
| 1931 | |
| 1932 | // Importance for the notification. |
| 1933 | optional int32 importance = 7; |
| 1934 | |
| 1935 | // ID for the notification channel. |
| 1936 | optional int32 channel_id = 8; |
| 1937 | |
| 1938 | // Importance for the notification channel. |
| 1939 | optional int32 channel_importance = 9; |
| 1940 | |
| 1941 | // Whether notification was a group summary. |
| 1942 | optional bool group_summary = 10; |
| 1943 | |
| 1944 | // Time since notification was created in milliseconds. |
| 1945 | optional int64 since_create_millis = 11; |
| 1946 | |
| 1947 | // Time since notification was interrupted in milliseconds. |
| 1948 | optional int64 since_interruption_millis = 12; |
| 1949 | |
| 1950 | // Time since notification was updated in milliseconds. |
| 1951 | optional int64 since_update_millis = 13; |
| 1952 | |
| 1953 | // Time since notification was visible in milliseconds. |
| 1954 | optional int64 since_visible_millis = 14; |
| 1955 | } |
| 1956 | |
| 1957 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1958 | ////////////////////////////////////////////////////////////////////// |
| 1959 | // Pulled atoms below this line // |
| 1960 | ////////////////////////////////////////////////////////////////////// |
| 1961 | |
| 1962 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1963 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1964 | * |
| 1965 | * Pulled from: |
| 1966 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1967 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1968 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1969 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1970 | |
| 1971 | optional int64 rx_bytes = 2; |
| 1972 | |
| 1973 | optional int64 rx_packets = 3; |
| 1974 | |
| 1975 | optional int64 tx_bytes = 4; |
| 1976 | |
| 1977 | optional int64 tx_packets = 5; |
| 1978 | } |
| 1979 | |
| 1980 | /** |
| 1981 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1982 | * |
| 1983 | * Pulled from: |
| 1984 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1985 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1986 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1987 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1988 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1989 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1990 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1991 | |
| 1992 | optional int64 rx_bytes = 3; |
| 1993 | |
| 1994 | optional int64 rx_packets = 4; |
| 1995 | |
| 1996 | optional int64 tx_bytes = 5; |
| 1997 | |
| 1998 | optional int64 tx_packets = 6; |
| 1999 | } |
| 2000 | |
| 2001 | /** |
| 2002 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 2003 | * |
| 2004 | * Pulled from: |
| 2005 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2006 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2007 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2008 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2009 | |
| 2010 | optional int64 rx_bytes = 2; |
| 2011 | |
| 2012 | optional int64 rx_packets = 3; |
| 2013 | |
| 2014 | optional int64 tx_bytes = 4; |
| 2015 | |
| 2016 | optional int64 tx_packets = 5; |
| 2017 | } |
| 2018 | |
| 2019 | /** |
| 2020 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 2021 | * |
| 2022 | * Pulled from: |
| 2023 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2024 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2025 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2026 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2027 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2028 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 2029 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2030 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2031 | |
| 2032 | optional int64 rx_bytes = 3; |
| 2033 | |
| 2034 | optional int64 rx_packets = 4; |
| 2035 | |
| 2036 | optional int64 tx_bytes = 5; |
| 2037 | |
| 2038 | optional int64 tx_packets = 6; |
| 2039 | } |
| 2040 | |
| 2041 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2042 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 2043 | * |
| 2044 | * Pulled from: |
| 2045 | * StatsCompanionService |
| 2046 | */ |
| 2047 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2048 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2049 | |
| 2050 | optional int64 rx_bytes = 2; |
| 2051 | |
| 2052 | optional int64 tx_bytes = 3; |
| 2053 | } |
| 2054 | |
| 2055 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2056 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 2057 | * android/internal/os/KernelWakelockStats.java |
| 2058 | * |
| 2059 | * Pulled from: |
| 2060 | * StatsCompanionService using KernelWakelockReader. |
| 2061 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2062 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2063 | optional string name = 1; |
| 2064 | |
| 2065 | optional int32 count = 2; |
| 2066 | |
| 2067 | optional int32 version = 3; |
| 2068 | |
| 2069 | optional int64 time = 4; |
| 2070 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2071 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2072 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2073 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 2074 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2075 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2076 | * hardware/interfaces/power/1.1/types.hal |
| 2077 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2078 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2079 | // Subsystem name |
| 2080 | optional string subsystem_name = 1; |
| 2081 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 2082 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 2083 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2084 | // 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] | 2085 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2086 | // 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] | 2087 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 2088 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2089 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2090 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2091 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 2092 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 2093 | * starts from highest to lowest. The value should be monotonically |
| 2094 | * increasing since boot. However, if there is a cpu |
| 2095 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2096 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2097 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2098 | optional uint32 cluster = 1; |
| 2099 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2100 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2101 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2102 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2103 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2104 | * Pulls Cpu Time Per Uid. |
| 2105 | * Note that isolated process uid time should be attributed to host uids. |
| 2106 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2107 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2108 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2109 | optional uint64 user_time_millis = 2; |
| 2110 | optional uint64 sys_time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2111 | } |
| 2112 | |
| 2113 | /** |
| 2114 | * Pulls Cpu Time Per Uid per frequency. |
| 2115 | * Note that isolated process uid time should be attributed to host uids. |
| 2116 | * For each uid, we order the time by descending frequencies. |
| 2117 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2118 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2119 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2120 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2121 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2122 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 2123 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2124 | /** |
| 2125 | * Pulls Wifi Controller Activity Energy Info |
| 2126 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2127 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2128 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2129 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2130 | // stack reported state |
| 2131 | // TODO: replace this with proto enum |
| 2132 | optional int32 stack_state = 2; |
| 2133 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2134 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2135 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2136 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2137 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2138 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2139 | // product of current(mA), voltage(V) and time(ms) |
| 2140 | optional uint64 controller_energy_used = 6; |
| 2141 | } |
| 2142 | |
| 2143 | /** |
| 2144 | * Pulls Modem Activity Energy Info |
| 2145 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2146 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2147 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2148 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2149 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2150 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2151 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2152 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2153 | /** |
| 2154 | * Tx power index |
| 2155 | * index 0 = tx_power < 0dBm |
| 2156 | * index 1 = 0dBm < tx_power < 5dBm |
| 2157 | * index 2 = 5dBm < tx_power < 15dBm |
| 2158 | * index 3 = 15dBm < tx_power < 20dBm |
| 2159 | * index 4 = tx_power > 20dBm |
| 2160 | */ |
| 2161 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2162 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2163 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2164 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2165 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2166 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2167 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2168 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2169 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2170 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2171 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2172 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2173 | // product of current(mA), voltage(V) and time(ms) |
| 2174 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 2175 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2176 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2177 | /** |
| 2178 | * Pulls Bluetooth Activity Energy Info |
| 2179 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 2180 | */ |
| 2181 | message BluetoothActivityInfo { |
| 2182 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2183 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2184 | // bluetooth stack state |
| 2185 | optional int32 bluetooth_stack_state = 2; |
| 2186 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2187 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2188 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2189 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2190 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2191 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2192 | // product of current(mA), voltage(V) and time(ms) |
| 2193 | optional uint64 energy_used = 6; |
| 2194 | } |
| 2195 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2196 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2197 | * Logs the memory stats for a process. |
| 2198 | */ |
| 2199 | message ProcessMemoryState { |
| 2200 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2201 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2202 | |
| 2203 | // The process name. |
| 2204 | optional string process_name = 2; |
| 2205 | |
| 2206 | // oom adj score. |
| 2207 | optional int32 oom_score = 3; |
| 2208 | |
| 2209 | // # of page-faults |
| 2210 | optional int64 pgfault = 4; |
| 2211 | |
| 2212 | // # of major page-faults |
| 2213 | optional int64 pgmajfault = 5; |
| 2214 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2215 | // RSS |
| 2216 | optional int64 rss_in_bytes = 6; |
| 2217 | |
| 2218 | // CACHE |
| 2219 | optional int64 cache_in_bytes = 7; |
| 2220 | |
| 2221 | // SWAP |
| 2222 | optional int64 swap_in_bytes = 8; |
Rafal Slawik | aaf6089 | 2018-09-12 13:04:30 +0100 | [diff] [blame^] | 2223 | |
| 2224 | // RSS high watermark. |
| 2225 | // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or |
| 2226 | // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups. |
| 2227 | optional int64 rss_high_watermark_in_bytes = 9; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2228 | } |
| 2229 | |
| 2230 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2231 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2232 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2233 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2234 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2235 | } |
| 2236 | |
| 2237 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2238 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2239 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2240 | message SystemUptime { |
| 2241 | // Milliseconds since the system was booted. |
| 2242 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2243 | // for external input). |
| 2244 | // 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] | 2245 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2246 | } |
| 2247 | |
| 2248 | /* |
| 2249 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2250 | * active: X (X is # cores) |
| 2251 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2252 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2253 | * ... |
| 2254 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2255 | * The file contains a monotonically increasing count of time for a single boot. |
| 2256 | */ |
| 2257 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2258 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2259 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2260 | } |
| 2261 | |
| 2262 | /** |
| 2263 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2264 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2265 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2266 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2267 | * ... |
| 2268 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2269 | * The file contains a monotonically increasing count of time for a single boot. |
| 2270 | */ |
| 2271 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2272 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2273 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2274 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2275 | } |
| 2276 | |
| 2277 | /* |
| 2278 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2279 | */ |
| 2280 | message DiskSpace { |
| 2281 | // available bytes in data partition |
| 2282 | optional uint64 data_available_bytes = 1; |
| 2283 | // available bytes in system partition |
| 2284 | optional uint64 system_available_bytes = 2; |
| 2285 | // available bytes in download cache or temp directories |
| 2286 | optional uint64 temp_available_bytes = 3; |
| 2287 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2288 | |
| 2289 | /** |
| 2290 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2291 | * Pulled from: |
| 2292 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2293 | */ |
| 2294 | message RemainingBatteryCapacity { |
| 2295 | optional int32 charge_uAh = 1; |
| 2296 | } |
| 2297 | |
| 2298 | /** |
| 2299 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2300 | * Pulled from: |
| 2301 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2302 | */ |
| 2303 | message FullBatteryCapacity { |
| 2304 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2305 | } |
| 2306 | |
| 2307 | /** |
Bookatz | 17f0d8a | 2018-09-13 12:56:32 -0700 | [diff] [blame] | 2308 | * Pulls battery voltage. |
| 2309 | * Pulled from: |
| 2310 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
| 2311 | */ |
| 2312 | message BatteryVoltage { |
| 2313 | // The voltage of the battery, in millivolts. |
| 2314 | optional int32 voltage_mV = 1; |
| 2315 | } |
| 2316 | |
| 2317 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2318 | * Pulls the temperature of various parts of the device. |
| 2319 | * 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] | 2320 | * |
| 2321 | * Pulled from: |
| 2322 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2323 | */ |
| 2324 | message Temperature { |
| 2325 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 2326 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2327 | |
| 2328 | // The name of the temperature source. Eg. CPU0 |
| 2329 | optional string sensor_name = 2; |
| 2330 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2331 | // Temperature in tenths of a degree C. |
| 2332 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2333 | } |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2334 | |
| 2335 | /** |
| 2336 | * Pulls the statistics of calls to Binder. |
| 2337 | * |
Olivier Gaillard | d25f7a8 | 2018-09-12 14:28:48 +0100 | [diff] [blame] | 2338 | * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one |
| 2339 | * config on the device. |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 2340 | * |
| 2341 | * Next tag: 14 |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2342 | */ |
| 2343 | message BinderCalls { |
Olivier Gaillard | 9ea238d | 2018-07-24 10:26:31 +0100 | [diff] [blame] | 2344 | optional int32 uid = 1 [(is_uid) = true]; |
| 2345 | // Fully qualified class name of the API call. |
| 2346 | // |
| 2347 | // This is a system server class name. |
| 2348 | // |
| 2349 | // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid |
| 2350 | // gets recycled and we have isolated uids, we might attribute the data incorrectly. |
| 2351 | // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less |
| 2352 | // commonly used APIs. |
| 2353 | optional string service_class_name = 2; |
| 2354 | // Method name of the API call. It can also be a transaction code if we cannot |
| 2355 | // resolve it to a name. See Binder#getTransactionName. |
| 2356 | // |
| 2357 | // This is a system server method name. |
| 2358 | optional string service_method_name = 3; |
| 2359 | // Total number of API calls. |
| 2360 | optional int64 call_count = 4; |
| 2361 | // True if the screen was interactive PowerManager#isInteractive at the end of the call. |
| 2362 | optional bool screen_interactive = 13; |
| 2363 | // Total number of API calls we have data recorded for. If we collected data for all the calls, |
| 2364 | // call_count will be equal to recorded_call_count. |
| 2365 | // |
| 2366 | // If recorded_call_count is different than call_count, it means data collection has been |
| 2367 | // sampled. All the fields below will be sampled in this case. |
| 2368 | optional int64 recorded_call_count = 12; |
| 2369 | // Number of exceptions thrown by the API. |
| 2370 | optional int64 recorded_exception_count = 5; |
| 2371 | // Total latency of all API calls. |
| 2372 | // Average can be computed using total_latency_micros / recorded_call_count. |
| 2373 | optional int64 recorded_total_latency_micros = 6; |
| 2374 | // Maximum latency of one API call. |
| 2375 | optional int64 recorded_max_latency_micros = 7; |
| 2376 | // Total CPU usage of all API calls. |
| 2377 | // Average can be computed using total_cpu_micros / recorded_call_count. |
| 2378 | // Total can be computed using total_cpu_micros / recorded_call_count * call_count. |
| 2379 | optional int64 recorded_total_cpu_micros = 8; |
| 2380 | // Maximum CPU usage of one API call. |
| 2381 | optional int64 recorded_max_cpu_micros = 9; |
| 2382 | // Maximum parcel reply size of one API call. |
| 2383 | optional int64 recorded_max_reply_size_bytes = 10; |
| 2384 | // Maximum parcel request size of one API call. |
| 2385 | optional int64 recorded_max_request_size_bytes = 11; |
| 2386 | } |
| 2387 | |
| 2388 | /** |
| 2389 | * Pulls the statistics of exceptions during calls to Binder. |
| 2390 | * |
| 2391 | * Binder stats are cumulative from boot unless somebody reset the data using |
| 2392 | * > adb shell dumpsys binder_calls_stats --reset |
| 2393 | */ |
| 2394 | message BinderCallsExceptions { |
| 2395 | // Exception class name, e.g. java.lang.IllegalArgumentException. |
| 2396 | // |
| 2397 | // This is an exception class name thrown by the system server. |
| 2398 | optional string exception_class_name = 1; |
| 2399 | // Total number of exceptions. |
| 2400 | optional int64 exception_count = 2; |
Olivier Gaillard | 00bfb1b | 2018-07-10 11:25:09 +0100 | [diff] [blame] | 2401 | } |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 2402 | |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 2403 | /** |
| 2404 | * Pulls the statistics of message dispatching on HandlerThreads. |
| 2405 | * |
| 2406 | * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one |
| 2407 | * config on the device. |
| 2408 | * |
| 2409 | * Next tag: 11 |
| 2410 | */ |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 2411 | message LooperStats { |
Marcin Oczeretko | ec75872 | 2018-09-12 12:53:47 +0100 | [diff] [blame] | 2412 | // 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] | 2413 | optional int32 uid = 1 [(is_uid) = true]; |
| 2414 | |
| 2415 | // Fully qualified class name of the handler target class. |
| 2416 | // |
| 2417 | // This field does not contain PII. This is a system server class name. |
| 2418 | optional string handler_class_name = 2; |
| 2419 | |
| 2420 | // The name of the thread that runs the Looper. |
| 2421 | // |
| 2422 | // This field does not contain PII. This is a system server thread name. |
| 2423 | optional string looper_thread_name = 3; |
| 2424 | |
| 2425 | // The name of the dispatched message. |
| 2426 | // |
| 2427 | // This field does not contain PII. This is a system server constant or class |
| 2428 | // name. |
| 2429 | optional string message_name = 4; |
| 2430 | |
| 2431 | // Total number of successfully dispatched messages. |
| 2432 | optional int64 message_count = 5; |
| 2433 | |
| 2434 | // Total number of messages that failed dispatching. |
| 2435 | optional int64 exception_count = 6; |
| 2436 | |
| 2437 | // Total number of processed messages we have data recorded for. If we |
| 2438 | // collected data for all the messages, message_count will be equal to |
| 2439 | // recorded_message_count. |
| 2440 | // |
| 2441 | // If recorded_message_count is different than message_count, it means data |
| 2442 | // collection has been sampled. All the fields below will be sampled in this |
| 2443 | // case. |
| 2444 | optional int64 recorded_message_count = 7; |
| 2445 | |
| 2446 | // Total latency of all processed messages. |
| 2447 | // Average can be computed using recorded_total_latency_micros / |
| 2448 | // recorded_message_count. |
| 2449 | optional int64 recorded_total_latency_micros = 8; |
| 2450 | |
| 2451 | // Total CPU usage of all processed message. |
| 2452 | // Average can be computed using recorded_total_cpu_micros / |
| 2453 | // recorded_message_count. Total can be computed using |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 2454 | // recorded_total_cpu_micros / recorded_message_count * message_count. |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 2455 | optional int64 recorded_total_cpu_micros = 9; |
Marcin Oczeretko | 3e6494e | 2018-09-10 18:06:52 +0100 | [diff] [blame] | 2456 | |
| 2457 | // True if the screen was interactive PowerManager#isInteractive at the end of the call. |
| 2458 | optional bool screen_interactive = 10; |
Marcin Oczeretko | d8cc859 | 2018-08-22 16:07:36 +0100 | [diff] [blame] | 2459 | } |
Tej Singh | 86dc9db | 2018-09-06 00:39:57 +0000 | [diff] [blame] | 2460 | |
| 2461 | /** |
| 2462 | * Pulls disk information, such as write speed and latency. |
| 2463 | */ |
| 2464 | message DiskStats { |
| 2465 | // Time taken to open, write 512B to, and close a file. |
| 2466 | // -1 if error performing the check. |
| 2467 | optional int64 data_write_latency_millis = 1; |
| 2468 | |
| 2469 | optional bool file_based_encryption = 2; |
| 2470 | |
| 2471 | // Recent disk write speed in kB/s. |
| 2472 | // -1 if error querying storageed. |
| 2473 | // 0 if data is unavailable. |
| 2474 | optional int32 recent_disk_write_speed = 3; |
| 2475 | } |
| 2476 | |
| 2477 | |
| 2478 | /** |
| 2479 | * Free and total bytes of the Data, Cache, and System partition. |
| 2480 | */ |
| 2481 | message DirectoryUsage { |
| 2482 | enum Directory { |
| 2483 | UNKNOWN = 0; |
| 2484 | DATA = 1; |
| 2485 | CACHE = 2; |
| 2486 | SYSTEM = 3; |
| 2487 | } |
| 2488 | optional Directory directory = 1; |
| 2489 | optional int64 free_bytes = 2; |
| 2490 | optional int64 total_bytes = 3; |
| 2491 | } |
| 2492 | |
| 2493 | |
| 2494 | /** |
| 2495 | * Size of an application: apk size, data size, and cache size. |
| 2496 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 2497 | * Information is only reported for apps with the primary user (user 0). |
| 2498 | * Sizes are aggregated by package name. |
| 2499 | */ |
| 2500 | message AppSize { |
| 2501 | // Including uids will involve modifying diskstats logic. |
| 2502 | optional string package_name = 1; |
| 2503 | // App size in bytes. -1 if unavailable. |
| 2504 | optional int64 app_size_bytes = 2; |
| 2505 | // App data size in bytes. -1 if unavailable. |
| 2506 | optional int64 app_data_size_bytes = 3; |
| 2507 | // App cache size in bytes. -1 if unavailable. |
| 2508 | optional int64 app_cache_size_bytes = 4; |
| 2509 | // Time that the cache file was produced. |
| 2510 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 2511 | optional int64 cache_time_millis = 5; |
| 2512 | } |
| 2513 | |
| 2514 | |
| 2515 | /** |
| 2516 | * Size of a particular category. Eg: photos, videos. |
| 2517 | * Reads from a cached file produced daily by DiskStatsLoggingService.java. |
| 2518 | */ |
| 2519 | message CategorySize { |
| 2520 | enum Category { |
| 2521 | UNKNOWN = 0; |
| 2522 | APP_SIZE = 1; |
| 2523 | APP_DATA_SIZE = 2; |
| 2524 | APP_CACHE_SIZE = 3; |
| 2525 | PHOTOS = 4; |
| 2526 | VIDEOS = 5; |
| 2527 | AUDIO = 6; |
| 2528 | DOWNLOADS = 7; |
| 2529 | SYSTEM = 8; |
| 2530 | OTHER = 9; |
| 2531 | } |
| 2532 | optional Category category = 1; |
| 2533 | // Category size in bytes. |
| 2534 | optional int64 size_bytes = 2; |
| 2535 | // Time that the cache file was produced. |
| 2536 | // Uses System.currentTimeMillis(), which is wall clock time. |
| 2537 | optional int64 cache_time_millis = 3; |
| 2538 | } |
Tej Singh | d6d6d77 | 2018-09-05 17:41:25 -0700 | [diff] [blame] | 2539 | |
| 2540 | /** |
| 2541 | * Pulls the number of fingerprints for each user. |
| 2542 | * |
| 2543 | * Pulled from StatsCompanionService, which queries FingerprintManager. |
| 2544 | */ |
| 2545 | message NumFingerprints { |
| 2546 | // The associated user. Eg: 0 for owners, 10+ for others. |
| 2547 | // Defined in android/os/UserHandle.java |
| 2548 | optional int32 user = 1; |
| 2549 | // Number of fingerprints registered to that user. |
| 2550 | optional int32 num_fingerprints = 2; |
| 2551 | } |
Chenjie Yu | 12e5e67 | 2018-09-14 15:54:59 -0700 | [diff] [blame] | 2552 | |
| 2553 | /** |
| 2554 | * Pulled from ProcessStatsService.java |
| 2555 | */ |
| 2556 | message ProcStats { |
| 2557 | optional android.service.procstats.ProcessStatsSectionProto proc_stats_section = 1; |
| 2558 | } |