blob: 60b2f34553e2eb85267aae7c46735edf2db4fc7b [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080029import "frameworks/base/core/proto/android/server/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070030import "frameworks/base/core/proto/android/service/procstats_enum.proto";
31import "frameworks/base/core/proto/android/stats/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080032import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080033import "frameworks/base/core/proto/android/telephony/enums.proto";
34import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080035
Yao Chend54f9dd2017-10-17 17:37:48 +000036/**
Stefan Lafonae2df012017-11-14 09:17:21 -080037 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000038 * raw stats log events from the Android system, also known as "atoms."
39 *
40 * This field contains a single oneof with all of the available messages.
41 * The stats-log-api-gen tool runs as part of the Android build and
42 * generates the android.util.StatsLog class, which contains the constants
43 * and methods that Android uses to log.
44 *
Stefan Lafonae2df012017-11-14 09:17:21 -080045 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000046 * Instead, statsd on Android constructs these messages synthetically,
47 * in the format defined here and in stats_log.proto.
48 */
Stefan Lafonae2df012017-11-14 09:17:21 -080049message Atom {
50 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070051 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070052 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
53 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070054 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070055 BleScanResultReceived ble_scan_result_received = 4;
56 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080057 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070058 SyncStateChanged sync_state_changed = 7;
59 ScheduledJobStateChanged scheduled_job_state_changed = 8;
60 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070061 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080062 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
63 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
64 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070065 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
66 MemoryFactorStateChanged memory_factor_state_changed = 15;
67 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
68 CachedKillReported cached_kill_reported = 17;
69 ProcessMemoryStatReported process_memory_stat_reported = 18;
70 // 19 is available
Bookatzddccf0a2017-11-28 16:48:14 -080071 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
72 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
73 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070074 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080075 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070076 CameraStateChanged camera_state_changed = 25;
77 FlashlightStateChanged flashlight_state_changed = 26;
78 UidProcessStateChanged uid_process_state_changed = 27;
79 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
80 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070081 BatteryLevelChanged battery_level_changed = 30;
82 ChargingStateChanged charging_state_changed = 31;
83 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070084 InteractiveStateChanged interactive_state_changed = 33;
85 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070086 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
87 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070088 WifiLockStateChanged wifi_lock_state_changed = 37;
89 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
90 WifiScanStateChanged wifi_scan_state_changed = 39;
91 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070092 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070093 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070094 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090095 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070096 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080097 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080098 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 AppStartOccurred app_start_occurred = 48;
100 AppStartCanceled app_start_canceled = 49;
101 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800102 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800103 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800104 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800105 LmkStateChanged lmk_state_changed = 54;
106 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800107 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800108 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800109 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800110 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800111 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800112 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800113 KeyguardStateChanged keyguard_state_changed = 62;
114 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
115 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800116 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800117 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800118 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
119 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700120 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700121 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800122 SpeakerImpedanceReported speaker_impedance_reported = 71;
123 HardwareFailed hardware_failed = 72;
124 PhysicalDropDetected physical_drop_detected = 73;
125 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800126 MobileConnectionStateChanged mobile_connection_state_changed = 75;
127 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700128 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800129 AppCrashOccurred app_crash_occurred = 78;
130 ANROccurred anr_occurred = 79;
131 WTFOccurred wtf_occurred = 80;
132 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700133 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700134 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700135 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700136 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700137 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700138 FingerprintAcquired fingerprint_acquired = 87;
139 FingerprintAuthenticated fingerprint_authenticated = 88;
140 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700141 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700142 BatteryHealthSnapshot battery_health_snapshot = 91;
143 SlowIo slow_io = 92;
144 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700145 PhoneServiceStateChanged phone_service_state_changed = 94;
146 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100147 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700148 SettingsUIChanged settings_ui_changed = 97;
Yao Chend54f9dd2017-10-17 17:37:48 +0000149 }
David Chenc8a43242017-10-17 16:23:28 -0700150
David Chen6e3e6cb2018-01-03 16:14:06 -0800151 // Pulled events will start at field 10000.
Rafal Slawik08621582018-10-15 14:53:07 +0100152 // Next: 10037
David Chenc8a43242017-10-17 16:23:28 -0700153 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800154 WifiBytesTransfer wifi_bytes_transfer = 10000;
155 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
156 MobileBytesTransfer mobile_bytes_transfer = 10002;
157 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800158 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800159 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800160 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800161 CpuTimePerFreq cpu_time_per_freq = 10008;
162 CpuTimePerUid cpu_time_per_uid = 10009;
163 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800164 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800165 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800166 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800167 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800168 SystemElapsedRealtime system_elapsed_realtime = 10014;
169 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800170 CpuActiveTime cpu_active_time = 10016;
171 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000172 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800173 RemainingBatteryCapacity remaining_battery_capacity = 10019;
174 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800175 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100176 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100177 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100178 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000179 DiskStats disk_stats = 10025;
180 DirectoryUsage directory_usage = 10026;
181 AppSize app_size = 10027;
182 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700183 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700184 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700185 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700186 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700187 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700188 ProcStats proc_stats_pkg_proc = 10034;
Rafal Slawik08621582018-10-15 14:53:07 +0100189 NativeProcessMemoryState native_process_memory_state = 10036;
David Chenc8a43242017-10-17 16:23:28 -0700190 }
yroa1fe77c2018-02-26 14:22:54 -0800191
Bookatz76aafcf2018-09-17 16:17:10 -0700192 // DO NOT USE field numbers above 100,000 in AOSP.
193 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
194 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700195}
196
Yao Chend54f9dd2017-10-17 17:37:48 +0000197/**
Yangster-mac20877162017-12-22 17:19:39 -0800198 * This proto represents a node of an attribution chain.
199 * Note: All attribution chains are represented as a repeated field of type
200 * AttributionNode. It is understood that in such arrays, the order is that
201 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000202 */
Yangster-mac20877162017-12-22 17:19:39 -0800203message AttributionNode {
204 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800205 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800206
Yangster-mac20877162017-12-22 17:19:39 -0800207 // The (optional) string tag for an element in the attribution chain. If the
208 // element has no tag, it is encoded as an empty string.
209 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700210}
211
Yangster-mac48b3d622018-08-18 12:38:11 -0700212message KeyValuePair {
213 optional int32 key = 1;
214 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700215 int32 value_int = 2;
216 int64 value_long = 3;
217 string value_str = 4;
218 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700219 }
220}
221
222message KeyValuePairsAtom {
223 optional int32 uid = 1;
224 repeated KeyValuePair pairs = 2;
225}
226
Yao Chend54f9dd2017-10-17 17:37:48 +0000227/*
228 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800229 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000230 *
231 * RULES:
232 * - The field ids for each atom must start at 1, and count upwards by 1.
233 * Skipping field ids is not allowed.
234 * - These form an API, so renaming, renumbering or removing fields is
235 * not allowed between android releases. (This is not currently enforced,
236 * but there will be a tool to enforce this restriction).
237 * - The types must be built-in protocol buffer types, namely, no sub-messages
238 * are allowed (yet). The bytes type is also not allowed.
239 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800240 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000241 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800242 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000243 * - A field that is a uid should be a string field, tagged with the [xxx]
244 * annotation. The generated code on android will be represented by UIDs,
245 * and those UIDs will be translated in xxx to those strings.
246 *
247 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700248 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000249 * - If there is a UID, it goes first. Think in an object-oriented fashion.
250 * *****************************************************************************
251 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700252
Yao Chend54f9dd2017-10-17 17:37:48 +0000253/**
Yangster-mace16189a2018-08-26 12:20:16 -0700254 * Logs when the Thermal service HAL notifies the throttling start/stop events.
255 *
256 * Logged from:
257 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
258 */
259message ThermalThrottlingStateChanged {
260 optional android.os.TemperatureTypeEnum sensor_type = 1;
261
262 enum State {
263 UNKNOWN = 0;
264 START = 1;
265 STOP = 2;
266 }
267
268 optional State state = 2;
269
270 optional float temperature = 3;
271}
272
273/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000274 * Logs when the screen state changes.
275 *
276 * Logged from:
277 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
278 */
279message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800280 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700281 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700282}
Yao Chend54f9dd2017-10-17 17:37:48 +0000283
284/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700285 * Logs that the process state of the uid, as determined by ActivityManager
286 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000287 *
288 * Logged from:
289 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
290 */
Bookatzc1a050a2017-10-10 15:49:28 -0700291message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700292 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000293
Bookatzdb026a22018-01-10 19:01:56 -0800294 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700295 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000296}
297
298/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700299 * Logs process state change of a process, as per the activity manager.
300 *
301 * Logged from:
302 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
303 */
304message ProcessStateChanged {
305 optional int32 uid = 1;
306 optional string process_name = 2;
307 optional string package_name = 3;
308 // TODO: remove this when validation is done
309 optional int64 version = 5;
310 // The state, from frameworks/base/core/proto/android/app/enums.proto.
311 optional android.app.ProcessStateEnum state = 4;
312}
313
314/**
315 * Logs when ActivityManagerService sleep state is changed.
316 *
317 * Logged from:
318 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
319 */
320message ActivityManagerSleepStateChanged {
321 // TODO: import frameworks proto
322 enum State {
323 UNKNOWN = 0;
324 ASLEEP = 1;
325 AWAKE = 2;
326 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700327 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700328}
329
330/**
331 * Logs when system memory state changes.
332 *
333 * Logged from:
334 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
335 */
336message MemoryFactorStateChanged {
337 // TODO: import frameworks proto
338 enum State {
339 MEMORY_UNKNOWN = 0;
340 NORMAL = 1; // normal.
341 MODERATE = 2; // moderate memory pressure.
342 LOW = 3; // low memory.
343 CRITICAL = 4; // critical memory.
344
345 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700346 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700347}
348
349/**
350 * Logs when app is using too much cpu, according to ActivityManagerService.
351 *
352 * Logged from:
353 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
354 */
355message ExcessiveCpuUsageReported {
356 optional int32 uid = 1;
357 optional string process_name = 2;
358 optional string package_name = 3;
359 // package version. TODO: remove this when validation is done
360 optional int64 version = 4;
361}
362
363/**
364 * Logs when a cached process is killed, along with its pss.
365 *
366 * Logged from:
367 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
368 */
369message CachedKillReported {
370 optional int32 uid = 1;
371 optional string process_name = 2;
372 optional string package_name = 3;
373 // TODO: remove this when validation is done
374 optional int64 version = 5;
375 optional int64 pss = 4;
376}
377
378/**
379 * Logs when memory stats of a process is reported.
380 *
381 * Logged from:
382 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
383 */
384message ProcessMemoryStatReported {
385 optional int32 uid = 1;
386 optional string process_name = 2;
387 optional string package_name = 3;
388 //TODO: remove this when validation is done
389 optional int64 version = 9;
390 optional int64 pss = 4;
391 optional int64 uss = 5;
392 optional int64 rss = 6;
393 enum Type {
394 ADD_PSS_INTERNAL_SINGLE = 0;
395 ADD_PSS_INTERNAL_ALL_MEM = 1;
396 ADD_PSS_INTERNAL_ALL_POLL = 2;
397 ADD_PSS_EXTERNAL = 3;
398 ADD_PSS_EXTERNAL_SLOW = 4;
399 }
400 optional Type type = 7;
401 optional int64 duration = 8;
402}
403
404/**
Bookatzc1a050a2017-10-10 15:49:28 -0700405 * Logs that a process started, finished, crashed, or ANRed.
406 *
407 * Logged from:
408 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
409 */
410message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700411 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700412
David Chen0b5c90c2018-01-25 16:51:49 -0800413 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800414 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700415
Bookatzddccf0a2017-11-28 16:48:14 -0800416 // What lifecycle state the process changed to.
417 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800418 enum State {
419 FINISHED = 0;
420 STARTED = 1;
421 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800422 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800423 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700424}
425
Bookatzc1a050a2017-10-10 15:49:28 -0700426/**
427 * Logs when the ble scan state changes.
428 *
429 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700430 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700431 */
432message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800433 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700434
435 enum State {
436 OFF = 0;
437 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700438 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
439 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700440 }
441 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700442
Bookatze5ec0b42018-03-26 13:34:56 -0700443 // Does the scan have a filter.
444 optional bool is_filtered = 3;
445 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
446 optional bool is_first_match = 4;
447 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
448 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700449}
450
451/**
452 * Logs reporting of a ble scan finding results.
453 *
454 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700455 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700456 */
Bookatzae6738e2018-09-13 11:38:56 -0700457// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700458message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800459 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700460
461 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800462 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700463}
464
465/**
466 * Logs when a sensor state changes.
467 *
468 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700469 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700470 */
471message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800472 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700473
Bookatzc1a050a2017-10-10 15:49:28 -0700474 // The id (int) of the sensor.
475 optional int32 sensor_id = 2;
476
477 enum State {
478 OFF = 0;
479 ON = 1;
480 }
481 optional State state = 3;
482}
483
484
485/**
486 * Logs when GPS state changes.
487 *
488 * Logged from:
489 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
490 */
491message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800492 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700493
494 enum State {
495 OFF = 0;
496 ON = 1;
497 }
498 optional State state = 2;
499}
500
501
502/**
503 * Logs when a sync manager sync state changes.
504 *
505 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700506 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700507 */
508message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800509 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700510
David Chen0b5c90c2018-01-25 16:51:49 -0800511 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800512 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700513
514 enum State {
515 OFF = 0;
516 ON = 1;
517 }
518 optional State state = 3;
519}
520
Yangster-mac96353002018-09-05 11:18:55 -0700521/*
522 * Deferred job stats.
523 *
524 * Logged from:
525 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
526*/
527message DeferredJobStatsReported {
528 repeated AttributionNode attribution_node = 1;
529
530 // Number of jobs deferred.
531 optional int32 num_jobs_deferred = 2;
532
533 // Time since the last job runs.
534 optional int64 time_since_last_job_millis = 3;
535}
536
Bookatzc1a050a2017-10-10 15:49:28 -0700537/**
538 * Logs when a job scheduler job state changes.
539 *
540 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700541 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700542 */
543message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800544 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700545
546 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800547 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700548
549 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800550 FINISHED = 0;
551 STARTED = 1;
552 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700553 }
554 optional State state = 3;
555
Tej Singh33a412b2018-03-16 18:43:59 -0700556 // The reason a job has stopped.
557 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700558 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700559 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700560}
561
562/**
563 * Logs when the audio state changes.
564 *
565 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700566 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700567 */
568message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800569 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700570
571 enum State {
572 OFF = 0;
573 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700574 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
575 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700576 }
577 optional State state = 2;
578}
579
580/**
581 * Logs when the video codec state changes.
582 *
583 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700585 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800586message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800587 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700588
589 enum State {
590 OFF = 0;
591 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700592 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
593 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700594 }
595 optional State state = 2;
596}
597
598/**
599 * Logs when the flashlight state changes.
600 *
601 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700602 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700603 */
604message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800605 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700606
607 enum State {
608 OFF = 0;
609 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700610 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
611 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700612 }
613 optional State state = 2;
614}
615
616/**
617 * Logs when the camera state changes.
618 *
619 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700620 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700621 */
622message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800623 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
625 enum State {
626 OFF = 0;
627 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700628 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
629 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630 }
631 optional State state = 2;
632}
633
634/**
635 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000636 *
637 * Logged from:
638 * TODO
639 */
Bookatzd6746242017-10-24 18:39:35 -0700640message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800641 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000642
Bookatz1a1b0462018-01-12 11:47:03 -0800643 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
644 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700645 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700646
647 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
648 optional string tag = 3;
649
650 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800651 RELEASE = 0;
652 ACQUIRE = 1;
653 CHANGE_RELEASE = 2;
654 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700655 }
656 optional State state = 4;
657}
658
659/**
Bookatzc1a050a2017-10-10 15:49:28 -0700660 * Logs when a partial wakelock is considered 'long' (over 1 min).
661 *
662 * Logged from:
663 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
664 */
665message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800666 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700667
Yao Chend54f9dd2017-10-17 17:37:48 +0000668 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
669 optional string tag = 2;
670
Bookatzc1a050a2017-10-10 15:49:28 -0700671 // TODO: I have no idea what this is.
672 optional string history_tag = 3;
673
674 enum State {
675 OFF = 0;
676 ON = 1;
677 }
678 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000679}
680
Bookatzc1a050a2017-10-10 15:49:28 -0700681/**
Bookatza66083f2018-09-20 17:24:00 -0700682 * Logs when the device is interactive, according to the PowerManager Notifier.
683 *
684 * Logged from:
685 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
686 */
687message InteractiveStateChanged {
688 enum State {
689 OFF = 0;
690 ON = 1;
691 }
692 optional State state = 1;
693}
694
695/**
Bookatzc1a050a2017-10-10 15:49:28 -0700696 * Logs Battery Saver state change.
697 *
698 * Logged from:
699 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
700 */
701message BatterySaverModeStateChanged {
702 enum State {
703 OFF = 0;
704 ON = 1;
705 }
706 optional State state = 1;
707}
708
709/**
710 * Logs Doze mode state change.
711 *
712 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800713 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700714 */
715message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800716 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800717}
718
719
720/**
721 * Logs state change of Doze mode including maintenance windows.
722 *
723 * Logged from:
724 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
725 */
726message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800727 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700728}
729
730/**
731 * Logs screen brightness level.
732 *
733 * Logged from:
734 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
735 */
736message ScreenBrightnessChanged {
737 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
738 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700739}
740
741/**
742 * Logs battery level (percent full, from 0 to 100).
743 *
744 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700745 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700746 */
747message BatteryLevelChanged {
748 // Battery level. Should be in [0, 100].
749 optional int32 battery_level = 1;
750}
751
752/**
753 * Logs change in charging status of the device.
754 *
755 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700756 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700757 */
758message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800759 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
760 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700761}
762
763/**
764 * Logs whether the device is plugged in, and what power source it is using.
765 *
766 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700767 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700768 */
769message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800770 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
771 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700772}
773
Bookatz8c6571b2017-10-24 15:04:41 -0700774/**
775 * Logs when an app's wakeup alarm fires.
776 *
777 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700778 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700779 */
780message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800781 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800782
783 // Name of the wakeup alarm.
784 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700785
786 // Name of source package (for historical reasons, since BatteryStats tracked it).
787 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800788}
789
790/**
791 * Logs when an an app causes the mobile radio to change state.
792 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
793 *
794 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700795 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800796 */
797message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800798 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800799
Bookatz1a1b0462018-01-12 11:47:03 -0800800 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
801 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800802}
803
804/**
805 * Logs when an an app causes the wifi radio to change state.
806 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
807 *
808 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700809 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800810 */
811message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800812 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800813
Bookatz1a1b0462018-01-12 11:47:03 -0800814 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
815 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700816}
817
818/**
819 * Logs kernel wakeup reasons and aborts.
820 *
821 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700822 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700823 */
824message KernelWakeupReported {
825 // Name of the kernel wakeup reason (or abort).
826 optional string wakeup_reason_name = 1;
827
828 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800829 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700830}
831
832/**
833 * Logs wifi locks held by an app.
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 WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800839 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700840
841 enum State {
842 OFF = 0;
843 ON = 1;
844 }
845 optional State state = 2;
846}
847
848/**
849 * Logs wifi signal strength changes.
850 *
851 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700852 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700853 */
854message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800855 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
856 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700857}
858
859/**
860 * Logs wifi scans performed by an app.
861 *
862 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700863 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700864 */
865message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800866 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700867
868 enum State {
869 OFF = 0;
870 ON = 1;
871 }
872 optional State state = 2;
873}
874
875/**
Tej Singh4503e102018-01-04 14:35:01 -0800876 * Logs wifi multicast locks held by an app
877 *
878 * Logged from:
879 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
880 */
881message WifiMulticastLockStateChanged {
882 repeated AttributionNode attribution_node = 1;
883
884 enum State {
885 OFF = 0;
886 ON = 1;
887 }
888 optional State state = 2;
889}
890
891/**
Tej Singh1ea42892018-01-19 09:27:00 -0800892 * Logs shutdown reason and duration on next boot.
893 *
894 * Logged from:
895 * frameworks/base/core/java/com/android/server/BootReceiver.java
896 */
897message ShutdownSequenceReported {
898 // True if shutdown is for a reboot. Default: false if we do not know.
899 optional bool reboot = 1;
900
901 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
902 optional string reason = 2;
903
904 // Beginning of shutdown time in ms using wall clock time since unix epoch.
905 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800906 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800907
908 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800909 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800910}
911
Tej Singh6483ea42018-01-25 17:45:49 -0800912
913/**
914 * Logs boot reason and duration.
915 *
916 * Logged from:
917 * system/core/bootstat/bootstat.cpp
918 */
919message BootSequenceReported {
920 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
921 // Default: "<EMPTY>" if not available.
922 optional string bootloader_reason = 1;
923
924 // Reason for system boot. Eg. bootloader, reboot,userrequested
925 // Default: "<EMPTY>" if not available.
926 optional string system_reason = 2;
927
928 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800929 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800930
931 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800932 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800933
934 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800935 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800936
937 // Time since last boot in ms. Default: 0 if not available.
938 optional int64 time_since_last_boot = 6;
939}
940
Tej Singhc477d9c2018-02-05 18:31:39 -0800941
942/**
943 * Logs call state and disconnect cause (if applicable).
944 *
945 * Logged from:
946 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
947 */
948message CallStateChanged {
949 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
950 // From frameworks/base/core/proto/android/telecomm/enums.proto.
951 optional android.telecom.CallStateEnum call_state = 1;
952
953 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
954 // This value is only applicable when the call_state is DISCONNECTED, and
955 // should always be UNKNOWN if the call_state is not DISCONNECTED.
956 // From frameworks/base/core/proto/android/telecomm/enums.proto.
957 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
958
959 // True if the call is self-managed, which are apps that use the
960 // telecom infrastructure to make their own calls.
961 optional bool self_managed = 3;
962
963 // True if call is external. External calls are calls on connected Wear
964 // devices but show up in Telecom so the user can pull them onto the device.
965 optional bool external_call = 4;
966}
967
Tej Singh1ea42892018-01-19 09:27:00 -0800968/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800969 * Logs keyguard state. The keyguard is the lock screen.
970 *
971 * Logged from:
972 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
973 */
974message KeyguardStateChanged {
975 enum State {
976 UNKNOWN = 0;
977 // The keyguard is hidden when the phone is unlocked.
978 HIDDEN = 1;
979 // The keyguard is shown when the phone is locked (screen turns off).
980 SHOWN= 2;
981 // The keyguard is occluded when something is overlaying the keyguard.
982 // Eg. Opening the camera while on the lock screen.
983 OCCLUDED = 3;
984 }
985 optional State state = 1;
986}
987
988/**
989 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
990 * prompts the user to enter a password (pattern, pin, etc).
991 *
992 * Logged from:
993 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
994 */
995
996message KeyguardBouncerStateChanged {
997 enum State {
998 UNKNOWN = 0;
999 // Bouncer is hidden, either as a result of successfully entering the
1000 // password, screen timing out, or user going back to lock screen.
1001 HIDDEN = 1;
1002 // This is when the user is being prompted to enter the password.
1003 SHOWN = 2;
1004 }
1005 optional State state = 1;
1006}
1007
1008/**
1009 * Logs the result of entering a password into the keyguard bouncer.
1010 *
1011 * Logged from:
1012 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1013 */
1014message KeyguardBouncerPasswordEntered {
1015 enum BouncerResult {
1016 UNKNOWN = 0;
1017 // The password entered was incorrect.
1018 FAILURE = 1;
1019 // The password entered was correct.
1020 SUCCESS = 2;
1021 }
1022 optional BouncerResult result = 1;
1023}
1024
Tej Singha883b372018-02-15 11:30:01 -08001025/*
1026 * Logs changes to the configuration of the device. The configuration is defined
1027 * in frameworks/base/core/java/android/content/res/Configuration.java
1028 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1029 * Please go there to interpret the possible values each field can be.
1030 *
1031 * Logged from:
1032 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1033 */
1034message ResourceConfigurationChanged {
1035 // Bit mask of color capabilities of the screen.
1036 // Contains information about the color gamut and hdr mode of the screen.
1037 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001038 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001039
1040 // The target screen density being rendered to.
1041 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001042 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001043
1044 // Current user preference for the scaling factor for fonts,
1045 // relative to the base density scaling.
1046 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001047 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001048
1049 // Flag indicating whether the hard keyboard is hidden.
1050 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001051 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001052
1053 // The type of keyboard attached to the device.
1054 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1055 optional int32 keyboard = 5;
1056
1057 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1058 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001059 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001060
1061 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1062 // 0 if undefined.
1063 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1064 optional int32 mcc = 7;
1065
1066 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1067 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1068 // MNC_ZERO symbol defined in Configuration.java.
1069 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1070 optional int32 mnc = 8;
1071
1072 // The kind of navigation available on the device.
1073 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1074 optional int32 navigation = 9;
1075
1076 // Flag indicating whether the navigation is available.
1077 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001078 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001079
1080 // Overall orientation of the screen.
1081 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1082 optional int32 orientation = 11;
1083
1084 // The current height of the available screen space, in dp units.
1085 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001086 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001087
1088 // Bit mask of overall layout of the screen.
1089 // Contains information about screen size, whether the screen is wider/taller
1090 // than normal, whether the screen layout is right-tl-left or left-to-right,
1091 // and whether the screen has a rounded shape.
1092 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001093 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001094
1095 // Current width of the available screen space, in dp units.
1096 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001097 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001098
1099 // The smallest screen size an application will see in normal operation.
1100 // This is the smallest value of both screenWidthDp and screenHeightDp
1101 // in portrait and landscape.
1102 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001103 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001104
1105 // The type of touch screen attached to the device.
1106 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1107 optional int32 touchscreen = 16;
1108
1109 // Bit mask of the ui mode.
1110 // Contains information about the overall ui mode of the device.
1111 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1112 // Also contains information about whether the device is in night mode.
1113 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001114 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001115}
1116
Tej Singheee317b2018-03-07 19:28:05 -08001117
1118/**
1119 * Logs changes in the connection state of the mobile radio.
1120 *
1121 * Logged from:
1122 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1123 */
1124message MobileConnectionStateChanged {
1125 // States are from the state machine DataConnection.java.
1126 enum State {
1127 UNKNOWN = 0;
1128 // The connection is inactive, or disconnected.
1129 INACTIVE = 1;
1130 // The connection is being activated, or connecting.
1131 ACTIVATING = 2;
1132 // The connection is active, or connected.
1133 ACTIVE = 3;
1134 // The connection is disconnecting.
1135 DISCONNECTING = 4;
1136 // The connection is disconnecting after creating a connection.
1137 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1138 }
1139 optional State state = 1;
1140 // For multi-sim phones, this distinguishes between the sim cards.
1141 optional int32 sim_slot_index = 2;
1142 // Used to identify the connection. Starts at 0 and increments by 1 for
1143 // every new network created. Resets whenever the device reboots.
1144 optional int32 data_connection_id = 3;
1145 // A bitmask for the capabilities of this connection.
1146 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1147 // Default value (if we have no information): 0
1148 optional int64 capabilities = 4;
1149 // If this connection has internet.
1150 // This just checks if the DEFAULT bit of capabilities is set.
1151 optional bool has_internet = 5;
1152}
1153
1154/**
1155 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1156 *
1157 * Logged from:
1158 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1159 */
1160message MobileRadioTechnologyChanged {
1161 optional android.telephony.NetworkTypeEnum state = 1;
1162 // For multi-sim phones, this distinguishes between the sim cards.
1163 optional int32 sim_slot_index = 2;
1164}
1165
Andrew Chantb56388b2018-03-22 21:07:33 -07001166/**
1167 * Logs the VID and PID of any connected USB devices.
1168 *
1169 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1170 *
1171 * Logged by Vendor.
1172 */
1173message UsbDeviceAttached {
1174 optional int32 vid = 1;
1175 optional int32 pid = 2;
1176 optional bool has_audio = 3;
1177 optional bool has_hid = 4;
1178 optional bool has_storage = 5;
1179}
1180
Tej Singheee317b2018-03-07 19:28:05 -08001181
Tej Singhdd7bd352018-02-09 19:33:15 -08001182/**
Tej Singh5d991e12018-03-09 19:48:11 -08001183 * Logs when Bluetooth is enabled and disabled.
1184 *
1185 * Logged from:
1186 * services/core/java/com/android/server/BluetoothManagerService.java
1187 */
1188message BluetoothEnabledStateChanged {
1189 repeated AttributionNode attribution_node = 1;
1190 // Whether or not bluetooth is enabled on the device.
1191 enum State {
1192 UNKNOWN = 0;
1193 ENABLED = 1;
1194 DISABLED = 2;
1195 }
1196 optional State state = 2;
1197 // The reason for being enabled/disabled.
1198 // Eg. Airplane mode, crash, application request.
1199 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1200 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001202}
1203
1204/**
1205 * Logs when a Bluetooth device connects and disconnects.
1206 *
1207 * Logged from:
1208 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1209 */
1210message BluetoothConnectionStateChanged {
1211 // The state of the connection.
1212 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1213 optional android.bluetooth.ConnectionStateEnum state = 1;
1214 // An identifier that can be used to match connect and disconnect events.
1215 // Currently is last two bytes of a hash of a device level ID and
1216 // the mac address of the bluetooth device that is connected.
1217 optional int32 obfuscated_id = 2;
1218 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1219 // From android.bluetooth.BluetoothAdapter.java
1220 optional int32 bt_profile = 3;
1221}
1222
1223/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001224 * Logs when something is plugged into or removed from the USB-C connector.
1225 *
1226 * Logged from:
1227 * Vendor USB HAL.
1228 */
1229message UsbConnectorStateChanged {
1230 enum State {
1231 DISCONNECTED = 0;
1232 CONNECTED = 1;
1233 }
1234 optional State state = 1;
1235}
1236
1237/**
1238 * Logs the reported speaker impedance.
1239 *
1240 * Logged from:
1241 * Vendor audio implementation.
1242 */
1243message SpeakerImpedanceReported {
1244 optional int32 speaker_location = 1;
1245 optional int32 impedance = 2;
1246}
1247
1248/**
1249 * Logs the report of a failed hardware.
1250 *
1251 * Logged from:
1252 * Vendor HALs.
1253 *
1254 */
1255message HardwareFailed {
1256 enum HardwareType {
1257 HARDWARE_FAILED_UNKNOWN = 0;
1258 HARDWARE_FAILED_MICROPHONE = 1;
1259 HARDWARE_FAILED_CODEC = 2;
1260 HARDWARE_FAILED_SPEAKER = 3;
1261 HARDWARE_FAILED_FINGERPRINT = 4;
1262 }
1263 optional HardwareType hardware_type = 1;
1264
1265 /* hardware_location allows vendors to differentiate between multiple instances of
1266 * the same hardware_type. The specific locations are vendor defined integers,
1267 * referring to board-specific numbering schemes.
1268 */
1269 optional int32 hardware_location = 2;
1270
1271 /* failure_code is specific to the HardwareType of the failed hardware.
1272 * It should use the enum values defined below.
1273 */
1274 enum MicrophoneFailureCode {
1275 MICROPHONE_FAILURE_COMPLETE = 0;
1276 }
1277 enum CodecFailureCode {
1278 CODEC_FAILURE_COMPLETE = 0;
1279 }
1280 enum SpeakerFailureCode {
1281 SPEAKER_FAILURE_COMPLETE = 0;
1282 SPEAKER_FAILURE_HIGH_Z = 1;
1283 SPEAKER_FAILURE_SHORT = 2;
1284 }
1285 enum FingerprintFailureCode {
1286 FINGERPRINT_FAILURE_COMPLETE = 0;
1287 FINGERPRINT_SENSOR_BROKEN = 1;
1288 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1289 }
1290 optional int32 failure_code = 3;
1291}
1292
1293/**
1294 * Log an event when the device has been physically dropped.
1295 * Reported from the /vendor partition.
1296 */
1297message PhysicalDropDetected {
1298 // Confidence that the event was actually a drop, 0 -> 100
1299 optional int32 confidence_pctg = 1;
1300 // Peak acceleration of the drop, in 1/1000s of a g.
1301 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001302 // Duration of freefall in ms
1303 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001304}
1305
1306/**
1307 * Log bucketed battery charge cycles.
1308 *
1309 * Each bucket represents cycles of the battery past
1310 * a given charge point. For example, bucket 1 is the
1311 * lowest 1/8th of the battery, and bucket 8 is 100%.
1312 *
1313 * Logged from:
1314 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1315 */
1316message ChargeCyclesReported {
1317 optional int32 cycle_bucket_1 = 1;
1318 optional int32 cycle_bucket_2 = 2;
1319 optional int32 cycle_bucket_3 = 3;
1320 optional int32 cycle_bucket_4 = 4;
1321 optional int32 cycle_bucket_5 = 5;
1322 optional int32 cycle_bucket_6 = 6;
1323 optional int32 cycle_bucket_7 = 7;
1324 optional int32 cycle_bucket_8 = 8;
1325}
1326
1327/**
Howard Roa46b6582018-09-18 16:45:02 -07001328 * Log battery health snapshot.
1329 *
1330 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1331 * are snapshotted periodically over 24hrs.
1332 */
1333message BatteryHealthSnapshot {
1334 enum BatterySnapshotType {
1335 UNKNOWN = 0;
1336 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1337 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1338 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1339 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1340 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1341 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1342 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1343 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1344 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1345 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1346 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1347 }
1348 optional BatterySnapshotType type = 1;
1349 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001351 // Voltage Battery Voltage, in microVolts.
1352 optional int32 voltage_micro_volt = 3;
1353 // Current Battery current, in microAmps.
1354 optional int32 current_micro_amps = 4;
1355 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1356 optional int32 open_circuit_micro_volt = 5;
1357 // Resistance Battery Resistance, in microOhms.
1358 optional int32 resistance_micro_ohm = 6;
1359 // Level Battery Level, as % of full.
1360 optional int32 level_percent = 7;
1361}
1362
1363/**
1364 * Log slow I/O operations on the primary storage.
1365 */
1366message SlowIo {
1367 // Classifications of IO Operations.
1368 enum IoOperation {
1369 UNKNOWN = 0;
1370 READ = 1;
1371 WRITE = 2;
1372 UNMAP = 3;
1373 SYNC = 4;
1374 }
1375 optional IoOperation operation = 1;
1376
1377 // The number of slow IO operations of this type over 24 hours.
1378 optional int32 count = 2;
1379}
1380
1381/**
1382 * Log battery caused shutdown with the last recorded voltage.
1383 */
1384message BatteryCausedShutdown {
1385 // The last recorded battery voltage prior to shutdown.
1386 optional int32 last_recorded_micro_volt = 1;
1387}
1388
1389/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001390 * Logs the duration of a davey (jank of >=700ms) when it occurs
1391 *
1392 * Logged from:
1393 * frameworks/base/libs/hwui/JankTracker.cpp
1394 */
1395message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001396 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001397 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001398
Tej Singhbb8554a2018-01-26 11:59:14 -08001399 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001400 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001401}
1402
1403/**
Bookatze5885242017-10-24 20:10:31 -07001404 * Logs phone signal strength changes.
1405 *
1406 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001407 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001408 */
1409message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001410 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1411 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001412}
1413
Yangster4ccebea2018-10-09 17:09:02 -07001414
1415/**
1416 * Logs when the phone state, sim state or signal strength changes
1417 *
1418 * Logged from:
1419 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1420 */
1421message PhoneServiceStateChanged {
1422 optional android.telephony.ServiceStateEnum state = 1;
1423 optional android.telephony.SimStateEnum sim_state = 2;
1424 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1425}
1426
1427/**
1428 * Logs when the phone becomes on or off.
1429 *
1430 * Logged from:
1431 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1432 */
1433message PhoneStateChanged {
1434 enum State {
1435 OFF = 0;
1436 ON = 1;
1437 }
1438 optional State state = 1;
1439}
1440
David Chenc28b2bb2017-10-24 12:52:52 -07001441/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001442 * Logs when Settings UI has changed.
1443 *
1444 * Logged from:
1445 * packages/apps/Settings
1446 */
1447message SettingsUIChanged {
1448 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001449 * Where this SettingsUIChange event comes from. For example, if
1450 * it's a PAGE_VISIBLE event, where the page is opened from.
1451 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001452 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001453
1454 /**
1455 * What the UI action is.
1456 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001457 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001458
1459 /**
1460 * Where the action is happening
1461 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001462 optional android.app.settings.PageId pageId = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001463
1464 /**
1465 * What preference changed in this event.
1466 */
1467 optional string changedPreferenceKey = 4;
1468
1469 /**
1470 * The new value of the changed preference.
1471 */
1472 optional int64 changedPreferenceIntValue = 5;
1473}
1474
1475/**
David Chenc28b2bb2017-10-24 12:52:52 -07001476 * Logs that a setting was updated.
1477 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001478 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001479 * The tag and is_default allow resetting of settings to default values based on the specified
1480 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1481 */
1482message SettingChanged {
1483 // The name of the setting.
1484 optional string setting = 1;
1485
1486 // The change being imposed on this setting. May represent a number, eg "3".
1487 optional string value = 2;
1488
1489 // The new value of this setting. For most settings, this is same as value. For some settings,
1490 // value is +X or -X where X represents an element in a set. For example, if the previous value
1491 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1492 // The +/- feature is currently only used for location_providers_allowed.
1493 optional string new_value = 3;
1494
1495 // The previous value of this setting.
1496 optional string prev_value = 4;
1497
1498 // The tag used with the is_default for resetting sets of settings. This is generally null.
1499 optional string tag = 5;
1500
Bookatz90867622018-01-31 15:05:57 -08001501 // True if this setting with tag should be resettable.
1502 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001503
David Chenbd789912018-03-16 17:19:55 -07001504 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001505 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001506
1507 enum ChangeReason {
1508 UPDATED = 1; // Updated can be an insertion or an update.
1509 DELETED = 2;
1510 }
1511 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001512}
Chenjie Yub3dda412017-10-24 13:41:59 -07001513
Chenjie Yu05013b32017-11-21 10:21:41 -08001514/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001515 * Logs activity going to foreground or background
1516 *
1517 * Logged from:
1518 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1519 */
1520message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001521 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001522 optional string pkg_name = 2;
1523 optional string class_name = 3;
1524
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001525 enum State {
1526 BACKGROUND = 0;
1527 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001528 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001529 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001530}
David Chenc8a43242017-10-17 16:23:28 -07001531
1532/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001533 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001534 * Logged from:
1535 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1536 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001537message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001538 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001539
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001540 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001541
1542 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001543 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001544 optional string process_name = 3;
1545
1546 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001547 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001548
1549 optional string package_name = 5;
1550
1551 enum InstantApp {
1552 UNAVAILABLE = 0;
1553 FALSE = 1;
1554 TRUE = 2;
1555 }
1556 optional InstantApp is_instant_app = 6;
1557
1558 enum ForegroundState {
1559 UNKNOWN = 0;
1560 BACKGROUND = 1;
1561 FOREGROUND = 2;
1562 }
1563 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001564}
David Chen9e3808c2017-11-20 17:25:34 -08001565
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001566/**
1567 * Logs when a WTF (What a Terrible Failure) happened.
1568 * Logged from:
1569 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1570 */
1571message WTFOccurred {
1572 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001573
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001574 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001575
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001576 // The name of the process.
1577 // system_server if it is not by an app
1578 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001579
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001580 // The pid if available. -1 means not available.
1581 optional sint32 pid = 4;
1582}
1583
1584/**
1585 * Logs when system server reports low memory.
1586 * Logged from:
1587 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1588 */
1589message LowMemReported {
1590}
1591
1592/**
1593 * Logs when an app ANR (App Not Responding) occurs.
1594 * Logged from:
1595 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1596 */
1597message ANROccurred {
1598 optional int32 uid = 1 [(is_uid) = true];
1599
1600 optional string process_name = 2;
1601
1602 optional string short_component_name = 3;
1603
1604 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001605
1606 enum InstantApp {
1607 UNAVAILABLE = 0;
1608 FALSE = 1;
1609 TRUE = 2;
1610 }
1611 optional InstantApp is_instant_app = 5;
1612
1613 enum ForegroundState {
1614 UNKNOWN = 0;
1615 BACKGROUND = 1;
1616 FOREGROUND = 2;
1617 }
1618 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001619}
1620
Bookatza7020bd2018-08-28 16:29:35 -07001621/**
1622 * Logs when the vibrator state changes.
1623 * Logged from:
1624 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1625 */
1626message VibratorStateChanged {
1627 repeated AttributionNode attribution_node = 1;
1628
1629 enum State {
1630 OFF = 0;
1631 ON = 1;
1632 }
1633 optional State state = 2;
1634
1635 // Duration (in milliseconds) requested to keep the vibrator on.
1636 // Only applicable for State == ON.
1637 optional int64 duration_millis = 3;
1638}
1639
David Chen0a368b22017-12-06 16:28:16 -08001640/*
1641 * Allows other apps to push events into statsd.
1642 * Logged from:
1643 * frameworks/base/core/java/android/util/StatsLog.java
1644 */
David Chen0b5c90c2018-01-25 16:51:49 -08001645message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001646 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001647 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001648
1649 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1650 optional int32 label = 2;
1651
1652 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1653 // predicates for the metrics).
1654 enum State {
1655 UNKNOWN = 0;
1656 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1657 STOP = 2;
1658 START = 3;
1659 }
1660 optional State state = 3;
1661}
1662
David Chen9e3808c2017-11-20 17:25:34 -08001663/**
Bookatz7948c872018-09-04 12:58:33 -07001664 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1665 * For example, this could be due to the user manually changing the time.
1666 *
1667 * Logged from:
1668 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1669 */
1670message WallClockTimeShifted {
1671 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1672 optional int64 wall_clock_timestamp_millis = 1;
1673}
1674
1675/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001676 * Logs when statsd detects an anomaly.
1677 *
1678 * Logged from:
1679 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1680 */
1681message AnomalyDetected {
1682 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001683 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001684
Yangster-mac94e197c2018-01-02 16:03:03 -08001685 // Id of the config whose anomaly detection alert fired.
1686 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001687
Yangster-mac94e197c2018-01-02 16:03:03 -08001688 // Id of the alert (i.e. name of the anomaly that was detected).
1689 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001690}
1691
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001692message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001693 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001694 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001695
1696 // The app package name.
1697 optional string pkg_name = 2;
1698
1699 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001700 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001701 WARM = 1;
1702 HOT = 2;
1703 COLD = 3;
1704 }
1705 // The transition type.
1706 optional TransitionType type = 3;
1707
1708 // The activity name.
1709 optional string activity_name = 4;
1710
1711 // The name of the calling app. Empty if not set.
1712 optional string calling_pkg_name = 5;
1713
1714 // Whether the app is an instant app.
1715 optional bool is_instant_app = 6;
1716
1717 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001718 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001719
Bookatz80d11a02018-01-16 10:46:35 -08001720 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001721
David Chen0b5c90c2018-01-25 16:51:49 -08001722 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001723 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001724 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001725 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001726 optional int32 bind_application_delay_millis = 11;
1727 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001728
1729 // Empty if not set.
1730 optional string launch_token = 13;
1731
Calin Juravle759fbda2018-02-20 19:52:30 +00001732 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001733 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001734
1735 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001736 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001737}
1738
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001739message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001740 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001741 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001742
1743 // The app package name.
1744 optional string pkg_name = 2;
1745
1746 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001747 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001748 WARM = 1;
1749 HOT = 2;
1750 COLD = 3;
1751 }
1752 // The transition type.
1753 optional TransitionType type = 3;
1754
1755 // The activity name.
1756 optional string activity_name = 4;
1757}
1758
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001759message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001760 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001761 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001762
1763 // The app package name.
1764 optional string pkg_name = 2;
1765
1766 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001767 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001768 WITH_BUNDLE = 1;
1769 WITHOUT_BUNDLE = 2;
1770 }
1771 // The transition type.
1772 optional TransitionType type = 3;
1773
1774 // The activity name.
1775 optional string activity_name = 4;
1776
1777 optional bool transition_process_running = 5;
1778
1779 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001780 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001781}
1782
Bookatz8fcd09a2017-12-18 13:01:10 -08001783/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001784 * Logs a picture-in-picture action
1785 * Logged from:
1786 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1787 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1788 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1789 */
1790message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001791 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001792 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001793
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001794 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001795
Chenjie Yu52cacc62017-12-08 18:11:45 -08001796 enum State {
1797 ENTERED = 1;
1798 EXPANDED_TO_FULL_SCREEN = 2;
1799 MINIMIZED = 3;
1800 DISMISSED = 4;
1801 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001802 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001803}
1804
1805/**
Chenjie Yue8904192017-12-08 19:12:57 -08001806 * Logs overlay action
1807 * Logged from:
1808 * services/core/java/com/android/server/wm/Session.java
1809 */
1810message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001811 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001812
1813 optional string package_name = 2;
1814
1815 optional bool using_alert_window = 3;
1816
1817 enum State {
1818 ENTERED = 1;
1819 EXITED = 2;
1820 }
1821 optional State state = 4;
1822}
1823
Chenjie Yuccfe6452018-01-30 11:33:21 -08001824/*
1825 * Logs foreground service starts and stops.
1826 * Note that this is not when a service starts or stops, but when it is
1827 * considered foreground.
1828 * Logged from
1829 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1830 */
1831message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001832 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001833 // package_name + "/" + class_name
1834 optional string short_name = 2;
1835
1836 enum State {
1837 ENTER = 1;
1838 EXIT = 2;
1839 }
1840 optional State state = 3;
1841}
1842
Chenjie Yue8904192017-12-08 19:12:57 -08001843/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001844 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1845 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1846 * attributed back to the parent (host) uid. One example is Chrome.
1847 *
1848 * Logged from:
1849 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1850 */
1851message IsolatedUidChanged {
1852 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001853 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001854 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001855 optional int32 parent_uid = 1;
1856
1857 optional int32 isolated_uid = 2;
1858
1859 // We expect an isolated uid to be removed before if it's used for another parent uid.
1860 enum Event {
1861 REMOVED = 0;
1862 CREATED = 1;
1863 }
1864 optional Event event = 3;
1865}
1866
1867/*
1868 * Logs the reception of an incoming network packet causing the main system to wake up for
1869 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1870 * and processed by WakeupController.cpp.
1871 */
1872message PacketWakeupOccurred {
1873 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1874 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001875 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001876 // The interface name on which the packet was received.
1877 optional string iface = 2;
1878 // The ethertype value of the packet.
1879 optional int32 ethertype = 3;
1880 // String representation of the destination MAC address of the packet.
1881 optional string destination_hardware_address = 4;
1882 // String representation of the source address of the packet if this was an IP packet.
1883 optional string source_ip = 5;
1884 // String representation of the destination address of the packet if this was an IP packet.
1885 optional string destination_ip = 6;
1886 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1887 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1888 // families.
1889 optional int32 ip_next_header = 7;
1890 // The source port if this was a TCP or UDP packet.
1891 optional int32 source_port = 8;
1892 // The destination port if this was a TCP or UDP packet.
1893 optional int32 destination_port = 9;
1894}
1895
1896/*
1897 * Logs the memory stats for an app on startup.
1898 * Logged from:
1899 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1900 */
1901message AppStartMemoryStateCaptured {
1902 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001903 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001904
1905 // The process name.
1906 optional string process_name = 2;
1907
1908 // The activity name.
1909 optional string activity_name = 3;
1910
1911 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001912 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001913
1914 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001915 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001916
1917 // RSS
1918 optional int64 rss_in_bytes = 6;
1919
1920 // CACHE
1921 optional int64 cache_in_bytes = 7;
1922
1923 // SWAP
1924 optional int64 swap_in_bytes = 8;
1925}
1926
1927/*
1928 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1929 * for LMK event.
1930 * Logged from:
1931 * system/core/lmkd/lmkd.c
1932 */
1933message LmkStateChanged {
1934 enum State {
1935 UNKNOWN = 0;
1936 START = 1;
1937 STOP = 2;
1938 }
1939 optional State state = 1;
1940}
1941
1942/*
1943 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1944 * Logged from:
1945 * system/core/lmkd/lmkd.c
1946 */
1947message LmkKillOccurred {
1948 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001949 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001950
1951 // The process name.
1952 optional string process_name = 2;
1953
1954 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07001955 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001956
1957 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001958 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001959
1960 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001961 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001962
1963 // RSS
1964 optional int64 rss_in_bytes = 6;
1965
1966 // CACHE
1967 optional int64 cache_in_bytes = 7;
1968
1969 // SWAP
1970 optional int64 swap_in_bytes = 8;
1971}
1972
Rajeev Kumar51b54602018-03-01 12:18:26 -08001973/*
1974 * Logs when the ActivityManagerService detects that an app died.
1975 *
1976 * Logged from:
1977 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1978 */
1979message AppDied {
1980 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07001981 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001982}
1983
Howard Ro21a039c2018-08-06 14:55:47 -07001984/**
1985 * An atom for generic metrics logging. Available from Android Q.
1986 */
1987message GenericAtom {
1988 // The uid of the application that sent this custom atom.
1989 optional int32 uid = 1 [(is_uid) = true];
1990
1991 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07001992 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001993}
1994
Tej Singhd6d6d772018-09-05 17:41:25 -07001995/**
1996 * Logs when a fingerprint acquire event occurs.
1997 *
1998 * Logged from:
1999 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2000 */
2001message FingerprintAcquired {
2002 // The associated user. Eg: 0 for owners, 10+ for others.
2003 // Defined in android/os/UserHandle.java
2004 optional int32 user = 1;
2005 // If this acquire is for a crypto fingerprint.
2006 // e.g. Secure purchases, unlock password storage.
2007 optional bool is_crypto = 2;
2008}
2009
2010/**
2011 * Logs when a fingerprint authentication event occurs.
2012 *
2013 * Logged from:
2014 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2015 */
2016message FingerprintAuthenticated {
2017 // The associated user. Eg: 0 for owners, 10+ for others.
2018 // Defined in android/os/UserHandle.java
2019 optional int32 user = 1;
2020 // If this authentication is for a crypto fingerprint.
2021 // e.g. Secure purchases, unlock password storage.
2022 optional bool is_crypto = 2;
2023 // Whether or not this authentication was successful.
2024 optional bool is_authenticated = 3;
2025}
2026
2027/**
2028 * Logs when a fingerprint error occurs.
2029 *
2030 * Logged from:
2031 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2032 */
2033message FingerprintErrorOccurred {
2034 // The associated user. Eg: 0 for owners, 10+ for others.
2035 // Defined in android/os/UserHandle.java
2036 optional int32 user = 1;
2037 // If this error is for a crypto fingerprint.
2038 // e.g. Secure purchases, unlock password storage.
2039 optional bool is_crypto = 2;
2040
2041 enum Error {
2042 UNKNOWN = 0;
2043 LOCKOUT = 1;
2044 PERMANENT_LOCKOUT = 2;
2045 }
2046 // The type of error.
2047 optional Error error = 3;
2048}
Howard Ro688ae182018-09-25 00:09:36 -07002049
2050message Notification {
2051
2052 // Type of notification event.
2053 enum Type {
2054 TYPE_UNKNOWN = 0;
2055 // Notification became visible to the user.
2056 TYPE_OPEN = 1;
2057 // Notification became hidden.
2058 TYPE_CLOSE = 2;
2059 // Notification switched to detail mode.
2060 TYPE_DETAIL = 3;
2061 // Notification was clicked.
2062 TYPE_ACTION = 4;
2063 // Notification was dismissed.
2064 TYPE_DISMISS = 5;
2065 // Notification switched to summary mode. The enum value of 14 is to
2066 // match that of metrics_constants.
2067 TYPE_COLLAPSE = 14;
2068 }
2069 optional Type type = 1;
2070
2071 // Package name associated with the notification.
2072 optional string package_name = 2;
2073
2074 // Tag associated with notification.
2075 optional string tag = 3;
2076
2077 // Application-supplied ID associated with the notification.
2078 optional int32 id = 4;
2079
2080 // Index of notification in the notification panel.
2081 optional int32 shade_index = 5;
2082
2083 // The number of notifications in the notification panel.
2084 optional int32 shade_count = 6;
2085
2086 // Importance for the notification.
2087 optional int32 importance = 7;
2088
2089 // ID for the notification channel.
2090 optional int32 channel_id = 8;
2091
2092 // Importance for the notification channel.
2093 optional int32 channel_importance = 9;
2094
2095 // Whether notification was a group summary.
2096 optional bool group_summary = 10;
2097
2098 // Time since notification was created in milliseconds.
2099 optional int64 since_create_millis = 11;
2100
2101 // Time since notification was interrupted in milliseconds.
2102 optional int64 since_interruption_millis = 12;
2103
2104 // Time since notification was updated in milliseconds.
2105 optional int64 since_update_millis = 13;
2106
2107 // Time since notification was visible in milliseconds.
2108 optional int64 since_visible_millis = 14;
2109}
2110
2111
Chenjie Yubbcbc602018-02-05 16:51:52 -08002112//////////////////////////////////////////////////////////////////////
2113// Pulled atoms below this line //
2114//////////////////////////////////////////////////////////////////////
2115
2116/**
David Chenc8a43242017-10-17 16:23:28 -07002117 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2118 *
2119 * Pulled from:
2120 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2121 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002122message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002123 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002124
2125 optional int64 rx_bytes = 2;
2126
2127 optional int64 rx_packets = 3;
2128
2129 optional int64 tx_bytes = 4;
2130
2131 optional int64 tx_packets = 5;
2132}
2133
2134/**
2135 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2136 *
2137 * Pulled from:
2138 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2139 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002140message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002141 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002142
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002143 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2144 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002145
2146 optional int64 rx_bytes = 3;
2147
2148 optional int64 rx_packets = 4;
2149
2150 optional int64 tx_bytes = 5;
2151
2152 optional int64 tx_packets = 6;
2153}
2154
2155/**
2156 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2157 *
2158 * Pulled from:
2159 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2160 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002161message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002162 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002163
2164 optional int64 rx_bytes = 2;
2165
2166 optional int64 rx_packets = 3;
2167
2168 optional int64 tx_bytes = 4;
2169
2170 optional int64 tx_packets = 5;
2171}
2172
2173/**
2174 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2175 *
2176 * Pulled from:
2177 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2178 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002179message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002180 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002181
Yao Chenc40a19d2018-03-15 16:48:25 -07002182 // 1 denotes foreground and 0 denotes background. This is called Set in
2183 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002184 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002185
2186 optional int64 rx_bytes = 3;
2187
2188 optional int64 rx_packets = 4;
2189
2190 optional int64 tx_bytes = 5;
2191
2192 optional int64 tx_packets = 6;
2193}
2194
2195/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002196 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2197 *
2198 * Pulled from:
2199 * StatsCompanionService
2200 */
2201message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002202 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002203
2204 optional int64 rx_bytes = 2;
2205
2206 optional int64 tx_bytes = 3;
2207}
2208
2209/**
David Chenc8a43242017-10-17 16:23:28 -07002210 * Pulls the kernel wakelock durations. This atom is adapted from
2211 * android/internal/os/KernelWakelockStats.java
2212 *
2213 * Pulled from:
2214 * StatsCompanionService using KernelWakelockReader.
2215 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002216message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002217 optional string name = 1;
2218
2219 optional int32 count = 2;
2220
2221 optional int32 version = 3;
2222
Yangster-maca8a30442018-10-13 23:46:34 -07002223 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002224}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002225
Chenjie Yu05013b32017-11-21 10:21:41 -08002226/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002227 * Pulls low power state information. This includes platform and subsystem sleep state information,
2228 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002229 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002230 * hardware/interfaces/power/1.1/types.hal
2231 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002232message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002233 // Subsystem name
2234 optional string subsystem_name = 1;
2235 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2236 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2237 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002238 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002239 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002240 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002241 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002242}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002243
Chenjie Yu05013b32017-11-21 10:21:41 -08002244/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002245 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002246 * Pulls the time the cpu spend on the frequency index. Frequency index
2247 * starts from highest to lowest. The value should be monotonically
2248 * increasing since boot. However, if there is a cpu
2249 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002250 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002251message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002252 optional uint32 cluster = 1;
2253 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002254 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002255}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002256
Chenjie Yu05013b32017-11-21 10:21:41 -08002257/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002258 * Pulls Cpu Time Per Uid.
2259 * Note that isolated process uid time should be attributed to host uids.
2260 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002261message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002262 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002263 optional uint64 user_time_millis = 2;
2264 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002265}
2266
2267/**
2268 * Pulls Cpu Time Per Uid per frequency.
2269 * Note that isolated process uid time should be attributed to host uids.
2270 * For each uid, we order the time by descending frequencies.
2271 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002272message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002273 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002274 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002275 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002276}
Hugo Benichi884970e2017-11-14 22:42:46 +09002277
Chenjie Yu05013b32017-11-21 10:21:41 -08002278/**
2279 * Pulls Wifi Controller Activity Energy Info
2280 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002281message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002282 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002283 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002284 // stack reported state
2285 // TODO: replace this with proto enum
2286 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002287 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002288 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002289 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002290 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002291 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002292 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002293 // product of current(mA), voltage(V) and time(ms)
2294 optional uint64 controller_energy_used = 6;
2295}
2296
2297/**
2298 * Pulls Modem Activity Energy Info
2299 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002300message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002301 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002302 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002303 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002304 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002305 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002306 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002307 /**
2308 * Tx power index
2309 * index 0 = tx_power < 0dBm
2310 * index 1 = 0dBm < tx_power < 5dBm
2311 * index 2 = 5dBm < tx_power < 15dBm
2312 * index 3 = 15dBm < tx_power < 20dBm
2313 * index 4 = tx_power > 20dBm
2314 */
2315 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002316 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002317 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002318 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002319 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002320 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002321 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002322 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002323 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002324 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002325 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002326 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002327 // product of current(mA), voltage(V) and time(ms)
2328 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002329}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002330
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002331/**
2332 * Pulls Bluetooth Activity Energy Info
2333 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2334 */
2335message BluetoothActivityInfo {
2336 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002337 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002338 // bluetooth stack state
2339 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002340 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002341 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002342 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002343 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002344 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002345 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002346 // product of current(mA), voltage(V) and time(ms)
2347 optional uint64 energy_used = 6;
2348}
2349
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002350/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002351 * Logs the memory stats for a process.
2352 */
2353message ProcessMemoryState {
2354 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002355 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002356
2357 // The process name.
2358 optional string process_name = 2;
2359
2360 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002361 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002362
2363 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002364 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002365
2366 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002367 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002368
Rajeev Kumar90235992018-01-29 11:06:48 -08002369 // RSS
2370 optional int64 rss_in_bytes = 6;
2371
2372 // CACHE
2373 optional int64 cache_in_bytes = 7;
2374
2375 // SWAP
2376 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002377
2378 // RSS high watermark.
2379 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2380 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2381 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002382}
2383
2384/*
Rafal Slawik08621582018-10-15 14:53:07 +01002385 * Logs the memory stats for a native process (from procfs).
2386 */
2387message NativeProcessMemoryState {
2388 // The uid if available. -1 means not available.
2389 optional int32 uid = 1 [(is_uid) = true];
2390
2391 // The process name.
2392 optional string process_name = 2;
2393
2394 // # of page-faults
Rafal Slawik298e07f2018-10-18 14:35:29 +01002395 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002396
2397 // # of major page-faults
Rafal Slawik298e07f2018-10-18 14:35:29 +01002398 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002399
2400 // RSS
2401 optional int64 rss_in_bytes = 5;
2402
2403 // RSS high watermark.
2404 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2405 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2406 optional int64 rss_high_watermark_in_bytes = 6;
2407}
2408
2409/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002410 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002411 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002412message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002413 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002414}
2415
2416/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002417 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002418 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002419message SystemUptime {
2420 // Milliseconds since the system was booted.
2421 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2422 // for external input).
2423 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002424 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002425}
2426
2427/*
2428 * Reads from /proc/uid_concurrent_active_time which has the format:
2429 * active: X (X is # cores)
2430 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2431 * [uid1]: [time-0] [time-1] [time-2] ... ...
2432 * ...
2433 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2434 * The file contains a monotonically increasing count of time for a single boot.
2435 */
2436message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002437 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002438 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002439}
2440
2441/**
2442 * Reads from /proc/uid_concurrent_policy_time which has the format:
2443 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2444 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2445 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2446 * ...
2447 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2448 * The file contains a monotonically increasing count of time for a single boot.
2449 */
2450message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002451 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002452 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002453 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002454}
2455
2456/*
2457 * Pulls free disk space, for data, system partition and temporary directory.
2458 */
2459message DiskSpace {
2460 // available bytes in data partition
2461 optional uint64 data_available_bytes = 1;
2462 // available bytes in system partition
2463 optional uint64 system_available_bytes = 2;
2464 // available bytes in download cache or temp directories
2465 optional uint64 temp_available_bytes = 3;
2466}
Tej Singhbf972d92018-01-10 20:51:13 -08002467
2468/**
2469 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002470 * Pulled from:
2471 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002472 */
2473message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002474 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002475}
2476
2477/**
2478 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002479 * Pulled from:
2480 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002481 */
2482message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002483 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002484}
2485
2486/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002487 * Pulls battery voltage.
2488 * Pulled from:
2489 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2490 */
2491message BatteryVoltage {
2492 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002493 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002494}
2495
2496/**
Tej Singhd89137e2018-03-26 14:51:40 -07002497 * Pulls the temperature of various parts of the device.
2498 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002499 *
2500 * Pulled from:
2501 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2502 */
2503message Temperature {
2504 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2505 optional android.os.TemperatureTypeEnum sensor_location = 1;
2506
2507 // The name of the temperature source. Eg. CPU0
2508 optional string sensor_name = 2;
2509
Tej Singhd89137e2018-03-26 14:51:40 -07002510 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002511 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002512}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002513
2514/**
2515 * Pulls the statistics of calls to Binder.
2516 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002517 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2518 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002519 *
2520 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002521 */
2522message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002523 optional int32 uid = 1 [(is_uid) = true];
2524 // Fully qualified class name of the API call.
2525 //
2526 // This is a system server class name.
2527 //
2528 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2529 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2530 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2531 // commonly used APIs.
2532 optional string service_class_name = 2;
2533 // Method name of the API call. It can also be a transaction code if we cannot
2534 // resolve it to a name. See Binder#getTransactionName.
2535 //
2536 // This is a system server method name.
2537 optional string service_method_name = 3;
2538 // Total number of API calls.
2539 optional int64 call_count = 4;
2540 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2541 optional bool screen_interactive = 13;
2542 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2543 // call_count will be equal to recorded_call_count.
2544 //
2545 // If recorded_call_count is different than call_count, it means data collection has been
2546 // sampled. All the fields below will be sampled in this case.
2547 optional int64 recorded_call_count = 12;
2548 // Number of exceptions thrown by the API.
2549 optional int64 recorded_exception_count = 5;
2550 // Total latency of all API calls.
2551 // Average can be computed using total_latency_micros / recorded_call_count.
2552 optional int64 recorded_total_latency_micros = 6;
2553 // Maximum latency of one API call.
2554 optional int64 recorded_max_latency_micros = 7;
2555 // Total CPU usage of all API calls.
2556 // Average can be computed using total_cpu_micros / recorded_call_count.
2557 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2558 optional int64 recorded_total_cpu_micros = 8;
2559 // Maximum CPU usage of one API call.
2560 optional int64 recorded_max_cpu_micros = 9;
2561 // Maximum parcel reply size of one API call.
2562 optional int64 recorded_max_reply_size_bytes = 10;
2563 // Maximum parcel request size of one API call.
2564 optional int64 recorded_max_request_size_bytes = 11;
2565}
2566
2567/**
2568 * Pulls the statistics of exceptions during calls to Binder.
2569 *
2570 * Binder stats are cumulative from boot unless somebody reset the data using
2571 * > adb shell dumpsys binder_calls_stats --reset
2572 */
2573message BinderCallsExceptions {
2574 // Exception class name, e.g. java.lang.IllegalArgumentException.
2575 //
2576 // This is an exception class name thrown by the system server.
2577 optional string exception_class_name = 1;
2578 // Total number of exceptions.
2579 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002580}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002581
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002582/**
2583 * Pulls the statistics of message dispatching on HandlerThreads.
2584 *
2585 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2586 * config on the device.
2587 *
2588 * Next tag: 11
2589 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002590message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002591 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002592 optional int32 uid = 1 [(is_uid) = true];
2593
2594 // Fully qualified class name of the handler target class.
2595 //
2596 // This field does not contain PII. This is a system server class name.
2597 optional string handler_class_name = 2;
2598
2599 // The name of the thread that runs the Looper.
2600 //
2601 // This field does not contain PII. This is a system server thread name.
2602 optional string looper_thread_name = 3;
2603
2604 // The name of the dispatched message.
2605 //
2606 // This field does not contain PII. This is a system server constant or class
2607 // name.
2608 optional string message_name = 4;
2609
2610 // Total number of successfully dispatched messages.
2611 optional int64 message_count = 5;
2612
2613 // Total number of messages that failed dispatching.
2614 optional int64 exception_count = 6;
2615
2616 // Total number of processed messages we have data recorded for. If we
2617 // collected data for all the messages, message_count will be equal to
2618 // recorded_message_count.
2619 //
2620 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002621 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002622 optional int64 recorded_message_count = 7;
2623
2624 // Total latency of all processed messages.
2625 // Average can be computed using recorded_total_latency_micros /
2626 // recorded_message_count.
2627 optional int64 recorded_total_latency_micros = 8;
2628
2629 // Total CPU usage of all processed message.
2630 // Average can be computed using recorded_total_cpu_micros /
2631 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002632 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002633 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002634
2635 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2636 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002637
2638 // Max recorded CPU usage of all processed messages.
2639 optional int64 recorded_max_cpu_micros = 11;
2640
2641 // Max recorded latency of all processed messages.
2642 optional int64 recorded_max_latency_micros = 12;
2643
2644 // Total number of messages we tracked the dispatching delay for. If we
2645 // collected data for all the messages, message_count will be equal to
2646 // recorded_delay_message_count.
2647 //
2648 // If recorded_delay_message_count is different than message_count, it means data
2649 // collection has been sampled or/and not all messages specified the target dispatch time.
2650 // The fields below will be sampled in this case.
2651 optional int64 recorded_delay_message_count = 13;
2652
2653 // Total dispatching delay of all processed messages.
2654 // Calculated as a difference between the target dispatching time (Message.when)
2655 // and the actual dispatching time.
2656 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2657 optional int64 recorded_total_delay_millis = 14;
2658
2659 // Max dispatching delay of all processed messages.
2660 // Calculated as a difference between the target dispatching time (Message.when)
2661 // and the actual dispatching time.
2662 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002663}
Tej Singh86dc9db2018-09-06 00:39:57 +00002664
2665/**
2666 * Pulls disk information, such as write speed and latency.
2667 */
2668message DiskStats {
2669 // Time taken to open, write 512B to, and close a file.
2670 // -1 if error performing the check.
2671 optional int64 data_write_latency_millis = 1;
2672
2673 optional bool file_based_encryption = 2;
2674
2675 // Recent disk write speed in kB/s.
2676 // -1 if error querying storageed.
2677 // 0 if data is unavailable.
2678 optional int32 recent_disk_write_speed = 3;
2679}
2680
2681
2682/**
2683 * Free and total bytes of the Data, Cache, and System partition.
2684 */
2685message DirectoryUsage {
2686 enum Directory {
2687 UNKNOWN = 0;
2688 DATA = 1;
2689 CACHE = 2;
2690 SYSTEM = 3;
2691 }
2692 optional Directory directory = 1;
2693 optional int64 free_bytes = 2;
2694 optional int64 total_bytes = 3;
2695}
2696
2697
2698/**
2699 * Size of an application: apk size, data size, and cache size.
2700 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2701 * Information is only reported for apps with the primary user (user 0).
2702 * Sizes are aggregated by package name.
2703 */
2704message AppSize {
2705 // Including uids will involve modifying diskstats logic.
2706 optional string package_name = 1;
2707 // App size in bytes. -1 if unavailable.
2708 optional int64 app_size_bytes = 2;
2709 // App data size in bytes. -1 if unavailable.
2710 optional int64 app_data_size_bytes = 3;
2711 // App cache size in bytes. -1 if unavailable.
2712 optional int64 app_cache_size_bytes = 4;
2713 // Time that the cache file was produced.
2714 // Uses System.currentTimeMillis(), which is wall clock time.
2715 optional int64 cache_time_millis = 5;
2716}
2717
2718
2719/**
2720 * Size of a particular category. Eg: photos, videos.
2721 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2722 */
2723message CategorySize {
2724 enum Category {
2725 UNKNOWN = 0;
2726 APP_SIZE = 1;
2727 APP_DATA_SIZE = 2;
2728 APP_CACHE_SIZE = 3;
2729 PHOTOS = 4;
2730 VIDEOS = 5;
2731 AUDIO = 6;
2732 DOWNLOADS = 7;
2733 SYSTEM = 8;
2734 OTHER = 9;
2735 }
2736 optional Category category = 1;
2737 // Category size in bytes.
2738 optional int64 size_bytes = 2;
2739 // Time that the cache file was produced.
2740 // Uses System.currentTimeMillis(), which is wall clock time.
2741 optional int64 cache_time_millis = 3;
2742}
Tej Singhd6d6d772018-09-05 17:41:25 -07002743
2744/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002745 * Pulls per uid I/O stats. The stats are cumulative since boot.
2746 *
2747 * Read/write bytes are I/O events from a storage device
2748 * Read/write chars are data requested by read/write syscalls, and can be
2749 * satisfied by caching.
2750 *
2751 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2752 */
2753message DiskIo {
2754 optional int32 uid = 1 [(is_uid) = true];
2755 optional int64 fg_chars_read = 2;
2756 optional int64 fg_chars_write = 3;
2757 optional int64 fg_bytes_read = 4;
2758 optional int64 fg_bytes_write = 5;
2759 optional int64 bg_chars_read = 6;
2760 optional int64 bg_chars_write = 7;
2761 optional int64 bg_bytes_read = 8;
2762 optional int64 bg_bytes_write = 9;
2763 optional int64 fg_fsync = 10;
2764 optional int64 bg_fsync= 11;
2765}
2766
2767
2768/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002769 * Pulls the number of fingerprints for each user.
2770 *
2771 * Pulled from StatsCompanionService, which queries FingerprintManager.
2772 */
2773message NumFingerprints {
2774 // The associated user. Eg: 0 for owners, 10+ for others.
2775 // Defined in android/os/UserHandle.java
2776 optional int32 user = 1;
2777 // Number of fingerprints registered to that user.
2778 optional int32 num_fingerprints = 2;
2779}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002780
Yangsteraf9aee72018-10-12 09:26:16 -07002781message AggStats {
2782 optional int64 min = 1;
2783
2784 optional int64 average = 2;
2785
2786 optional int64 max = 3;
2787}
2788
2789message ProcessStatsStateProto {
2790 optional android.service.procstats.ScreenState screen_state = 1;
2791
2792 optional android.service.procstats.MemoryState memory_state = 2;
2793
2794 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
2795 // and not frameworks/base/core/java/android/app/ActivityManager.java
2796 optional android.service.procstats.ProcessState process_state = 3;
2797
2798 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002799 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002800
2801 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002802 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07002803
2804 // # of samples taken
2805 optional int32 sample_size = 5;
2806
2807 // PSS is memory reserved for this process
2808 optional AggStats pss = 6;
2809
2810 // USS is memory shared between processes, divided evenly for accounting
2811 optional AggStats uss = 7;
2812
2813 // RSS is memory resident for this process
2814 optional AggStats rss = 8;
2815}
2816
2817// Next Tag: 7
2818message ProcessStatsProto {
2819 // Name of process.
2820 optional string process = 1;
2821
2822 // Uid of the process.
2823 optional int32 uid = 2;
2824
2825 // Information about how often kills occurred
2826 message Kill {
2827 // Count of excessive CPU kills
2828 optional int32 cpu = 1;
2829
2830 // Count of kills when cached
2831 optional int32 cached = 2;
2832
2833 // PSS stats during cached kill
2834 optional AggStats cached_pss = 3;
2835 }
2836 optional Kill kill = 3;
2837
2838 // Time and memory spent in various states.
2839 repeated ProcessStatsStateProto states = 5;
2840
2841 // Total time process has been running... screen_state, memory_state, and process_state
2842 // will not be set.
2843 optional ProcessStatsStateProto total_running_state = 6;
2844}
2845
2846message PackageServiceOperationStatsProto {
2847 // Operate enum: Started, Foreground, Bound, Executing
2848 optional android.service.procstats.ServiceOperationState operation = 1;
2849
2850 // Number of times the service was in this operation.
2851 optional int32 count = 2;
2852
2853 // Information about a state the service can be in.
2854 message StateStats {
2855 // Screen state enum.
2856 optional android.service.procstats.ScreenState screen_state = 1;
2857 // Memory state enum.
2858 optional android.service.procstats.MemoryState memory_state = 2;
2859
2860 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07002861 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002862 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002863 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002864 }
2865 repeated StateStats state_stats = 3;
2866}
2867
2868message PackageServiceStatsProto {
2869 // Name of service component.
2870 optional string service_name = 1;
2871
2872 // The operation stats.
2873 // The package_name, package_uid, package_version, service_name will not be set to save space.
2874 repeated PackageServiceOperationStatsProto operation_stats = 2;
2875}
2876
2877message PackageAssociationSourceProcessStatsProto {
2878 // Uid of the process.
2879 optional int32 process_uid = 1;
2880 // Process name.
2881 optional string process_name = 2;
2882
2883 // Total count of the times this association appeared.
2884 optional int32 total_count = 3;
2885
2886 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07002887 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002888
2889 // Total count of the times this association became actively impacting its target process.
2890 optional int32 active_count = 5;
2891
2892 // Information on one source in this association.
2893 message StateStats {
2894 // Process state enum.
2895 optional android.service.procstats.ProcessState process_state = 1;
2896 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002897 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07002898 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002899 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002900 }
2901 repeated StateStats active_state_stats = 6;
2902}
2903
2904message PackageAssociationProcessStatsProto {
2905 // Name of the target component.
2906 optional string component_name = 1;
2907 // Information on one source in this association.
2908 repeated PackageAssociationSourceProcessStatsProto sources = 2;
2909}
2910
2911
2912message ProcessStatsPackageProto {
2913 // Name of package.
2914 optional string package = 1;
2915
2916 // Uid of the package.
2917 optional int32 uid = 2;
2918
2919 // Version of the package.
2920 optional int64 version = 3;
2921
2922 // Stats for each process running with the package loaded in to it.
2923 repeated ProcessStatsProto process_stats = 4;
2924
2925 // Stats for each of the package's services.
2926 repeated PackageServiceStatsProto service_stats = 5;
2927
2928 // Stats for each association with the package.
2929 repeated PackageAssociationProcessStatsProto association_stats = 6;
2930}
2931
2932message ProcessStatsSectionProto {
2933 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002934 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07002935
2936 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002937 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07002938
2939 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002940 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002941
2942 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002943 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002944
2945 // System runtime library. e.g. "libdvm.so", "libart.so".
2946 optional string runtime = 5;
2947
2948 // whether kernel reports swapped pss.
2949 optional bool has_swapped_pss = 6;
2950
2951 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
2952 enum Status {
2953 STATUS_UNKNOWN = 0;
2954 STATUS_COMPLETE = 1;
2955 STATUS_PARTIAL = 2;
2956 STATUS_SHUTDOWN = 3;
2957 STATUS_SYSPROPS = 4;
2958 }
2959 repeated Status status = 7;
2960
2961 // Stats for each process.
2962 repeated ProcessStatsProto process_stats = 8;
2963
2964 // Stats for each package.
2965 repeated ProcessStatsPackageProto package_stats = 9;
2966}
2967
Chenjie Yu12e5e672018-09-14 15:54:59 -07002968/**
2969 * Pulled from ProcessStatsService.java
2970 */
2971message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07002972 optional ProcessStatsSectionProto proc_stats_section = 1;
2973}
2974
2975message PowerProfileProto {
2976 optional double cpu_suspend = 1;
2977
2978 optional double cpu_idle = 2;
2979
2980 optional double cpu_active = 3;
2981
2982 message CpuCluster {
2983 optional int32 id = 1;
2984 optional double cluster_power = 2;
2985 optional int32 cores = 3;
2986 repeated int64 speed = 4;
2987 repeated double core_power = 5;
2988 }
2989
2990 repeated CpuCluster cpu_cluster = 40;
2991
2992 optional double wifi_scan = 4;
2993
2994 optional double wifi_on = 5;
2995
2996 optional double wifi_active = 6;
2997
2998 optional double wifi_controller_idle = 7;
2999
3000 optional double wifi_controller_rx = 8;
3001
3002 optional double wifi_controller_tx = 9;
3003
3004 repeated double wifi_controller_tx_levels = 10;
3005
3006 optional double wifi_controller_operating_voltage = 11;
3007
3008 optional double bluetooth_controller_idle = 12;
3009
3010 optional double bluetooth_controller_rx = 13;
3011
3012 optional double bluetooth_controller_tx = 14;
3013
3014 optional double bluetooth_controller_operating_voltage = 15;
3015
3016 optional double modem_controller_sleep = 16;
3017
3018 optional double modem_controller_idle = 17;
3019
3020 optional double modem_controller_rx = 18;
3021
3022 repeated double modem_controller_tx = 19;
3023
3024 optional double modem_controller_operating_voltage = 20;
3025
3026 optional double gps_on = 21;
3027
3028 repeated double gps_signal_quality_based = 22;
3029
3030 optional double gps_operating_voltage = 23;
3031
3032 optional double bluetooth_on = 24;
3033
3034 optional double bluetooth_active = 25;
3035
3036 optional double bluetooth_at_cmd = 26;
3037
3038 optional double ambient_display = 27;
3039
3040 optional double screen_on = 28;
3041
3042 optional double radio_on = 29;
3043
3044 optional double radio_scanning = 30;
3045
3046 optional double radio_active = 31;
3047
3048 optional double screen_full = 32;
3049
3050 optional double audio = 33;
3051
3052 optional double video = 34;
3053
3054 optional double flashlight = 35;
3055
3056 optional double memory = 36;
3057
3058 optional double camera = 37;
3059
3060 optional double wifi_batched_scan = 38;
3061
3062 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003063}
Chenjie Yuab530202018-09-26 12:39:20 -07003064
3065/**
3066 * power_profile.xml and other constants for power model calculations.
3067 * Pulled from PowerProfile.java
3068 */
3069message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003070 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003071}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003072
3073/**
arangelovd5db50e2018-10-12 20:24:39 +01003074 * Logs when a user restriction was added or removed.
3075 *
3076 * Logged from:
3077 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3078 */
3079message UserRestrictionChanged {
3080 // The raw string of the user restriction as defined in UserManager.
3081 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3082 optional string restriction = 1;
3083 // Whether the restriction is enabled or disabled.
3084 optional bool enabled = 2;
3085}