blob: 1e9c354d26bf94395862128e6cdf43d3030580e3 [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";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080027import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080028import "frameworks/base/core/proto/android/server/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080029import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/telephony/enums.proto";
31import "frameworks/base/core/proto/android/view/enums.proto";
Howard Ro0546d542018-08-30 16:23:44 -070032import "frameworks/base/proto/src/stats_enums.proto";
Chenjie Yu159e4f82018-08-29 11:49:11 -070033import "frameworks/base/core/proto/android/service/procstats.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080034
Yao Chend54f9dd2017-10-17 17:37:48 +000035/**
Stefan Lafonae2df012017-11-14 09:17:21 -080036 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000037 * raw stats log events from the Android system, also known as "atoms."
38 *
39 * This field contains a single oneof with all of the available messages.
40 * The stats-log-api-gen tool runs as part of the Android build and
41 * generates the android.util.StatsLog class, which contains the constants
42 * and methods that Android uses to log.
43 *
Stefan Lafonae2df012017-11-14 09:17:21 -080044 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000045 * Instead, statsd on Android constructs these messages synthetically,
46 * in the format defined here and in stats_log.proto.
47 */
Stefan Lafonae2df012017-11-14 09:17:21 -080048message Atom {
49 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070050 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070051 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
52 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070053 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070054 BleScanResultReceived ble_scan_result_received = 4;
55 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080056 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070057 SyncStateChanged sync_state_changed = 7;
58 ScheduledJobStateChanged scheduled_job_state_changed = 8;
59 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070060 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080061 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
62 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
63 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070064 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
65 MemoryFactorStateChanged memory_factor_state_changed = 15;
66 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
67 CachedKillReported cached_kill_reported = 17;
68 ProcessMemoryStatReported process_memory_stat_reported = 18;
69 // 19 is available
Bookatzddccf0a2017-11-28 16:48:14 -080070 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
71 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
72 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070073 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080074 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070075 CameraStateChanged camera_state_changed = 25;
76 FlashlightStateChanged flashlight_state_changed = 26;
77 UidProcessStateChanged uid_process_state_changed = 27;
78 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
79 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070080 BatteryLevelChanged battery_level_changed = 30;
81 ChargingStateChanged charging_state_changed = 31;
82 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070083 InteractiveStateChanged interactive_state_changed = 33;
84 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070085 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
86 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070087 WifiLockStateChanged wifi_lock_state_changed = 37;
88 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
89 WifiScanStateChanged wifi_scan_state_changed = 39;
90 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070091 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070092 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070093 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090094 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070095 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080096 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080097 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080098 AppStartOccurred app_start_occurred = 48;
99 AppStartCanceled app_start_canceled = 49;
100 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800101 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800102 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800103 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800104 LmkStateChanged lmk_state_changed = 54;
105 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800106 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800107 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800108 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800109 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800110 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800111 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800112 KeyguardStateChanged keyguard_state_changed = 62;
113 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
114 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800115 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800116 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800117 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
118 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700119 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700120 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800121 SpeakerImpedanceReported speaker_impedance_reported = 71;
122 HardwareFailed hardware_failed = 72;
123 PhysicalDropDetected physical_drop_detected = 73;
124 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800125 MobileConnectionStateChanged mobile_connection_state_changed = 75;
126 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700127 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800128 AppCrashOccurred app_crash_occurred = 78;
129 ANROccurred anr_occurred = 79;
130 WTFOccurred wtf_occurred = 80;
131 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700132 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700133 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700134 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700135 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700136 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700137 FingerprintAcquired fingerprint_acquired = 87;
138 FingerprintAuthenticated fingerprint_authenticated = 88;
139 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700140 Notification notification = 90;
Yao Chend54f9dd2017-10-17 17:37:48 +0000141 }
David Chenc8a43242017-10-17 16:23:28 -0700142
David Chen6e3e6cb2018-01-03 16:14:06 -0800143 // Pulled events will start at field 10000.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100144 // Next: 10025
David Chenc8a43242017-10-17 16:23:28 -0700145 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800146 WifiBytesTransfer wifi_bytes_transfer = 10000;
147 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
148 MobileBytesTransfer mobile_bytes_transfer = 10002;
149 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800150 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800151 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800152 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800153 CpuTimePerFreq cpu_time_per_freq = 10008;
154 CpuTimePerUid cpu_time_per_uid = 10009;
155 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800156 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800157 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800158 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800159 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800160 SystemElapsedRealtime system_elapsed_realtime = 10014;
161 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800162 CpuActiveTime cpu_active_time = 10016;
163 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000164 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800165 RemainingBatteryCapacity remaining_battery_capacity = 10019;
166 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800167 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100168 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100169 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100170 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000171 DiskStats disk_stats = 10025;
172 DirectoryUsage directory_usage = 10026;
173 AppSize app_size = 10027;
174 CategorySize category_size = 10028;
Bookatz17f0d8a2018-09-13 12:56:32 -0700175 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700176 NumFingerprints num_fingerprints = 10031;
Chenjie Yu12e5e672018-09-14 15:54:59 -0700177 ProcStats proc_stats = 10029;
David Chenc8a43242017-10-17 16:23:28 -0700178 }
yroa1fe77c2018-02-26 14:22:54 -0800179
Bookatz76aafcf2018-09-17 16:17:10 -0700180 // DO NOT USE field numbers above 100,000 in AOSP.
181 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
182 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700183}
184
Yao Chend54f9dd2017-10-17 17:37:48 +0000185/**
Yangster-mac20877162017-12-22 17:19:39 -0800186 * This proto represents a node of an attribution chain.
187 * Note: All attribution chains are represented as a repeated field of type
188 * AttributionNode. It is understood that in such arrays, the order is that
189 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000190 */
Yangster-mac20877162017-12-22 17:19:39 -0800191message AttributionNode {
192 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800193 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800194
Yangster-mac20877162017-12-22 17:19:39 -0800195 // The (optional) string tag for an element in the attribution chain. If the
196 // element has no tag, it is encoded as an empty string.
197 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700198}
199
Yangster-mac48b3d622018-08-18 12:38:11 -0700200message KeyValuePair {
201 optional int32 key = 1;
202 oneof value {
203 int64 value_int = 2;
204 string value_str = 3;
205 float value_float = 4;
206 }
207}
208
209message KeyValuePairsAtom {
210 optional int32 uid = 1;
211 repeated KeyValuePair pairs = 2;
212}
213
Yao Chend54f9dd2017-10-17 17:37:48 +0000214/*
215 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800216 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000217 *
218 * RULES:
219 * - The field ids for each atom must start at 1, and count upwards by 1.
220 * Skipping field ids is not allowed.
221 * - These form an API, so renaming, renumbering or removing fields is
222 * not allowed between android releases. (This is not currently enforced,
223 * but there will be a tool to enforce this restriction).
224 * - The types must be built-in protocol buffer types, namely, no sub-messages
225 * are allowed (yet). The bytes type is also not allowed.
226 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800227 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000228 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800229 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000230 * - A field that is a uid should be a string field, tagged with the [xxx]
231 * annotation. The generated code on android will be represented by UIDs,
232 * and those UIDs will be translated in xxx to those strings.
233 *
234 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700235 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000236 * - If there is a UID, it goes first. Think in an object-oriented fashion.
237 * *****************************************************************************
238 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700239
Yao Chend54f9dd2017-10-17 17:37:48 +0000240/**
Yangster-mace16189a2018-08-26 12:20:16 -0700241 * Logs when the Thermal service HAL notifies the throttling start/stop events.
242 *
243 * Logged from:
244 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
245 */
246message ThermalThrottlingStateChanged {
247 optional android.os.TemperatureTypeEnum sensor_type = 1;
248
249 enum State {
250 UNKNOWN = 0;
251 START = 1;
252 STOP = 2;
253 }
254
255 optional State state = 2;
256
257 optional float temperature = 3;
258}
259
260/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000261 * Logs when the screen state changes.
262 *
263 * Logged from:
264 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
265 */
266message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800267 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800268 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700269}
Yao Chend54f9dd2017-10-17 17:37:48 +0000270
271/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700272 * Logs that the process state of the uid, as determined by ActivityManager
273 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000274 *
275 * Logged from:
276 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
277 */
Bookatzc1a050a2017-10-10 15:49:28 -0700278message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700279 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000280
Bookatzdb026a22018-01-10 19:01:56 -0800281 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800282 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000283}
284
285/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700286 * Logs process state change of a process, as per the activity manager.
287 *
288 * Logged from:
289 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
290 */
291message ProcessStateChanged {
292 optional int32 uid = 1;
293 optional string process_name = 2;
294 optional string package_name = 3;
295 // TODO: remove this when validation is done
296 optional int64 version = 5;
297 // The state, from frameworks/base/core/proto/android/app/enums.proto.
298 optional android.app.ProcessStateEnum state = 4;
299}
300
301/**
302 * Logs when ActivityManagerService sleep state is changed.
303 *
304 * Logged from:
305 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
306 */
307message ActivityManagerSleepStateChanged {
308 // TODO: import frameworks proto
309 enum State {
310 UNKNOWN = 0;
311 ASLEEP = 1;
312 AWAKE = 2;
313 }
314 optional State state = 1 [(stateFieldOption).option = EXCLUSIVE];
315}
316
317/**
318 * Logs when system memory state changes.
319 *
320 * Logged from:
321 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
322 */
323message MemoryFactorStateChanged {
324 // TODO: import frameworks proto
325 enum State {
326 MEMORY_UNKNOWN = 0;
327 NORMAL = 1; // normal.
328 MODERATE = 2; // moderate memory pressure.
329 LOW = 3; // low memory.
330 CRITICAL = 4; // critical memory.
331
332 }
333 optional State factor = 1 [(stateFieldOption).option = EXCLUSIVE];
334}
335
336/**
337 * Logs when app is using too much cpu, according to ActivityManagerService.
338 *
339 * Logged from:
340 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
341 */
342message ExcessiveCpuUsageReported {
343 optional int32 uid = 1;
344 optional string process_name = 2;
345 optional string package_name = 3;
346 // package version. TODO: remove this when validation is done
347 optional int64 version = 4;
348}
349
350/**
351 * Logs when a cached process is killed, along with its pss.
352 *
353 * Logged from:
354 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
355 */
356message CachedKillReported {
357 optional int32 uid = 1;
358 optional string process_name = 2;
359 optional string package_name = 3;
360 // TODO: remove this when validation is done
361 optional int64 version = 5;
362 optional int64 pss = 4;
363}
364
365/**
366 * Logs when memory stats of a process is reported.
367 *
368 * Logged from:
369 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
370 */
371message ProcessMemoryStatReported {
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 = 9;
377 optional int64 pss = 4;
378 optional int64 uss = 5;
379 optional int64 rss = 6;
380 enum Type {
381 ADD_PSS_INTERNAL_SINGLE = 0;
382 ADD_PSS_INTERNAL_ALL_MEM = 1;
383 ADD_PSS_INTERNAL_ALL_POLL = 2;
384 ADD_PSS_EXTERNAL = 3;
385 ADD_PSS_EXTERNAL_SLOW = 4;
386 }
387 optional Type type = 7;
388 optional int64 duration = 8;
389}
390
391/**
Bookatzc1a050a2017-10-10 15:49:28 -0700392 * Logs that a process started, finished, crashed, or ANRed.
393 *
394 * Logged from:
395 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
396 */
397message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700398 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700399
David Chen0b5c90c2018-01-25 16:51:49 -0800400 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800401 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700402
Bookatzddccf0a2017-11-28 16:48:14 -0800403 // What lifecycle state the process changed to.
404 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800405 enum State {
406 FINISHED = 0;
407 STARTED = 1;
408 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800409 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800410 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700411}
412
Bookatzc1a050a2017-10-10 15:49:28 -0700413/**
414 * Logs when the ble scan state changes.
415 *
416 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700417 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700418 */
419message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800420 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700421
422 enum State {
423 OFF = 0;
424 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700425 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
426 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700427 }
428 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700429
Bookatze5ec0b42018-03-26 13:34:56 -0700430 // Does the scan have a filter.
431 optional bool is_filtered = 3;
432 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
433 optional bool is_first_match = 4;
434 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
435 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700436}
437
438/**
439 * Logs reporting of a ble scan finding results.
440 *
441 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700442 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700443 */
Bookatzae6738e2018-09-13 11:38:56 -0700444// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700445message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800446 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700447
448 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800449 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700450}
451
452/**
453 * Logs when a sensor state changes.
454 *
455 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700456 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700457 */
458message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800459 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700460
Bookatzc1a050a2017-10-10 15:49:28 -0700461 // The id (int) of the sensor.
462 optional int32 sensor_id = 2;
463
464 enum State {
465 OFF = 0;
466 ON = 1;
467 }
468 optional State state = 3;
469}
470
471
472/**
473 * Logs when GPS state changes.
474 *
475 * Logged from:
476 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
477 */
478message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800479 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700480
481 enum State {
482 OFF = 0;
483 ON = 1;
484 }
485 optional State state = 2;
486}
487
488
489/**
490 * Logs when a sync manager sync state changes.
491 *
492 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700493 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700494 */
495message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800496 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700497
David Chen0b5c90c2018-01-25 16:51:49 -0800498 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800499 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700500
501 enum State {
502 OFF = 0;
503 ON = 1;
504 }
505 optional State state = 3;
506}
507
Yangster-mac96353002018-09-05 11:18:55 -0700508/*
509 * Deferred job stats.
510 *
511 * Logged from:
512 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
513*/
514message DeferredJobStatsReported {
515 repeated AttributionNode attribution_node = 1;
516
517 // Number of jobs deferred.
518 optional int32 num_jobs_deferred = 2;
519
520 // Time since the last job runs.
521 optional int64 time_since_last_job_millis = 3;
522}
523
Bookatzc1a050a2017-10-10 15:49:28 -0700524/**
525 * Logs when a job scheduler job state changes.
526 *
527 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700528 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700529 */
530message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800531 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700532
533 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800534 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700535
536 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800537 FINISHED = 0;
538 STARTED = 1;
539 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700540 }
541 optional State state = 3;
542
Tej Singh33a412b2018-03-16 18:43:59 -0700543 // The reason a job has stopped.
544 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700545 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700546 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700547}
548
549/**
550 * Logs when the audio state changes.
551 *
552 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700553 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700554 */
555message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800556 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700557
558 enum State {
559 OFF = 0;
560 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700561 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
562 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700563 }
564 optional State state = 2;
565}
566
567/**
568 * Logs when the video codec state changes.
569 *
570 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700572 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800573message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800574 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700575
576 enum State {
577 OFF = 0;
578 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700579 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
580 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700581 }
582 optional State state = 2;
583}
584
585/**
586 * Logs when the flashlight state changes.
587 *
588 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700589 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700590 */
591message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800592 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700593
594 enum State {
595 OFF = 0;
596 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700597 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
598 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700599 }
600 optional State state = 2;
601}
602
603/**
604 * Logs when the camera state changes.
605 *
606 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700607 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700608 */
609message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 enum State {
613 OFF = 0;
614 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700615 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
616 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700617 }
618 optional State state = 2;
619}
620
621/**
622 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000623 *
624 * Logged from:
625 * TODO
626 */
Bookatzd6746242017-10-24 18:39:35 -0700627message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800628 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000629
Bookatz1a1b0462018-01-12 11:47:03 -0800630 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
631 // From frameworks/base/core/proto/android/os/enums.proto.
632 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633
634 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
635 optional string tag = 3;
636
637 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800638 RELEASE = 0;
639 ACQUIRE = 1;
640 CHANGE_RELEASE = 2;
641 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700642 }
643 optional State state = 4;
644}
645
646/**
Bookatzc1a050a2017-10-10 15:49:28 -0700647 * Logs when a partial wakelock is considered 'long' (over 1 min).
648 *
649 * Logged from:
650 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
651 */
652message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800653 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700654
Yao Chend54f9dd2017-10-17 17:37:48 +0000655 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
656 optional string tag = 2;
657
Bookatzc1a050a2017-10-10 15:49:28 -0700658 // TODO: I have no idea what this is.
659 optional string history_tag = 3;
660
661 enum State {
662 OFF = 0;
663 ON = 1;
664 }
665 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000666}
667
Bookatzc1a050a2017-10-10 15:49:28 -0700668/**
Bookatza66083f2018-09-20 17:24:00 -0700669 * Logs when the device is interactive, according to the PowerManager Notifier.
670 *
671 * Logged from:
672 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
673 */
674message InteractiveStateChanged {
675 enum State {
676 OFF = 0;
677 ON = 1;
678 }
679 optional State state = 1;
680}
681
682/**
Bookatzc1a050a2017-10-10 15:49:28 -0700683 * Logs Battery Saver state change.
684 *
685 * Logged from:
686 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
687 */
688message BatterySaverModeStateChanged {
689 enum State {
690 OFF = 0;
691 ON = 1;
692 }
693 optional State state = 1;
694}
695
696/**
697 * Logs Doze mode state change.
698 *
699 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800700 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700701 */
702message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800703 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800704}
705
706
707/**
708 * Logs state change of Doze mode including maintenance windows.
709 *
710 * Logged from:
711 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
712 */
713message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800714 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715}
716
717/**
718 * Logs screen brightness level.
719 *
720 * Logged from:
721 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
722 */
723message ScreenBrightnessChanged {
724 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
725 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700726}
727
728/**
729 * Logs battery level (percent full, from 0 to 100).
730 *
731 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700732 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700733 */
734message BatteryLevelChanged {
735 // Battery level. Should be in [0, 100].
736 optional int32 battery_level = 1;
737}
738
739/**
740 * Logs change in charging status of the device.
741 *
742 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700743 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700744 */
745message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800746 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
747 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700748}
749
750/**
751 * Logs whether the device is plugged in, and what power source it is using.
752 *
753 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700755 */
756message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800757 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
758 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700759}
760
Bookatz8c6571b2017-10-24 15:04:41 -0700761/**
762 * Logs when an app's wakeup alarm fires.
763 *
764 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700765 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700766 */
767message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800768 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800769
770 // Name of the wakeup alarm.
771 optional string tag = 2;
772}
773
774/**
775 * Logs when an an app causes the mobile radio to change state.
776 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
777 *
778 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700779 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800780 */
781message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800782 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800783
Bookatz1a1b0462018-01-12 11:47:03 -0800784 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
785 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800786}
787
788/**
789 * Logs when an an app causes the wifi radio to change state.
790 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
791 *
792 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700793 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800794 */
795message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800796 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800797
Bookatz1a1b0462018-01-12 11:47:03 -0800798 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
799 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700800}
801
802/**
803 * Logs kernel wakeup reasons and aborts.
804 *
805 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700806 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700807 */
808message KernelWakeupReported {
809 // Name of the kernel wakeup reason (or abort).
810 optional string wakeup_reason_name = 1;
811
812 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800813 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700814}
815
816/**
817 * Logs wifi locks held by an app.
818 *
819 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700820 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700821 */
822message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800823 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700824
825 enum State {
826 OFF = 0;
827 ON = 1;
828 }
829 optional State state = 2;
830}
831
832/**
833 * Logs wifi signal strength changes.
834 *
835 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700836 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700837 */
838message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800839 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
840 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700841}
842
843/**
844 * Logs wifi scans performed by an app.
845 *
846 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700847 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700848 */
849message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800850 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700851
852 enum State {
853 OFF = 0;
854 ON = 1;
855 }
856 optional State state = 2;
857}
858
859/**
Tej Singh4503e102018-01-04 14:35:01 -0800860 * Logs wifi multicast locks held by an app
861 *
862 * Logged from:
863 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
864 */
865message WifiMulticastLockStateChanged {
866 repeated AttributionNode attribution_node = 1;
867
868 enum State {
869 OFF = 0;
870 ON = 1;
871 }
872 optional State state = 2;
873}
874
875/**
Tej Singh1ea42892018-01-19 09:27:00 -0800876 * Logs shutdown reason and duration on next boot.
877 *
878 * Logged from:
879 * frameworks/base/core/java/com/android/server/BootReceiver.java
880 */
881message ShutdownSequenceReported {
882 // True if shutdown is for a reboot. Default: false if we do not know.
883 optional bool reboot = 1;
884
885 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
886 optional string reason = 2;
887
888 // Beginning of shutdown time in ms using wall clock time since unix epoch.
889 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800890 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800891
892 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800893 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800894}
895
Tej Singh6483ea42018-01-25 17:45:49 -0800896
897/**
898 * Logs boot reason and duration.
899 *
900 * Logged from:
901 * system/core/bootstat/bootstat.cpp
902 */
903message BootSequenceReported {
904 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
905 // Default: "<EMPTY>" if not available.
906 optional string bootloader_reason = 1;
907
908 // Reason for system boot. Eg. bootloader, reboot,userrequested
909 // Default: "<EMPTY>" if not available.
910 optional string system_reason = 2;
911
912 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800913 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800914
915 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800916 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800917
918 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800919 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800920
921 // Time since last boot in ms. Default: 0 if not available.
922 optional int64 time_since_last_boot = 6;
923}
924
Tej Singhc477d9c2018-02-05 18:31:39 -0800925
926/**
927 * Logs call state and disconnect cause (if applicable).
928 *
929 * Logged from:
930 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
931 */
932message CallStateChanged {
933 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
934 // From frameworks/base/core/proto/android/telecomm/enums.proto.
935 optional android.telecom.CallStateEnum call_state = 1;
936
937 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
938 // This value is only applicable when the call_state is DISCONNECTED, and
939 // should always be UNKNOWN if the call_state is not DISCONNECTED.
940 // From frameworks/base/core/proto/android/telecomm/enums.proto.
941 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
942
943 // True if the call is self-managed, which are apps that use the
944 // telecom infrastructure to make their own calls.
945 optional bool self_managed = 3;
946
947 // True if call is external. External calls are calls on connected Wear
948 // devices but show up in Telecom so the user can pull them onto the device.
949 optional bool external_call = 4;
950}
951
Tej Singh1ea42892018-01-19 09:27:00 -0800952/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800953 * Logs keyguard state. The keyguard is the lock screen.
954 *
955 * Logged from:
956 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
957 */
958message KeyguardStateChanged {
959 enum State {
960 UNKNOWN = 0;
961 // The keyguard is hidden when the phone is unlocked.
962 HIDDEN = 1;
963 // The keyguard is shown when the phone is locked (screen turns off).
964 SHOWN= 2;
965 // The keyguard is occluded when something is overlaying the keyguard.
966 // Eg. Opening the camera while on the lock screen.
967 OCCLUDED = 3;
968 }
969 optional State state = 1;
970}
971
972/**
973 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
974 * prompts the user to enter a password (pattern, pin, etc).
975 *
976 * Logged from:
977 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
978 */
979
980message KeyguardBouncerStateChanged {
981 enum State {
982 UNKNOWN = 0;
983 // Bouncer is hidden, either as a result of successfully entering the
984 // password, screen timing out, or user going back to lock screen.
985 HIDDEN = 1;
986 // This is when the user is being prompted to enter the password.
987 SHOWN = 2;
988 }
989 optional State state = 1;
990}
991
992/**
993 * Logs the result of entering a password into the keyguard bouncer.
994 *
995 * Logged from:
996 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
997 */
998message KeyguardBouncerPasswordEntered {
999 enum BouncerResult {
1000 UNKNOWN = 0;
1001 // The password entered was incorrect.
1002 FAILURE = 1;
1003 // The password entered was correct.
1004 SUCCESS = 2;
1005 }
1006 optional BouncerResult result = 1;
1007}
1008
Tej Singha883b372018-02-15 11:30:01 -08001009/*
1010 * Logs changes to the configuration of the device. The configuration is defined
1011 * in frameworks/base/core/java/android/content/res/Configuration.java
1012 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1013 * Please go there to interpret the possible values each field can be.
1014 *
1015 * Logged from:
1016 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1017 */
1018message ResourceConfigurationChanged {
1019 // Bit mask of color capabilities of the screen.
1020 // Contains information about the color gamut and hdr mode of the screen.
1021 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
1022 optional int32 colorMode = 1;
1023
1024 // The target screen density being rendered to.
1025 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
1026 optional int32 densityDpi = 2;
1027
1028 // Current user preference for the scaling factor for fonts,
1029 // relative to the base density scaling.
1030 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
1031 optional float fontScale = 3;
1032
1033 // Flag indicating whether the hard keyboard is hidden.
1034 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
1035 optional int32 hardKeyboardHidden = 4;
1036
1037 // The type of keyboard attached to the device.
1038 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1039 optional int32 keyboard = 5;
1040
1041 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1042 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
1043 optional int32 keyboardHideen = 6;
1044
1045 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1046 // 0 if undefined.
1047 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1048 optional int32 mcc = 7;
1049
1050 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1051 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1052 // MNC_ZERO symbol defined in Configuration.java.
1053 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1054 optional int32 mnc = 8;
1055
1056 // The kind of navigation available on the device.
1057 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1058 optional int32 navigation = 9;
1059
1060 // Flag indicating whether the navigation is available.
1061 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
1062 optional int32 navigationHidden = 10;
1063
1064 // Overall orientation of the screen.
1065 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1066 optional int32 orientation = 11;
1067
1068 // The current height of the available screen space, in dp units.
1069 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
1070 optional int32 screenHeightDp = 12;
1071
1072 // Bit mask of overall layout of the screen.
1073 // Contains information about screen size, whether the screen is wider/taller
1074 // than normal, whether the screen layout is right-tl-left or left-to-right,
1075 // and whether the screen has a rounded shape.
1076 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
1077 optional int32 screenLayout = 13;
1078
1079 // Current width of the available screen space, in dp units.
1080 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
1081 optional int32 screenWidthDp = 14;
1082
1083 // The smallest screen size an application will see in normal operation.
1084 // This is the smallest value of both screenWidthDp and screenHeightDp
1085 // in portrait and landscape.
1086 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
1087 optional int32 smallestScreenWidthDp = 15;
1088
1089 // The type of touch screen attached to the device.
1090 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1091 optional int32 touchscreen = 16;
1092
1093 // Bit mask of the ui mode.
1094 // Contains information about the overall ui mode of the device.
1095 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1096 // Also contains information about whether the device is in night mode.
1097 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
1098 optional int32 uiMode = 17;
1099}
1100
Tej Singheee317b2018-03-07 19:28:05 -08001101
1102/**
1103 * Logs changes in the connection state of the mobile radio.
1104 *
1105 * Logged from:
1106 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1107 */
1108message MobileConnectionStateChanged {
1109 // States are from the state machine DataConnection.java.
1110 enum State {
1111 UNKNOWN = 0;
1112 // The connection is inactive, or disconnected.
1113 INACTIVE = 1;
1114 // The connection is being activated, or connecting.
1115 ACTIVATING = 2;
1116 // The connection is active, or connected.
1117 ACTIVE = 3;
1118 // The connection is disconnecting.
1119 DISCONNECTING = 4;
1120 // The connection is disconnecting after creating a connection.
1121 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1122 }
1123 optional State state = 1;
1124 // For multi-sim phones, this distinguishes between the sim cards.
1125 optional int32 sim_slot_index = 2;
1126 // Used to identify the connection. Starts at 0 and increments by 1 for
1127 // every new network created. Resets whenever the device reboots.
1128 optional int32 data_connection_id = 3;
1129 // A bitmask for the capabilities of this connection.
1130 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1131 // Default value (if we have no information): 0
1132 optional int64 capabilities = 4;
1133 // If this connection has internet.
1134 // This just checks if the DEFAULT bit of capabilities is set.
1135 optional bool has_internet = 5;
1136}
1137
1138/**
1139 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1140 *
1141 * Logged from:
1142 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1143 */
1144message MobileRadioTechnologyChanged {
1145 optional android.telephony.NetworkTypeEnum state = 1;
1146 // For multi-sim phones, this distinguishes between the sim cards.
1147 optional int32 sim_slot_index = 2;
1148}
1149
Andrew Chantb56388b2018-03-22 21:07:33 -07001150/**
1151 * Logs the VID and PID of any connected USB devices.
1152 *
1153 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1154 *
1155 * Logged by Vendor.
1156 */
1157message UsbDeviceAttached {
1158 optional int32 vid = 1;
1159 optional int32 pid = 2;
1160 optional bool has_audio = 3;
1161 optional bool has_hid = 4;
1162 optional bool has_storage = 5;
1163}
1164
Tej Singheee317b2018-03-07 19:28:05 -08001165
Tej Singhdd7bd352018-02-09 19:33:15 -08001166/**
Tej Singh5d991e12018-03-09 19:48:11 -08001167 * Logs when Bluetooth is enabled and disabled.
1168 *
1169 * Logged from:
1170 * services/core/java/com/android/server/BluetoothManagerService.java
1171 */
1172message BluetoothEnabledStateChanged {
1173 repeated AttributionNode attribution_node = 1;
1174 // Whether or not bluetooth is enabled on the device.
1175 enum State {
1176 UNKNOWN = 0;
1177 ENABLED = 1;
1178 DISABLED = 2;
1179 }
1180 optional State state = 2;
1181 // The reason for being enabled/disabled.
1182 // Eg. Airplane mode, crash, application request.
1183 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1184 // If the reason is an application request, this will be the package name.
1185 optional string pkgName = 4;
1186}
1187
1188/**
1189 * Logs when a Bluetooth device connects and disconnects.
1190 *
1191 * Logged from:
1192 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1193 */
1194message BluetoothConnectionStateChanged {
1195 // The state of the connection.
1196 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1197 optional android.bluetooth.ConnectionStateEnum state = 1;
1198 // An identifier that can be used to match connect and disconnect events.
1199 // Currently is last two bytes of a hash of a device level ID and
1200 // the mac address of the bluetooth device that is connected.
1201 optional int32 obfuscated_id = 2;
1202 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1203 // From android.bluetooth.BluetoothAdapter.java
1204 optional int32 bt_profile = 3;
1205}
1206
1207/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001208 * Logs when something is plugged into or removed from the USB-C connector.
1209 *
1210 * Logged from:
1211 * Vendor USB HAL.
1212 */
1213message UsbConnectorStateChanged {
1214 enum State {
1215 DISCONNECTED = 0;
1216 CONNECTED = 1;
1217 }
1218 optional State state = 1;
1219}
1220
1221/**
1222 * Logs the reported speaker impedance.
1223 *
1224 * Logged from:
1225 * Vendor audio implementation.
1226 */
1227message SpeakerImpedanceReported {
1228 optional int32 speaker_location = 1;
1229 optional int32 impedance = 2;
1230}
1231
1232/**
1233 * Logs the report of a failed hardware.
1234 *
1235 * Logged from:
1236 * Vendor HALs.
1237 *
1238 */
1239message HardwareFailed {
1240 enum HardwareType {
1241 HARDWARE_FAILED_UNKNOWN = 0;
1242 HARDWARE_FAILED_MICROPHONE = 1;
1243 HARDWARE_FAILED_CODEC = 2;
1244 HARDWARE_FAILED_SPEAKER = 3;
1245 HARDWARE_FAILED_FINGERPRINT = 4;
1246 }
1247 optional HardwareType hardware_type = 1;
1248
1249 /* hardware_location allows vendors to differentiate between multiple instances of
1250 * the same hardware_type. The specific locations are vendor defined integers,
1251 * referring to board-specific numbering schemes.
1252 */
1253 optional int32 hardware_location = 2;
1254
1255 /* failure_code is specific to the HardwareType of the failed hardware.
1256 * It should use the enum values defined below.
1257 */
1258 enum MicrophoneFailureCode {
1259 MICROPHONE_FAILURE_COMPLETE = 0;
1260 }
1261 enum CodecFailureCode {
1262 CODEC_FAILURE_COMPLETE = 0;
1263 }
1264 enum SpeakerFailureCode {
1265 SPEAKER_FAILURE_COMPLETE = 0;
1266 SPEAKER_FAILURE_HIGH_Z = 1;
1267 SPEAKER_FAILURE_SHORT = 2;
1268 }
1269 enum FingerprintFailureCode {
1270 FINGERPRINT_FAILURE_COMPLETE = 0;
1271 FINGERPRINT_SENSOR_BROKEN = 1;
1272 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1273 }
1274 optional int32 failure_code = 3;
1275}
1276
1277/**
1278 * Log an event when the device has been physically dropped.
1279 * Reported from the /vendor partition.
1280 */
1281message PhysicalDropDetected {
1282 // Confidence that the event was actually a drop, 0 -> 100
1283 optional int32 confidence_pctg = 1;
1284 // Peak acceleration of the drop, in 1/1000s of a g.
1285 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001286 // Duration of freefall in ms
1287 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001288}
1289
1290/**
1291 * Log bucketed battery charge cycles.
1292 *
1293 * Each bucket represents cycles of the battery past
1294 * a given charge point. For example, bucket 1 is the
1295 * lowest 1/8th of the battery, and bucket 8 is 100%.
1296 *
1297 * Logged from:
1298 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1299 */
1300message ChargeCyclesReported {
1301 optional int32 cycle_bucket_1 = 1;
1302 optional int32 cycle_bucket_2 = 2;
1303 optional int32 cycle_bucket_3 = 3;
1304 optional int32 cycle_bucket_4 = 4;
1305 optional int32 cycle_bucket_5 = 5;
1306 optional int32 cycle_bucket_6 = 6;
1307 optional int32 cycle_bucket_7 = 7;
1308 optional int32 cycle_bucket_8 = 8;
1309}
1310
1311/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001312 * Logs the duration of a davey (jank of >=700ms) when it occurs
1313 *
1314 * Logged from:
1315 * frameworks/base/libs/hwui/JankTracker.cpp
1316 */
1317message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001318 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001319 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001320
Tej Singhbb8554a2018-01-26 11:59:14 -08001321 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001322 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001323}
1324
1325/**
Bookatze5885242017-10-24 20:10:31 -07001326 * Logs phone signal strength changes.
1327 *
1328 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001329 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001330 */
1331message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001332 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1333 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001334}
1335
1336/**
1337 * Logs that a setting was updated.
1338 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001339 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001340 * The tag and is_default allow resetting of settings to default values based on the specified
1341 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1342 */
1343message SettingChanged {
1344 // The name of the setting.
1345 optional string setting = 1;
1346
1347 // The change being imposed on this setting. May represent a number, eg "3".
1348 optional string value = 2;
1349
1350 // The new value of this setting. For most settings, this is same as value. For some settings,
1351 // value is +X or -X where X represents an element in a set. For example, if the previous value
1352 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1353 // The +/- feature is currently only used for location_providers_allowed.
1354 optional string new_value = 3;
1355
1356 // The previous value of this setting.
1357 optional string prev_value = 4;
1358
1359 // The tag used with the is_default for resetting sets of settings. This is generally null.
1360 optional string tag = 5;
1361
Bookatz90867622018-01-31 15:05:57 -08001362 // True if this setting with tag should be resettable.
1363 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001364
David Chenbd789912018-03-16 17:19:55 -07001365 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001366 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001367
1368 enum ChangeReason {
1369 UPDATED = 1; // Updated can be an insertion or an update.
1370 DELETED = 2;
1371 }
1372 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001373}
Chenjie Yub3dda412017-10-24 13:41:59 -07001374
Chenjie Yu05013b32017-11-21 10:21:41 -08001375/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001376 * Logs activity going to foreground or background
1377 *
1378 * Logged from:
1379 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1380 */
1381message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001382 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001383 optional string pkg_name = 2;
1384 optional string class_name = 3;
1385
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001386 enum State {
1387 BACKGROUND = 0;
1388 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001389 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001390 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001391}
David Chenc8a43242017-10-17 16:23:28 -07001392
1393/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001394 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001395 * Logged from:
1396 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1397 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001398message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001399 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001400
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001401 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001402
1403 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001404 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001405 optional string process_name = 3;
1406
1407 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001408 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001409
1410 optional string package_name = 5;
1411
1412 enum InstantApp {
1413 UNAVAILABLE = 0;
1414 FALSE = 1;
1415 TRUE = 2;
1416 }
1417 optional InstantApp is_instant_app = 6;
1418
1419 enum ForegroundState {
1420 UNKNOWN = 0;
1421 BACKGROUND = 1;
1422 FOREGROUND = 2;
1423 }
1424 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001425}
David Chen9e3808c2017-11-20 17:25:34 -08001426
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001427/**
1428 * Logs when a WTF (What a Terrible Failure) happened.
1429 * Logged from:
1430 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1431 */
1432message WTFOccurred {
1433 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001434
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001435 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001436
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001437 // The name of the process.
1438 // system_server if it is not by an app
1439 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001440
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001441 // The pid if available. -1 means not available.
1442 optional sint32 pid = 4;
1443}
1444
1445/**
1446 * Logs when system server reports low memory.
1447 * Logged from:
1448 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1449 */
1450message LowMemReported {
1451}
1452
1453/**
1454 * Logs when an app ANR (App Not Responding) occurs.
1455 * Logged from:
1456 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1457 */
1458message ANROccurred {
1459 optional int32 uid = 1 [(is_uid) = true];
1460
1461 optional string process_name = 2;
1462
1463 optional string short_component_name = 3;
1464
1465 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001466
1467 enum InstantApp {
1468 UNAVAILABLE = 0;
1469 FALSE = 1;
1470 TRUE = 2;
1471 }
1472 optional InstantApp is_instant_app = 5;
1473
1474 enum ForegroundState {
1475 UNKNOWN = 0;
1476 BACKGROUND = 1;
1477 FOREGROUND = 2;
1478 }
1479 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001480}
1481
Bookatza7020bd2018-08-28 16:29:35 -07001482/**
1483 * Logs when the vibrator state changes.
1484 * Logged from:
1485 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1486 */
1487message VibratorStateChanged {
1488 repeated AttributionNode attribution_node = 1;
1489
1490 enum State {
1491 OFF = 0;
1492 ON = 1;
1493 }
1494 optional State state = 2;
1495
1496 // Duration (in milliseconds) requested to keep the vibrator on.
1497 // Only applicable for State == ON.
1498 optional int64 duration_millis = 3;
1499}
1500
David Chen0a368b22017-12-06 16:28:16 -08001501/*
1502 * Allows other apps to push events into statsd.
1503 * Logged from:
1504 * frameworks/base/core/java/android/util/StatsLog.java
1505 */
David Chen0b5c90c2018-01-25 16:51:49 -08001506message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001507 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001508 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001509
1510 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1511 optional int32 label = 2;
1512
1513 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1514 // predicates for the metrics).
1515 enum State {
1516 UNKNOWN = 0;
1517 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1518 STOP = 2;
1519 START = 3;
1520 }
1521 optional State state = 3;
1522}
1523
David Chen9e3808c2017-11-20 17:25:34 -08001524/**
Bookatz7948c872018-09-04 12:58:33 -07001525 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1526 * For example, this could be due to the user manually changing the time.
1527 *
1528 * Logged from:
1529 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1530 */
1531message WallClockTimeShifted {
1532 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1533 optional int64 wall_clock_timestamp_millis = 1;
1534}
1535
1536/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001537 * Logs when statsd detects an anomaly.
1538 *
1539 * Logged from:
1540 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1541 */
1542message AnomalyDetected {
1543 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001544 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001545
Yangster-mac94e197c2018-01-02 16:03:03 -08001546 // Id of the config whose anomaly detection alert fired.
1547 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001548
Yangster-mac94e197c2018-01-02 16:03:03 -08001549 // Id of the alert (i.e. name of the anomaly that was detected).
1550 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001551}
1552
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001553message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001554 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001555 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001556
1557 // The app package name.
1558 optional string pkg_name = 2;
1559
1560 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001561 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001562 WARM = 1;
1563 HOT = 2;
1564 COLD = 3;
1565 }
1566 // The transition type.
1567 optional TransitionType type = 3;
1568
1569 // The activity name.
1570 optional string activity_name = 4;
1571
1572 // The name of the calling app. Empty if not set.
1573 optional string calling_pkg_name = 5;
1574
1575 // Whether the app is an instant app.
1576 optional bool is_instant_app = 6;
1577
1578 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001579 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001580
Bookatz80d11a02018-01-16 10:46:35 -08001581 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001582
David Chen0b5c90c2018-01-25 16:51:49 -08001583 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001584 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001585 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001586 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001587 optional int32 bind_application_delay_millis = 11;
1588 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001589
1590 // Empty if not set.
1591 optional string launch_token = 13;
1592
Calin Juravle759fbda2018-02-20 19:52:30 +00001593 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001594 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001595
1596 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001597 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001598}
1599
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001600message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001601 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001602 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001603
1604 // The app package name.
1605 optional string pkg_name = 2;
1606
1607 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001608 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001609 WARM = 1;
1610 HOT = 2;
1611 COLD = 3;
1612 }
1613 // The transition type.
1614 optional TransitionType type = 3;
1615
1616 // The activity name.
1617 optional string activity_name = 4;
1618}
1619
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001620message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001621 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001622 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001623
1624 // The app package name.
1625 optional string pkg_name = 2;
1626
1627 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001628 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001629 WITH_BUNDLE = 1;
1630 WITHOUT_BUNDLE = 2;
1631 }
1632 // The transition type.
1633 optional TransitionType type = 3;
1634
1635 // The activity name.
1636 optional string activity_name = 4;
1637
1638 optional bool transition_process_running = 5;
1639
1640 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001641 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001642}
1643
Bookatz8fcd09a2017-12-18 13:01:10 -08001644/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001645 * Logs a picture-in-picture action
1646 * Logged from:
1647 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1648 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1649 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1650 */
1651message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001652 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001653 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001654
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001655 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001656
Chenjie Yu52cacc62017-12-08 18:11:45 -08001657 enum State {
1658 ENTERED = 1;
1659 EXPANDED_TO_FULL_SCREEN = 2;
1660 MINIMIZED = 3;
1661 DISMISSED = 4;
1662 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001663 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001664}
1665
1666/**
Chenjie Yue8904192017-12-08 19:12:57 -08001667 * Logs overlay action
1668 * Logged from:
1669 * services/core/java/com/android/server/wm/Session.java
1670 */
1671message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001672 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001673
1674 optional string package_name = 2;
1675
1676 optional bool using_alert_window = 3;
1677
1678 enum State {
1679 ENTERED = 1;
1680 EXITED = 2;
1681 }
1682 optional State state = 4;
1683}
1684
Chenjie Yuccfe6452018-01-30 11:33:21 -08001685/*
1686 * Logs foreground service starts and stops.
1687 * Note that this is not when a service starts or stops, but when it is
1688 * considered foreground.
1689 * Logged from
1690 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1691 */
1692message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001693 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001694 // package_name + "/" + class_name
1695 optional string short_name = 2;
1696
1697 enum State {
1698 ENTER = 1;
1699 EXIT = 2;
1700 }
1701 optional State state = 3;
1702}
1703
Chenjie Yue8904192017-12-08 19:12:57 -08001704/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001705 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1706 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1707 * attributed back to the parent (host) uid. One example is Chrome.
1708 *
1709 * Logged from:
1710 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1711 */
1712message IsolatedUidChanged {
1713 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001714 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001715 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001716 optional int32 parent_uid = 1;
1717
1718 optional int32 isolated_uid = 2;
1719
1720 // We expect an isolated uid to be removed before if it's used for another parent uid.
1721 enum Event {
1722 REMOVED = 0;
1723 CREATED = 1;
1724 }
1725 optional Event event = 3;
1726}
1727
1728/*
1729 * Logs the reception of an incoming network packet causing the main system to wake up for
1730 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1731 * and processed by WakeupController.cpp.
1732 */
1733message PacketWakeupOccurred {
1734 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1735 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001736 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001737 // The interface name on which the packet was received.
1738 optional string iface = 2;
1739 // The ethertype value of the packet.
1740 optional int32 ethertype = 3;
1741 // String representation of the destination MAC address of the packet.
1742 optional string destination_hardware_address = 4;
1743 // String representation of the source address of the packet if this was an IP packet.
1744 optional string source_ip = 5;
1745 // String representation of the destination address of the packet if this was an IP packet.
1746 optional string destination_ip = 6;
1747 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1748 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1749 // families.
1750 optional int32 ip_next_header = 7;
1751 // The source port if this was a TCP or UDP packet.
1752 optional int32 source_port = 8;
1753 // The destination port if this was a TCP or UDP packet.
1754 optional int32 destination_port = 9;
1755}
1756
1757/*
1758 * Logs the memory stats for an app on startup.
1759 * Logged from:
1760 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1761 */
1762message AppStartMemoryStateCaptured {
1763 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001764 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001765
1766 // The process name.
1767 optional string process_name = 2;
1768
1769 // The activity name.
1770 optional string activity_name = 3;
1771
1772 // # of page-faults
1773 optional int64 pgfault = 4;
1774
1775 // # of major page-faults
1776 optional int64 pgmajfault = 5;
1777
1778 // RSS
1779 optional int64 rss_in_bytes = 6;
1780
1781 // CACHE
1782 optional int64 cache_in_bytes = 7;
1783
1784 // SWAP
1785 optional int64 swap_in_bytes = 8;
1786}
1787
1788/*
1789 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1790 * for LMK event.
1791 * Logged from:
1792 * system/core/lmkd/lmkd.c
1793 */
1794message LmkStateChanged {
1795 enum State {
1796 UNKNOWN = 0;
1797 START = 1;
1798 STOP = 2;
1799 }
1800 optional State state = 1;
1801}
1802
1803/*
1804 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1805 * Logged from:
1806 * system/core/lmkd/lmkd.c
1807 */
1808message LmkKillOccurred {
1809 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001810 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001811
1812 // The process name.
1813 optional string process_name = 2;
1814
1815 // oom adj score.
1816 optional int32 oom_score = 3;
1817
1818 // # of page-faults
1819 optional int64 pgfault = 4;
1820
1821 // # of major page-faults
1822 optional int64 pgmajfault = 5;
1823
1824 // RSS
1825 optional int64 rss_in_bytes = 6;
1826
1827 // CACHE
1828 optional int64 cache_in_bytes = 7;
1829
1830 // SWAP
1831 optional int64 swap_in_bytes = 8;
1832}
1833
Rajeev Kumar51b54602018-03-01 12:18:26 -08001834/*
1835 * Logs when the ActivityManagerService detects that an app died.
1836 *
1837 * Logged from:
1838 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1839 */
1840message AppDied {
1841 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001842 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001843}
1844
Howard Ro21a039c2018-08-06 14:55:47 -07001845/**
1846 * An atom for generic metrics logging. Available from Android Q.
1847 */
1848message GenericAtom {
1849 // The uid of the application that sent this custom atom.
1850 optional int32 uid = 1 [(is_uid) = true];
1851
1852 // An event_id indicates the type of event.
Howard Ro0546d542018-08-30 16:23:44 -07001853 optional android.os.statsd.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001854}
1855
Tej Singhd6d6d772018-09-05 17:41:25 -07001856/**
1857 * Logs when a fingerprint acquire event occurs.
1858 *
1859 * Logged from:
1860 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1861 */
1862message FingerprintAcquired {
1863 // The associated user. Eg: 0 for owners, 10+ for others.
1864 // Defined in android/os/UserHandle.java
1865 optional int32 user = 1;
1866 // If this acquire is for a crypto fingerprint.
1867 // e.g. Secure purchases, unlock password storage.
1868 optional bool is_crypto = 2;
1869}
1870
1871/**
1872 * Logs when a fingerprint authentication event occurs.
1873 *
1874 * Logged from:
1875 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1876 */
1877message FingerprintAuthenticated {
1878 // The associated user. Eg: 0 for owners, 10+ for others.
1879 // Defined in android/os/UserHandle.java
1880 optional int32 user = 1;
1881 // If this authentication is for a crypto fingerprint.
1882 // e.g. Secure purchases, unlock password storage.
1883 optional bool is_crypto = 2;
1884 // Whether or not this authentication was successful.
1885 optional bool is_authenticated = 3;
1886}
1887
1888/**
1889 * Logs when a fingerprint error occurs.
1890 *
1891 * Logged from:
1892 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1893 */
1894message FingerprintErrorOccurred {
1895 // The associated user. Eg: 0 for owners, 10+ for others.
1896 // Defined in android/os/UserHandle.java
1897 optional int32 user = 1;
1898 // If this error is for a crypto fingerprint.
1899 // e.g. Secure purchases, unlock password storage.
1900 optional bool is_crypto = 2;
1901
1902 enum Error {
1903 UNKNOWN = 0;
1904 LOCKOUT = 1;
1905 PERMANENT_LOCKOUT = 2;
1906 }
1907 // The type of error.
1908 optional Error error = 3;
1909}
Howard Ro688ae182018-09-25 00:09:36 -07001910
1911message Notification {
1912
1913 // Type of notification event.
1914 enum Type {
1915 TYPE_UNKNOWN = 0;
1916 // Notification became visible to the user.
1917 TYPE_OPEN = 1;
1918 // Notification became hidden.
1919 TYPE_CLOSE = 2;
1920 // Notification switched to detail mode.
1921 TYPE_DETAIL = 3;
1922 // Notification was clicked.
1923 TYPE_ACTION = 4;
1924 // Notification was dismissed.
1925 TYPE_DISMISS = 5;
1926 // Notification switched to summary mode. The enum value of 14 is to
1927 // match that of metrics_constants.
1928 TYPE_COLLAPSE = 14;
1929 }
1930 optional Type type = 1;
1931
1932 // Package name associated with the notification.
1933 optional string package_name = 2;
1934
1935 // Tag associated with notification.
1936 optional string tag = 3;
1937
1938 // Application-supplied ID associated with the notification.
1939 optional int32 id = 4;
1940
1941 // Index of notification in the notification panel.
1942 optional int32 shade_index = 5;
1943
1944 // The number of notifications in the notification panel.
1945 optional int32 shade_count = 6;
1946
1947 // Importance for the notification.
1948 optional int32 importance = 7;
1949
1950 // ID for the notification channel.
1951 optional int32 channel_id = 8;
1952
1953 // Importance for the notification channel.
1954 optional int32 channel_importance = 9;
1955
1956 // Whether notification was a group summary.
1957 optional bool group_summary = 10;
1958
1959 // Time since notification was created in milliseconds.
1960 optional int64 since_create_millis = 11;
1961
1962 // Time since notification was interrupted in milliseconds.
1963 optional int64 since_interruption_millis = 12;
1964
1965 // Time since notification was updated in milliseconds.
1966 optional int64 since_update_millis = 13;
1967
1968 // Time since notification was visible in milliseconds.
1969 optional int64 since_visible_millis = 14;
1970}
1971
1972
Chenjie Yubbcbc602018-02-05 16:51:52 -08001973//////////////////////////////////////////////////////////////////////
1974// Pulled atoms below this line //
1975//////////////////////////////////////////////////////////////////////
1976
1977/**
David Chenc8a43242017-10-17 16:23:28 -07001978 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1979 *
1980 * Pulled from:
1981 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1982 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001983message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001984 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001985
1986 optional int64 rx_bytes = 2;
1987
1988 optional int64 rx_packets = 3;
1989
1990 optional int64 tx_bytes = 4;
1991
1992 optional int64 tx_packets = 5;
1993}
1994
1995/**
1996 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1997 *
1998 * Pulled from:
1999 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2000 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002001message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002002 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002003
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002004 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2005 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002006
2007 optional int64 rx_bytes = 3;
2008
2009 optional int64 rx_packets = 4;
2010
2011 optional int64 tx_bytes = 5;
2012
2013 optional int64 tx_packets = 6;
2014}
2015
2016/**
2017 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2018 *
2019 * Pulled from:
2020 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2021 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002022message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002023 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002024
2025 optional int64 rx_bytes = 2;
2026
2027 optional int64 rx_packets = 3;
2028
2029 optional int64 tx_bytes = 4;
2030
2031 optional int64 tx_packets = 5;
2032}
2033
2034/**
2035 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2036 *
2037 * Pulled from:
2038 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2039 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002040message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002041 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002042
Yao Chenc40a19d2018-03-15 16:48:25 -07002043 // 1 denotes foreground and 0 denotes background. This is called Set in
2044 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002045 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002046
2047 optional int64 rx_bytes = 3;
2048
2049 optional int64 rx_packets = 4;
2050
2051 optional int64 tx_bytes = 5;
2052
2053 optional int64 tx_packets = 6;
2054}
2055
2056/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002057 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2058 *
2059 * Pulled from:
2060 * StatsCompanionService
2061 */
2062message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002063 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002064
2065 optional int64 rx_bytes = 2;
2066
2067 optional int64 tx_bytes = 3;
2068}
2069
2070/**
David Chenc8a43242017-10-17 16:23:28 -07002071 * Pulls the kernel wakelock durations. This atom is adapted from
2072 * android/internal/os/KernelWakelockStats.java
2073 *
2074 * Pulled from:
2075 * StatsCompanionService using KernelWakelockReader.
2076 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002077message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002078 optional string name = 1;
2079
2080 optional int32 count = 2;
2081
2082 optional int32 version = 3;
2083
2084 optional int64 time = 4;
2085}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002086
Chenjie Yu05013b32017-11-21 10:21:41 -08002087/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002088 * Pulls low power state information. This includes platform and subsystem sleep state information,
2089 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002090 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002091 * hardware/interfaces/power/1.1/types.hal
2092 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002093message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002094 // Subsystem name
2095 optional string subsystem_name = 1;
2096 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2097 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2098 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002099 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002100 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002101 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002102 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002103}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002104
Chenjie Yu05013b32017-11-21 10:21:41 -08002105/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002106 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002107 * Pulls the time the cpu spend on the frequency index. Frequency index
2108 * starts from highest to lowest. The value should be monotonically
2109 * increasing since boot. However, if there is a cpu
2110 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002111 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002112message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002113 optional uint32 cluster = 1;
2114 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002115 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002116}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002117
Chenjie Yu05013b32017-11-21 10:21:41 -08002118/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002119 * Pulls Cpu Time Per Uid.
2120 * Note that isolated process uid time should be attributed to host uids.
2121 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002122message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002123 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002124 optional uint64 user_time_millis = 2;
2125 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002126}
2127
2128/**
2129 * Pulls Cpu Time Per Uid per frequency.
2130 * Note that isolated process uid time should be attributed to host uids.
2131 * For each uid, we order the time by descending frequencies.
2132 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002133message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002134 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002135 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002136 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002137}
Hugo Benichi884970e2017-11-14 22:42:46 +09002138
Chenjie Yu05013b32017-11-21 10:21:41 -08002139/**
2140 * Pulls Wifi Controller Activity Energy Info
2141 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002142message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002143 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002144 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002145 // stack reported state
2146 // TODO: replace this with proto enum
2147 optional int32 stack_state = 2;
2148 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002149 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002150 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002151 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002152 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002153 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002154 // product of current(mA), voltage(V) and time(ms)
2155 optional uint64 controller_energy_used = 6;
2156}
2157
2158/**
2159 * Pulls Modem Activity Energy Info
2160 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002161message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002162 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002163 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002164 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002165 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002166 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002167 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002168 /**
2169 * Tx power index
2170 * index 0 = tx_power < 0dBm
2171 * index 1 = 0dBm < tx_power < 5dBm
2172 * index 2 = 5dBm < tx_power < 15dBm
2173 * index 3 = 15dBm < tx_power < 20dBm
2174 * index 4 = tx_power > 20dBm
2175 */
2176 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002177 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002178 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002179 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002180 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002181 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002182 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002183 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002184 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002185 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002186 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002187 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002188 // product of current(mA), voltage(V) and time(ms)
2189 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002190}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002191
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002192/**
2193 * Pulls Bluetooth Activity Energy Info
2194 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2195 */
2196message BluetoothActivityInfo {
2197 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002198 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002199 // bluetooth stack state
2200 optional int32 bluetooth_stack_state = 2;
2201 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002202 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002203 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002204 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002205 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002206 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002207 // product of current(mA), voltage(V) and time(ms)
2208 optional uint64 energy_used = 6;
2209}
2210
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002211/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002212 * Logs the memory stats for a process.
2213 */
2214message ProcessMemoryState {
2215 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002216 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002217
2218 // The process name.
2219 optional string process_name = 2;
2220
2221 // oom adj score.
2222 optional int32 oom_score = 3;
2223
2224 // # of page-faults
2225 optional int64 pgfault = 4;
2226
2227 // # of major page-faults
2228 optional int64 pgmajfault = 5;
2229
Rajeev Kumar90235992018-01-29 11:06:48 -08002230 // RSS
2231 optional int64 rss_in_bytes = 6;
2232
2233 // CACHE
2234 optional int64 cache_in_bytes = 7;
2235
2236 // SWAP
2237 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002238
2239 // RSS high watermark.
2240 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2241 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2242 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002243}
2244
2245/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002246 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002247 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002248message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002249 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002250}
2251
2252/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002253 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002254 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002255message SystemUptime {
2256 // Milliseconds since the system was booted.
2257 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2258 // for external input).
2259 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002260 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002261}
2262
2263/*
2264 * Reads from /proc/uid_concurrent_active_time which has the format:
2265 * active: X (X is # cores)
2266 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2267 * [uid1]: [time-0] [time-1] [time-2] ... ...
2268 * ...
2269 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2270 * The file contains a monotonically increasing count of time for a single boot.
2271 */
2272message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002273 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002274 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002275}
2276
2277/**
2278 * Reads from /proc/uid_concurrent_policy_time which has the format:
2279 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2280 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2281 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2282 * ...
2283 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2284 * The file contains a monotonically increasing count of time for a single boot.
2285 */
2286message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002287 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002288 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002289 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002290}
2291
2292/*
2293 * Pulls free disk space, for data, system partition and temporary directory.
2294 */
2295message DiskSpace {
2296 // available bytes in data partition
2297 optional uint64 data_available_bytes = 1;
2298 // available bytes in system partition
2299 optional uint64 system_available_bytes = 2;
2300 // available bytes in download cache or temp directories
2301 optional uint64 temp_available_bytes = 3;
2302}
Tej Singhbf972d92018-01-10 20:51:13 -08002303
2304/**
2305 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002306 * Pulled from:
2307 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002308 */
2309message RemainingBatteryCapacity {
2310 optional int32 charge_uAh = 1;
2311}
2312
2313/**
2314 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002315 * Pulled from:
2316 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002317 */
2318message FullBatteryCapacity {
2319 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002320}
2321
2322/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002323 * Pulls battery voltage.
2324 * Pulled from:
2325 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2326 */
2327message BatteryVoltage {
2328 // The voltage of the battery, in millivolts.
2329 optional int32 voltage_mV = 1;
2330}
2331
2332/**
Tej Singhd89137e2018-03-26 14:51:40 -07002333 * Pulls the temperature of various parts of the device.
2334 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002335 *
2336 * Pulled from:
2337 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2338 */
2339message Temperature {
2340 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2341 optional android.os.TemperatureTypeEnum sensor_location = 1;
2342
2343 // The name of the temperature source. Eg. CPU0
2344 optional string sensor_name = 2;
2345
Tej Singhd89137e2018-03-26 14:51:40 -07002346 // Temperature in tenths of a degree C.
2347 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002348}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002349
2350/**
2351 * Pulls the statistics of calls to Binder.
2352 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002353 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2354 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002355 *
2356 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002357 */
2358message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002359 optional int32 uid = 1 [(is_uid) = true];
2360 // Fully qualified class name of the API call.
2361 //
2362 // This is a system server class name.
2363 //
2364 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2365 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2366 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2367 // commonly used APIs.
2368 optional string service_class_name = 2;
2369 // Method name of the API call. It can also be a transaction code if we cannot
2370 // resolve it to a name. See Binder#getTransactionName.
2371 //
2372 // This is a system server method name.
2373 optional string service_method_name = 3;
2374 // Total number of API calls.
2375 optional int64 call_count = 4;
2376 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2377 optional bool screen_interactive = 13;
2378 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2379 // call_count will be equal to recorded_call_count.
2380 //
2381 // If recorded_call_count is different than call_count, it means data collection has been
2382 // sampled. All the fields below will be sampled in this case.
2383 optional int64 recorded_call_count = 12;
2384 // Number of exceptions thrown by the API.
2385 optional int64 recorded_exception_count = 5;
2386 // Total latency of all API calls.
2387 // Average can be computed using total_latency_micros / recorded_call_count.
2388 optional int64 recorded_total_latency_micros = 6;
2389 // Maximum latency of one API call.
2390 optional int64 recorded_max_latency_micros = 7;
2391 // Total CPU usage of all API calls.
2392 // Average can be computed using total_cpu_micros / recorded_call_count.
2393 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2394 optional int64 recorded_total_cpu_micros = 8;
2395 // Maximum CPU usage of one API call.
2396 optional int64 recorded_max_cpu_micros = 9;
2397 // Maximum parcel reply size of one API call.
2398 optional int64 recorded_max_reply_size_bytes = 10;
2399 // Maximum parcel request size of one API call.
2400 optional int64 recorded_max_request_size_bytes = 11;
2401}
2402
2403/**
2404 * Pulls the statistics of exceptions during calls to Binder.
2405 *
2406 * Binder stats are cumulative from boot unless somebody reset the data using
2407 * > adb shell dumpsys binder_calls_stats --reset
2408 */
2409message BinderCallsExceptions {
2410 // Exception class name, e.g. java.lang.IllegalArgumentException.
2411 //
2412 // This is an exception class name thrown by the system server.
2413 optional string exception_class_name = 1;
2414 // Total number of exceptions.
2415 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002416}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002417
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002418/**
2419 * Pulls the statistics of message dispatching on HandlerThreads.
2420 *
2421 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2422 * config on the device.
2423 *
2424 * Next tag: 11
2425 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002426message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002427 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002428 optional int32 uid = 1 [(is_uid) = true];
2429
2430 // Fully qualified class name of the handler target class.
2431 //
2432 // This field does not contain PII. This is a system server class name.
2433 optional string handler_class_name = 2;
2434
2435 // The name of the thread that runs the Looper.
2436 //
2437 // This field does not contain PII. This is a system server thread name.
2438 optional string looper_thread_name = 3;
2439
2440 // The name of the dispatched message.
2441 //
2442 // This field does not contain PII. This is a system server constant or class
2443 // name.
2444 optional string message_name = 4;
2445
2446 // Total number of successfully dispatched messages.
2447 optional int64 message_count = 5;
2448
2449 // Total number of messages that failed dispatching.
2450 optional int64 exception_count = 6;
2451
2452 // Total number of processed messages we have data recorded for. If we
2453 // collected data for all the messages, message_count will be equal to
2454 // recorded_message_count.
2455 //
2456 // If recorded_message_count is different than message_count, it means data
2457 // collection has been sampled. All the fields below will be sampled in this
2458 // case.
2459 optional int64 recorded_message_count = 7;
2460
2461 // Total latency of all processed messages.
2462 // Average can be computed using recorded_total_latency_micros /
2463 // recorded_message_count.
2464 optional int64 recorded_total_latency_micros = 8;
2465
2466 // Total CPU usage of all processed message.
2467 // Average can be computed using recorded_total_cpu_micros /
2468 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002469 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002470 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002471
2472 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2473 optional bool screen_interactive = 10;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002474}
Tej Singh86dc9db2018-09-06 00:39:57 +00002475
2476/**
2477 * Pulls disk information, such as write speed and latency.
2478 */
2479message DiskStats {
2480 // Time taken to open, write 512B to, and close a file.
2481 // -1 if error performing the check.
2482 optional int64 data_write_latency_millis = 1;
2483
2484 optional bool file_based_encryption = 2;
2485
2486 // Recent disk write speed in kB/s.
2487 // -1 if error querying storageed.
2488 // 0 if data is unavailable.
2489 optional int32 recent_disk_write_speed = 3;
2490}
2491
2492
2493/**
2494 * Free and total bytes of the Data, Cache, and System partition.
2495 */
2496message DirectoryUsage {
2497 enum Directory {
2498 UNKNOWN = 0;
2499 DATA = 1;
2500 CACHE = 2;
2501 SYSTEM = 3;
2502 }
2503 optional Directory directory = 1;
2504 optional int64 free_bytes = 2;
2505 optional int64 total_bytes = 3;
2506}
2507
2508
2509/**
2510 * Size of an application: apk size, data size, and cache size.
2511 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2512 * Information is only reported for apps with the primary user (user 0).
2513 * Sizes are aggregated by package name.
2514 */
2515message AppSize {
2516 // Including uids will involve modifying diskstats logic.
2517 optional string package_name = 1;
2518 // App size in bytes. -1 if unavailable.
2519 optional int64 app_size_bytes = 2;
2520 // App data size in bytes. -1 if unavailable.
2521 optional int64 app_data_size_bytes = 3;
2522 // App cache size in bytes. -1 if unavailable.
2523 optional int64 app_cache_size_bytes = 4;
2524 // Time that the cache file was produced.
2525 // Uses System.currentTimeMillis(), which is wall clock time.
2526 optional int64 cache_time_millis = 5;
2527}
2528
2529
2530/**
2531 * Size of a particular category. Eg: photos, videos.
2532 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2533 */
2534message CategorySize {
2535 enum Category {
2536 UNKNOWN = 0;
2537 APP_SIZE = 1;
2538 APP_DATA_SIZE = 2;
2539 APP_CACHE_SIZE = 3;
2540 PHOTOS = 4;
2541 VIDEOS = 5;
2542 AUDIO = 6;
2543 DOWNLOADS = 7;
2544 SYSTEM = 8;
2545 OTHER = 9;
2546 }
2547 optional Category category = 1;
2548 // Category size in bytes.
2549 optional int64 size_bytes = 2;
2550 // Time that the cache file was produced.
2551 // Uses System.currentTimeMillis(), which is wall clock time.
2552 optional int64 cache_time_millis = 3;
2553}
Tej Singhd6d6d772018-09-05 17:41:25 -07002554
2555/**
2556 * Pulls the number of fingerprints for each user.
2557 *
2558 * Pulled from StatsCompanionService, which queries FingerprintManager.
2559 */
2560message NumFingerprints {
2561 // The associated user. Eg: 0 for owners, 10+ for others.
2562 // Defined in android/os/UserHandle.java
2563 optional int32 user = 1;
2564 // Number of fingerprints registered to that user.
2565 optional int32 num_fingerprints = 2;
2566}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002567
2568/**
2569 * Pulled from ProcessStatsService.java
2570 */
2571message ProcStats {
2572 optional android.service.procstats.ProcessStatsSectionProto proc_stats_section = 1;
2573}