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