blob: 9866c7a2d0c0a1d0740b46402154bd82990e853c [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
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
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080029import "frameworks/base/core/proto/android/server/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070030import "frameworks/base/core/proto/android/service/procstats_enum.proto";
31import "frameworks/base/core/proto/android/stats/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070032import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080033import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080034import "frameworks/base/core/proto/android/telephony/enums.proto";
35import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080036
Yao Chend54f9dd2017-10-17 17:37:48 +000037/**
Stefan Lafonae2df012017-11-14 09:17:21 -080038 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000039 * raw stats log events from the Android system, also known as "atoms."
40 *
41 * This field contains a single oneof with all of the available messages.
42 * The stats-log-api-gen tool runs as part of the Android build and
43 * generates the android.util.StatsLog class, which contains the constants
44 * and methods that Android uses to log.
45 *
Stefan Lafonae2df012017-11-14 09:17:21 -080046 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000047 * Instead, statsd on Android constructs these messages synthetically,
48 * in the format defined here and in stats_log.proto.
49 */
Stefan Lafonae2df012017-11-14 09:17:21 -080050message Atom {
51 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070052 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070053 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
54 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070055 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070056 BleScanResultReceived ble_scan_result_received = 4;
57 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080058 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070059 SyncStateChanged sync_state_changed = 7;
60 ScheduledJobStateChanged scheduled_job_state_changed = 8;
61 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070062 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080063 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
64 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
65 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070066 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
67 MemoryFactorStateChanged memory_factor_state_changed = 15;
68 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
69 CachedKillReported cached_kill_reported = 17;
70 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070071 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080072 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
73 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
74 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070075 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080076 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070077 CameraStateChanged camera_state_changed = 25;
78 FlashlightStateChanged flashlight_state_changed = 26;
79 UidProcessStateChanged uid_process_state_changed = 27;
80 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
81 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070082 BatteryLevelChanged battery_level_changed = 30;
83 ChargingStateChanged charging_state_changed = 31;
84 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070085 InteractiveStateChanged interactive_state_changed = 33;
86 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070087 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
88 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070089 WifiLockStateChanged wifi_lock_state_changed = 37;
90 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
91 WifiScanStateChanged wifi_scan_state_changed = 39;
92 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070093 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070094 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070095 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090096 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070097 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080098 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080099 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 AppStartOccurred app_start_occurred = 48;
101 AppStartCanceled app_start_canceled = 49;
102 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800103 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800104 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800105 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800106 LmkStateChanged lmk_state_changed = 54;
107 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800108 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800109 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800110 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800111 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800112 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800113 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800114 KeyguardStateChanged keyguard_state_changed = 62;
115 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
116 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800117 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800118 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800119 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
120 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700121 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700122 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800123 SpeakerImpedanceReported speaker_impedance_reported = 71;
124 HardwareFailed hardware_failed = 72;
125 PhysicalDropDetected physical_drop_detected = 73;
126 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800127 MobileConnectionStateChanged mobile_connection_state_changed = 75;
128 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700129 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800130 AppCrashOccurred app_crash_occurred = 78;
131 ANROccurred anr_occurred = 79;
132 WTFOccurred wtf_occurred = 80;
133 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700134 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700135 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700136 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700137 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700138 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700139 FingerprintAcquired fingerprint_acquired = 87;
140 FingerprintAuthenticated fingerprint_authenticated = 88;
141 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700142 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700143 BatteryHealthSnapshot battery_health_snapshot = 91;
144 SlowIo slow_io = 92;
145 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700146 PhoneServiceStateChanged phone_service_state_changed = 94;
147 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100148 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700149 SettingsUIChanged settings_ui_changed = 97;
Yao Chend54f9dd2017-10-17 17:37:48 +0000150 }
David Chenc8a43242017-10-17 16:23:28 -0700151
David Chen6e3e6cb2018-01-03 16:14:06 -0800152 // Pulled events will start at field 10000.
Rafal Slawik08621582018-10-15 14:53:07 +0100153 // Next: 10037
David Chenc8a43242017-10-17 16:23:28 -0700154 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800155 WifiBytesTransfer wifi_bytes_transfer = 10000;
156 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
157 MobileBytesTransfer mobile_bytes_transfer = 10002;
158 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800159 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800160 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800161 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800162 CpuTimePerFreq cpu_time_per_freq = 10008;
163 CpuTimePerUid cpu_time_per_uid = 10009;
164 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800165 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800166 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800167 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800168 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800169 SystemElapsedRealtime system_elapsed_realtime = 10014;
170 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800171 CpuActiveTime cpu_active_time = 10016;
172 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000173 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800174 RemainingBatteryCapacity remaining_battery_capacity = 10019;
175 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800176 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100177 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100178 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100179 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000180 DiskStats disk_stats = 10025;
181 DirectoryUsage directory_usage = 10026;
182 AppSize app_size = 10027;
183 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700184 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700185 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700186 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700187 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700188 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700189 ProcStats proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700190 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100191 NativeProcessMemoryState native_process_memory_state = 10036;
David Chenc8a43242017-10-17 16:23:28 -0700192 }
yroa1fe77c2018-02-26 14:22:54 -0800193
Bookatz76aafcf2018-09-17 16:17:10 -0700194 // DO NOT USE field numbers above 100,000 in AOSP.
195 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
196 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700197}
198
Yao Chend54f9dd2017-10-17 17:37:48 +0000199/**
Yangster-mac20877162017-12-22 17:19:39 -0800200 * This proto represents a node of an attribution chain.
201 * Note: All attribution chains are represented as a repeated field of type
202 * AttributionNode. It is understood that in such arrays, the order is that
203 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000204 */
Yangster-mac20877162017-12-22 17:19:39 -0800205message AttributionNode {
206 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800207 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800208
Yangster-mac20877162017-12-22 17:19:39 -0800209 // The (optional) string tag for an element in the attribution chain. If the
210 // element has no tag, it is encoded as an empty string.
211 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700212}
213
Yangster-mac48b3d622018-08-18 12:38:11 -0700214message KeyValuePair {
215 optional int32 key = 1;
216 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700217 int32 value_int = 2;
218 int64 value_long = 3;
219 string value_str = 4;
220 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700221 }
222}
223
224message KeyValuePairsAtom {
225 optional int32 uid = 1;
226 repeated KeyValuePair pairs = 2;
227}
228
Yao Chend54f9dd2017-10-17 17:37:48 +0000229/*
230 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800231 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000232 *
233 * RULES:
234 * - The field ids for each atom must start at 1, and count upwards by 1.
235 * Skipping field ids is not allowed.
236 * - These form an API, so renaming, renumbering or removing fields is
237 * not allowed between android releases. (This is not currently enforced,
238 * but there will be a tool to enforce this restriction).
239 * - The types must be built-in protocol buffer types, namely, no sub-messages
240 * are allowed (yet). The bytes type is also not allowed.
241 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800242 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000243 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800244 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000245 * - A field that is a uid should be a string field, tagged with the [xxx]
246 * annotation. The generated code on android will be represented by UIDs,
247 * and those UIDs will be translated in xxx to those strings.
248 *
249 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700250 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000251 * - If there is a UID, it goes first. Think in an object-oriented fashion.
252 * *****************************************************************************
253 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700254
Yao Chend54f9dd2017-10-17 17:37:48 +0000255/**
Yangster-mace16189a2018-08-26 12:20:16 -0700256 * Logs when the Thermal service HAL notifies the throttling start/stop events.
257 *
258 * Logged from:
259 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
260 */
261message ThermalThrottlingStateChanged {
262 optional android.os.TemperatureTypeEnum sensor_type = 1;
263
264 enum State {
265 UNKNOWN = 0;
266 START = 1;
267 STOP = 2;
268 }
269
270 optional State state = 2;
271
272 optional float temperature = 3;
273}
274
275/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000276 * Logs when the screen state changes.
277 *
278 * Logged from:
279 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
280 */
281message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800282 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700283 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700284}
Yao Chend54f9dd2017-10-17 17:37:48 +0000285
286/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700287 * Logs that the process state of the uid, as determined by ActivityManager
288 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000289 *
290 * Logged from:
291 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
292 */
Bookatzc1a050a2017-10-10 15:49:28 -0700293message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700294 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000295
Bookatzdb026a22018-01-10 19:01:56 -0800296 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700297 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000298}
299
300/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700301 * Logs process state change of a process, as per the activity manager.
302 *
303 * Logged from:
304 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
305 */
306message ProcessStateChanged {
307 optional int32 uid = 1;
308 optional string process_name = 2;
309 optional string package_name = 3;
310 // TODO: remove this when validation is done
311 optional int64 version = 5;
312 // The state, from frameworks/base/core/proto/android/app/enums.proto.
313 optional android.app.ProcessStateEnum state = 4;
314}
315
316/**
317 * Logs when ActivityManagerService sleep state is changed.
318 *
319 * Logged from:
320 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
321 */
322message ActivityManagerSleepStateChanged {
323 // TODO: import frameworks proto
324 enum State {
325 UNKNOWN = 0;
326 ASLEEP = 1;
327 AWAKE = 2;
328 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700329 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700330}
331
332/**
333 * Logs when system memory state changes.
334 *
335 * Logged from:
336 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
337 */
338message MemoryFactorStateChanged {
339 // TODO: import frameworks proto
340 enum State {
341 MEMORY_UNKNOWN = 0;
342 NORMAL = 1; // normal.
343 MODERATE = 2; // moderate memory pressure.
344 LOW = 3; // low memory.
345 CRITICAL = 4; // critical memory.
346
347 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700348 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700349}
350
351/**
352 * Logs when app is using too much cpu, according to ActivityManagerService.
353 *
354 * Logged from:
355 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
356 */
357message ExcessiveCpuUsageReported {
358 optional int32 uid = 1;
359 optional string process_name = 2;
360 optional string package_name = 3;
361 // package version. TODO: remove this when validation is done
362 optional int64 version = 4;
363}
364
365/**
366 * Logs when a cached process is killed, along with its pss.
367 *
368 * Logged from:
369 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
370 */
371message CachedKillReported {
372 optional int32 uid = 1;
373 optional string process_name = 2;
374 optional string package_name = 3;
375 // TODO: remove this when validation is done
376 optional int64 version = 5;
377 optional int64 pss = 4;
378}
379
380/**
381 * Logs when memory stats of a process is reported.
382 *
383 * Logged from:
384 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
385 */
386message ProcessMemoryStatReported {
387 optional int32 uid = 1;
388 optional string process_name = 2;
389 optional string package_name = 3;
390 //TODO: remove this when validation is done
391 optional int64 version = 9;
392 optional int64 pss = 4;
393 optional int64 uss = 5;
394 optional int64 rss = 6;
395 enum Type {
396 ADD_PSS_INTERNAL_SINGLE = 0;
397 ADD_PSS_INTERNAL_ALL_MEM = 1;
398 ADD_PSS_INTERNAL_ALL_POLL = 2;
399 ADD_PSS_EXTERNAL = 3;
400 ADD_PSS_EXTERNAL_SLOW = 4;
401 }
402 optional Type type = 7;
403 optional int64 duration = 8;
404}
405
406/**
Bookatzc1a050a2017-10-10 15:49:28 -0700407 * Logs that a process started, finished, crashed, or ANRed.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
411 */
412message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700413 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700414
David Chen0b5c90c2018-01-25 16:51:49 -0800415 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800416 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700417
Bookatzddccf0a2017-11-28 16:48:14 -0800418 // What lifecycle state the process changed to.
419 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800420 enum State {
421 FINISHED = 0;
422 STARTED = 1;
423 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800424 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800425 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700426}
427
Bookatzc1a050a2017-10-10 15:49:28 -0700428/**
429 * Logs when the ble scan state changes.
430 *
431 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700432 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700433 */
434message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800435 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700436
437 enum State {
438 OFF = 0;
439 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700440 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
441 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700442 }
443 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700444
Bookatze5ec0b42018-03-26 13:34:56 -0700445 // Does the scan have a filter.
446 optional bool is_filtered = 3;
447 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
448 optional bool is_first_match = 4;
449 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
450 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700451}
452
453/**
454 * Logs reporting of a ble scan finding results.
455 *
456 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700457 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700458 */
Bookatzae6738e2018-09-13 11:38:56 -0700459// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700460message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800461 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700462
463 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800464 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700465}
466
467/**
468 * Logs when a sensor state changes.
469 *
470 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700471 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700472 */
473message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800474 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700475
Bookatzc1a050a2017-10-10 15:49:28 -0700476 // The id (int) of the sensor.
477 optional int32 sensor_id = 2;
478
479 enum State {
480 OFF = 0;
481 ON = 1;
482 }
483 optional State state = 3;
484}
485
486
487/**
488 * Logs when GPS state changes.
489 *
490 * Logged from:
491 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
492 */
493message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800494 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700495
496 enum State {
497 OFF = 0;
498 ON = 1;
499 }
500 optional State state = 2;
501}
502
503
504/**
505 * Logs when a sync manager sync state changes.
506 *
507 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700508 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700509 */
510message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800511 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700512
David Chen0b5c90c2018-01-25 16:51:49 -0800513 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800514 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700515
516 enum State {
517 OFF = 0;
518 ON = 1;
519 }
520 optional State state = 3;
521}
522
Yangster-mac96353002018-09-05 11:18:55 -0700523/*
524 * Deferred job stats.
525 *
526 * Logged from:
527 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
528*/
529message DeferredJobStatsReported {
530 repeated AttributionNode attribution_node = 1;
531
532 // Number of jobs deferred.
533 optional int32 num_jobs_deferred = 2;
534
535 // Time since the last job runs.
536 optional int64 time_since_last_job_millis = 3;
537}
538
Bookatzc1a050a2017-10-10 15:49:28 -0700539/**
540 * Logs when a job scheduler job state changes.
541 *
542 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700543 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700544 */
545message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800546 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700547
548 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800549 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700550
551 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800552 FINISHED = 0;
553 STARTED = 1;
554 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700555 }
556 optional State state = 3;
557
Tej Singh33a412b2018-03-16 18:43:59 -0700558 // The reason a job has stopped.
559 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700560 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700561 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700562}
563
564/**
565 * Logs when the audio state changes.
566 *
567 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700568 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700569 */
570message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800571 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700572
573 enum State {
574 OFF = 0;
575 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700576 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
577 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700578 }
579 optional State state = 2;
580}
581
582/**
583 * Logs when the video codec state changes.
584 *
585 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700586 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700587 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800588message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800589 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700590
591 enum State {
592 OFF = 0;
593 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700594 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
595 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700596 }
597 optional State state = 2;
598}
599
600/**
601 * Logs when the flashlight state changes.
602 *
603 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700604 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700605 */
606message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800607 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700608
609 enum State {
610 OFF = 0;
611 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700612 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
613 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700614 }
615 optional State state = 2;
616}
617
618/**
619 * Logs when the camera state changes.
620 *
621 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700622 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700623 */
624message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800625 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
627 enum State {
628 OFF = 0;
629 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700630 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
631 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632 }
633 optional State state = 2;
634}
635
636/**
637 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000638 *
639 * Logged from:
640 * TODO
641 */
Bookatzd6746242017-10-24 18:39:35 -0700642message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800643 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000644
Bookatz1a1b0462018-01-12 11:47:03 -0800645 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
646 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700647 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
649 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
650 optional string tag = 3;
651
652 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800653 RELEASE = 0;
654 ACQUIRE = 1;
655 CHANGE_RELEASE = 2;
656 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700657 }
658 optional State state = 4;
659}
660
661/**
Bookatzc1a050a2017-10-10 15:49:28 -0700662 * Logs when a partial wakelock is considered 'long' (over 1 min).
663 *
664 * Logged from:
665 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
666 */
667message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800668 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700669
Yao Chend54f9dd2017-10-17 17:37:48 +0000670 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
671 optional string tag = 2;
672
Bookatzc1a050a2017-10-10 15:49:28 -0700673 // TODO: I have no idea what this is.
674 optional string history_tag = 3;
675
676 enum State {
677 OFF = 0;
678 ON = 1;
679 }
680 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000681}
682
Bookatzc1a050a2017-10-10 15:49:28 -0700683/**
Bookatza66083f2018-09-20 17:24:00 -0700684 * Logs when the device is interactive, according to the PowerManager Notifier.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
688 */
689message InteractiveStateChanged {
690 enum State {
691 OFF = 0;
692 ON = 1;
693 }
694 optional State state = 1;
695}
696
697/**
Bookatzc1a050a2017-10-10 15:49:28 -0700698 * Logs Battery Saver state change.
699 *
700 * Logged from:
701 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
702 */
703message BatterySaverModeStateChanged {
704 enum State {
705 OFF = 0;
706 ON = 1;
707 }
708 optional State state = 1;
709}
710
711/**
712 * Logs Doze mode state change.
713 *
714 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800715 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700716 */
717message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800718 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800719}
720
721
722/**
723 * Logs state change of Doze mode including maintenance windows.
724 *
725 * Logged from:
726 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
727 */
728message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800729 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730}
731
732/**
733 * Logs screen brightness level.
734 *
735 * Logged from:
736 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
737 */
738message ScreenBrightnessChanged {
739 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
740 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700741}
742
743/**
744 * Logs battery level (percent full, from 0 to 100).
745 *
746 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700747 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700748 */
749message BatteryLevelChanged {
750 // Battery level. Should be in [0, 100].
751 optional int32 battery_level = 1;
752}
753
754/**
755 * Logs change in charging status of the device.
756 *
757 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700758 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700759 */
760message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800761 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
762 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700763}
764
765/**
766 * Logs whether the device is plugged in, and what power source it is using.
767 *
768 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700769 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700770 */
771message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800772 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
773 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700774}
775
Bookatz8c6571b2017-10-24 15:04:41 -0700776/**
777 * Logs when an app's wakeup alarm fires.
778 *
779 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700780 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700781 */
782message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800783 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800784
785 // Name of the wakeup alarm.
786 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700787
788 // Name of source package (for historical reasons, since BatteryStats tracked it).
789 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800790}
791
792/**
793 * Logs when an an app causes the mobile radio to change state.
794 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
795 *
796 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700797 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800798 */
799message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800800 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800801
Bookatz1a1b0462018-01-12 11:47:03 -0800802 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
803 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800804}
805
806/**
807 * Logs when an an app causes the wifi radio to change state.
808 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
809 *
810 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700811 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800812 */
813message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800814 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800815
Bookatz1a1b0462018-01-12 11:47:03 -0800816 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
817 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700818}
819
820/**
821 * Logs kernel wakeup reasons and aborts.
822 *
823 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700824 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700825 */
826message KernelWakeupReported {
827 // Name of the kernel wakeup reason (or abort).
828 optional string wakeup_reason_name = 1;
829
830 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800831 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700832}
833
834/**
835 * Logs wifi locks held by an app.
836 *
837 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700838 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700839 */
840message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800841 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700842
843 enum State {
844 OFF = 0;
845 ON = 1;
846 }
847 optional State state = 2;
848}
849
850/**
851 * Logs wifi signal strength changes.
852 *
853 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700854 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700855 */
856message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800857 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
858 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700859}
860
861/**
862 * Logs wifi scans performed by an app.
863 *
864 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700865 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700866 */
867message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800868 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700869
870 enum State {
871 OFF = 0;
872 ON = 1;
873 }
874 optional State state = 2;
875}
876
877/**
Tej Singh4503e102018-01-04 14:35:01 -0800878 * Logs wifi multicast locks held by an app
879 *
880 * Logged from:
881 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
882 */
883message WifiMulticastLockStateChanged {
884 repeated AttributionNode attribution_node = 1;
885
886 enum State {
887 OFF = 0;
888 ON = 1;
889 }
890 optional State state = 2;
891}
892
893/**
Tej Singh1ea42892018-01-19 09:27:00 -0800894 * Logs shutdown reason and duration on next boot.
895 *
896 * Logged from:
897 * frameworks/base/core/java/com/android/server/BootReceiver.java
898 */
899message ShutdownSequenceReported {
900 // True if shutdown is for a reboot. Default: false if we do not know.
901 optional bool reboot = 1;
902
903 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
904 optional string reason = 2;
905
906 // Beginning of shutdown time in ms using wall clock time since unix epoch.
907 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800908 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800909
910 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800911 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800912}
913
Tej Singh6483ea42018-01-25 17:45:49 -0800914
915/**
916 * Logs boot reason and duration.
917 *
918 * Logged from:
919 * system/core/bootstat/bootstat.cpp
920 */
921message BootSequenceReported {
922 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
923 // Default: "<EMPTY>" if not available.
924 optional string bootloader_reason = 1;
925
926 // Reason for system boot. Eg. bootloader, reboot,userrequested
927 // Default: "<EMPTY>" if not available.
928 optional string system_reason = 2;
929
930 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800931 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800932
933 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800934 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800935
936 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800937 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800938
939 // Time since last boot in ms. Default: 0 if not available.
940 optional int64 time_since_last_boot = 6;
941}
942
Tej Singhc477d9c2018-02-05 18:31:39 -0800943
944/**
945 * Logs call state and disconnect cause (if applicable).
946 *
947 * Logged from:
948 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
949 */
950message CallStateChanged {
951 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
952 // From frameworks/base/core/proto/android/telecomm/enums.proto.
953 optional android.telecom.CallStateEnum call_state = 1;
954
955 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
956 // This value is only applicable when the call_state is DISCONNECTED, and
957 // should always be UNKNOWN if the call_state is not DISCONNECTED.
958 // From frameworks/base/core/proto/android/telecomm/enums.proto.
959 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
960
961 // True if the call is self-managed, which are apps that use the
962 // telecom infrastructure to make their own calls.
963 optional bool self_managed = 3;
964
965 // True if call is external. External calls are calls on connected Wear
966 // devices but show up in Telecom so the user can pull them onto the device.
967 optional bool external_call = 4;
968}
969
Tej Singh1ea42892018-01-19 09:27:00 -0800970/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800971 * Logs keyguard state. The keyguard is the lock screen.
972 *
973 * Logged from:
974 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
975 */
976message KeyguardStateChanged {
977 enum State {
978 UNKNOWN = 0;
979 // The keyguard is hidden when the phone is unlocked.
980 HIDDEN = 1;
981 // The keyguard is shown when the phone is locked (screen turns off).
982 SHOWN= 2;
983 // The keyguard is occluded when something is overlaying the keyguard.
984 // Eg. Opening the camera while on the lock screen.
985 OCCLUDED = 3;
986 }
987 optional State state = 1;
988}
989
990/**
991 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
992 * prompts the user to enter a password (pattern, pin, etc).
993 *
994 * Logged from:
995 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
996 */
997
998message KeyguardBouncerStateChanged {
999 enum State {
1000 UNKNOWN = 0;
1001 // Bouncer is hidden, either as a result of successfully entering the
1002 // password, screen timing out, or user going back to lock screen.
1003 HIDDEN = 1;
1004 // This is when the user is being prompted to enter the password.
1005 SHOWN = 2;
1006 }
1007 optional State state = 1;
1008}
1009
1010/**
1011 * Logs the result of entering a password into the keyguard bouncer.
1012 *
1013 * Logged from:
1014 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1015 */
1016message KeyguardBouncerPasswordEntered {
1017 enum BouncerResult {
1018 UNKNOWN = 0;
1019 // The password entered was incorrect.
1020 FAILURE = 1;
1021 // The password entered was correct.
1022 SUCCESS = 2;
1023 }
1024 optional BouncerResult result = 1;
1025}
1026
Tej Singha883b372018-02-15 11:30:01 -08001027/*
1028 * Logs changes to the configuration of the device. The configuration is defined
1029 * in frameworks/base/core/java/android/content/res/Configuration.java
1030 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1031 * Please go there to interpret the possible values each field can be.
1032 *
1033 * Logged from:
1034 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1035 */
1036message ResourceConfigurationChanged {
1037 // Bit mask of color capabilities of the screen.
1038 // Contains information about the color gamut and hdr mode of the screen.
1039 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001040 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001041
1042 // The target screen density being rendered to.
1043 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001044 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001045
1046 // Current user preference for the scaling factor for fonts,
1047 // relative to the base density scaling.
1048 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001049 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001050
1051 // Flag indicating whether the hard keyboard is hidden.
1052 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001053 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001054
1055 // The type of keyboard attached to the device.
1056 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1057 optional int32 keyboard = 5;
1058
1059 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1060 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001061 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001062
1063 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1064 // 0 if undefined.
1065 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1066 optional int32 mcc = 7;
1067
1068 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1069 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1070 // MNC_ZERO symbol defined in Configuration.java.
1071 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1072 optional int32 mnc = 8;
1073
1074 // The kind of navigation available on the device.
1075 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1076 optional int32 navigation = 9;
1077
1078 // Flag indicating whether the navigation is available.
1079 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001080 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001081
1082 // Overall orientation of the screen.
1083 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1084 optional int32 orientation = 11;
1085
1086 // The current height of the available screen space, in dp units.
1087 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001088 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001089
1090 // Bit mask of overall layout of the screen.
1091 // Contains information about screen size, whether the screen is wider/taller
1092 // than normal, whether the screen layout is right-tl-left or left-to-right,
1093 // and whether the screen has a rounded shape.
1094 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001095 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001096
1097 // Current width of the available screen space, in dp units.
1098 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001099 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001100
1101 // The smallest screen size an application will see in normal operation.
1102 // This is the smallest value of both screenWidthDp and screenHeightDp
1103 // in portrait and landscape.
1104 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001105 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001106
1107 // The type of touch screen attached to the device.
1108 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1109 optional int32 touchscreen = 16;
1110
1111 // Bit mask of the ui mode.
1112 // Contains information about the overall ui mode of the device.
1113 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1114 // Also contains information about whether the device is in night mode.
1115 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001116 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001117}
1118
Tej Singheee317b2018-03-07 19:28:05 -08001119
1120/**
1121 * Logs changes in the connection state of the mobile radio.
1122 *
1123 * Logged from:
1124 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1125 */
1126message MobileConnectionStateChanged {
1127 // States are from the state machine DataConnection.java.
1128 enum State {
1129 UNKNOWN = 0;
1130 // The connection is inactive, or disconnected.
1131 INACTIVE = 1;
1132 // The connection is being activated, or connecting.
1133 ACTIVATING = 2;
1134 // The connection is active, or connected.
1135 ACTIVE = 3;
1136 // The connection is disconnecting.
1137 DISCONNECTING = 4;
1138 // The connection is disconnecting after creating a connection.
1139 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1140 }
1141 optional State state = 1;
1142 // For multi-sim phones, this distinguishes between the sim cards.
1143 optional int32 sim_slot_index = 2;
1144 // Used to identify the connection. Starts at 0 and increments by 1 for
1145 // every new network created. Resets whenever the device reboots.
1146 optional int32 data_connection_id = 3;
1147 // A bitmask for the capabilities of this connection.
1148 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1149 // Default value (if we have no information): 0
1150 optional int64 capabilities = 4;
1151 // If this connection has internet.
1152 // This just checks if the DEFAULT bit of capabilities is set.
1153 optional bool has_internet = 5;
1154}
1155
1156/**
1157 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1158 *
1159 * Logged from:
1160 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1161 */
1162message MobileRadioTechnologyChanged {
1163 optional android.telephony.NetworkTypeEnum state = 1;
1164 // For multi-sim phones, this distinguishes between the sim cards.
1165 optional int32 sim_slot_index = 2;
1166}
1167
Andrew Chantb56388b2018-03-22 21:07:33 -07001168/**
1169 * Logs the VID and PID of any connected USB devices.
1170 *
1171 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1172 *
1173 * Logged by Vendor.
1174 */
1175message UsbDeviceAttached {
1176 optional int32 vid = 1;
1177 optional int32 pid = 2;
1178 optional bool has_audio = 3;
1179 optional bool has_hid = 4;
1180 optional bool has_storage = 5;
1181}
1182
Tej Singheee317b2018-03-07 19:28:05 -08001183
Tej Singhdd7bd352018-02-09 19:33:15 -08001184/**
Tej Singh5d991e12018-03-09 19:48:11 -08001185 * Logs when Bluetooth is enabled and disabled.
1186 *
1187 * Logged from:
1188 * services/core/java/com/android/server/BluetoothManagerService.java
1189 */
1190message BluetoothEnabledStateChanged {
1191 repeated AttributionNode attribution_node = 1;
1192 // Whether or not bluetooth is enabled on the device.
1193 enum State {
1194 UNKNOWN = 0;
1195 ENABLED = 1;
1196 DISABLED = 2;
1197 }
1198 optional State state = 2;
1199 // The reason for being enabled/disabled.
1200 // Eg. Airplane mode, crash, application request.
1201 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1202 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001203 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001204}
1205
1206/**
1207 * Logs when a Bluetooth device connects and disconnects.
1208 *
1209 * Logged from:
1210 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1211 */
1212message BluetoothConnectionStateChanged {
1213 // The state of the connection.
1214 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1215 optional android.bluetooth.ConnectionStateEnum state = 1;
1216 // An identifier that can be used to match connect and disconnect events.
1217 // Currently is last two bytes of a hash of a device level ID and
1218 // the mac address of the bluetooth device that is connected.
1219 optional int32 obfuscated_id = 2;
1220 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1221 // From android.bluetooth.BluetoothAdapter.java
1222 optional int32 bt_profile = 3;
1223}
1224
1225/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001226 * Logs when something is plugged into or removed from the USB-C connector.
1227 *
1228 * Logged from:
1229 * Vendor USB HAL.
1230 */
1231message UsbConnectorStateChanged {
1232 enum State {
1233 DISCONNECTED = 0;
1234 CONNECTED = 1;
1235 }
1236 optional State state = 1;
1237}
1238
1239/**
1240 * Logs the reported speaker impedance.
1241 *
1242 * Logged from:
1243 * Vendor audio implementation.
1244 */
1245message SpeakerImpedanceReported {
1246 optional int32 speaker_location = 1;
1247 optional int32 impedance = 2;
1248}
1249
1250/**
1251 * Logs the report of a failed hardware.
1252 *
1253 * Logged from:
1254 * Vendor HALs.
1255 *
1256 */
1257message HardwareFailed {
1258 enum HardwareType {
1259 HARDWARE_FAILED_UNKNOWN = 0;
1260 HARDWARE_FAILED_MICROPHONE = 1;
1261 HARDWARE_FAILED_CODEC = 2;
1262 HARDWARE_FAILED_SPEAKER = 3;
1263 HARDWARE_FAILED_FINGERPRINT = 4;
1264 }
1265 optional HardwareType hardware_type = 1;
1266
1267 /* hardware_location allows vendors to differentiate between multiple instances of
1268 * the same hardware_type. The specific locations are vendor defined integers,
1269 * referring to board-specific numbering schemes.
1270 */
1271 optional int32 hardware_location = 2;
1272
1273 /* failure_code is specific to the HardwareType of the failed hardware.
1274 * It should use the enum values defined below.
1275 */
1276 enum MicrophoneFailureCode {
1277 MICROPHONE_FAILURE_COMPLETE = 0;
1278 }
1279 enum CodecFailureCode {
1280 CODEC_FAILURE_COMPLETE = 0;
1281 }
1282 enum SpeakerFailureCode {
1283 SPEAKER_FAILURE_COMPLETE = 0;
1284 SPEAKER_FAILURE_HIGH_Z = 1;
1285 SPEAKER_FAILURE_SHORT = 2;
1286 }
1287 enum FingerprintFailureCode {
1288 FINGERPRINT_FAILURE_COMPLETE = 0;
1289 FINGERPRINT_SENSOR_BROKEN = 1;
1290 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1291 }
1292 optional int32 failure_code = 3;
1293}
1294
1295/**
1296 * Log an event when the device has been physically dropped.
1297 * Reported from the /vendor partition.
1298 */
1299message PhysicalDropDetected {
1300 // Confidence that the event was actually a drop, 0 -> 100
1301 optional int32 confidence_pctg = 1;
1302 // Peak acceleration of the drop, in 1/1000s of a g.
1303 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001304 // Duration of freefall in ms
1305 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001306}
1307
1308/**
1309 * Log bucketed battery charge cycles.
1310 *
1311 * Each bucket represents cycles of the battery past
1312 * a given charge point. For example, bucket 1 is the
1313 * lowest 1/8th of the battery, and bucket 8 is 100%.
1314 *
1315 * Logged from:
1316 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1317 */
1318message ChargeCyclesReported {
1319 optional int32 cycle_bucket_1 = 1;
1320 optional int32 cycle_bucket_2 = 2;
1321 optional int32 cycle_bucket_3 = 3;
1322 optional int32 cycle_bucket_4 = 4;
1323 optional int32 cycle_bucket_5 = 5;
1324 optional int32 cycle_bucket_6 = 6;
1325 optional int32 cycle_bucket_7 = 7;
1326 optional int32 cycle_bucket_8 = 8;
1327}
1328
1329/**
Howard Roa46b6582018-09-18 16:45:02 -07001330 * Log battery health snapshot.
1331 *
1332 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1333 * are snapshotted periodically over 24hrs.
1334 */
1335message BatteryHealthSnapshot {
1336 enum BatterySnapshotType {
1337 UNKNOWN = 0;
1338 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1339 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1340 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1341 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1342 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1343 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1344 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1345 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1346 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1347 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1348 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1349 }
1350 optional BatterySnapshotType type = 1;
1351 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001352 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001353 // Voltage Battery Voltage, in microVolts.
1354 optional int32 voltage_micro_volt = 3;
1355 // Current Battery current, in microAmps.
1356 optional int32 current_micro_amps = 4;
1357 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1358 optional int32 open_circuit_micro_volt = 5;
1359 // Resistance Battery Resistance, in microOhms.
1360 optional int32 resistance_micro_ohm = 6;
1361 // Level Battery Level, as % of full.
1362 optional int32 level_percent = 7;
1363}
1364
1365/**
1366 * Log slow I/O operations on the primary storage.
1367 */
1368message SlowIo {
1369 // Classifications of IO Operations.
1370 enum IoOperation {
1371 UNKNOWN = 0;
1372 READ = 1;
1373 WRITE = 2;
1374 UNMAP = 3;
1375 SYNC = 4;
1376 }
1377 optional IoOperation operation = 1;
1378
1379 // The number of slow IO operations of this type over 24 hours.
1380 optional int32 count = 2;
1381}
1382
1383/**
1384 * Log battery caused shutdown with the last recorded voltage.
1385 */
1386message BatteryCausedShutdown {
1387 // The last recorded battery voltage prior to shutdown.
1388 optional int32 last_recorded_micro_volt = 1;
1389}
1390
1391/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001392 * Logs the duration of a davey (jank of >=700ms) when it occurs
1393 *
1394 * Logged from:
1395 * frameworks/base/libs/hwui/JankTracker.cpp
1396 */
1397message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001398 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001399 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001400
Tej Singhbb8554a2018-01-26 11:59:14 -08001401 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001402 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001403}
1404
1405/**
Bookatze5885242017-10-24 20:10:31 -07001406 * Logs phone signal strength changes.
1407 *
1408 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001409 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001410 */
1411message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001412 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1413 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001414}
1415
Yangster4ccebea2018-10-09 17:09:02 -07001416
1417/**
1418 * Logs when the phone state, sim state or signal strength changes
1419 *
1420 * Logged from:
1421 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1422 */
1423message PhoneServiceStateChanged {
1424 optional android.telephony.ServiceStateEnum state = 1;
1425 optional android.telephony.SimStateEnum sim_state = 2;
1426 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1427}
1428
1429/**
1430 * Logs when the phone becomes on or off.
1431 *
1432 * Logged from:
1433 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1434 */
1435message PhoneStateChanged {
1436 enum State {
1437 OFF = 0;
1438 ON = 1;
1439 }
1440 optional State state = 1;
1441}
1442
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001443message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001444 optional android.stats.launcher.LauncherAction action = 1;
1445 optional android.stats.launcher.LauncherState src_state = 2;
1446 optional android.stats.launcher.LauncherState dst_state = 3;
1447 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001448 optional bool is_swipe_up_enabled = 5;
1449}
1450
David Chenc28b2bb2017-10-24 12:52:52 -07001451/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001452 * Logs when Settings UI has changed.
1453 *
1454 * Logged from:
1455 * packages/apps/Settings
1456 */
1457message SettingsUIChanged {
1458 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001459 * Where this SettingsUIChange event comes from. For example, if
1460 * it's a PAGE_VISIBLE event, where the page is opened from.
1461 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001462 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001463
1464 /**
1465 * What the UI action is.
1466 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001467 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001468
1469 /**
1470 * Where the action is happening
1471 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001472 optional android.app.settings.PageId pageId = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001473
1474 /**
1475 * What preference changed in this event.
1476 */
1477 optional string changedPreferenceKey = 4;
1478
1479 /**
1480 * The new value of the changed preference.
1481 */
1482 optional int64 changedPreferenceIntValue = 5;
1483}
1484
1485/**
David Chenc28b2bb2017-10-24 12:52:52 -07001486 * Logs that a setting was updated.
1487 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001488 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001489 * The tag and is_default allow resetting of settings to default values based on the specified
1490 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1491 */
1492message SettingChanged {
1493 // The name of the setting.
1494 optional string setting = 1;
1495
1496 // The change being imposed on this setting. May represent a number, eg "3".
1497 optional string value = 2;
1498
1499 // The new value of this setting. For most settings, this is same as value. For some settings,
1500 // value is +X or -X where X represents an element in a set. For example, if the previous value
1501 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1502 // The +/- feature is currently only used for location_providers_allowed.
1503 optional string new_value = 3;
1504
1505 // The previous value of this setting.
1506 optional string prev_value = 4;
1507
1508 // The tag used with the is_default for resetting sets of settings. This is generally null.
1509 optional string tag = 5;
1510
Bookatz90867622018-01-31 15:05:57 -08001511 // True if this setting with tag should be resettable.
1512 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001513
David Chenbd789912018-03-16 17:19:55 -07001514 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001515 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001516
1517 enum ChangeReason {
1518 UPDATED = 1; // Updated can be an insertion or an update.
1519 DELETED = 2;
1520 }
1521 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001522}
Chenjie Yub3dda412017-10-24 13:41:59 -07001523
Chenjie Yu05013b32017-11-21 10:21:41 -08001524/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001525 * Logs activity going to foreground or background
1526 *
1527 * Logged from:
1528 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1529 */
1530message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001531 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001532 optional string pkg_name = 2;
1533 optional string class_name = 3;
1534
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001535 enum State {
1536 BACKGROUND = 0;
1537 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001538 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001539 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001540}
David Chenc8a43242017-10-17 16:23:28 -07001541
1542/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001543 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001544 * Logged from:
1545 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1546 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001547message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001548 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001549
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001550 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001551
1552 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001553 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001554 optional string process_name = 3;
1555
1556 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001557 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001558
1559 optional string package_name = 5;
1560
1561 enum InstantApp {
1562 UNAVAILABLE = 0;
1563 FALSE = 1;
1564 TRUE = 2;
1565 }
1566 optional InstantApp is_instant_app = 6;
1567
1568 enum ForegroundState {
1569 UNKNOWN = 0;
1570 BACKGROUND = 1;
1571 FOREGROUND = 2;
1572 }
1573 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001574}
David Chen9e3808c2017-11-20 17:25:34 -08001575
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001576/**
1577 * Logs when a WTF (What a Terrible Failure) happened.
1578 * Logged from:
1579 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1580 */
1581message WTFOccurred {
1582 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001583
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001584 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001585
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001586 // The name of the process.
1587 // system_server if it is not by an app
1588 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001589
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001590 // The pid if available. -1 means not available.
1591 optional sint32 pid = 4;
1592}
1593
1594/**
1595 * Logs when system server reports low memory.
1596 * Logged from:
1597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1598 */
1599message LowMemReported {
1600}
1601
1602/**
1603 * Logs when an app ANR (App Not Responding) occurs.
1604 * Logged from:
1605 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1606 */
1607message ANROccurred {
1608 optional int32 uid = 1 [(is_uid) = true];
1609
1610 optional string process_name = 2;
1611
1612 optional string short_component_name = 3;
1613
1614 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001615
1616 enum InstantApp {
1617 UNAVAILABLE = 0;
1618 FALSE = 1;
1619 TRUE = 2;
1620 }
1621 optional InstantApp is_instant_app = 5;
1622
1623 enum ForegroundState {
1624 UNKNOWN = 0;
1625 BACKGROUND = 1;
1626 FOREGROUND = 2;
1627 }
1628 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001629}
1630
Bookatza7020bd2018-08-28 16:29:35 -07001631/**
1632 * Logs when the vibrator state changes.
1633 * Logged from:
1634 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1635 */
1636message VibratorStateChanged {
1637 repeated AttributionNode attribution_node = 1;
1638
1639 enum State {
1640 OFF = 0;
1641 ON = 1;
1642 }
1643 optional State state = 2;
1644
1645 // Duration (in milliseconds) requested to keep the vibrator on.
1646 // Only applicable for State == ON.
1647 optional int64 duration_millis = 3;
1648}
1649
David Chen0a368b22017-12-06 16:28:16 -08001650/*
1651 * Allows other apps to push events into statsd.
1652 * Logged from:
1653 * frameworks/base/core/java/android/util/StatsLog.java
1654 */
David Chen0b5c90c2018-01-25 16:51:49 -08001655message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001656 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001657 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001658
1659 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1660 optional int32 label = 2;
1661
1662 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1663 // predicates for the metrics).
1664 enum State {
1665 UNKNOWN = 0;
1666 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1667 STOP = 2;
1668 START = 3;
1669 }
1670 optional State state = 3;
1671}
1672
David Chen9e3808c2017-11-20 17:25:34 -08001673/**
Bookatz7948c872018-09-04 12:58:33 -07001674 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1675 * For example, this could be due to the user manually changing the time.
1676 *
1677 * Logged from:
1678 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1679 */
1680message WallClockTimeShifted {
1681 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1682 optional int64 wall_clock_timestamp_millis = 1;
1683}
1684
1685/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001686 * Logs when statsd detects an anomaly.
1687 *
1688 * Logged from:
1689 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1690 */
1691message AnomalyDetected {
1692 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001693 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001694
Yangster-mac94e197c2018-01-02 16:03:03 -08001695 // Id of the config whose anomaly detection alert fired.
1696 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001697
Yangster-mac94e197c2018-01-02 16:03:03 -08001698 // Id of the alert (i.e. name of the anomaly that was detected).
1699 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001700}
1701
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001702message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001703 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001704 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001705
1706 // The app package name.
1707 optional string pkg_name = 2;
1708
1709 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001710 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001711 WARM = 1;
1712 HOT = 2;
1713 COLD = 3;
1714 }
1715 // The transition type.
1716 optional TransitionType type = 3;
1717
1718 // The activity name.
1719 optional string activity_name = 4;
1720
1721 // The name of the calling app. Empty if not set.
1722 optional string calling_pkg_name = 5;
1723
1724 // Whether the app is an instant app.
1725 optional bool is_instant_app = 6;
1726
1727 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001728 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001729
Bookatz80d11a02018-01-16 10:46:35 -08001730 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001731
David Chen0b5c90c2018-01-25 16:51:49 -08001732 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001733 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001734 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001735 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001736 optional int32 bind_application_delay_millis = 11;
1737 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001738
1739 // Empty if not set.
1740 optional string launch_token = 13;
1741
Calin Juravle759fbda2018-02-20 19:52:30 +00001742 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001743 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001744
1745 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001746 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001747}
1748
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001749message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001750 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001751 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001752
1753 // The app package name.
1754 optional string pkg_name = 2;
1755
1756 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001757 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001758 WARM = 1;
1759 HOT = 2;
1760 COLD = 3;
1761 }
1762 // The transition type.
1763 optional TransitionType type = 3;
1764
1765 // The activity name.
1766 optional string activity_name = 4;
1767}
1768
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001769message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001770 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001771 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001772
1773 // The app package name.
1774 optional string pkg_name = 2;
1775
1776 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001777 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001778 WITH_BUNDLE = 1;
1779 WITHOUT_BUNDLE = 2;
1780 }
1781 // The transition type.
1782 optional TransitionType type = 3;
1783
1784 // The activity name.
1785 optional string activity_name = 4;
1786
1787 optional bool transition_process_running = 5;
1788
1789 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001790 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001791}
1792
Bookatz8fcd09a2017-12-18 13:01:10 -08001793/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001794 * Logs a picture-in-picture action
1795 * Logged from:
1796 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1797 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1798 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1799 */
1800message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001801 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001802 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001803
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001804 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001805
Chenjie Yu52cacc62017-12-08 18:11:45 -08001806 enum State {
1807 ENTERED = 1;
1808 EXPANDED_TO_FULL_SCREEN = 2;
1809 MINIMIZED = 3;
1810 DISMISSED = 4;
1811 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001812 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001813}
1814
1815/**
Chenjie Yue8904192017-12-08 19:12:57 -08001816 * Logs overlay action
1817 * Logged from:
1818 * services/core/java/com/android/server/wm/Session.java
1819 */
1820message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001821 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001822
1823 optional string package_name = 2;
1824
1825 optional bool using_alert_window = 3;
1826
1827 enum State {
1828 ENTERED = 1;
1829 EXITED = 2;
1830 }
1831 optional State state = 4;
1832}
1833
Chenjie Yuccfe6452018-01-30 11:33:21 -08001834/*
1835 * Logs foreground service starts and stops.
1836 * Note that this is not when a service starts or stops, but when it is
1837 * considered foreground.
1838 * Logged from
1839 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1840 */
1841message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001842 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001843 // package_name + "/" + class_name
1844 optional string short_name = 2;
1845
1846 enum State {
1847 ENTER = 1;
1848 EXIT = 2;
1849 }
1850 optional State state = 3;
1851}
1852
Chenjie Yue8904192017-12-08 19:12:57 -08001853/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001854 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1855 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1856 * attributed back to the parent (host) uid. One example is Chrome.
1857 *
1858 * Logged from:
1859 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1860 */
1861message IsolatedUidChanged {
1862 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001863 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001864 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001865 optional int32 parent_uid = 1;
1866
1867 optional int32 isolated_uid = 2;
1868
1869 // We expect an isolated uid to be removed before if it's used for another parent uid.
1870 enum Event {
1871 REMOVED = 0;
1872 CREATED = 1;
1873 }
1874 optional Event event = 3;
1875}
1876
1877/*
1878 * Logs the reception of an incoming network packet causing the main system to wake up for
1879 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1880 * and processed by WakeupController.cpp.
1881 */
1882message PacketWakeupOccurred {
1883 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1884 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001885 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001886 // The interface name on which the packet was received.
1887 optional string iface = 2;
1888 // The ethertype value of the packet.
1889 optional int32 ethertype = 3;
1890 // String representation of the destination MAC address of the packet.
1891 optional string destination_hardware_address = 4;
1892 // String representation of the source address of the packet if this was an IP packet.
1893 optional string source_ip = 5;
1894 // String representation of the destination address of the packet if this was an IP packet.
1895 optional string destination_ip = 6;
1896 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1897 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1898 // families.
1899 optional int32 ip_next_header = 7;
1900 // The source port if this was a TCP or UDP packet.
1901 optional int32 source_port = 8;
1902 // The destination port if this was a TCP or UDP packet.
1903 optional int32 destination_port = 9;
1904}
1905
1906/*
1907 * Logs the memory stats for an app on startup.
1908 * Logged from:
1909 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1910 */
1911message AppStartMemoryStateCaptured {
1912 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001913 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001914
1915 // The process name.
1916 optional string process_name = 2;
1917
1918 // The activity name.
1919 optional string activity_name = 3;
1920
1921 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001922 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001923
1924 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001925 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001926
1927 // RSS
1928 optional int64 rss_in_bytes = 6;
1929
1930 // CACHE
1931 optional int64 cache_in_bytes = 7;
1932
1933 // SWAP
1934 optional int64 swap_in_bytes = 8;
1935}
1936
1937/*
1938 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1939 * for LMK event.
1940 * Logged from:
1941 * system/core/lmkd/lmkd.c
1942 */
1943message LmkStateChanged {
1944 enum State {
1945 UNKNOWN = 0;
1946 START = 1;
1947 STOP = 2;
1948 }
1949 optional State state = 1;
1950}
1951
1952/*
1953 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1954 * Logged from:
1955 * system/core/lmkd/lmkd.c
1956 */
1957message LmkKillOccurred {
1958 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001959 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001960
1961 // The process name.
1962 optional string process_name = 2;
1963
1964 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07001965 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001966
1967 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001968 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001969
1970 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001971 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001972
1973 // RSS
1974 optional int64 rss_in_bytes = 6;
1975
1976 // CACHE
1977 optional int64 cache_in_bytes = 7;
1978
1979 // SWAP
1980 optional int64 swap_in_bytes = 8;
1981}
1982
Rajeev Kumar51b54602018-03-01 12:18:26 -08001983/*
1984 * Logs when the ActivityManagerService detects that an app died.
1985 *
1986 * Logged from:
1987 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1988 */
1989message AppDied {
1990 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07001991 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001992}
1993
Howard Ro21a039c2018-08-06 14:55:47 -07001994/**
1995 * An atom for generic metrics logging. Available from Android Q.
1996 */
1997message GenericAtom {
1998 // The uid of the application that sent this custom atom.
1999 optional int32 uid = 1 [(is_uid) = true];
2000
2001 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002002 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002003}
2004
Tej Singhd6d6d772018-09-05 17:41:25 -07002005/**
2006 * Logs when a fingerprint acquire event occurs.
2007 *
2008 * Logged from:
2009 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2010 */
2011message FingerprintAcquired {
2012 // The associated user. Eg: 0 for owners, 10+ for others.
2013 // Defined in android/os/UserHandle.java
2014 optional int32 user = 1;
2015 // If this acquire is for a crypto fingerprint.
2016 // e.g. Secure purchases, unlock password storage.
2017 optional bool is_crypto = 2;
2018}
2019
2020/**
2021 * Logs when a fingerprint authentication event occurs.
2022 *
2023 * Logged from:
2024 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2025 */
2026message FingerprintAuthenticated {
2027 // The associated user. Eg: 0 for owners, 10+ for others.
2028 // Defined in android/os/UserHandle.java
2029 optional int32 user = 1;
2030 // If this authentication is for a crypto fingerprint.
2031 // e.g. Secure purchases, unlock password storage.
2032 optional bool is_crypto = 2;
2033 // Whether or not this authentication was successful.
2034 optional bool is_authenticated = 3;
2035}
2036
2037/**
2038 * Logs when a fingerprint error occurs.
2039 *
2040 * Logged from:
2041 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2042 */
2043message FingerprintErrorOccurred {
2044 // The associated user. Eg: 0 for owners, 10+ for others.
2045 // Defined in android/os/UserHandle.java
2046 optional int32 user = 1;
2047 // If this error is for a crypto fingerprint.
2048 // e.g. Secure purchases, unlock password storage.
2049 optional bool is_crypto = 2;
2050
2051 enum Error {
2052 UNKNOWN = 0;
2053 LOCKOUT = 1;
2054 PERMANENT_LOCKOUT = 2;
2055 }
2056 // The type of error.
2057 optional Error error = 3;
2058}
Howard Ro688ae182018-09-25 00:09:36 -07002059
2060message Notification {
2061
2062 // Type of notification event.
2063 enum Type {
2064 TYPE_UNKNOWN = 0;
2065 // Notification became visible to the user.
2066 TYPE_OPEN = 1;
2067 // Notification became hidden.
2068 TYPE_CLOSE = 2;
2069 // Notification switched to detail mode.
2070 TYPE_DETAIL = 3;
2071 // Notification was clicked.
2072 TYPE_ACTION = 4;
2073 // Notification was dismissed.
2074 TYPE_DISMISS = 5;
2075 // Notification switched to summary mode. The enum value of 14 is to
2076 // match that of metrics_constants.
2077 TYPE_COLLAPSE = 14;
2078 }
2079 optional Type type = 1;
2080
2081 // Package name associated with the notification.
2082 optional string package_name = 2;
2083
2084 // Tag associated with notification.
2085 optional string tag = 3;
2086
2087 // Application-supplied ID associated with the notification.
2088 optional int32 id = 4;
2089
2090 // Index of notification in the notification panel.
2091 optional int32 shade_index = 5;
2092
2093 // The number of notifications in the notification panel.
2094 optional int32 shade_count = 6;
2095
2096 // Importance for the notification.
2097 optional int32 importance = 7;
2098
2099 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002100 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002101
2102 // Importance for the notification channel.
2103 optional int32 channel_importance = 9;
2104
Howard Ro183c2bd2018-10-18 13:52:10 -07002105 // Application-supplied ID associated with the notifications group.
2106 optional string group_id = 10;
2107
Howard Ro688ae182018-09-25 00:09:36 -07002108 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002109 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002110
Howard Ro183c2bd2018-10-18 13:52:10 -07002111 // Reason for dismissal of a notification. This field is only meaningful for
2112 // TYPE_DISMISS events.
2113 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002114
Howard Ro183c2bd2018-10-18 13:52:10 -07002115 // The first post time of notification, stable across updates.
2116 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002117
Howard Ro183c2bd2018-10-18 13:52:10 -07002118 // The most recent interruption time, or the creation time if no updates.
2119 // Differs from update_millis because updates are filtered based on whether
2120 // they actually interrupted the user.
2121 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002122
Howard Ro183c2bd2018-10-18 13:52:10 -07002123 // The most recent update time, or the creation time if no updates.
2124 optional int64 update_millis = 15;
2125
2126 // The most recent visibility event.
2127 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002128}
2129
2130
Chenjie Yubbcbc602018-02-05 16:51:52 -08002131//////////////////////////////////////////////////////////////////////
2132// Pulled atoms below this line //
2133//////////////////////////////////////////////////////////////////////
2134
2135/**
David Chenc8a43242017-10-17 16:23:28 -07002136 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2137 *
2138 * Pulled from:
2139 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2140 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002141message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002142 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002143
2144 optional int64 rx_bytes = 2;
2145
2146 optional int64 rx_packets = 3;
2147
2148 optional int64 tx_bytes = 4;
2149
2150 optional int64 tx_packets = 5;
2151}
2152
2153/**
2154 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2155 *
2156 * Pulled from:
2157 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2158 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002159message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002160 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002161
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002162 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2163 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002164
2165 optional int64 rx_bytes = 3;
2166
2167 optional int64 rx_packets = 4;
2168
2169 optional int64 tx_bytes = 5;
2170
2171 optional int64 tx_packets = 6;
2172}
2173
2174/**
2175 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2176 *
2177 * Pulled from:
2178 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2179 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002180message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002181 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002182
2183 optional int64 rx_bytes = 2;
2184
2185 optional int64 rx_packets = 3;
2186
2187 optional int64 tx_bytes = 4;
2188
2189 optional int64 tx_packets = 5;
2190}
2191
2192/**
2193 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2194 *
2195 * Pulled from:
2196 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2197 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002198message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002199 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002200
Yao Chenc40a19d2018-03-15 16:48:25 -07002201 // 1 denotes foreground and 0 denotes background. This is called Set in
2202 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002203 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002204
2205 optional int64 rx_bytes = 3;
2206
2207 optional int64 rx_packets = 4;
2208
2209 optional int64 tx_bytes = 5;
2210
2211 optional int64 tx_packets = 6;
2212}
2213
2214/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002215 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2216 *
2217 * Pulled from:
2218 * StatsCompanionService
2219 */
2220message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002221 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002222
2223 optional int64 rx_bytes = 2;
2224
2225 optional int64 tx_bytes = 3;
2226}
2227
2228/**
David Chenc8a43242017-10-17 16:23:28 -07002229 * Pulls the kernel wakelock durations. This atom is adapted from
2230 * android/internal/os/KernelWakelockStats.java
2231 *
2232 * Pulled from:
2233 * StatsCompanionService using KernelWakelockReader.
2234 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002235message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002236 optional string name = 1;
2237
2238 optional int32 count = 2;
2239
2240 optional int32 version = 3;
2241
Yangster-maca8a30442018-10-13 23:46:34 -07002242 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002243}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002244
Chenjie Yu05013b32017-11-21 10:21:41 -08002245/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002246 * Pulls low power state information. This includes platform and subsystem sleep state information,
2247 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002248 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002249 * hardware/interfaces/power/1.1/types.hal
2250 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002251message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002252 // Subsystem name
2253 optional string subsystem_name = 1;
2254 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2255 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2256 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002257 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002258 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002259 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002260 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002261}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002262
Chenjie Yu05013b32017-11-21 10:21:41 -08002263/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002264 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002265 * Pulls the time the cpu spend on the frequency index. Frequency index
2266 * starts from highest to lowest. The value should be monotonically
2267 * increasing since boot. However, if there is a cpu
2268 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002269 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002270message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002271 optional uint32 cluster = 1;
2272 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002273 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002274}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002275
Chenjie Yu05013b32017-11-21 10:21:41 -08002276/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002277 * Pulls Cpu Time Per Uid.
2278 * Note that isolated process uid time should be attributed to host uids.
2279 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002280message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002281 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002282 optional uint64 user_time_millis = 2;
2283 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002284}
2285
2286/**
2287 * Pulls Cpu Time Per Uid per frequency.
2288 * Note that isolated process uid time should be attributed to host uids.
2289 * For each uid, we order the time by descending frequencies.
2290 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002291message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002292 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002293 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002294 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002295}
Hugo Benichi884970e2017-11-14 22:42:46 +09002296
Chenjie Yu05013b32017-11-21 10:21:41 -08002297/**
2298 * Pulls Wifi Controller Activity Energy Info
2299 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002300message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002301 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002302 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002303 // stack reported state
2304 // TODO: replace this with proto enum
2305 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002306 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002307 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002308 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002309 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002310 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002311 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002312 // product of current(mA), voltage(V) and time(ms)
2313 optional uint64 controller_energy_used = 6;
2314}
2315
2316/**
2317 * Pulls Modem Activity Energy Info
2318 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002319message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002320 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002321 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002322 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002323 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002324 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002325 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002326 /**
2327 * Tx power index
2328 * index 0 = tx_power < 0dBm
2329 * index 1 = 0dBm < tx_power < 5dBm
2330 * index 2 = 5dBm < tx_power < 15dBm
2331 * index 3 = 15dBm < tx_power < 20dBm
2332 * index 4 = tx_power > 20dBm
2333 */
2334 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002335 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002336 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002337 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002338 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002339 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002340 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002341 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002342 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002343 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002344 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002345 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002346 // product of current(mA), voltage(V) and time(ms)
2347 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002348}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002349
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002350/**
2351 * Pulls Bluetooth Activity Energy Info
2352 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2353 */
2354message BluetoothActivityInfo {
2355 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002356 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002357 // bluetooth stack state
2358 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002359 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002360 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002361 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002362 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002363 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002364 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002365 // product of current(mA), voltage(V) and time(ms)
2366 optional uint64 energy_used = 6;
2367}
2368
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002369/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002370 * Logs the memory stats for a process.
2371 */
2372message ProcessMemoryState {
2373 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002374 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002375
2376 // The process name.
2377 optional string process_name = 2;
2378
2379 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002380 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002381
2382 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002383 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002384
2385 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002386 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002387
Rajeev Kumar90235992018-01-29 11:06:48 -08002388 // RSS
2389 optional int64 rss_in_bytes = 6;
2390
2391 // CACHE
2392 optional int64 cache_in_bytes = 7;
2393
2394 // SWAP
2395 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002396
2397 // RSS high watermark.
2398 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2399 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2400 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002401}
2402
2403/*
Rafal Slawik08621582018-10-15 14:53:07 +01002404 * Logs the memory stats for a native process (from procfs).
2405 */
2406message NativeProcessMemoryState {
2407 // The uid if available. -1 means not available.
2408 optional int32 uid = 1 [(is_uid) = true];
2409
2410 // The process name.
2411 optional string process_name = 2;
2412
2413 // # of page-faults
Rafal Slawik298e07f2018-10-18 14:35:29 +01002414 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002415
2416 // # of major page-faults
Rafal Slawik298e07f2018-10-18 14:35:29 +01002417 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002418
2419 // RSS
2420 optional int64 rss_in_bytes = 5;
2421
2422 // RSS high watermark.
2423 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2424 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2425 optional int64 rss_high_watermark_in_bytes = 6;
2426}
2427
2428/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002429 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002430 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002431message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002432 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002433}
2434
2435/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002436 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002437 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002438message SystemUptime {
2439 // Milliseconds since the system was booted.
2440 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2441 // for external input).
2442 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002443 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002444}
2445
2446/*
2447 * Reads from /proc/uid_concurrent_active_time which has the format:
2448 * active: X (X is # cores)
2449 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2450 * [uid1]: [time-0] [time-1] [time-2] ... ...
2451 * ...
2452 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2453 * The file contains a monotonically increasing count of time for a single boot.
2454 */
2455message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002456 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002457 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002458}
2459
2460/**
2461 * Reads from /proc/uid_concurrent_policy_time which has the format:
2462 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2463 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2464 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2465 * ...
2466 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2467 * The file contains a monotonically increasing count of time for a single boot.
2468 */
2469message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002470 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002471 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002472 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002473}
2474
2475/*
2476 * Pulls free disk space, for data, system partition and temporary directory.
2477 */
2478message DiskSpace {
2479 // available bytes in data partition
2480 optional uint64 data_available_bytes = 1;
2481 // available bytes in system partition
2482 optional uint64 system_available_bytes = 2;
2483 // available bytes in download cache or temp directories
2484 optional uint64 temp_available_bytes = 3;
2485}
Tej Singhbf972d92018-01-10 20:51:13 -08002486
2487/**
2488 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002489 * Pulled from:
2490 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002491 */
2492message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002493 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002494}
2495
2496/**
2497 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002498 * Pulled from:
2499 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002500 */
2501message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002502 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002503}
2504
2505/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002506 * Pulls battery voltage.
2507 * Pulled from:
2508 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2509 */
2510message BatteryVoltage {
2511 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002512 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002513}
2514
2515/**
Tej Singhd89137e2018-03-26 14:51:40 -07002516 * Pulls the temperature of various parts of the device.
2517 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002518 *
2519 * Pulled from:
2520 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2521 */
2522message Temperature {
2523 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2524 optional android.os.TemperatureTypeEnum sensor_location = 1;
2525
2526 // The name of the temperature source. Eg. CPU0
2527 optional string sensor_name = 2;
2528
Tej Singhd89137e2018-03-26 14:51:40 -07002529 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002530 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002531}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002532
2533/**
2534 * Pulls the statistics of calls to Binder.
2535 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002536 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2537 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002538 *
2539 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002540 */
2541message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002542 optional int32 uid = 1 [(is_uid) = true];
2543 // Fully qualified class name of the API call.
2544 //
2545 // This is a system server class name.
2546 //
2547 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2548 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2549 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2550 // commonly used APIs.
2551 optional string service_class_name = 2;
2552 // Method name of the API call. It can also be a transaction code if we cannot
2553 // resolve it to a name. See Binder#getTransactionName.
2554 //
2555 // This is a system server method name.
2556 optional string service_method_name = 3;
2557 // Total number of API calls.
2558 optional int64 call_count = 4;
2559 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2560 optional bool screen_interactive = 13;
2561 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2562 // call_count will be equal to recorded_call_count.
2563 //
2564 // If recorded_call_count is different than call_count, it means data collection has been
2565 // sampled. All the fields below will be sampled in this case.
2566 optional int64 recorded_call_count = 12;
2567 // Number of exceptions thrown by the API.
2568 optional int64 recorded_exception_count = 5;
2569 // Total latency of all API calls.
2570 // Average can be computed using total_latency_micros / recorded_call_count.
2571 optional int64 recorded_total_latency_micros = 6;
2572 // Maximum latency of one API call.
2573 optional int64 recorded_max_latency_micros = 7;
2574 // Total CPU usage of all API calls.
2575 // Average can be computed using total_cpu_micros / recorded_call_count.
2576 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2577 optional int64 recorded_total_cpu_micros = 8;
2578 // Maximum CPU usage of one API call.
2579 optional int64 recorded_max_cpu_micros = 9;
2580 // Maximum parcel reply size of one API call.
2581 optional int64 recorded_max_reply_size_bytes = 10;
2582 // Maximum parcel request size of one API call.
2583 optional int64 recorded_max_request_size_bytes = 11;
2584}
2585
2586/**
2587 * Pulls the statistics of exceptions during calls to Binder.
2588 *
2589 * Binder stats are cumulative from boot unless somebody reset the data using
2590 * > adb shell dumpsys binder_calls_stats --reset
2591 */
2592message BinderCallsExceptions {
2593 // Exception class name, e.g. java.lang.IllegalArgumentException.
2594 //
2595 // This is an exception class name thrown by the system server.
2596 optional string exception_class_name = 1;
2597 // Total number of exceptions.
2598 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002599}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002600
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002601/**
2602 * Pulls the statistics of message dispatching on HandlerThreads.
2603 *
2604 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2605 * config on the device.
2606 *
2607 * Next tag: 11
2608 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002609message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002610 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002611 optional int32 uid = 1 [(is_uid) = true];
2612
2613 // Fully qualified class name of the handler target class.
2614 //
2615 // This field does not contain PII. This is a system server class name.
2616 optional string handler_class_name = 2;
2617
2618 // The name of the thread that runs the Looper.
2619 //
2620 // This field does not contain PII. This is a system server thread name.
2621 optional string looper_thread_name = 3;
2622
2623 // The name of the dispatched message.
2624 //
2625 // This field does not contain PII. This is a system server constant or class
2626 // name.
2627 optional string message_name = 4;
2628
2629 // Total number of successfully dispatched messages.
2630 optional int64 message_count = 5;
2631
2632 // Total number of messages that failed dispatching.
2633 optional int64 exception_count = 6;
2634
2635 // Total number of processed messages we have data recorded for. If we
2636 // collected data for all the messages, message_count will be equal to
2637 // recorded_message_count.
2638 //
2639 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002640 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002641 optional int64 recorded_message_count = 7;
2642
2643 // Total latency of all processed messages.
2644 // Average can be computed using recorded_total_latency_micros /
2645 // recorded_message_count.
2646 optional int64 recorded_total_latency_micros = 8;
2647
2648 // Total CPU usage of all processed message.
2649 // Average can be computed using recorded_total_cpu_micros /
2650 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002651 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002652 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002653
2654 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2655 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002656
2657 // Max recorded CPU usage of all processed messages.
2658 optional int64 recorded_max_cpu_micros = 11;
2659
2660 // Max recorded latency of all processed messages.
2661 optional int64 recorded_max_latency_micros = 12;
2662
2663 // Total number of messages we tracked the dispatching delay for. If we
2664 // collected data for all the messages, message_count will be equal to
2665 // recorded_delay_message_count.
2666 //
2667 // If recorded_delay_message_count is different than message_count, it means data
2668 // collection has been sampled or/and not all messages specified the target dispatch time.
2669 // The fields below will be sampled in this case.
2670 optional int64 recorded_delay_message_count = 13;
2671
2672 // Total dispatching delay of all processed messages.
2673 // Calculated as a difference between the target dispatching time (Message.when)
2674 // and the actual dispatching time.
2675 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2676 optional int64 recorded_total_delay_millis = 14;
2677
2678 // Max dispatching delay of all processed messages.
2679 // Calculated as a difference between the target dispatching time (Message.when)
2680 // and the actual dispatching time.
2681 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002682}
Tej Singh86dc9db2018-09-06 00:39:57 +00002683
2684/**
2685 * Pulls disk information, such as write speed and latency.
2686 */
2687message DiskStats {
2688 // Time taken to open, write 512B to, and close a file.
2689 // -1 if error performing the check.
2690 optional int64 data_write_latency_millis = 1;
2691
2692 optional bool file_based_encryption = 2;
2693
2694 // Recent disk write speed in kB/s.
2695 // -1 if error querying storageed.
2696 // 0 if data is unavailable.
2697 optional int32 recent_disk_write_speed = 3;
2698}
2699
2700
2701/**
2702 * Free and total bytes of the Data, Cache, and System partition.
2703 */
2704message DirectoryUsage {
2705 enum Directory {
2706 UNKNOWN = 0;
2707 DATA = 1;
2708 CACHE = 2;
2709 SYSTEM = 3;
2710 }
2711 optional Directory directory = 1;
2712 optional int64 free_bytes = 2;
2713 optional int64 total_bytes = 3;
2714}
2715
2716
2717/**
2718 * Size of an application: apk size, data size, and cache size.
2719 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2720 * Information is only reported for apps with the primary user (user 0).
2721 * Sizes are aggregated by package name.
2722 */
2723message AppSize {
2724 // Including uids will involve modifying diskstats logic.
2725 optional string package_name = 1;
2726 // App size in bytes. -1 if unavailable.
2727 optional int64 app_size_bytes = 2;
2728 // App data size in bytes. -1 if unavailable.
2729 optional int64 app_data_size_bytes = 3;
2730 // App cache size in bytes. -1 if unavailable.
2731 optional int64 app_cache_size_bytes = 4;
2732 // Time that the cache file was produced.
2733 // Uses System.currentTimeMillis(), which is wall clock time.
2734 optional int64 cache_time_millis = 5;
2735}
2736
2737
2738/**
2739 * Size of a particular category. Eg: photos, videos.
2740 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2741 */
2742message CategorySize {
2743 enum Category {
2744 UNKNOWN = 0;
2745 APP_SIZE = 1;
2746 APP_DATA_SIZE = 2;
2747 APP_CACHE_SIZE = 3;
2748 PHOTOS = 4;
2749 VIDEOS = 5;
2750 AUDIO = 6;
2751 DOWNLOADS = 7;
2752 SYSTEM = 8;
2753 OTHER = 9;
2754 }
2755 optional Category category = 1;
2756 // Category size in bytes.
2757 optional int64 size_bytes = 2;
2758 // Time that the cache file was produced.
2759 // Uses System.currentTimeMillis(), which is wall clock time.
2760 optional int64 cache_time_millis = 3;
2761}
Tej Singhd6d6d772018-09-05 17:41:25 -07002762
2763/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002764 * Pulls per uid I/O stats. The stats are cumulative since boot.
2765 *
2766 * Read/write bytes are I/O events from a storage device
2767 * Read/write chars are data requested by read/write syscalls, and can be
2768 * satisfied by caching.
2769 *
2770 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2771 */
2772message DiskIo {
2773 optional int32 uid = 1 [(is_uid) = true];
2774 optional int64 fg_chars_read = 2;
2775 optional int64 fg_chars_write = 3;
2776 optional int64 fg_bytes_read = 4;
2777 optional int64 fg_bytes_write = 5;
2778 optional int64 bg_chars_read = 6;
2779 optional int64 bg_chars_write = 7;
2780 optional int64 bg_bytes_read = 8;
2781 optional int64 bg_bytes_write = 9;
2782 optional int64 fg_fsync = 10;
2783 optional int64 bg_fsync= 11;
2784}
2785
2786
2787/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002788 * Pulls the number of fingerprints for each user.
2789 *
2790 * Pulled from StatsCompanionService, which queries FingerprintManager.
2791 */
2792message NumFingerprints {
2793 // The associated user. Eg: 0 for owners, 10+ for others.
2794 // Defined in android/os/UserHandle.java
2795 optional int32 user = 1;
2796 // Number of fingerprints registered to that user.
2797 optional int32 num_fingerprints = 2;
2798}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002799
Yangsteraf9aee72018-10-12 09:26:16 -07002800message AggStats {
2801 optional int64 min = 1;
2802
2803 optional int64 average = 2;
2804
2805 optional int64 max = 3;
2806}
2807
2808message ProcessStatsStateProto {
2809 optional android.service.procstats.ScreenState screen_state = 1;
2810
2811 optional android.service.procstats.MemoryState memory_state = 2;
2812
2813 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
2814 // and not frameworks/base/core/java/android/app/ActivityManager.java
2815 optional android.service.procstats.ProcessState process_state = 3;
2816
2817 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002818 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002819
2820 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002821 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07002822
2823 // # of samples taken
2824 optional int32 sample_size = 5;
2825
2826 // PSS is memory reserved for this process
2827 optional AggStats pss = 6;
2828
2829 // USS is memory shared between processes, divided evenly for accounting
2830 optional AggStats uss = 7;
2831
2832 // RSS is memory resident for this process
2833 optional AggStats rss = 8;
2834}
2835
2836// Next Tag: 7
2837message ProcessStatsProto {
2838 // Name of process.
2839 optional string process = 1;
2840
2841 // Uid of the process.
2842 optional int32 uid = 2;
2843
2844 // Information about how often kills occurred
2845 message Kill {
2846 // Count of excessive CPU kills
2847 optional int32 cpu = 1;
2848
2849 // Count of kills when cached
2850 optional int32 cached = 2;
2851
2852 // PSS stats during cached kill
2853 optional AggStats cached_pss = 3;
2854 }
2855 optional Kill kill = 3;
2856
2857 // Time and memory spent in various states.
2858 repeated ProcessStatsStateProto states = 5;
2859
2860 // Total time process has been running... screen_state, memory_state, and process_state
2861 // will not be set.
2862 optional ProcessStatsStateProto total_running_state = 6;
2863}
2864
2865message PackageServiceOperationStatsProto {
2866 // Operate enum: Started, Foreground, Bound, Executing
2867 optional android.service.procstats.ServiceOperationState operation = 1;
2868
2869 // Number of times the service was in this operation.
2870 optional int32 count = 2;
2871
2872 // Information about a state the service can be in.
2873 message StateStats {
2874 // Screen state enum.
2875 optional android.service.procstats.ScreenState screen_state = 1;
2876 // Memory state enum.
2877 optional android.service.procstats.MemoryState memory_state = 2;
2878
2879 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07002880 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002881 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002882 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002883 }
2884 repeated StateStats state_stats = 3;
2885}
2886
2887message PackageServiceStatsProto {
2888 // Name of service component.
2889 optional string service_name = 1;
2890
2891 // The operation stats.
2892 // The package_name, package_uid, package_version, service_name will not be set to save space.
2893 repeated PackageServiceOperationStatsProto operation_stats = 2;
2894}
2895
2896message PackageAssociationSourceProcessStatsProto {
2897 // Uid of the process.
2898 optional int32 process_uid = 1;
2899 // Process name.
2900 optional string process_name = 2;
2901
2902 // Total count of the times this association appeared.
2903 optional int32 total_count = 3;
2904
2905 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07002906 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002907
2908 // Total count of the times this association became actively impacting its target process.
2909 optional int32 active_count = 5;
2910
2911 // Information on one source in this association.
2912 message StateStats {
2913 // Process state enum.
2914 optional android.service.procstats.ProcessState process_state = 1;
2915 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002916 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07002917 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002918 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002919 }
2920 repeated StateStats active_state_stats = 6;
2921}
2922
2923message PackageAssociationProcessStatsProto {
2924 // Name of the target component.
2925 optional string component_name = 1;
2926 // Information on one source in this association.
2927 repeated PackageAssociationSourceProcessStatsProto sources = 2;
2928}
2929
2930
2931message ProcessStatsPackageProto {
2932 // Name of package.
2933 optional string package = 1;
2934
2935 // Uid of the package.
2936 optional int32 uid = 2;
2937
2938 // Version of the package.
2939 optional int64 version = 3;
2940
2941 // Stats for each process running with the package loaded in to it.
2942 repeated ProcessStatsProto process_stats = 4;
2943
2944 // Stats for each of the package's services.
2945 repeated PackageServiceStatsProto service_stats = 5;
2946
2947 // Stats for each association with the package.
2948 repeated PackageAssociationProcessStatsProto association_stats = 6;
2949}
2950
2951message ProcessStatsSectionProto {
2952 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002953 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07002954
2955 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002956 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07002957
2958 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002959 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002960
2961 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002962 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002963
2964 // System runtime library. e.g. "libdvm.so", "libart.so".
2965 optional string runtime = 5;
2966
2967 // whether kernel reports swapped pss.
2968 optional bool has_swapped_pss = 6;
2969
2970 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
2971 enum Status {
2972 STATUS_UNKNOWN = 0;
2973 STATUS_COMPLETE = 1;
2974 STATUS_PARTIAL = 2;
2975 STATUS_SHUTDOWN = 3;
2976 STATUS_SYSPROPS = 4;
2977 }
2978 repeated Status status = 7;
2979
2980 // Stats for each process.
2981 repeated ProcessStatsProto process_stats = 8;
2982
2983 // Stats for each package.
2984 repeated ProcessStatsPackageProto package_stats = 9;
2985}
2986
Chenjie Yu12e5e672018-09-14 15:54:59 -07002987/**
2988 * Pulled from ProcessStatsService.java
2989 */
2990message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07002991 optional ProcessStatsSectionProto proc_stats_section = 1;
2992}
2993
2994message PowerProfileProto {
2995 optional double cpu_suspend = 1;
2996
2997 optional double cpu_idle = 2;
2998
2999 optional double cpu_active = 3;
3000
3001 message CpuCluster {
3002 optional int32 id = 1;
3003 optional double cluster_power = 2;
3004 optional int32 cores = 3;
3005 repeated int64 speed = 4;
3006 repeated double core_power = 5;
3007 }
3008
3009 repeated CpuCluster cpu_cluster = 40;
3010
3011 optional double wifi_scan = 4;
3012
3013 optional double wifi_on = 5;
3014
3015 optional double wifi_active = 6;
3016
3017 optional double wifi_controller_idle = 7;
3018
3019 optional double wifi_controller_rx = 8;
3020
3021 optional double wifi_controller_tx = 9;
3022
3023 repeated double wifi_controller_tx_levels = 10;
3024
3025 optional double wifi_controller_operating_voltage = 11;
3026
3027 optional double bluetooth_controller_idle = 12;
3028
3029 optional double bluetooth_controller_rx = 13;
3030
3031 optional double bluetooth_controller_tx = 14;
3032
3033 optional double bluetooth_controller_operating_voltage = 15;
3034
3035 optional double modem_controller_sleep = 16;
3036
3037 optional double modem_controller_idle = 17;
3038
3039 optional double modem_controller_rx = 18;
3040
3041 repeated double modem_controller_tx = 19;
3042
3043 optional double modem_controller_operating_voltage = 20;
3044
3045 optional double gps_on = 21;
3046
3047 repeated double gps_signal_quality_based = 22;
3048
3049 optional double gps_operating_voltage = 23;
3050
3051 optional double bluetooth_on = 24;
3052
3053 optional double bluetooth_active = 25;
3054
3055 optional double bluetooth_at_cmd = 26;
3056
3057 optional double ambient_display = 27;
3058
3059 optional double screen_on = 28;
3060
3061 optional double radio_on = 29;
3062
3063 optional double radio_scanning = 30;
3064
3065 optional double radio_active = 31;
3066
3067 optional double screen_full = 32;
3068
3069 optional double audio = 33;
3070
3071 optional double video = 34;
3072
3073 optional double flashlight = 35;
3074
3075 optional double memory = 36;
3076
3077 optional double camera = 37;
3078
3079 optional double wifi_batched_scan = 38;
3080
3081 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003082}
Chenjie Yuab530202018-09-26 12:39:20 -07003083
3084/**
3085 * power_profile.xml and other constants for power model calculations.
3086 * Pulled from PowerProfile.java
3087 */
3088message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003089 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003090}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003091
3092/**
arangelovd5db50e2018-10-12 20:24:39 +01003093 * Logs when a user restriction was added or removed.
3094 *
3095 * Logged from:
3096 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3097 */
3098message UserRestrictionChanged {
3099 // The raw string of the user restriction as defined in UserManager.
3100 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3101 optional string restriction = 1;
3102 // Whether the restriction is enabled or disabled.
3103 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003104}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003105
3106/**
3107 * Pulls process user time and system time. Puller takes a snapshot of all pids
3108 * in the system and returns cpu stats for those that are working at the time.
3109 * Dead pids will be dropped. Kernel processes are excluded.
3110 * Min cool-down is 5 sec.
3111 */
3112message ProcessCpuTime {
3113 optional int32 uid = 1 [(is_uid) = true];
3114
3115 optional string process_name = 2;
3116 // Process cpu time in user space, cumulative from boot/process start
3117 optional int64 user_time_millis = 3;
3118 // Process cpu time in system space, cumulative from boot/process start
3119 optional int64 system_time_millis = 4;
3120}