blob: 10b7c0b0117dd52064025eeb85600473a3c4821b [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080027import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080028import "frameworks/base/core/proto/android/server/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070029import "frameworks/base/core/proto/android/service/procstats_enum.proto";
30import "frameworks/base/core/proto/android/stats/enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080031import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080032import "frameworks/base/core/proto/android/telephony/enums.proto";
33import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080034
Yao Chend54f9dd2017-10-17 17:37:48 +000035/**
Stefan Lafonae2df012017-11-14 09:17:21 -080036 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000037 * raw stats log events from the Android system, also known as "atoms."
38 *
39 * This field contains a single oneof with all of the available messages.
40 * The stats-log-api-gen tool runs as part of the Android build and
41 * generates the android.util.StatsLog class, which contains the constants
42 * and methods that Android uses to log.
43 *
Stefan Lafonae2df012017-11-14 09:17:21 -080044 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000045 * Instead, statsd on Android constructs these messages synthetically,
46 * in the format defined here and in stats_log.proto.
47 */
Stefan Lafonae2df012017-11-14 09:17:21 -080048message Atom {
49 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070050 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070051 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
52 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070053 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070054 BleScanResultReceived ble_scan_result_received = 4;
55 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080056 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070057 SyncStateChanged sync_state_changed = 7;
58 ScheduledJobStateChanged scheduled_job_state_changed = 8;
59 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070060 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080061 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
62 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
63 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070064 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
65 MemoryFactorStateChanged memory_factor_state_changed = 15;
66 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
67 CachedKillReported cached_kill_reported = 17;
68 ProcessMemoryStatReported process_memory_stat_reported = 18;
69 // 19 is available
Bookatzddccf0a2017-11-28 16:48:14 -080070 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
71 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
72 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070073 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080074 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070075 CameraStateChanged camera_state_changed = 25;
76 FlashlightStateChanged flashlight_state_changed = 26;
77 UidProcessStateChanged uid_process_state_changed = 27;
78 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
79 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070080 BatteryLevelChanged battery_level_changed = 30;
81 ChargingStateChanged charging_state_changed = 31;
82 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070083 InteractiveStateChanged interactive_state_changed = 33;
84 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070085 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
86 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070087 WifiLockStateChanged wifi_lock_state_changed = 37;
88 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
89 WifiScanStateChanged wifi_scan_state_changed = 39;
90 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070091 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070092 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070093 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090094 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -070095 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -080096 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080097 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080098 AppStartOccurred app_start_occurred = 48;
99 AppStartCanceled app_start_canceled = 49;
100 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800101 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800102 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800103 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800104 LmkStateChanged lmk_state_changed = 54;
105 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800106 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800107 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800108 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800109 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800110 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800111 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800112 KeyguardStateChanged keyguard_state_changed = 62;
113 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
114 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800115 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800116 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800117 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
118 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700119 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700120 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800121 SpeakerImpedanceReported speaker_impedance_reported = 71;
122 HardwareFailed hardware_failed = 72;
123 PhysicalDropDetected physical_drop_detected = 73;
124 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800125 MobileConnectionStateChanged mobile_connection_state_changed = 75;
126 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700127 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800128 AppCrashOccurred app_crash_occurred = 78;
129 ANROccurred anr_occurred = 79;
130 WTFOccurred wtf_occurred = 80;
131 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700132 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700133 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700134 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700135 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700136 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700137 FingerprintAcquired fingerprint_acquired = 87;
138 FingerprintAuthenticated fingerprint_authenticated = 88;
139 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700140 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700141 BatteryHealthSnapshot battery_health_snapshot = 91;
142 SlowIo slow_io = 92;
143 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700144 PhoneServiceStateChanged phone_service_state_changed = 94;
145 PhoneStateChanged phone_state_changed = 95;
Yao Chend54f9dd2017-10-17 17:37:48 +0000146 }
David Chenc8a43242017-10-17 16:23:28 -0700147
David Chen6e3e6cb2018-01-03 16:14:06 -0800148 // Pulled events will start at field 10000.
Rafal Slawik08621582018-10-15 14:53:07 +0100149 // Next: 10037
David Chenc8a43242017-10-17 16:23:28 -0700150 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800151 WifiBytesTransfer wifi_bytes_transfer = 10000;
152 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
153 MobileBytesTransfer mobile_bytes_transfer = 10002;
154 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800155 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800156 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800157 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800158 CpuTimePerFreq cpu_time_per_freq = 10008;
159 CpuTimePerUid cpu_time_per_uid = 10009;
160 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800161 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800162 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800163 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800164 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800165 SystemElapsedRealtime system_elapsed_realtime = 10014;
166 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800167 CpuActiveTime cpu_active_time = 10016;
168 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000169 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800170 RemainingBatteryCapacity remaining_battery_capacity = 10019;
171 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800172 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100173 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100174 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100175 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000176 DiskStats disk_stats = 10025;
177 DirectoryUsage directory_usage = 10026;
178 AppSize app_size = 10027;
179 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700180 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700181 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700182 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700183 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700184 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700185 ProcStats proc_stats_pkg_proc = 10034;
Chenjie Yub35b5f72018-10-13 23:25:11 -0700186 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100187 NativeProcessMemoryState native_process_memory_state = 10036;
David Chenc8a43242017-10-17 16:23:28 -0700188 }
yroa1fe77c2018-02-26 14:22:54 -0800189
Bookatz76aafcf2018-09-17 16:17:10 -0700190 // DO NOT USE field numbers above 100,000 in AOSP.
191 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
192 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700193}
194
Yao Chend54f9dd2017-10-17 17:37:48 +0000195/**
Yangster-mac20877162017-12-22 17:19:39 -0800196 * This proto represents a node of an attribution chain.
197 * Note: All attribution chains are represented as a repeated field of type
198 * AttributionNode. It is understood that in such arrays, the order is that
199 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000200 */
Yangster-mac20877162017-12-22 17:19:39 -0800201message AttributionNode {
202 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800203 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800204
Yangster-mac20877162017-12-22 17:19:39 -0800205 // The (optional) string tag for an element in the attribution chain. If the
206 // element has no tag, it is encoded as an empty string.
207 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700208}
209
Yangster-mac48b3d622018-08-18 12:38:11 -0700210message KeyValuePair {
211 optional int32 key = 1;
212 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700213 int32 value_int = 2;
214 int64 value_long = 3;
215 string value_str = 4;
216 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700217 }
218}
219
220message KeyValuePairsAtom {
221 optional int32 uid = 1;
222 repeated KeyValuePair pairs = 2;
223}
224
Yao Chend54f9dd2017-10-17 17:37:48 +0000225/*
226 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800227 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000228 *
229 * RULES:
230 * - The field ids for each atom must start at 1, and count upwards by 1.
231 * Skipping field ids is not allowed.
232 * - These form an API, so renaming, renumbering or removing fields is
233 * not allowed between android releases. (This is not currently enforced,
234 * but there will be a tool to enforce this restriction).
235 * - The types must be built-in protocol buffer types, namely, no sub-messages
236 * are allowed (yet). The bytes type is also not allowed.
237 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800238 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000239 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800240 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000241 * - A field that is a uid should be a string field, tagged with the [xxx]
242 * annotation. The generated code on android will be represented by UIDs,
243 * and those UIDs will be translated in xxx to those strings.
244 *
245 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700246 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000247 * - If there is a UID, it goes first. Think in an object-oriented fashion.
248 * *****************************************************************************
249 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700250
Yao Chend54f9dd2017-10-17 17:37:48 +0000251/**
Yangster-mace16189a2018-08-26 12:20:16 -0700252 * Logs when the Thermal service HAL notifies the throttling start/stop events.
253 *
254 * Logged from:
255 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
256 */
257message ThermalThrottlingStateChanged {
258 optional android.os.TemperatureTypeEnum sensor_type = 1;
259
260 enum State {
261 UNKNOWN = 0;
262 START = 1;
263 STOP = 2;
264 }
265
266 optional State state = 2;
267
268 optional float temperature = 3;
269}
270
271/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000272 * Logs when the screen state changes.
273 *
274 * Logged from:
275 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
276 */
277message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800278 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700279 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700280}
Yao Chend54f9dd2017-10-17 17:37:48 +0000281
282/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700283 * Logs that the process state of the uid, as determined by ActivityManager
284 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000285 *
286 * Logged from:
287 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
288 */
Bookatzc1a050a2017-10-10 15:49:28 -0700289message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700290 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000291
Bookatzdb026a22018-01-10 19:01:56 -0800292 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700293 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000294}
295
296/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700297 * Logs process state change of a process, as per the activity manager.
298 *
299 * Logged from:
300 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
301 */
302message ProcessStateChanged {
303 optional int32 uid = 1;
304 optional string process_name = 2;
305 optional string package_name = 3;
306 // TODO: remove this when validation is done
307 optional int64 version = 5;
308 // The state, from frameworks/base/core/proto/android/app/enums.proto.
309 optional android.app.ProcessStateEnum state = 4;
310}
311
312/**
313 * Logs when ActivityManagerService sleep state is changed.
314 *
315 * Logged from:
316 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
317 */
318message ActivityManagerSleepStateChanged {
319 // TODO: import frameworks proto
320 enum State {
321 UNKNOWN = 0;
322 ASLEEP = 1;
323 AWAKE = 2;
324 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700325 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700326}
327
328/**
329 * Logs when system memory state changes.
330 *
331 * Logged from:
332 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
333 */
334message MemoryFactorStateChanged {
335 // TODO: import frameworks proto
336 enum State {
337 MEMORY_UNKNOWN = 0;
338 NORMAL = 1; // normal.
339 MODERATE = 2; // moderate memory pressure.
340 LOW = 3; // low memory.
341 CRITICAL = 4; // critical memory.
342
343 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700344 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700345}
346
347/**
348 * Logs when app is using too much cpu, according to ActivityManagerService.
349 *
350 * Logged from:
351 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
352 */
353message ExcessiveCpuUsageReported {
354 optional int32 uid = 1;
355 optional string process_name = 2;
356 optional string package_name = 3;
357 // package version. TODO: remove this when validation is done
358 optional int64 version = 4;
359}
360
361/**
362 * Logs when a cached process is killed, along with its pss.
363 *
364 * Logged from:
365 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
366 */
367message CachedKillReported {
368 optional int32 uid = 1;
369 optional string process_name = 2;
370 optional string package_name = 3;
371 // TODO: remove this when validation is done
372 optional int64 version = 5;
373 optional int64 pss = 4;
374}
375
376/**
377 * Logs when memory stats of a process is reported.
378 *
379 * Logged from:
380 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
381 */
382message ProcessMemoryStatReported {
383 optional int32 uid = 1;
384 optional string process_name = 2;
385 optional string package_name = 3;
386 //TODO: remove this when validation is done
387 optional int64 version = 9;
388 optional int64 pss = 4;
389 optional int64 uss = 5;
390 optional int64 rss = 6;
391 enum Type {
392 ADD_PSS_INTERNAL_SINGLE = 0;
393 ADD_PSS_INTERNAL_ALL_MEM = 1;
394 ADD_PSS_INTERNAL_ALL_POLL = 2;
395 ADD_PSS_EXTERNAL = 3;
396 ADD_PSS_EXTERNAL_SLOW = 4;
397 }
398 optional Type type = 7;
399 optional int64 duration = 8;
400}
401
402/**
Bookatzc1a050a2017-10-10 15:49:28 -0700403 * Logs that a process started, finished, crashed, or ANRed.
404 *
405 * Logged from:
406 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
407 */
408message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700409 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700410
David Chen0b5c90c2018-01-25 16:51:49 -0800411 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800412 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700413
Bookatzddccf0a2017-11-28 16:48:14 -0800414 // What lifecycle state the process changed to.
415 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800416 enum State {
417 FINISHED = 0;
418 STARTED = 1;
419 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800420 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800421 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700422}
423
Bookatzc1a050a2017-10-10 15:49:28 -0700424/**
425 * Logs when the ble scan state changes.
426 *
427 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700428 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700429 */
430message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800431 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700432
433 enum State {
434 OFF = 0;
435 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700436 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
437 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700438 }
439 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700440
Bookatze5ec0b42018-03-26 13:34:56 -0700441 // Does the scan have a filter.
442 optional bool is_filtered = 3;
443 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
444 optional bool is_first_match = 4;
445 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
446 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700447}
448
449/**
450 * Logs reporting of a ble scan finding results.
451 *
452 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700453 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700454 */
Bookatzae6738e2018-09-13 11:38:56 -0700455// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700456message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800457 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700458
459 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800460 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700461}
462
463/**
464 * Logs when a sensor state changes.
465 *
466 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700467 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700468 */
469message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800470 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700471
Bookatzc1a050a2017-10-10 15:49:28 -0700472 // The id (int) of the sensor.
473 optional int32 sensor_id = 2;
474
475 enum State {
476 OFF = 0;
477 ON = 1;
478 }
479 optional State state = 3;
480}
481
482
483/**
484 * Logs when GPS state changes.
485 *
486 * Logged from:
487 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
488 */
489message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800490 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700491
492 enum State {
493 OFF = 0;
494 ON = 1;
495 }
496 optional State state = 2;
497}
498
499
500/**
501 * Logs when a sync manager sync state changes.
502 *
503 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700504 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700505 */
506message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800507 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700508
David Chen0b5c90c2018-01-25 16:51:49 -0800509 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800510 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700511
512 enum State {
513 OFF = 0;
514 ON = 1;
515 }
516 optional State state = 3;
517}
518
Yangster-mac96353002018-09-05 11:18:55 -0700519/*
520 * Deferred job stats.
521 *
522 * Logged from:
523 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
524*/
525message DeferredJobStatsReported {
526 repeated AttributionNode attribution_node = 1;
527
528 // Number of jobs deferred.
529 optional int32 num_jobs_deferred = 2;
530
531 // Time since the last job runs.
532 optional int64 time_since_last_job_millis = 3;
533}
534
Bookatzc1a050a2017-10-10 15:49:28 -0700535/**
536 * Logs when a job scheduler job state changes.
537 *
538 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700539 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700540 */
541message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800542 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700543
544 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800545 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700546
547 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800548 FINISHED = 0;
549 STARTED = 1;
550 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700551 }
552 optional State state = 3;
553
Tej Singh33a412b2018-03-16 18:43:59 -0700554 // The reason a job has stopped.
555 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700556 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700557 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700558}
559
560/**
561 * Logs when the audio state changes.
562 *
563 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700564 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700565 */
566message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800567 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700568
569 enum State {
570 OFF = 0;
571 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700572 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
573 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700574 }
575 optional State state = 2;
576}
577
578/**
579 * Logs when the video codec state changes.
580 *
581 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700582 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700583 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800584message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800585 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700586
587 enum State {
588 OFF = 0;
589 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700590 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
591 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700592 }
593 optional State state = 2;
594}
595
596/**
597 * Logs when the flashlight state changes.
598 *
599 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700600 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700601 */
602message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800603 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700604
605 enum State {
606 OFF = 0;
607 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700608 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
609 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700610 }
611 optional State state = 2;
612}
613
614/**
615 * Logs when the camera state changes.
616 *
617 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700619 */
620message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800621 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700622
623 enum State {
624 OFF = 0;
625 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700626 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
627 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700628 }
629 optional State state = 2;
630}
631
632/**
633 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000634 *
635 * Logged from:
636 * TODO
637 */
Bookatzd6746242017-10-24 18:39:35 -0700638message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800639 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000640
Bookatz1a1b0462018-01-12 11:47:03 -0800641 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
642 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700643 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700644
645 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
646 optional string tag = 3;
647
648 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800649 RELEASE = 0;
650 ACQUIRE = 1;
651 CHANGE_RELEASE = 2;
652 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700653 }
654 optional State state = 4;
655}
656
657/**
Bookatzc1a050a2017-10-10 15:49:28 -0700658 * Logs when a partial wakelock is considered 'long' (over 1 min).
659 *
660 * Logged from:
661 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
662 */
663message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
Yao Chend54f9dd2017-10-17 17:37:48 +0000666 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
667 optional string tag = 2;
668
Bookatzc1a050a2017-10-10 15:49:28 -0700669 // TODO: I have no idea what this is.
670 optional string history_tag = 3;
671
672 enum State {
673 OFF = 0;
674 ON = 1;
675 }
676 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000677}
678
Bookatzc1a050a2017-10-10 15:49:28 -0700679/**
Bookatza66083f2018-09-20 17:24:00 -0700680 * Logs when the device is interactive, according to the PowerManager Notifier.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
684 */
685message InteractiveStateChanged {
686 enum State {
687 OFF = 0;
688 ON = 1;
689 }
690 optional State state = 1;
691}
692
693/**
Bookatzc1a050a2017-10-10 15:49:28 -0700694 * Logs Battery Saver state change.
695 *
696 * Logged from:
697 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
698 */
699message BatterySaverModeStateChanged {
700 enum State {
701 OFF = 0;
702 ON = 1;
703 }
704 optional State state = 1;
705}
706
707/**
708 * Logs Doze mode state change.
709 *
710 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800711 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700712 */
713message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800714 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800715}
716
717
718/**
719 * Logs state change of Doze mode including maintenance windows.
720 *
721 * Logged from:
722 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
723 */
724message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800725 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700726}
727
728/**
729 * Logs screen brightness level.
730 *
731 * Logged from:
732 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
733 */
734message ScreenBrightnessChanged {
735 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
736 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700737}
738
739/**
740 * Logs battery level (percent full, from 0 to 100).
741 *
742 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700743 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700744 */
745message BatteryLevelChanged {
746 // Battery level. Should be in [0, 100].
747 optional int32 battery_level = 1;
748}
749
750/**
751 * Logs change in charging status of the device.
752 *
753 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700755 */
756message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800757 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
758 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700759}
760
761/**
762 * Logs whether the device is plugged in, and what power source it is using.
763 *
764 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700765 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700766 */
767message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800768 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
769 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700770}
771
Bookatz8c6571b2017-10-24 15:04:41 -0700772/**
773 * Logs when an app's wakeup alarm fires.
774 *
775 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700776 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700777 */
778message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800779 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800780
781 // Name of the wakeup alarm.
782 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700783
784 // Name of source package (for historical reasons, since BatteryStats tracked it).
785 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800786}
787
788/**
789 * Logs when an an app causes the mobile radio to change state.
790 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
791 *
792 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700793 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800794 */
795message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800796 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800797
Bookatz1a1b0462018-01-12 11:47:03 -0800798 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
799 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800800}
801
802/**
803 * Logs when an an app causes the wifi radio to change state.
804 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
805 *
806 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700807 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800808 */
809message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800810 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800811
Bookatz1a1b0462018-01-12 11:47:03 -0800812 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
813 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700814}
815
816/**
817 * Logs kernel wakeup reasons and aborts.
818 *
819 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700820 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700821 */
822message KernelWakeupReported {
823 // Name of the kernel wakeup reason (or abort).
824 optional string wakeup_reason_name = 1;
825
826 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800827 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700828}
829
830/**
831 * Logs wifi locks held by an app.
832 *
833 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700834 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700835 */
836message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800837 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700838
839 enum State {
840 OFF = 0;
841 ON = 1;
842 }
843 optional State state = 2;
844}
845
846/**
847 * Logs wifi signal strength changes.
848 *
849 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700850 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700851 */
852message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800853 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
854 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700855}
856
857/**
858 * Logs wifi scans performed by an app.
859 *
860 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700861 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700862 */
863message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800864 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700865
866 enum State {
867 OFF = 0;
868 ON = 1;
869 }
870 optional State state = 2;
871}
872
873/**
Tej Singh4503e102018-01-04 14:35:01 -0800874 * Logs wifi multicast locks held by an app
875 *
876 * Logged from:
877 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
878 */
879message WifiMulticastLockStateChanged {
880 repeated AttributionNode attribution_node = 1;
881
882 enum State {
883 OFF = 0;
884 ON = 1;
885 }
886 optional State state = 2;
887}
888
889/**
Tej Singh1ea42892018-01-19 09:27:00 -0800890 * Logs shutdown reason and duration on next boot.
891 *
892 * Logged from:
893 * frameworks/base/core/java/com/android/server/BootReceiver.java
894 */
895message ShutdownSequenceReported {
896 // True if shutdown is for a reboot. Default: false if we do not know.
897 optional bool reboot = 1;
898
899 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
900 optional string reason = 2;
901
902 // Beginning of shutdown time in ms using wall clock time since unix epoch.
903 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800904 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800905
906 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800907 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800908}
909
Tej Singh6483ea42018-01-25 17:45:49 -0800910
911/**
912 * Logs boot reason and duration.
913 *
914 * Logged from:
915 * system/core/bootstat/bootstat.cpp
916 */
917message BootSequenceReported {
918 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
919 // Default: "<EMPTY>" if not available.
920 optional string bootloader_reason = 1;
921
922 // Reason for system boot. Eg. bootloader, reboot,userrequested
923 // Default: "<EMPTY>" if not available.
924 optional string system_reason = 2;
925
926 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800927 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800928
929 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800930 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800931
932 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800933 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800934
935 // Time since last boot in ms. Default: 0 if not available.
936 optional int64 time_since_last_boot = 6;
937}
938
Tej Singhc477d9c2018-02-05 18:31:39 -0800939
940/**
941 * Logs call state and disconnect cause (if applicable).
942 *
943 * Logged from:
944 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
945 */
946message CallStateChanged {
947 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
948 // From frameworks/base/core/proto/android/telecomm/enums.proto.
949 optional android.telecom.CallStateEnum call_state = 1;
950
951 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
952 // This value is only applicable when the call_state is DISCONNECTED, and
953 // should always be UNKNOWN if the call_state is not DISCONNECTED.
954 // From frameworks/base/core/proto/android/telecomm/enums.proto.
955 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
956
957 // True if the call is self-managed, which are apps that use the
958 // telecom infrastructure to make their own calls.
959 optional bool self_managed = 3;
960
961 // True if call is external. External calls are calls on connected Wear
962 // devices but show up in Telecom so the user can pull them onto the device.
963 optional bool external_call = 4;
964}
965
Tej Singh1ea42892018-01-19 09:27:00 -0800966/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800967 * Logs keyguard state. The keyguard is the lock screen.
968 *
969 * Logged from:
970 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
971 */
972message KeyguardStateChanged {
973 enum State {
974 UNKNOWN = 0;
975 // The keyguard is hidden when the phone is unlocked.
976 HIDDEN = 1;
977 // The keyguard is shown when the phone is locked (screen turns off).
978 SHOWN= 2;
979 // The keyguard is occluded when something is overlaying the keyguard.
980 // Eg. Opening the camera while on the lock screen.
981 OCCLUDED = 3;
982 }
983 optional State state = 1;
984}
985
986/**
987 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
988 * prompts the user to enter a password (pattern, pin, etc).
989 *
990 * Logged from:
991 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
992 */
993
994message KeyguardBouncerStateChanged {
995 enum State {
996 UNKNOWN = 0;
997 // Bouncer is hidden, either as a result of successfully entering the
998 // password, screen timing out, or user going back to lock screen.
999 HIDDEN = 1;
1000 // This is when the user is being prompted to enter the password.
1001 SHOWN = 2;
1002 }
1003 optional State state = 1;
1004}
1005
1006/**
1007 * Logs the result of entering a password into the keyguard bouncer.
1008 *
1009 * Logged from:
1010 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1011 */
1012message KeyguardBouncerPasswordEntered {
1013 enum BouncerResult {
1014 UNKNOWN = 0;
1015 // The password entered was incorrect.
1016 FAILURE = 1;
1017 // The password entered was correct.
1018 SUCCESS = 2;
1019 }
1020 optional BouncerResult result = 1;
1021}
1022
Tej Singha883b372018-02-15 11:30:01 -08001023/*
1024 * Logs changes to the configuration of the device. The configuration is defined
1025 * in frameworks/base/core/java/android/content/res/Configuration.java
1026 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1027 * Please go there to interpret the possible values each field can be.
1028 *
1029 * Logged from:
1030 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1031 */
1032message ResourceConfigurationChanged {
1033 // Bit mask of color capabilities of the screen.
1034 // Contains information about the color gamut and hdr mode of the screen.
1035 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001036 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001037
1038 // The target screen density being rendered to.
1039 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001040 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001041
1042 // Current user preference for the scaling factor for fonts,
1043 // relative to the base density scaling.
1044 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001045 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001046
1047 // Flag indicating whether the hard keyboard is hidden.
1048 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001049 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001050
1051 // The type of keyboard attached to the device.
1052 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1053 optional int32 keyboard = 5;
1054
1055 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1056 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001057 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001058
1059 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1060 // 0 if undefined.
1061 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1062 optional int32 mcc = 7;
1063
1064 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1065 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1066 // MNC_ZERO symbol defined in Configuration.java.
1067 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1068 optional int32 mnc = 8;
1069
1070 // The kind of navigation available on the device.
1071 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1072 optional int32 navigation = 9;
1073
1074 // Flag indicating whether the navigation is available.
1075 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001076 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001077
1078 // Overall orientation of the screen.
1079 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1080 optional int32 orientation = 11;
1081
1082 // The current height of the available screen space, in dp units.
1083 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001084 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001085
1086 // Bit mask of overall layout of the screen.
1087 // Contains information about screen size, whether the screen is wider/taller
1088 // than normal, whether the screen layout is right-tl-left or left-to-right,
1089 // and whether the screen has a rounded shape.
1090 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001091 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001092
1093 // Current width of the available screen space, in dp units.
1094 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001095 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001096
1097 // The smallest screen size an application will see in normal operation.
1098 // This is the smallest value of both screenWidthDp and screenHeightDp
1099 // in portrait and landscape.
1100 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001101 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001102
1103 // The type of touch screen attached to the device.
1104 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1105 optional int32 touchscreen = 16;
1106
1107 // Bit mask of the ui mode.
1108 // Contains information about the overall ui mode of the device.
1109 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1110 // Also contains information about whether the device is in night mode.
1111 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001112 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001113}
1114
Tej Singheee317b2018-03-07 19:28:05 -08001115
1116/**
1117 * Logs changes in the connection state of the mobile radio.
1118 *
1119 * Logged from:
1120 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1121 */
1122message MobileConnectionStateChanged {
1123 // States are from the state machine DataConnection.java.
1124 enum State {
1125 UNKNOWN = 0;
1126 // The connection is inactive, or disconnected.
1127 INACTIVE = 1;
1128 // The connection is being activated, or connecting.
1129 ACTIVATING = 2;
1130 // The connection is active, or connected.
1131 ACTIVE = 3;
1132 // The connection is disconnecting.
1133 DISCONNECTING = 4;
1134 // The connection is disconnecting after creating a connection.
1135 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1136 }
1137 optional State state = 1;
1138 // For multi-sim phones, this distinguishes between the sim cards.
1139 optional int32 sim_slot_index = 2;
1140 // Used to identify the connection. Starts at 0 and increments by 1 for
1141 // every new network created. Resets whenever the device reboots.
1142 optional int32 data_connection_id = 3;
1143 // A bitmask for the capabilities of this connection.
1144 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1145 // Default value (if we have no information): 0
1146 optional int64 capabilities = 4;
1147 // If this connection has internet.
1148 // This just checks if the DEFAULT bit of capabilities is set.
1149 optional bool has_internet = 5;
1150}
1151
1152/**
1153 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1154 *
1155 * Logged from:
1156 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1157 */
1158message MobileRadioTechnologyChanged {
1159 optional android.telephony.NetworkTypeEnum state = 1;
1160 // For multi-sim phones, this distinguishes between the sim cards.
1161 optional int32 sim_slot_index = 2;
1162}
1163
Andrew Chantb56388b2018-03-22 21:07:33 -07001164/**
1165 * Logs the VID and PID of any connected USB devices.
1166 *
1167 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1168 *
1169 * Logged by Vendor.
1170 */
1171message UsbDeviceAttached {
1172 optional int32 vid = 1;
1173 optional int32 pid = 2;
1174 optional bool has_audio = 3;
1175 optional bool has_hid = 4;
1176 optional bool has_storage = 5;
1177}
1178
Tej Singheee317b2018-03-07 19:28:05 -08001179
Tej Singhdd7bd352018-02-09 19:33:15 -08001180/**
Tej Singh5d991e12018-03-09 19:48:11 -08001181 * Logs when Bluetooth is enabled and disabled.
1182 *
1183 * Logged from:
1184 * services/core/java/com/android/server/BluetoothManagerService.java
1185 */
1186message BluetoothEnabledStateChanged {
1187 repeated AttributionNode attribution_node = 1;
1188 // Whether or not bluetooth is enabled on the device.
1189 enum State {
1190 UNKNOWN = 0;
1191 ENABLED = 1;
1192 DISABLED = 2;
1193 }
1194 optional State state = 2;
1195 // The reason for being enabled/disabled.
1196 // Eg. Airplane mode, crash, application request.
1197 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1198 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001199 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001200}
1201
1202/**
1203 * Logs when a Bluetooth device connects and disconnects.
1204 *
1205 * Logged from:
1206 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1207 */
1208message BluetoothConnectionStateChanged {
1209 // The state of the connection.
1210 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1211 optional android.bluetooth.ConnectionStateEnum state = 1;
1212 // An identifier that can be used to match connect and disconnect events.
1213 // Currently is last two bytes of a hash of a device level ID and
1214 // the mac address of the bluetooth device that is connected.
1215 optional int32 obfuscated_id = 2;
1216 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1217 // From android.bluetooth.BluetoothAdapter.java
1218 optional int32 bt_profile = 3;
1219}
1220
1221/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001222 * Logs when something is plugged into or removed from the USB-C connector.
1223 *
1224 * Logged from:
1225 * Vendor USB HAL.
1226 */
1227message UsbConnectorStateChanged {
1228 enum State {
1229 DISCONNECTED = 0;
1230 CONNECTED = 1;
1231 }
1232 optional State state = 1;
1233}
1234
1235/**
1236 * Logs the reported speaker impedance.
1237 *
1238 * Logged from:
1239 * Vendor audio implementation.
1240 */
1241message SpeakerImpedanceReported {
1242 optional int32 speaker_location = 1;
1243 optional int32 impedance = 2;
1244}
1245
1246/**
1247 * Logs the report of a failed hardware.
1248 *
1249 * Logged from:
1250 * Vendor HALs.
1251 *
1252 */
1253message HardwareFailed {
1254 enum HardwareType {
1255 HARDWARE_FAILED_UNKNOWN = 0;
1256 HARDWARE_FAILED_MICROPHONE = 1;
1257 HARDWARE_FAILED_CODEC = 2;
1258 HARDWARE_FAILED_SPEAKER = 3;
1259 HARDWARE_FAILED_FINGERPRINT = 4;
1260 }
1261 optional HardwareType hardware_type = 1;
1262
1263 /* hardware_location allows vendors to differentiate between multiple instances of
1264 * the same hardware_type. The specific locations are vendor defined integers,
1265 * referring to board-specific numbering schemes.
1266 */
1267 optional int32 hardware_location = 2;
1268
1269 /* failure_code is specific to the HardwareType of the failed hardware.
1270 * It should use the enum values defined below.
1271 */
1272 enum MicrophoneFailureCode {
1273 MICROPHONE_FAILURE_COMPLETE = 0;
1274 }
1275 enum CodecFailureCode {
1276 CODEC_FAILURE_COMPLETE = 0;
1277 }
1278 enum SpeakerFailureCode {
1279 SPEAKER_FAILURE_COMPLETE = 0;
1280 SPEAKER_FAILURE_HIGH_Z = 1;
1281 SPEAKER_FAILURE_SHORT = 2;
1282 }
1283 enum FingerprintFailureCode {
1284 FINGERPRINT_FAILURE_COMPLETE = 0;
1285 FINGERPRINT_SENSOR_BROKEN = 1;
1286 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1287 }
1288 optional int32 failure_code = 3;
1289}
1290
1291/**
1292 * Log an event when the device has been physically dropped.
1293 * Reported from the /vendor partition.
1294 */
1295message PhysicalDropDetected {
1296 // Confidence that the event was actually a drop, 0 -> 100
1297 optional int32 confidence_pctg = 1;
1298 // Peak acceleration of the drop, in 1/1000s of a g.
1299 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001300 // Duration of freefall in ms
1301 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001302}
1303
1304/**
1305 * Log bucketed battery charge cycles.
1306 *
1307 * Each bucket represents cycles of the battery past
1308 * a given charge point. For example, bucket 1 is the
1309 * lowest 1/8th of the battery, and bucket 8 is 100%.
1310 *
1311 * Logged from:
1312 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1313 */
1314message ChargeCyclesReported {
1315 optional int32 cycle_bucket_1 = 1;
1316 optional int32 cycle_bucket_2 = 2;
1317 optional int32 cycle_bucket_3 = 3;
1318 optional int32 cycle_bucket_4 = 4;
1319 optional int32 cycle_bucket_5 = 5;
1320 optional int32 cycle_bucket_6 = 6;
1321 optional int32 cycle_bucket_7 = 7;
1322 optional int32 cycle_bucket_8 = 8;
1323}
1324
1325/**
Howard Roa46b6582018-09-18 16:45:02 -07001326 * Log battery health snapshot.
1327 *
1328 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1329 * are snapshotted periodically over 24hrs.
1330 */
1331message BatteryHealthSnapshot {
1332 enum BatterySnapshotType {
1333 UNKNOWN = 0;
1334 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1335 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1336 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1337 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1338 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1339 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1340 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1341 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1342 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1343 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1344 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1345 }
1346 optional BatterySnapshotType type = 1;
1347 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001348 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001349 // Voltage Battery Voltage, in microVolts.
1350 optional int32 voltage_micro_volt = 3;
1351 // Current Battery current, in microAmps.
1352 optional int32 current_micro_amps = 4;
1353 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1354 optional int32 open_circuit_micro_volt = 5;
1355 // Resistance Battery Resistance, in microOhms.
1356 optional int32 resistance_micro_ohm = 6;
1357 // Level Battery Level, as % of full.
1358 optional int32 level_percent = 7;
1359}
1360
1361/**
1362 * Log slow I/O operations on the primary storage.
1363 */
1364message SlowIo {
1365 // Classifications of IO Operations.
1366 enum IoOperation {
1367 UNKNOWN = 0;
1368 READ = 1;
1369 WRITE = 2;
1370 UNMAP = 3;
1371 SYNC = 4;
1372 }
1373 optional IoOperation operation = 1;
1374
1375 // The number of slow IO operations of this type over 24 hours.
1376 optional int32 count = 2;
1377}
1378
1379/**
1380 * Log battery caused shutdown with the last recorded voltage.
1381 */
1382message BatteryCausedShutdown {
1383 // The last recorded battery voltage prior to shutdown.
1384 optional int32 last_recorded_micro_volt = 1;
1385}
1386
1387/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001388 * Logs the duration of a davey (jank of >=700ms) when it occurs
1389 *
1390 * Logged from:
1391 * frameworks/base/libs/hwui/JankTracker.cpp
1392 */
1393message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001394 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001395 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001396
Tej Singhbb8554a2018-01-26 11:59:14 -08001397 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001398 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001399}
1400
1401/**
Bookatze5885242017-10-24 20:10:31 -07001402 * Logs phone signal strength changes.
1403 *
1404 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001405 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001406 */
1407message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001408 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1409 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001410}
1411
Yangster4ccebea2018-10-09 17:09:02 -07001412
1413/**
1414 * Logs when the phone state, sim state or signal strength changes
1415 *
1416 * Logged from:
1417 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1418 */
1419message PhoneServiceStateChanged {
1420 optional android.telephony.ServiceStateEnum state = 1;
1421 optional android.telephony.SimStateEnum sim_state = 2;
1422 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1423}
1424
1425/**
1426 * Logs when the phone becomes on or off.
1427 *
1428 * Logged from:
1429 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1430 */
1431message PhoneStateChanged {
1432 enum State {
1433 OFF = 0;
1434 ON = 1;
1435 }
1436 optional State state = 1;
1437}
1438
David Chenc28b2bb2017-10-24 12:52:52 -07001439/**
1440 * Logs that a setting was updated.
1441 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001442 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001443 * The tag and is_default allow resetting of settings to default values based on the specified
1444 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1445 */
1446message SettingChanged {
1447 // The name of the setting.
1448 optional string setting = 1;
1449
1450 // The change being imposed on this setting. May represent a number, eg "3".
1451 optional string value = 2;
1452
1453 // The new value of this setting. For most settings, this is same as value. For some settings,
1454 // value is +X or -X where X represents an element in a set. For example, if the previous value
1455 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1456 // The +/- feature is currently only used for location_providers_allowed.
1457 optional string new_value = 3;
1458
1459 // The previous value of this setting.
1460 optional string prev_value = 4;
1461
1462 // The tag used with the is_default for resetting sets of settings. This is generally null.
1463 optional string tag = 5;
1464
Bookatz90867622018-01-31 15:05:57 -08001465 // True if this setting with tag should be resettable.
1466 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001467
David Chenbd789912018-03-16 17:19:55 -07001468 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001469 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001470
1471 enum ChangeReason {
1472 UPDATED = 1; // Updated can be an insertion or an update.
1473 DELETED = 2;
1474 }
1475 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001476}
Chenjie Yub3dda412017-10-24 13:41:59 -07001477
Chenjie Yu05013b32017-11-21 10:21:41 -08001478/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001479 * Logs activity going to foreground or background
1480 *
1481 * Logged from:
1482 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1483 */
1484message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001485 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001486 optional string pkg_name = 2;
1487 optional string class_name = 3;
1488
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001489 enum State {
1490 BACKGROUND = 0;
1491 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001492 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001493 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001494}
David Chenc8a43242017-10-17 16:23:28 -07001495
1496/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001497 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001498 * Logged from:
1499 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1500 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001501message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001502 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001503
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001504 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001505
1506 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001507 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001508 optional string process_name = 3;
1509
1510 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001511 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001512
1513 optional string package_name = 5;
1514
1515 enum InstantApp {
1516 UNAVAILABLE = 0;
1517 FALSE = 1;
1518 TRUE = 2;
1519 }
1520 optional InstantApp is_instant_app = 6;
1521
1522 enum ForegroundState {
1523 UNKNOWN = 0;
1524 BACKGROUND = 1;
1525 FOREGROUND = 2;
1526 }
1527 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001528}
David Chen9e3808c2017-11-20 17:25:34 -08001529
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001530/**
1531 * Logs when a WTF (What a Terrible Failure) happened.
1532 * Logged from:
1533 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1534 */
1535message WTFOccurred {
1536 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001537
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001538 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001539
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001540 // The name of the process.
1541 // system_server if it is not by an app
1542 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001543
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001544 // The pid if available. -1 means not available.
1545 optional sint32 pid = 4;
1546}
1547
1548/**
1549 * Logs when system server reports low memory.
1550 * Logged from:
1551 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1552 */
1553message LowMemReported {
1554}
1555
1556/**
1557 * Logs when an app ANR (App Not Responding) occurs.
1558 * Logged from:
1559 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1560 */
1561message ANROccurred {
1562 optional int32 uid = 1 [(is_uid) = true];
1563
1564 optional string process_name = 2;
1565
1566 optional string short_component_name = 3;
1567
1568 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001569
1570 enum InstantApp {
1571 UNAVAILABLE = 0;
1572 FALSE = 1;
1573 TRUE = 2;
1574 }
1575 optional InstantApp is_instant_app = 5;
1576
1577 enum ForegroundState {
1578 UNKNOWN = 0;
1579 BACKGROUND = 1;
1580 FOREGROUND = 2;
1581 }
1582 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001583}
1584
Bookatza7020bd2018-08-28 16:29:35 -07001585/**
1586 * Logs when the vibrator state changes.
1587 * Logged from:
1588 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1589 */
1590message VibratorStateChanged {
1591 repeated AttributionNode attribution_node = 1;
1592
1593 enum State {
1594 OFF = 0;
1595 ON = 1;
1596 }
1597 optional State state = 2;
1598
1599 // Duration (in milliseconds) requested to keep the vibrator on.
1600 // Only applicable for State == ON.
1601 optional int64 duration_millis = 3;
1602}
1603
David Chen0a368b22017-12-06 16:28:16 -08001604/*
1605 * Allows other apps to push events into statsd.
1606 * Logged from:
1607 * frameworks/base/core/java/android/util/StatsLog.java
1608 */
David Chen0b5c90c2018-01-25 16:51:49 -08001609message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001610 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001611 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001612
1613 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1614 optional int32 label = 2;
1615
1616 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1617 // predicates for the metrics).
1618 enum State {
1619 UNKNOWN = 0;
1620 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1621 STOP = 2;
1622 START = 3;
1623 }
1624 optional State state = 3;
1625}
1626
David Chen9e3808c2017-11-20 17:25:34 -08001627/**
Bookatz7948c872018-09-04 12:58:33 -07001628 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1629 * For example, this could be due to the user manually changing the time.
1630 *
1631 * Logged from:
1632 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1633 */
1634message WallClockTimeShifted {
1635 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1636 optional int64 wall_clock_timestamp_millis = 1;
1637}
1638
1639/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001640 * Logs when statsd detects an anomaly.
1641 *
1642 * Logged from:
1643 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1644 */
1645message AnomalyDetected {
1646 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001647 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001648
Yangster-mac94e197c2018-01-02 16:03:03 -08001649 // Id of the config whose anomaly detection alert fired.
1650 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001651
Yangster-mac94e197c2018-01-02 16:03:03 -08001652 // Id of the alert (i.e. name of the anomaly that was detected).
1653 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001654}
1655
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001656message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001657 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001658 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001659
1660 // The app package name.
1661 optional string pkg_name = 2;
1662
1663 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001664 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001665 WARM = 1;
1666 HOT = 2;
1667 COLD = 3;
1668 }
1669 // The transition type.
1670 optional TransitionType type = 3;
1671
1672 // The activity name.
1673 optional string activity_name = 4;
1674
1675 // The name of the calling app. Empty if not set.
1676 optional string calling_pkg_name = 5;
1677
1678 // Whether the app is an instant app.
1679 optional bool is_instant_app = 6;
1680
1681 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001682 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001683
Bookatz80d11a02018-01-16 10:46:35 -08001684 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001685
David Chen0b5c90c2018-01-25 16:51:49 -08001686 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001687 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001688 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001689 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001690 optional int32 bind_application_delay_millis = 11;
1691 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001692
1693 // Empty if not set.
1694 optional string launch_token = 13;
1695
Calin Juravle759fbda2018-02-20 19:52:30 +00001696 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001697 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001698
1699 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001700 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001701}
1702
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001703message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001704 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001705 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001706
1707 // The app package name.
1708 optional string pkg_name = 2;
1709
1710 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001711 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001712 WARM = 1;
1713 HOT = 2;
1714 COLD = 3;
1715 }
1716 // The transition type.
1717 optional TransitionType type = 3;
1718
1719 // The activity name.
1720 optional string activity_name = 4;
1721}
1722
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001723message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001724 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001725 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001726
1727 // The app package name.
1728 optional string pkg_name = 2;
1729
1730 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001731 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001732 WITH_BUNDLE = 1;
1733 WITHOUT_BUNDLE = 2;
1734 }
1735 // The transition type.
1736 optional TransitionType type = 3;
1737
1738 // The activity name.
1739 optional string activity_name = 4;
1740
1741 optional bool transition_process_running = 5;
1742
1743 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001744 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001745}
1746
Bookatz8fcd09a2017-12-18 13:01:10 -08001747/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001748 * Logs a picture-in-picture action
1749 * Logged from:
1750 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1751 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1752 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1753 */
1754message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001755 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001756 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001757
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001758 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001759
Chenjie Yu52cacc62017-12-08 18:11:45 -08001760 enum State {
1761 ENTERED = 1;
1762 EXPANDED_TO_FULL_SCREEN = 2;
1763 MINIMIZED = 3;
1764 DISMISSED = 4;
1765 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001766 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001767}
1768
1769/**
Chenjie Yue8904192017-12-08 19:12:57 -08001770 * Logs overlay action
1771 * Logged from:
1772 * services/core/java/com/android/server/wm/Session.java
1773 */
1774message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001776
1777 optional string package_name = 2;
1778
1779 optional bool using_alert_window = 3;
1780
1781 enum State {
1782 ENTERED = 1;
1783 EXITED = 2;
1784 }
1785 optional State state = 4;
1786}
1787
Chenjie Yuccfe6452018-01-30 11:33:21 -08001788/*
1789 * Logs foreground service starts and stops.
1790 * Note that this is not when a service starts or stops, but when it is
1791 * considered foreground.
1792 * Logged from
1793 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1794 */
1795message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001796 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001797 // package_name + "/" + class_name
1798 optional string short_name = 2;
1799
1800 enum State {
1801 ENTER = 1;
1802 EXIT = 2;
1803 }
1804 optional State state = 3;
1805}
1806
Chenjie Yue8904192017-12-08 19:12:57 -08001807/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001808 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1809 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1810 * attributed back to the parent (host) uid. One example is Chrome.
1811 *
1812 * Logged from:
1813 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1814 */
1815message IsolatedUidChanged {
1816 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001817 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001818 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001819 optional int32 parent_uid = 1;
1820
1821 optional int32 isolated_uid = 2;
1822
1823 // We expect an isolated uid to be removed before if it's used for another parent uid.
1824 enum Event {
1825 REMOVED = 0;
1826 CREATED = 1;
1827 }
1828 optional Event event = 3;
1829}
1830
1831/*
1832 * Logs the reception of an incoming network packet causing the main system to wake up for
1833 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1834 * and processed by WakeupController.cpp.
1835 */
1836message PacketWakeupOccurred {
1837 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1838 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001839 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001840 // The interface name on which the packet was received.
1841 optional string iface = 2;
1842 // The ethertype value of the packet.
1843 optional int32 ethertype = 3;
1844 // String representation of the destination MAC address of the packet.
1845 optional string destination_hardware_address = 4;
1846 // String representation of the source address of the packet if this was an IP packet.
1847 optional string source_ip = 5;
1848 // String representation of the destination address of the packet if this was an IP packet.
1849 optional string destination_ip = 6;
1850 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1851 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1852 // families.
1853 optional int32 ip_next_header = 7;
1854 // The source port if this was a TCP or UDP packet.
1855 optional int32 source_port = 8;
1856 // The destination port if this was a TCP or UDP packet.
1857 optional int32 destination_port = 9;
1858}
1859
1860/*
1861 * Logs the memory stats for an app on startup.
1862 * Logged from:
1863 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1864 */
1865message AppStartMemoryStateCaptured {
1866 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001868
1869 // The process name.
1870 optional string process_name = 2;
1871
1872 // The activity name.
1873 optional string activity_name = 3;
1874
1875 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001876 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001877
1878 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001879 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001880
1881 // RSS
1882 optional int64 rss_in_bytes = 6;
1883
1884 // CACHE
1885 optional int64 cache_in_bytes = 7;
1886
1887 // SWAP
1888 optional int64 swap_in_bytes = 8;
1889}
1890
1891/*
1892 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1893 * for LMK event.
1894 * Logged from:
1895 * system/core/lmkd/lmkd.c
1896 */
1897message LmkStateChanged {
1898 enum State {
1899 UNKNOWN = 0;
1900 START = 1;
1901 STOP = 2;
1902 }
1903 optional State state = 1;
1904}
1905
1906/*
1907 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1908 * Logged from:
1909 * system/core/lmkd/lmkd.c
1910 */
1911message LmkKillOccurred {
1912 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001913 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001914
1915 // The process name.
1916 optional string process_name = 2;
1917
1918 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07001919 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001920
1921 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001922 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001923
1924 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001925 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001926
1927 // RSS
1928 optional int64 rss_in_bytes = 6;
1929
1930 // CACHE
1931 optional int64 cache_in_bytes = 7;
1932
1933 // SWAP
1934 optional int64 swap_in_bytes = 8;
1935}
1936
Rajeev Kumar51b54602018-03-01 12:18:26 -08001937/*
1938 * Logs when the ActivityManagerService detects that an app died.
1939 *
1940 * Logged from:
1941 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1942 */
1943message AppDied {
1944 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07001945 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001946}
1947
Howard Ro21a039c2018-08-06 14:55:47 -07001948/**
1949 * An atom for generic metrics logging. Available from Android Q.
1950 */
1951message GenericAtom {
1952 // The uid of the application that sent this custom atom.
1953 optional int32 uid = 1 [(is_uid) = true];
1954
1955 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07001956 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07001957}
1958
Tej Singhd6d6d772018-09-05 17:41:25 -07001959/**
1960 * Logs when a fingerprint acquire event occurs.
1961 *
1962 * Logged from:
1963 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1964 */
1965message FingerprintAcquired {
1966 // The associated user. Eg: 0 for owners, 10+ for others.
1967 // Defined in android/os/UserHandle.java
1968 optional int32 user = 1;
1969 // If this acquire is for a crypto fingerprint.
1970 // e.g. Secure purchases, unlock password storage.
1971 optional bool is_crypto = 2;
1972}
1973
1974/**
1975 * Logs when a fingerprint authentication event occurs.
1976 *
1977 * Logged from:
1978 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1979 */
1980message FingerprintAuthenticated {
1981 // The associated user. Eg: 0 for owners, 10+ for others.
1982 // Defined in android/os/UserHandle.java
1983 optional int32 user = 1;
1984 // If this authentication is for a crypto fingerprint.
1985 // e.g. Secure purchases, unlock password storage.
1986 optional bool is_crypto = 2;
1987 // Whether or not this authentication was successful.
1988 optional bool is_authenticated = 3;
1989}
1990
1991/**
1992 * Logs when a fingerprint error occurs.
1993 *
1994 * Logged from:
1995 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
1996 */
1997message FingerprintErrorOccurred {
1998 // The associated user. Eg: 0 for owners, 10+ for others.
1999 // Defined in android/os/UserHandle.java
2000 optional int32 user = 1;
2001 // If this error is for a crypto fingerprint.
2002 // e.g. Secure purchases, unlock password storage.
2003 optional bool is_crypto = 2;
2004
2005 enum Error {
2006 UNKNOWN = 0;
2007 LOCKOUT = 1;
2008 PERMANENT_LOCKOUT = 2;
2009 }
2010 // The type of error.
2011 optional Error error = 3;
2012}
Howard Ro688ae182018-09-25 00:09:36 -07002013
2014message Notification {
2015
2016 // Type of notification event.
2017 enum Type {
2018 TYPE_UNKNOWN = 0;
2019 // Notification became visible to the user.
2020 TYPE_OPEN = 1;
2021 // Notification became hidden.
2022 TYPE_CLOSE = 2;
2023 // Notification switched to detail mode.
2024 TYPE_DETAIL = 3;
2025 // Notification was clicked.
2026 TYPE_ACTION = 4;
2027 // Notification was dismissed.
2028 TYPE_DISMISS = 5;
2029 // Notification switched to summary mode. The enum value of 14 is to
2030 // match that of metrics_constants.
2031 TYPE_COLLAPSE = 14;
2032 }
2033 optional Type type = 1;
2034
2035 // Package name associated with the notification.
2036 optional string package_name = 2;
2037
2038 // Tag associated with notification.
2039 optional string tag = 3;
2040
2041 // Application-supplied ID associated with the notification.
2042 optional int32 id = 4;
2043
2044 // Index of notification in the notification panel.
2045 optional int32 shade_index = 5;
2046
2047 // The number of notifications in the notification panel.
2048 optional int32 shade_count = 6;
2049
2050 // Importance for the notification.
2051 optional int32 importance = 7;
2052
2053 // ID for the notification channel.
2054 optional int32 channel_id = 8;
2055
2056 // Importance for the notification channel.
2057 optional int32 channel_importance = 9;
2058
2059 // Whether notification was a group summary.
2060 optional bool group_summary = 10;
2061
2062 // Time since notification was created in milliseconds.
2063 optional int64 since_create_millis = 11;
2064
2065 // Time since notification was interrupted in milliseconds.
2066 optional int64 since_interruption_millis = 12;
2067
2068 // Time since notification was updated in milliseconds.
2069 optional int64 since_update_millis = 13;
2070
2071 // Time since notification was visible in milliseconds.
2072 optional int64 since_visible_millis = 14;
2073}
2074
2075
Chenjie Yubbcbc602018-02-05 16:51:52 -08002076//////////////////////////////////////////////////////////////////////
2077// Pulled atoms below this line //
2078//////////////////////////////////////////////////////////////////////
2079
2080/**
David Chenc8a43242017-10-17 16:23:28 -07002081 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2082 *
2083 * Pulled from:
2084 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2085 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002086message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002087 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002088
2089 optional int64 rx_bytes = 2;
2090
2091 optional int64 rx_packets = 3;
2092
2093 optional int64 tx_bytes = 4;
2094
2095 optional int64 tx_packets = 5;
2096}
2097
2098/**
2099 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2100 *
2101 * Pulled from:
2102 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2103 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002104message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002105 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002106
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002107 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2108 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002109
2110 optional int64 rx_bytes = 3;
2111
2112 optional int64 rx_packets = 4;
2113
2114 optional int64 tx_bytes = 5;
2115
2116 optional int64 tx_packets = 6;
2117}
2118
2119/**
2120 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2121 *
2122 * Pulled from:
2123 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2124 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002125message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002126 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002127
2128 optional int64 rx_bytes = 2;
2129
2130 optional int64 rx_packets = 3;
2131
2132 optional int64 tx_bytes = 4;
2133
2134 optional int64 tx_packets = 5;
2135}
2136
2137/**
2138 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2139 *
2140 * Pulled from:
2141 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2142 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002143message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002144 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002145
Yao Chenc40a19d2018-03-15 16:48:25 -07002146 // 1 denotes foreground and 0 denotes background. This is called Set in
2147 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002148 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002149
2150 optional int64 rx_bytes = 3;
2151
2152 optional int64 rx_packets = 4;
2153
2154 optional int64 tx_bytes = 5;
2155
2156 optional int64 tx_packets = 6;
2157}
2158
2159/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002160 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2161 *
2162 * Pulled from:
2163 * StatsCompanionService
2164 */
2165message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002166 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002167
2168 optional int64 rx_bytes = 2;
2169
2170 optional int64 tx_bytes = 3;
2171}
2172
2173/**
David Chenc8a43242017-10-17 16:23:28 -07002174 * Pulls the kernel wakelock durations. This atom is adapted from
2175 * android/internal/os/KernelWakelockStats.java
2176 *
2177 * Pulled from:
2178 * StatsCompanionService using KernelWakelockReader.
2179 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002180message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002181 optional string name = 1;
2182
2183 optional int32 count = 2;
2184
2185 optional int32 version = 3;
2186
Yangster-maca8a30442018-10-13 23:46:34 -07002187 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002188}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002189
Chenjie Yu05013b32017-11-21 10:21:41 -08002190/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002191 * Pulls low power state information. This includes platform and subsystem sleep state information,
2192 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002193 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002194 * hardware/interfaces/power/1.1/types.hal
2195 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002196message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002197 // Subsystem name
2198 optional string subsystem_name = 1;
2199 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2200 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2201 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002202 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002203 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002204 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002205 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002206}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002207
Chenjie Yu05013b32017-11-21 10:21:41 -08002208/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002209 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002210 * Pulls the time the cpu spend on the frequency index. Frequency index
2211 * starts from highest to lowest. The value should be monotonically
2212 * increasing since boot. However, if there is a cpu
2213 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002214 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002215message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002216 optional uint32 cluster = 1;
2217 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002218 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002219}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002220
Chenjie Yu05013b32017-11-21 10:21:41 -08002221/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002222 * Pulls Cpu Time Per Uid.
2223 * Note that isolated process uid time should be attributed to host uids.
2224 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002225message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002226 optional int32 uid = 1 [(is_uid) = true];
David Chen0b5c90c2018-01-25 16:51:49 -08002227 optional uint64 user_time_millis = 2;
2228 optional uint64 sys_time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002229}
2230
2231/**
2232 * Pulls Cpu Time Per Uid per frequency.
2233 * Note that isolated process uid time should be attributed to host uids.
2234 * For each uid, we order the time by descending frequencies.
2235 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002236message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002237 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002238 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002239 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002240}
Hugo Benichi884970e2017-11-14 22:42:46 +09002241
Chenjie Yu05013b32017-11-21 10:21:41 -08002242/**
2243 * Pulls Wifi Controller Activity Energy Info
2244 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002245message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002246 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002247 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002248 // stack reported state
2249 // TODO: replace this with proto enum
2250 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002251 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002252 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002253 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002254 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002255 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002256 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002257 // product of current(mA), voltage(V) and time(ms)
2258 optional uint64 controller_energy_used = 6;
2259}
2260
2261/**
2262 * Pulls Modem Activity Energy Info
2263 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002264message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002265 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002266 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002267 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002268 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002269 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002270 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002271 /**
2272 * Tx power index
2273 * index 0 = tx_power < 0dBm
2274 * index 1 = 0dBm < tx_power < 5dBm
2275 * index 2 = 5dBm < tx_power < 15dBm
2276 * index 3 = 15dBm < tx_power < 20dBm
2277 * index 4 = tx_power > 20dBm
2278 */
2279 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002280 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002281 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002282 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002283 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002284 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002285 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002286 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002287 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002288 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002289 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002290 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002291 // product of current(mA), voltage(V) and time(ms)
2292 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002293}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002294
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002295/**
2296 * Pulls Bluetooth Activity Energy Info
2297 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2298 */
2299message BluetoothActivityInfo {
2300 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002301 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002302 // bluetooth stack state
2303 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002304 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002305 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002306 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002307 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002308 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002309 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002310 // product of current(mA), voltage(V) and time(ms)
2311 optional uint64 energy_used = 6;
2312}
2313
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002314/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002315 * Logs the memory stats for a process.
2316 */
2317message ProcessMemoryState {
2318 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002319 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002320
2321 // The process name.
2322 optional string process_name = 2;
2323
2324 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002325 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002326
2327 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002328 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002329
2330 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002331 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002332
Rajeev Kumar90235992018-01-29 11:06:48 -08002333 // RSS
2334 optional int64 rss_in_bytes = 6;
2335
2336 // CACHE
2337 optional int64 cache_in_bytes = 7;
2338
2339 // SWAP
2340 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002341
2342 // RSS high watermark.
2343 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2344 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2345 optional int64 rss_high_watermark_in_bytes = 9;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002346}
2347
2348/*
Rafal Slawik08621582018-10-15 14:53:07 +01002349 * Logs the memory stats for a native process (from procfs).
2350 */
2351message NativeProcessMemoryState {
2352 // The uid if available. -1 means not available.
2353 optional int32 uid = 1 [(is_uid) = true];
2354
2355 // The process name.
2356 optional string process_name = 2;
2357
2358 // # of page-faults
2359 optional int64 pgfault = 3;
2360
2361 // # of major page-faults
2362 optional int64 pgmajfault = 4;
2363
2364 // RSS
2365 optional int64 rss_in_bytes = 5;
2366
2367 // RSS high watermark.
2368 // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
2369 // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
2370 optional int64 rss_high_watermark_in_bytes = 6;
2371}
2372
2373/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002374 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002375 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002376message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002377 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002378}
2379
2380/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002381 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002382 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002383message SystemUptime {
2384 // Milliseconds since the system was booted.
2385 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2386 // for external input).
2387 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002388 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002389}
2390
2391/*
2392 * Reads from /proc/uid_concurrent_active_time which has the format:
2393 * active: X (X is # cores)
2394 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2395 * [uid1]: [time-0] [time-1] [time-2] ... ...
2396 * ...
2397 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2398 * The file contains a monotonically increasing count of time for a single boot.
2399 */
2400message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002401 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002402 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002403}
2404
2405/**
2406 * Reads from /proc/uid_concurrent_policy_time which has the format:
2407 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2408 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2409 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2410 * ...
2411 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2412 * The file contains a monotonically increasing count of time for a single boot.
2413 */
2414message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002415 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002416 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002417 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002418}
2419
2420/*
2421 * Pulls free disk space, for data, system partition and temporary directory.
2422 */
2423message DiskSpace {
2424 // available bytes in data partition
2425 optional uint64 data_available_bytes = 1;
2426 // available bytes in system partition
2427 optional uint64 system_available_bytes = 2;
2428 // available bytes in download cache or temp directories
2429 optional uint64 temp_available_bytes = 3;
2430}
Tej Singhbf972d92018-01-10 20:51:13 -08002431
2432/**
2433 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002434 * Pulled from:
2435 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002436 */
2437message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002438 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002439}
2440
2441/**
2442 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002443 * Pulled from:
2444 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002445 */
2446message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002447 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002448}
2449
2450/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002451 * Pulls battery voltage.
2452 * Pulled from:
2453 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2454 */
2455message BatteryVoltage {
2456 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002457 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002458}
2459
2460/**
Tej Singhd89137e2018-03-26 14:51:40 -07002461 * Pulls the temperature of various parts of the device.
2462 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002463 *
2464 * Pulled from:
2465 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2466 */
2467message Temperature {
2468 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2469 optional android.os.TemperatureTypeEnum sensor_location = 1;
2470
2471 // The name of the temperature source. Eg. CPU0
2472 optional string sensor_name = 2;
2473
Tej Singhd89137e2018-03-26 14:51:40 -07002474 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002475 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002476}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002477
2478/**
2479 * Pulls the statistics of calls to Binder.
2480 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002481 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2482 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002483 *
2484 * Next tag: 14
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002485 */
2486message BinderCalls {
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002487 optional int32 uid = 1 [(is_uid) = true];
2488 // Fully qualified class name of the API call.
2489 //
2490 // This is a system server class name.
2491 //
2492 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2493 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2494 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2495 // commonly used APIs.
2496 optional string service_class_name = 2;
2497 // Method name of the API call. It can also be a transaction code if we cannot
2498 // resolve it to a name. See Binder#getTransactionName.
2499 //
2500 // This is a system server method name.
2501 optional string service_method_name = 3;
2502 // Total number of API calls.
2503 optional int64 call_count = 4;
2504 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2505 optional bool screen_interactive = 13;
2506 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2507 // call_count will be equal to recorded_call_count.
2508 //
2509 // If recorded_call_count is different than call_count, it means data collection has been
2510 // sampled. All the fields below will be sampled in this case.
2511 optional int64 recorded_call_count = 12;
2512 // Number of exceptions thrown by the API.
2513 optional int64 recorded_exception_count = 5;
2514 // Total latency of all API calls.
2515 // Average can be computed using total_latency_micros / recorded_call_count.
2516 optional int64 recorded_total_latency_micros = 6;
2517 // Maximum latency of one API call.
2518 optional int64 recorded_max_latency_micros = 7;
2519 // Total CPU usage of all API calls.
2520 // Average can be computed using total_cpu_micros / recorded_call_count.
2521 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2522 optional int64 recorded_total_cpu_micros = 8;
2523 // Maximum CPU usage of one API call.
2524 optional int64 recorded_max_cpu_micros = 9;
2525 // Maximum parcel reply size of one API call.
2526 optional int64 recorded_max_reply_size_bytes = 10;
2527 // Maximum parcel request size of one API call.
2528 optional int64 recorded_max_request_size_bytes = 11;
2529}
2530
2531/**
2532 * Pulls the statistics of exceptions during calls to Binder.
2533 *
2534 * Binder stats are cumulative from boot unless somebody reset the data using
2535 * > adb shell dumpsys binder_calls_stats --reset
2536 */
2537message BinderCallsExceptions {
2538 // Exception class name, e.g. java.lang.IllegalArgumentException.
2539 //
2540 // This is an exception class name thrown by the system server.
2541 optional string exception_class_name = 1;
2542 // Total number of exceptions.
2543 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002544}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002545
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002546/**
2547 * Pulls the statistics of message dispatching on HandlerThreads.
2548 *
2549 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2550 * config on the device.
2551 *
2552 * Next tag: 11
2553 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002554message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002555 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002556 optional int32 uid = 1 [(is_uid) = true];
2557
2558 // Fully qualified class name of the handler target class.
2559 //
2560 // This field does not contain PII. This is a system server class name.
2561 optional string handler_class_name = 2;
2562
2563 // The name of the thread that runs the Looper.
2564 //
2565 // This field does not contain PII. This is a system server thread name.
2566 optional string looper_thread_name = 3;
2567
2568 // The name of the dispatched message.
2569 //
2570 // This field does not contain PII. This is a system server constant or class
2571 // name.
2572 optional string message_name = 4;
2573
2574 // Total number of successfully dispatched messages.
2575 optional int64 message_count = 5;
2576
2577 // Total number of messages that failed dispatching.
2578 optional int64 exception_count = 6;
2579
2580 // Total number of processed messages we have data recorded for. If we
2581 // collected data for all the messages, message_count will be equal to
2582 // recorded_message_count.
2583 //
2584 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002585 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002586 optional int64 recorded_message_count = 7;
2587
2588 // Total latency of all processed messages.
2589 // Average can be computed using recorded_total_latency_micros /
2590 // recorded_message_count.
2591 optional int64 recorded_total_latency_micros = 8;
2592
2593 // Total CPU usage of all processed message.
2594 // Average can be computed using recorded_total_cpu_micros /
2595 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002596 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002597 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002598
2599 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2600 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002601
2602 // Max recorded CPU usage of all processed messages.
2603 optional int64 recorded_max_cpu_micros = 11;
2604
2605 // Max recorded latency of all processed messages.
2606 optional int64 recorded_max_latency_micros = 12;
2607
2608 // Total number of messages we tracked the dispatching delay for. If we
2609 // collected data for all the messages, message_count will be equal to
2610 // recorded_delay_message_count.
2611 //
2612 // If recorded_delay_message_count is different than message_count, it means data
2613 // collection has been sampled or/and not all messages specified the target dispatch time.
2614 // The fields below will be sampled in this case.
2615 optional int64 recorded_delay_message_count = 13;
2616
2617 // Total dispatching delay of all processed messages.
2618 // Calculated as a difference between the target dispatching time (Message.when)
2619 // and the actual dispatching time.
2620 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2621 optional int64 recorded_total_delay_millis = 14;
2622
2623 // Max dispatching delay of all processed messages.
2624 // Calculated as a difference between the target dispatching time (Message.when)
2625 // and the actual dispatching time.
2626 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002627}
Tej Singh86dc9db2018-09-06 00:39:57 +00002628
2629/**
2630 * Pulls disk information, such as write speed and latency.
2631 */
2632message DiskStats {
2633 // Time taken to open, write 512B to, and close a file.
2634 // -1 if error performing the check.
2635 optional int64 data_write_latency_millis = 1;
2636
2637 optional bool file_based_encryption = 2;
2638
2639 // Recent disk write speed in kB/s.
2640 // -1 if error querying storageed.
2641 // 0 if data is unavailable.
2642 optional int32 recent_disk_write_speed = 3;
2643}
2644
2645
2646/**
2647 * Free and total bytes of the Data, Cache, and System partition.
2648 */
2649message DirectoryUsage {
2650 enum Directory {
2651 UNKNOWN = 0;
2652 DATA = 1;
2653 CACHE = 2;
2654 SYSTEM = 3;
2655 }
2656 optional Directory directory = 1;
2657 optional int64 free_bytes = 2;
2658 optional int64 total_bytes = 3;
2659}
2660
2661
2662/**
2663 * Size of an application: apk size, data size, and cache size.
2664 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2665 * Information is only reported for apps with the primary user (user 0).
2666 * Sizes are aggregated by package name.
2667 */
2668message AppSize {
2669 // Including uids will involve modifying diskstats logic.
2670 optional string package_name = 1;
2671 // App size in bytes. -1 if unavailable.
2672 optional int64 app_size_bytes = 2;
2673 // App data size in bytes. -1 if unavailable.
2674 optional int64 app_data_size_bytes = 3;
2675 // App cache size in bytes. -1 if unavailable.
2676 optional int64 app_cache_size_bytes = 4;
2677 // Time that the cache file was produced.
2678 // Uses System.currentTimeMillis(), which is wall clock time.
2679 optional int64 cache_time_millis = 5;
2680}
2681
2682
2683/**
2684 * Size of a particular category. Eg: photos, videos.
2685 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2686 */
2687message CategorySize {
2688 enum Category {
2689 UNKNOWN = 0;
2690 APP_SIZE = 1;
2691 APP_DATA_SIZE = 2;
2692 APP_CACHE_SIZE = 3;
2693 PHOTOS = 4;
2694 VIDEOS = 5;
2695 AUDIO = 6;
2696 DOWNLOADS = 7;
2697 SYSTEM = 8;
2698 OTHER = 9;
2699 }
2700 optional Category category = 1;
2701 // Category size in bytes.
2702 optional int64 size_bytes = 2;
2703 // Time that the cache file was produced.
2704 // Uses System.currentTimeMillis(), which is wall clock time.
2705 optional int64 cache_time_millis = 3;
2706}
Tej Singhd6d6d772018-09-05 17:41:25 -07002707
2708/**
Tej Singhe7726dc2018-09-21 11:42:12 -07002709 * Pulls per uid I/O stats. The stats are cumulative since boot.
2710 *
2711 * Read/write bytes are I/O events from a storage device
2712 * Read/write chars are data requested by read/write syscalls, and can be
2713 * satisfied by caching.
2714 *
2715 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
2716 */
2717message DiskIo {
2718 optional int32 uid = 1 [(is_uid) = true];
2719 optional int64 fg_chars_read = 2;
2720 optional int64 fg_chars_write = 3;
2721 optional int64 fg_bytes_read = 4;
2722 optional int64 fg_bytes_write = 5;
2723 optional int64 bg_chars_read = 6;
2724 optional int64 bg_chars_write = 7;
2725 optional int64 bg_bytes_read = 8;
2726 optional int64 bg_bytes_write = 9;
2727 optional int64 fg_fsync = 10;
2728 optional int64 bg_fsync= 11;
2729}
2730
2731
2732/**
Tej Singhd6d6d772018-09-05 17:41:25 -07002733 * Pulls the number of fingerprints for each user.
2734 *
2735 * Pulled from StatsCompanionService, which queries FingerprintManager.
2736 */
2737message NumFingerprints {
2738 // The associated user. Eg: 0 for owners, 10+ for others.
2739 // Defined in android/os/UserHandle.java
2740 optional int32 user = 1;
2741 // Number of fingerprints registered to that user.
2742 optional int32 num_fingerprints = 2;
2743}
Chenjie Yu12e5e672018-09-14 15:54:59 -07002744
Yangsteraf9aee72018-10-12 09:26:16 -07002745message AggStats {
2746 optional int64 min = 1;
2747
2748 optional int64 average = 2;
2749
2750 optional int64 max = 3;
2751}
2752
2753message ProcessStatsStateProto {
2754 optional android.service.procstats.ScreenState screen_state = 1;
2755
2756 optional android.service.procstats.MemoryState memory_state = 2;
2757
2758 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
2759 // and not frameworks/base/core/java/android/app/ActivityManager.java
2760 optional android.service.procstats.ProcessState process_state = 3;
2761
2762 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002763 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002764
2765 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002766 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07002767
2768 // # of samples taken
2769 optional int32 sample_size = 5;
2770
2771 // PSS is memory reserved for this process
2772 optional AggStats pss = 6;
2773
2774 // USS is memory shared between processes, divided evenly for accounting
2775 optional AggStats uss = 7;
2776
2777 // RSS is memory resident for this process
2778 optional AggStats rss = 8;
2779}
2780
2781// Next Tag: 7
2782message ProcessStatsProto {
2783 // Name of process.
2784 optional string process = 1;
2785
2786 // Uid of the process.
2787 optional int32 uid = 2;
2788
2789 // Information about how often kills occurred
2790 message Kill {
2791 // Count of excessive CPU kills
2792 optional int32 cpu = 1;
2793
2794 // Count of kills when cached
2795 optional int32 cached = 2;
2796
2797 // PSS stats during cached kill
2798 optional AggStats cached_pss = 3;
2799 }
2800 optional Kill kill = 3;
2801
2802 // Time and memory spent in various states.
2803 repeated ProcessStatsStateProto states = 5;
2804
2805 // Total time process has been running... screen_state, memory_state, and process_state
2806 // will not be set.
2807 optional ProcessStatsStateProto total_running_state = 6;
2808}
2809
2810message PackageServiceOperationStatsProto {
2811 // Operate enum: Started, Foreground, Bound, Executing
2812 optional android.service.procstats.ServiceOperationState operation = 1;
2813
2814 // Number of times the service was in this operation.
2815 optional int32 count = 2;
2816
2817 // Information about a state the service can be in.
2818 message StateStats {
2819 // Screen state enum.
2820 optional android.service.procstats.ScreenState screen_state = 1;
2821 // Memory state enum.
2822 optional android.service.procstats.MemoryState memory_state = 2;
2823
2824 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07002825 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002826 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002827 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002828 }
2829 repeated StateStats state_stats = 3;
2830}
2831
2832message PackageServiceStatsProto {
2833 // Name of service component.
2834 optional string service_name = 1;
2835
2836 // The operation stats.
2837 // The package_name, package_uid, package_version, service_name will not be set to save space.
2838 repeated PackageServiceOperationStatsProto operation_stats = 2;
2839}
2840
2841message PackageAssociationSourceProcessStatsProto {
2842 // Uid of the process.
2843 optional int32 process_uid = 1;
2844 // Process name.
2845 optional string process_name = 2;
2846
2847 // Total count of the times this association appeared.
2848 optional int32 total_count = 3;
2849
2850 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07002851 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002852
2853 // Total count of the times this association became actively impacting its target process.
2854 optional int32 active_count = 5;
2855
2856 // Information on one source in this association.
2857 message StateStats {
2858 // Process state enum.
2859 optional android.service.procstats.ProcessState process_state = 1;
2860 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07002861 optional int64 duration_millis = 2;
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_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002864 }
2865 repeated StateStats active_state_stats = 6;
2866}
2867
2868message PackageAssociationProcessStatsProto {
2869 // Name of the target component.
2870 optional string component_name = 1;
2871 // Information on one source in this association.
2872 repeated PackageAssociationSourceProcessStatsProto sources = 2;
2873}
2874
2875
2876message ProcessStatsPackageProto {
2877 // Name of package.
2878 optional string package = 1;
2879
2880 // Uid of the package.
2881 optional int32 uid = 2;
2882
2883 // Version of the package.
2884 optional int64 version = 3;
2885
2886 // Stats for each process running with the package loaded in to it.
2887 repeated ProcessStatsProto process_stats = 4;
2888
2889 // Stats for each of the package's services.
2890 repeated PackageServiceStatsProto service_stats = 5;
2891
2892 // Stats for each association with the package.
2893 repeated PackageAssociationProcessStatsProto association_stats = 6;
2894}
2895
2896message ProcessStatsSectionProto {
2897 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002898 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07002899
2900 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002901 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07002902
2903 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002904 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07002905
2906 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07002907 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07002908
2909 // System runtime library. e.g. "libdvm.so", "libart.so".
2910 optional string runtime = 5;
2911
2912 // whether kernel reports swapped pss.
2913 optional bool has_swapped_pss = 6;
2914
2915 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
2916 enum Status {
2917 STATUS_UNKNOWN = 0;
2918 STATUS_COMPLETE = 1;
2919 STATUS_PARTIAL = 2;
2920 STATUS_SHUTDOWN = 3;
2921 STATUS_SYSPROPS = 4;
2922 }
2923 repeated Status status = 7;
2924
2925 // Stats for each process.
2926 repeated ProcessStatsProto process_stats = 8;
2927
2928 // Stats for each package.
2929 repeated ProcessStatsPackageProto package_stats = 9;
2930}
2931
Chenjie Yu12e5e672018-09-14 15:54:59 -07002932/**
2933 * Pulled from ProcessStatsService.java
2934 */
2935message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07002936 optional ProcessStatsSectionProto proc_stats_section = 1;
2937}
2938
2939message PowerProfileProto {
2940 optional double cpu_suspend = 1;
2941
2942 optional double cpu_idle = 2;
2943
2944 optional double cpu_active = 3;
2945
2946 message CpuCluster {
2947 optional int32 id = 1;
2948 optional double cluster_power = 2;
2949 optional int32 cores = 3;
2950 repeated int64 speed = 4;
2951 repeated double core_power = 5;
2952 }
2953
2954 repeated CpuCluster cpu_cluster = 40;
2955
2956 optional double wifi_scan = 4;
2957
2958 optional double wifi_on = 5;
2959
2960 optional double wifi_active = 6;
2961
2962 optional double wifi_controller_idle = 7;
2963
2964 optional double wifi_controller_rx = 8;
2965
2966 optional double wifi_controller_tx = 9;
2967
2968 repeated double wifi_controller_tx_levels = 10;
2969
2970 optional double wifi_controller_operating_voltage = 11;
2971
2972 optional double bluetooth_controller_idle = 12;
2973
2974 optional double bluetooth_controller_rx = 13;
2975
2976 optional double bluetooth_controller_tx = 14;
2977
2978 optional double bluetooth_controller_operating_voltage = 15;
2979
2980 optional double modem_controller_sleep = 16;
2981
2982 optional double modem_controller_idle = 17;
2983
2984 optional double modem_controller_rx = 18;
2985
2986 repeated double modem_controller_tx = 19;
2987
2988 optional double modem_controller_operating_voltage = 20;
2989
2990 optional double gps_on = 21;
2991
2992 repeated double gps_signal_quality_based = 22;
2993
2994 optional double gps_operating_voltage = 23;
2995
2996 optional double bluetooth_on = 24;
2997
2998 optional double bluetooth_active = 25;
2999
3000 optional double bluetooth_at_cmd = 26;
3001
3002 optional double ambient_display = 27;
3003
3004 optional double screen_on = 28;
3005
3006 optional double radio_on = 29;
3007
3008 optional double radio_scanning = 30;
3009
3010 optional double radio_active = 31;
3011
3012 optional double screen_full = 32;
3013
3014 optional double audio = 33;
3015
3016 optional double video = 34;
3017
3018 optional double flashlight = 35;
3019
3020 optional double memory = 36;
3021
3022 optional double camera = 37;
3023
3024 optional double wifi_batched_scan = 38;
3025
3026 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003027}
Chenjie Yuab530202018-09-26 12:39:20 -07003028
3029/**
3030 * power_profile.xml and other constants for power model calculations.
3031 * Pulled from PowerProfile.java
3032 */
3033message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003034 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003035}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003036
3037/**
3038 * Pulls process user time and system time. Puller takes a snapshot of all pids
3039 * in the system and returns cpu stats for those that are working at the time.
3040 * Dead pids will be dropped. Kernel processes are excluded.
3041 * Min cool-down is 5 sec.
3042 */
3043message ProcessCpuTime {
3044 optional int32 uid = 1 [(is_uid) = true];
3045
3046 optional string process_name = 2;
3047 // Process cpu time in user space, cumulative from boot/process start
3048 optional int64 user_time_millis = 3;
3049 // Process cpu time in system space, cumulative from boot/process start
3050 optional int64 system_time_millis = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003051}