blob: 230052684d6dce0e27d58283220e25a765b23971 [file] [log] [blame]
Maggie White5cf0fda2019-04-09 16:52:07 -07001/*
2 * Copyright (C) 2018 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";
18
19// C++ namespace: android::hardware::google::pixel::PixelAtoms
20package android.hardware.google.pixel.PixelAtoms;
21
22option java_package = "android.hardware.google.pixel";
23option java_outer_classname = "PixelAtoms";
24
25/*
26 * Please note that the following features are not currently supported by
27 * the IStats->reportVendorAtom implementation:
28 * - types outside of int, long, float, and string (ex. uint)
29 * - submessages within an atom
30 * - repeated fields - arrays must be unrolled
31 * - field # 1 - this will be occupied by the vendor namespace
32 */
33
Tej Singhb624a782021-07-02 15:19:29 -070034/* Allocated atom IDs. */
Jeffrey Huang74943082021-04-09 10:49:09 -070035message Atom {
36 oneof pushed {
37 // AOSP atom ID range starts at 105000
38 ChargeStats charge_stats = 105000;
39 VoltageTierStats voltage_tier_stats = 105001;
40 BatteryCapacity battery_capacity = 105002;
41 StorageUfsHealth storage_ufs_health = 105003;
42 F2fsStatsInfo f2fs_stats = 105004;
43 ZramMmStat zram_mm_stat = 105005;
44 ZramBdStat zram_bd_stat = 105006;
45 BootStatsInfo boot_stats = 105007;
46 WirelessChargingStats wireless_charging_stats = 105008;
47 DeviceOrientation device_orientation = 105009;
48 BatteryCapacityFG fg_capacity = 105010;
49 PdVidPid pd_vid_pid = 105011;
50 BatteryEEPROM battery_eeprom = 105012;
51 VendorSpeakerImpedance vendor_speaker_impedance = 105013; // moved from atoms.proto
52 StorageUfsResetCount ufs_reset_count = 105014;
53 PixelMmMetricsPerHour pixel_mm_metrics_per_hour = 105015;
54 PixelMmMetricsPerDay pixel_mm_metrics_per_day = 105016;
55 F2fsCompressionInfo f2fs_compression_info = 105017;
56 VendorChargeCycles vendor_charge_cycles = 105018; // moved from atoms.proto
57 VendorHardwareFailed vendor_hardware_failed = 105019; // moved from atoms.proto
58 VendorSlowIo vendor_slow_io = 105020; // moved from atoms.proto
59 VendorSpeechDspStat vendor_speech_dsp_stat = 105021; // moved from atoms.proto
60 VendorPhysicalDropDetected vendor_physical_drop_detected = 105022; // moved from atoms.proto
61 VendorUsbPortOverheat vendor_usb_port_overheat = 105023; // moved from atoms.proto
62 CmaStatus cma_status = 105024;
63 CmaStatusExt cma_status_ext = 105025;
64 VendorBatteryHealthSnapshot vendor_battery_health_snapshot = 105026; // moved from atoms.proto
65 VendorBatteryCausedShutdown vendor_battery_caused_shutdown = 105027; // moved from atoms.proto
Daeho Jeongb802fd42021-07-13 00:16:11 -070066 F2fsGcSegmentInfo f2fs_gc_segment_info = 105028;
George Lee73506ac2021-06-09 10:14:26 -070067 PowerMitigationStats mitigation_stats = 105029; // moved from atoms.proto
Stephane Lee46bfff72020-08-17 16:08:15 -070068
Jeffrey Huang74943082021-04-09 10:49:09 -070069 CitadelVersion citadel_version = 100018; // moved from vendor proprietary
70 CitadelEvent citadel_event = 100019; // moved from vendor proprietary
Roger Fang0ff3f5c2021-08-23 19:29:59 +080071 VendorSpeakerStatsReported vendor_speaker_stats_reported = 105030;
Arthur Ishiguro0a731b02021-12-13 17:39:26 +000072
73 ChreHalNanoappLoadFailed chre_hal_nanoapp_load_failed = 105031;
74 ChrePalOpenFailed chre_pal_open_failed = 105032;
75 ChreApiErrorCodeDistributionTaken chre_api_error_code_distribution_taken = 105033;
76 ChreDynamicMemorySnapshotReported chre_dynamic_memory_snapshot_reported = 105034;
77 ChreEventQueueSnapshotReported chre_event_queue_snapshot_reported = 105035;
78 ChreApWakeUpOccurred chre_ap_wake_up_occurred = 105036;
Stephane Lee747d01f2022-04-27 13:19:31 -070079
80 BatteryHealthStatus battery_health_status = 105037;
Jenny Hoce127722022-02-22 19:52:41 +080081 BatteryHealthUsage battery_health_usage = 105038;
Ocean Chen03e386a2022-03-10 02:49:40 +080082 F2fsSmartIdleMaintEnabledStateChanged f2fs_smart_idle_maint_enabled_state_changed = 105039;
Ocean Chen652c5822022-06-06 02:47:16 +080083 BlockStatsReported block_stats_reported = 105040;
Roger Fangc8dda042022-08-19 14:15:17 +080084 VendorAudioHardwareStatsReported vendor_audio_hardware_stats_reported = 105041;
Sayanna Chandula9e3b9452022-08-17 15:01:06 -070085
86 ThermalDfsStats thermal_dfs_stats = 105042;
Jeffrey Huang74943082021-04-09 10:49:09 -070087 }
Maggie White5cf0fda2019-04-09 16:52:07 -070088 // AOSP atom ID range ends at 109999
89}
90
Tej Singhb624a782021-07-02 15:19:29 -070091/* Supported reverse domain names. */
Maggie White5cf0fda2019-04-09 16:52:07 -070092message ReverseDomainNames {
93 optional string pixel = 1 [default = "com.google.pixel"];
94}
95
96/* A message containing detailed statistics and debug information about a charge session. */
97message ChargeStats {
98 /* Charge Adapter stats. */
99 enum AdapterType {
100 ADAPTER_TYPE_UNKNOWN = 0;
101 ADAPTER_TYPE_USB = 1;
102 ADAPTER_TYPE_USB_SDP = 2;
103 ADAPTER_TYPE_USB_DCP = 3;
104 ADAPTER_TYPE_USB_CDP = 4;
105 ADAPTER_TYPE_USB_ACA = 5;
106 ADAPTER_TYPE_USB_C = 6;
107 ADAPTER_TYPE_USB_PD = 7;
108 ADAPTER_TYPE_USB_PD_DRP = 8;
109 ADAPTER_TYPE_USB_PD_PPS = 9;
110 ADAPTER_TYPE_USB_PD_BRICKID = 10;
111 ADAPTER_TYPE_HVDCP = 11;
112 ADAPTER_TYPE_HVDCP3 = 12;
Maggie White571f6752019-07-16 18:51:20 -0700113 ADAPTER_TYPE_FLOAT = 13;
114 ADAPTER_TYPE_WLC = 14;
115 ADAPTER_TYPE_WLC_EPP = 15;
116 ADAPTER_TYPE_WLC_SPP = 16;
Stephane Lee8cffac72021-03-16 13:04:06 -0700117 ADAPTER_TYPE_GPP = 17;
118 ADAPTER_TYPE_10W = 18;
119 ADAPTER_TYPE_L7 = 19;
120 ADAPTER_TYPE_DL = 20;
121 ADAPTER_TYPE_WPC_EPP = 21;
122 ADAPTER_TYPE_WPC_GPP = 22;
123 ADAPTER_TYPE_WPC_10W = 23;
124 ADAPTER_TYPE_WPC_BPP = 24;
125 ADAPTER_TYPE_WPC_L7 = 25;
Prasanna Prapancham497106a2022-07-11 18:25:17 +0000126 ADAPTER_TYPE_EXT = 26;
127 ADAPTER_TYPE_EXT1 = 27;
128 ADAPTER_TYPE_EXT2 = 28;
129 ADAPTER_TYPE_EXT_UNKNOWN = 29;
Maggie White5cf0fda2019-04-09 16:52:07 -0700130 }
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700131 optional string reverse_domain_name = 1;
Maggie White5cf0fda2019-04-09 16:52:07 -0700132 /* Type of charge adapter, enumerated above. */
133 optional AdapterType adapter_type = 2;
134 /* Max negotiated voltage by charge adapter, in mV. */
135 optional int32 adapter_voltage = 3;
136 /* Max negotiated current by charge adapter current, in mA. */
137 optional int32 adapter_amperage = 4;
138
139 /* Stats at beginning of charge session. */
140 /* System State of Charge, in percent. */
141 optional int32 ssoc_in = 5;
142 /* Voltage in mV. */
143 optional int32 voltage_in = 6;
144
145 /* Stats at end of charge session. */
146 /* System State of Charge, in percent. */
147 optional int32 ssoc_out = 7;
148 /* Voltage in mV. */
149 optional int32 voltage_out = 8;
Stephane Lee8cffac72021-03-16 13:04:06 -0700150
151 /**
152 * These values are meant to represent status of the charging device, used
153 * to validate the charging algorithm and explain charging performances.
154 * Examples of the content of the register:
155 * - APDO, PDO (power capabilities of the device, eg. 5V3A, 9V2A, 20V2A) for wired charging
156 * - Wireless charging MFG code. This is the value of a register of the WLC integrated
157 * circuit to identify the vendor and type of WLC pad
158 * - Receiver operating frequency
159 * - Register status
160 */
161 optional int32 adapter_capabilities0 = 9;
162 optional int32 adapter_capabilities1 = 10;
163 optional int32 adapter_capabilities2 = 11;
164 optional int32 adapter_capabilities3 = 12;
165 optional int32 adapter_capabilities4 = 13;
166
167 /**
168 * These are values which reports the state of the wireless receiver, which will help in
169 * debugging charging issues and alternate configurations.
170 */
171 optional int32 receiver_state0 = 14;
172 optional int32 receiver_state1 = 15;
Jenny Ho2e4812f2021-12-16 19:17:21 +0800173
174 /* AACR feature to record capacity */
Jenny Hoc5e11bd2022-02-10 09:11:29 +0800175 optional int32 charge_capacity = 16;
Maggie White5cf0fda2019-04-09 16:52:07 -0700176}
177
178/* A message containing stats from each charge voltage tier. */
179message VoltageTierStats {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700180 optional string reverse_domain_name = 1;
Maggie White5cf0fda2019-04-09 16:52:07 -0700181 /* Voltage tier number, custom to implementation, should be <= 3. */
182 optional int32 voltage_tier = 2;
183
184 /* Stats when entering voltage tier. */
185 /* State of charge, in percent. */
186 optional float soc_in = 3;
187 /* Coulomb count, in mAh. */
188 optional int32 cc_in = 4;
189 /* Battery temperature, in deciC. */
190 optional int32 temp_in = 5;
191
192 /* Time spent at various charge speeds, in seconds. */
193 optional int32 time_fast_secs = 6;
194 optional int32 time_taper_secs = 7;
195 optional int32 time_other_secs = 8;
196
197 /* Battery temperature stats, in deciC. */
198 optional int32 temp_min = 9;
199 optional int32 temp_avg = 10;
200 optional int32 temp_max = 11;
201
202 /* Battery current stats, in mA. */
203 optional int32 ibatt_min = 12;
204 optional int32 ibatt_avg = 13;
205 optional int32 ibatt_max = 14;
206
207 /* Input current limit stats, in mA. */
208 optional int32 icl_min = 15;
209 optional int32 icl_avg = 16;
210 optional int32 icl_max = 17;
Stephane Lee8cffac72021-03-16 13:04:06 -0700211
212 /**
213 * Efficiency number, receiver operating frequency in kHz for wireless charging
214 * (alignment)
215 */
216 optional int32 charging_operating_point = 18;
217 /* The minimum power out of the adapter at the given charging tier */
218 optional int32 min_adapter_power_out = 19;
219 /* The time-averaged power out of the adapter at the given charging tier */
220 optional int32 time_avg_adapter_power_out = 20;
221 /* The maximum power out of the adapter at the given charging tier */
222 optional int32 max_adapter_power_out = 21;
Maggie White5cf0fda2019-04-09 16:52:07 -0700223}
Maggie White4122b0c2019-04-19 10:23:14 -0700224
225/* A message containing an alternate proprietary full battery capacity estimate. */
226message BatteryCapacity {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700227 optional string reverse_domain_name = 1;
Maggie White4122b0c2019-04-19 10:23:14 -0700228 /* Sum of the change in coulomb count. */
229 optional int32 delta_cc_sum = 2;
230 /* Sum of the change in state of charge (battery level). */
231 optional int32 delta_vfsoc_sum = 3;
232}
Ocean Chen3189ee92019-12-10 17:42:55 +0800233
234/* A message containing health values of UFS */
235message StorageUfsHealth {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700236 optional string reverse_domain_name = 1;
Ocean Chen3189ee92019-12-10 17:42:55 +0800237 /* The value of lifetimeA for UFS health */
238 optional int32 lifetime_a = 2;
239 /* The value of lifetimeB for UFS health */
240 optional int32 lifetime_b = 3;
241 /* The value of lifetimeC for UFS health */
242 optional int32 lifetime_c = 4;
243}
244
245/* A message containing filesystem stats of F2FS */
246message F2fsStatsInfo {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700247 optional string reverse_domain_name = 1;
Ocean Chen3189ee92019-12-10 17:42:55 +0800248 /* The value of dirty segments of f2fs */
249 optional int32 dirty_segments = 2;
250 /* The value of free segments of f2fs */
251 optional int32 free_segments = 3;
252 /* The times of checkpoint function called in foreground*/
253 optional int32 cp_calls_fg = 4;
254 /* The times of checkpoint function called in background */
Ocean Chena2d26262020-04-05 10:09:27 +0800255 optional int32 cp_calls_bg = 5;
Ocean Chen3189ee92019-12-10 17:42:55 +0800256 /* The times of garbage collection function called in foreground */
Ocean Chena2d26262020-04-05 10:09:27 +0800257 optional int32 gc_calls_fg = 6;
Ocean Chen3189ee92019-12-10 17:42:55 +0800258 /* The times of garbage collection function called in background */
Ocean Chena2d26262020-04-05 10:09:27 +0800259 optional int32 gc_calls_bg = 7;
Ocean Chen3189ee92019-12-10 17:42:55 +0800260 /* The amount of blocks been moved by garbage collection in foreground */
Ocean Chena2d26262020-04-05 10:09:27 +0800261 optional int32 moved_blocks_fg = 8;
Ocean Chen3189ee92019-12-10 17:42:55 +0800262 /* The amount of blocks been moved by garbage collection in background */
Ocean Chena2d26262020-04-05 10:09:27 +0800263 optional int32 moved_blocks_bg = 9;
Ocean Chen3189ee92019-12-10 17:42:55 +0800264 /* The average of how many valid blocks is in a segment */
Ocean Chena2d26262020-04-05 10:09:27 +0800265 optional int32 valid_blocks = 10;
Ocean Chen3189ee92019-12-10 17:42:55 +0800266}
Minchan Kim5b655f92020-02-26 13:51:40 -0800267
268message ZramMmStat {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700269 optional string reverse_domain_name = 1;
Minchan Kim5b655f92020-02-26 13:51:40 -0800270 /* The value of original memory size */
271 optional int64 orig_data_size = 2;
272 /* The value of compressed memory size */
273 optional int64 compr_data_size = 3;
274 /* The value of consumed memory size to store compressed memory */
275 optional int64 mem_used_total = 4;
276 /* The value of number of page filled with same elements data */
277 optional int64 same_pages = 5;
278 /* The value of number of incompressible page */
279 optional int64 huge_pages = 6;
Chiawei Wang4c2cd6a2021-03-15 21:44:03 +0800280 /* The value of number of incompressible pages since boot */
281 optional int64 huge_pages_since_boot = 7;
Minchan Kim5b655f92020-02-26 13:51:40 -0800282}
283
284message ZramBdStat {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700285 optional string reverse_domain_name = 1;
Minchan Kim5b655f92020-02-26 13:51:40 -0800286 /* the number of pages in backing device */
287 optional int64 bd_count = 2;
288 /* The number of pages readed from backing device */
289 optional int64 bd_reads = 3;
290 /* The number of pages written to backing device */
291 optional int64 bd_writes = 4;
292}
Jaegeuk Kim17c1b692020-02-27 12:11:12 -0800293
294/* A message containing boot times */
295message BootStatsInfo {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700296 optional string reverse_domain_name = 1;
Jaegeuk Kim17c1b692020-02-27 12:11:12 -0800297 /* The F2FS fsck time in secs */
298 optional int32 fsck_time_sec = 2;
299 /* The F2FS mounted time in secs */
300 optional int32 mounted_time_sec = 3;
301 /* The F2FS checkpoint=disable time in secs */
302 optional int32 checkpoint_time_sec = 4;
303}
Denny cy Lee6866f4e2020-01-03 16:52:41 +0800304
305/* A message containing wireless charging health info. */
306message WirelessChargingStats {
307 /* Captures if a google charger used when start wireless charging */
308 enum ChargerVendor {
309 VENDOR_UNKNOWN = 0;
310 VENDOR_GOOGLE = 1;
311 }
312
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700313 optional string reverse_domain_name = 1;
Denny cy Lee6866f4e2020-01-03 16:52:41 +0800314 optional ChargerVendor charger_vendor = 2;
315}
316
317/* Current device Orientation */
318message DeviceOrientation {
319 enum Orientation {
320 ORIENTATION_UNKNOWN = 0;
321 ORIENTATION_0 = 1;
322 ORIENTATION_90 = 2;
323 ORIENTATION_180 = 3;
324 ORIENTATION_270 = 4;
325 }
326
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700327 optional string reverse_domain_name = 1;
Denny cy Lee6866f4e2020-01-03 16:52:41 +0800328 /* Device orientation. */
329 optional Orientation orientation = 2;
330}
Stephane Leeedf62bf2020-03-23 17:13:33 -0700331
332/* Raw battery capacity stats */
333message BatteryCapacityFG {
334 enum LogReason {
335 LOG_REASON_UNKNOWN = 0;
336 LOG_REASON_CONNECTED = 1;
337 LOG_REASON_DISCONNECTED = 2;
338 LOG_REASON_FULL_CHARGE = 3;
339 LOG_REASON_PERCENT_SKIP = 4;
340 LOG_REASON_DIVERGING_FG = 5;
341 }
342
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700343 optional string reverse_domain_name = 1;
Stephane Leeedf62bf2020-03-23 17:13:33 -0700344 /* Uevent logging reason, enumerated above. */
345 optional LogReason capacity_log_reason = 2;
346
347 /* The battery capacity reported from the FG (fuel gauge) hardware */
348 optional float capacity_gdf = 3;
349 /* The filtered system battery capacity reported to the UI */
350 optional float capacity_ssoc = 4;
351 /* The fuel gauge capacity curve midpoint FG (fuel gauge) value */
352 optional float capacity_gdf_curve = 5;
353 /* The fuel gauge capacity curve midpoint UI value */
354 optional float capacity_ssoc_curve = 6;
355}
356
Badhri Jagan Sridharandef8f1f2020-03-09 19:23:29 -0700357message PdVidPid {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700358 optional string reverse_domain_name = 1;
Badhri Jagan Sridharandef8f1f2020-03-09 19:23:29 -0700359 /* Vendor ID of wired charger */
360 optional int32 vid = 2;
361 /* Product ID of wired charger */
362 optional int32 pid = 3;
363}
Andrew Chant245091d2020-06-18 13:51:18 -0700364
Stephane Lee46bfff72020-08-17 16:08:15 -0700365message BatteryEEPROM {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700366 optional string reverse_domain_name = 1;
367 /* The cycle count number; record of charge/discharge times */
Stephane Lee46bfff72020-08-17 16:08:15 -0700368 optional int32 cycle_cnt = 2;
369 /* The current full capacity of the battery under nominal conditions */
370 optional int32 full_cap = 3;
371 /* The battery equivalent series resistance */
372 optional int32 esr = 4;
373 /* Battery resistance related to temperature change */
374 optional int32 rslow = 5;
375 /* Battery health indicator reflecting the battery age state */
376 optional int32 soh = 6;
377 /* The battery temperature */
378 optional int32 batt_temp = 7;
379
380 /* Battery state of charge (SOC) shutdown point */
381 optional int32 cutoff_soc = 8;
382 /* Raw battery state of charge (SOC), based on battery current (CC = Coulomb Counter) */
383 optional int32 cc_soc = 9;
384 /* Estimated battery state of charge (SOC) from batt_soc with endpoint limiting (0% and 100%) */
385 optional int32 sys_soc = 10;
386 /* Filtered monotonic SOC, handles situations where the cutoff_soc is increased and
387 * then decreased from the battery physical properties
388 */
389 optional int32 msoc = 11;
390 /* Estimated SOC derived from cc_soc that provides voltage loop feedback correction using
391 * battery voltage, current, and status values
392 */
393 optional int32 batt_soc = 12;
394
395 /* Field used for data padding in the EEPROM data */
396 optional int32 reserve = 13;
397
398 /* The maximum battery temperature ever seen */
399 optional int32 max_temp = 14;
400 /* The minimum battery temperature ever seen */
401 optional int32 min_temp = 15;
402 /* The maximum battery voltage ever seen */
403 optional int32 max_vbatt = 16;
404 /* The minimum battery voltage ever seen */
405 optional int32 min_vbatt = 17;
406 /* The maximum battery current ever seen */
407 optional int32 max_ibatt = 18;
408 /* The minimum battery current ever seen */
409 optional int32 min_ibatt = 19;
410 /* Field used to verify the integrity of the EEPROM data */
411 optional int32 checksum = 20;
Jenny Ho41b86b42022-03-17 05:37:33 +0800412
413 /* Extend data for P21 */
414 /* Temperature compensation information */
415 optional int32 tempco = 21;
416 /* Learned characterization related to the voltage gauge */
417 optional int32 rcomp0 = 22;
418 /* For time to monitor the life of cell */
419 optional int32 timer_h = 23;
420 /* The full capacity of the battery learning at the end of every charge cycle */
421 optional int32 full_rep = 24;
Stephane Lee46bfff72020-08-17 16:08:15 -0700422}
423
Andrew Chant245091d2020-06-18 13:51:18 -0700424/* A message containing an exceptional event from citadel. */
425message CitadelEvent {
426 enum Event {
427 ALERT = 1;
428 REBOOTED = 2;
429 UPGRADED = 3;
Chungjui Fan2cfc0d52021-03-04 00:04:48 +0800430 ALERT_V2 = 4;
Chungjui Fan80d58da2022-07-26 15:51:06 +0000431 SEC_CH_STATE = 5;
Andrew Chant245091d2020-06-18 13:51:18 -0700432 };
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700433 optional string reverse_domain_name = 1;
Andrew Chant245091d2020-06-18 13:51:18 -0700434 optional Event event = 2;
435 optional int32 reset_count = 3;
436 optional int64 uptime_micros = 4;
437 enum Priority {
438 LOW = 0;
439 MEDIUM = 1;
440 HIGH = 2;
441 };
442 optional Priority priority = 5;
443
444 // ALERT-specific fields. These fields correspond to the interrupt status
445 // bits for alerts within citadel. When alerts fire one or more of these
446 // bits are set to indicate the alert source.
447 optional int32 intr_sts_0 = 6;
448 optional int32 intr_sts_1 = 7;
449 optional int32 intr_sts_2 = 8;
450
451 // REBOOTED-specific fields. These fields correspond to the details of how
452 // the hardware reboot occurred. A reboot is a noteworthy event for citadel,
453 // as it can be triggered by events like stack overflow or other software
454 // bugs.
455 optional int32 rstsrc = 9;
456 optional int32 exitpd = 10;
457 optional int32 which0 = 11;
458 optional int32 which1 = 12;
Chungjui Fan6be1d9a2020-09-26 14:38:54 +0800459
460 // UPGRADED-specific field. This field corresponds to the result of FW
461 // upgrade for citadel.
462 optional int32 upgrade_state = 13;
Chungjui Fan2cfc0d52021-03-04 00:04:48 +0800463
464 // ALERT_V2-specific field. This field corresponds to the GLOBALSEC Log
465 // which contains normal globalsec, camo, temp and buserr.
466 optional int32 alert_grp_0 = 14;
467 optional int32 alert_grp_1 = 15;
468 optional int32 alert_grp_2 = 16;
469 optional int32 alert_grp_3 = 17;
470 optional int32 camo_breaches_0 = 18;
471 optional int32 camo_breaches_1 = 19;
472 optional int32 temp_min = 20;
473 optional int32 temp_max = 21;
474 optional int32 bus_err = 22;
Chungjui Fan80d58da2022-07-26 15:51:06 +0000475
476 // SEC_CH_STATE-specific filed. This field corresponds to the state
477 // of GSA-GSC secure channel.
478 optional int32 sec_ch_state = 23;
Andrew Chant245091d2020-06-18 13:51:18 -0700479}
480
481/* A message containing the citadel firmware version. */
482message CitadelVersion {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700483 optional string reverse_domain_name = 1;
484 optional string version = 2;
Andrew Chant245091d2020-06-18 13:51:18 -0700485}
Vova Sharaienkoe18280c2021-02-03 02:43:59 +0000486
487/* A message containing the speaker impedance. */
488 message VendorSpeakerImpedance {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700489 optional string reverse_domain_name = 1;
Vova Sharaienkoe18280c2021-02-03 02:43:59 +0000490 optional int32 speaker_location = 2;
491 optional int32 impedance = 3;
492}
Ocean Chenef533c32021-03-05 16:50:56 +0800493
Roger Fang0ff3f5c2021-08-23 19:29:59 +0800494/**
495 * Logs the reported vendor speaker health stats.
496 * Logged from: hardware/google/pixel/pixelstats/SysfsCollector.cpp
497 */
498message VendorSpeakerStatsReported {
499 /* Vendor reverse domain name (expecting "com.google.pixel") */
500 optional string reverse_domain_name = 1;
501 /* The location of speaker; 0 = left , 1 = right */
502 optional int32 speaker_location = 2;
503 /* The speaker's impedance value (milliOhm) */
504 optional int32 impedance = 3;
505 /* The speaker's maximum temperature (milliDegree C) */
506 optional int32 max_temperature = 4;
507 /* The speaker's execursion length (micrometer) */
508 optional int32 excursion = 5;
509 /* The speaker's heart beat count */
510 optional int32 heartbeat = 6;
511}
512
Ocean Chenef533c32021-03-05 16:50:56 +0800513/* A message containing how many times of ufs host reset */
514message StorageUfsResetCount {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700515 optional string reverse_domain_name = 1;
Ocean Chenef533c32021-03-05 16:50:56 +0800516 /* How many UFS error reset are triggered */
517 optional int32 host_reset_count = 2;
518}
Chiawei Wangba14fc72021-02-04 12:59:17 +0800519
520/* A message containing Pixel memory metrics collected hourly. */
521message PixelMmMetricsPerHour {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700522 optional string reverse_domain_name = 1;
Chiawei Wang40148412021-04-06 08:00:30 +0800523 optional int64 free_pages = 2;
524 optional int64 anon_pages = 3;
525 optional int64 file_pages = 4;
526 optional int64 slab_reclaimable = 5;
527 optional int64 zspages = 6;
528 optional int64 unevictable = 7;
529 optional int64 ion_total_pools = 8;
530 optional int64 gpu_memory = 9;
Robin Hsu625ec772022-07-06 12:15:08 +0800531 optional int64 slab_unreclaimable = 10;
532 optional int64 psi_cpu_some_total = 11;
533 optional int64 psi_io_full_total = 12;
534 optional int64 psi_io_some_total = 13;
535 optional int64 psi_mem_full_total = 14;
536 optional int64 psi_mem_some_total = 15;
537 optional int32 psi_cpu_some_avg10_min = 16;
538 optional int32 psi_cpu_some_avg10_max = 17;
539 optional int32 psi_cpu_some_avg10_avg = 18;
540 optional int32 psi_cpu_some_avg60_min = 19;
541 optional int32 psi_cpu_some_avg60_max = 20;
542 optional int32 psi_cpu_some_avg60_avg = 21;
543 optional int32 psi_cpu_some_avg300_min = 22;
544 optional int32 psi_cpu_some_avg300_max = 23;
545 optional int32 psi_cpu_some_avg300_avg = 24;
546 optional int32 psi_io_full_avg10_min = 25;
547 optional int32 psi_io_full_avg10_max = 26;
548 optional int32 psi_io_full_avg10_avg = 27;
549 optional int32 psi_io_full_avg60_min = 28;
550 optional int32 psi_io_full_avg60_max = 29;
551 optional int32 psi_io_full_avg60_avg = 30;
552 optional int32 psi_io_full_avg300_min = 31;
553 optional int32 psi_io_full_avg300_max = 32;
554 optional int32 psi_io_full_avg300_avg = 33;
555 optional int32 psi_io_some_avg10_min = 34;
556 optional int32 psi_io_some_avg10_max = 35;
557 optional int32 psi_io_some_avg10_avg = 36;
558 optional int32 psi_io_some_avg60_min = 37;
559 optional int32 psi_io_some_avg60_max = 38;
560 optional int32 psi_io_some_avg60_avg = 39;
561 optional int32 psi_io_some_avg300_min = 40;
562 optional int32 psi_io_some_avg300_max = 41;
563 optional int32 psi_io_some_avg300_avg = 42;
564 optional int32 psi_mem_full_avg10_min = 43;
565 optional int32 psi_mem_full_avg10_max = 44;
566 optional int32 psi_mem_full_avg10_avg = 45;
567 optional int32 psi_mem_full_avg60_min = 46;
568 optional int32 psi_mem_full_avg60_max = 47;
569 optional int32 psi_mem_full_avg60_avg = 48;
570 optional int32 psi_mem_full_avg300_min = 49;
571 optional int32 psi_mem_full_avg300_max = 50;
572 optional int32 psi_mem_full_avg300_avg = 51;
573 optional int32 psi_mem_some_avg10_min = 52;
574 optional int32 psi_mem_some_avg10_max = 53;
575 optional int32 psi_mem_some_avg10_avg = 54;
576 optional int32 psi_mem_some_avg60_min = 55;
577 optional int32 psi_mem_some_avg60_max = 56;
578 optional int32 psi_mem_some_avg60_avg = 57;
579 optional int32 psi_mem_some_avg300_min = 58;
580 optional int32 psi_mem_some_avg300_max = 59;
581 optional int32 psi_mem_some_avg300_avg = 60;
Chiawei Wangba14fc72021-02-04 12:59:17 +0800582}
583
584/* A message containing Pixel memory metrics collected daily. */
585message PixelMmMetricsPerDay {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700586 optional string reverse_domain_name = 1;
Robin Hsu625ec772022-07-06 12:15:08 +0800587 optional int64 workingset_refault = 2; /* refault_file */
Chiawei Wang40148412021-04-06 08:00:30 +0800588 optional int64 pswpin = 3;
589 optional int64 pswpout = 4;
590 optional int64 allocstall_dma = 5;
591 optional int64 allocstall_dma32 = 6;
592 optional int64 allocstall_normal = 7;
593 optional int64 allocstall_movable = 8;
594 optional int64 pgalloc_dma = 9;
595 optional int64 pgalloc_dma32 = 10;
596 optional int64 pgalloc_normal = 11;
597 optional int64 pgalloc_movable = 12;
598 optional int64 pgsteal_kswapd = 13;
599 optional int64 pgsteal_direct = 14;
600 optional int64 pgscan_kswapd = 15;
601 optional int64 pgscan_direct = 16;
602 optional int64 oom_kill = 17;
603 optional int64 pgalloc_high = 18;
604 optional int64 pgcache_hit = 19;
605 optional int64 pgcache_miss = 20;
Chiawei Wang18e14b82021-04-15 23:13:32 +0800606 optional int64 kswapd_stime_clks = 21;
607 optional int64 kcompactd_stime_clks = 22;
Robin Hsu625ec772022-07-06 12:15:08 +0800608 optional int64 direct_reclaim_native_latency_total_time = 23;
609 optional int64 direct_reclaim_native_latency0 = 24;
610 optional int64 direct_reclaim_native_latency1 = 25;
611 optional int64 direct_reclaim_native_latency2 = 26;
612 optional int64 direct_reclaim_native_latency3 = 27;
613 optional int64 direct_reclaim_visible_latency_total_time = 28;
614 optional int64 direct_reclaim_visible_latency0 = 29;
615 optional int64 direct_reclaim_visible_latency1 = 30;
616 optional int64 direct_reclaim_visible_latency2 = 31;
617 optional int64 direct_reclaim_visible_latency3 = 32;
618 optional int64 direct_reclaim_top_latency_total_time = 33;
619 optional int64 direct_reclaim_top_latency0 = 34;
620 optional int64 direct_reclaim_top_latency1 = 35;
621 optional int64 direct_reclaim_top_latency2 = 36;
622 optional int64 direct_reclaim_top_latency3 = 37;
623 optional int64 direct_reclaim_other_latency_total_time = 38;
624 optional int64 direct_reclaim_other_latency0 = 39;
625 optional int64 direct_reclaim_other_latency1 = 40;
626 optional int64 direct_reclaim_other_latency2 = 41;
627 optional int64 direct_reclaim_other_latency3 = 42;
628 optional int64 compaction_total_time = 43;
629 optional int64 compaction_ev_count0 = 44;
630 optional int64 compaction_ev_count1 = 45;
631 optional int64 compaction_ev_count2 = 46;
632 optional int64 compaction_ev_count3 = 47;
633 optional int64 compaction_ev_count4 = 48;
634 optional int64 workingset_refault_anon = 49;
635 optional int64 workingset_refault_file = 50;
636 optional int64 compact_success = 51;
637 optional int64 compact_fail = 52;
638 optional int64 kswapd_low_wmark_hq = 53;
639 optional int64 kswapd_high_wmark_hq = 54;
640 optional int64 thp_file_alloc = 55;
641 optional int64 thp_zero_page_alloc = 56;
642 optional int64 thp_split_page = 57;
643 optional int64 thp_migration_split = 58;
644 optional int64 thp_deferred_split_page = 59;
Chiawei Wang588e3282021-03-09 22:01:47 +0800645}
646
647/* A message containing CMA metrics collected from dogfooding only. */
648message CmaStatus {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700649 optional string reverse_domain_name = 1;
Chiawei Wang40148412021-04-06 08:00:30 +0800650 optional int32 type = 2;
651 optional int64 cma_alloc_pages_attempts = 3;
652 optional int64 cma_alloc_pages_soft_attempts = 4;
653 optional int64 cma_fail_pages = 5;
654 optional int64 cma_fail_soft_pages = 6;
655 optional int64 migrated_pages = 7;
Chiawei Wangb354a052021-07-19 22:24:48 +0800656 optional string cma_heap_name = 8;
Chiawei Wang588e3282021-03-09 22:01:47 +0800657}
658
659/* A message containing CMA metrics (External). */
660message CmaStatusExt {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700661 optional string reverse_domain_name = 1;
Chiawei Wang40148412021-04-06 08:00:30 +0800662 optional int32 type = 2;
663 optional int64 cma_alloc_latency_low = 3;
664 optional int64 cma_alloc_latency_mid = 4;
665 optional int64 cma_alloc_latency_high = 5;
Chiawei Wangb354a052021-07-19 22:24:48 +0800666 optional string cma_heap_name = 6;
Chiawei Wangba14fc72021-02-04 12:59:17 +0800667}
Ocean Chen17e0ecb2021-03-05 17:38:58 +0800668
669message F2fsCompressionInfo {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700670 optional string reverse_domain_name = 1;
Ocean Chen17e0ecb2021-03-05 17:38:58 +0800671 /* Show the block count written after compression since mount */
672 optional int32 compr_written_blocks = 2;
673 /* Show the saved block count with compression since mount */
674 optional int32 compr_saved_blocks = 3;
675 /* Show the count of inode newly enabled for compression since mount */
676 optional int32 compr_new_inodes = 4;
677}
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000678
679/**
680 * Log bucketed battery charge cycles.
681 *
682 * Each bucket represents cycles of the battery past
683 * a given charge point. For example, bucket 1 is the
684 * lowest 1/8th of the battery, and bucket 8 is 100%.
685 *
686 * Logged from:
687 * /sys/class/power_supply/bms/cycle_count, via Vendor.
688 */
689message VendorChargeCycles {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700690 optional string reverse_domain_name = 1;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000691 optional int32 cycle_bucket_1 = 2;
692 optional int32 cycle_bucket_2 = 3;
693 optional int32 cycle_bucket_3 = 4;
694 optional int32 cycle_bucket_4 = 5;
695 optional int32 cycle_bucket_5 = 6;
696 optional int32 cycle_bucket_6 = 7;
697 optional int32 cycle_bucket_7 = 8;
698 optional int32 cycle_bucket_8 = 9;
699 optional int32 cycle_bucket_9 = 10;
700 optional int32 cycle_bucket_10 = 11;
701}
702
703/**
704 * Logs the report of a failed hardware.
705 *
706 * Logged from:
707 * Vendor HALs.
708 *
709 */
710message VendorHardwareFailed {
711 enum HardwareType {
712 HARDWARE_FAILED_UNKNOWN = 0;
713 HARDWARE_FAILED_MICROPHONE = 1;
714 HARDWARE_FAILED_CODEC = 2;
715 HARDWARE_FAILED_SPEAKER = 3;
716 HARDWARE_FAILED_FINGERPRINT = 4;
717 }
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700718 optional string reverse_domain_name = 1;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000719 optional HardwareType hardware_type = 2;
720
721 /**
722 * hardware_location allows vendors to differentiate between multiple
723 * instances of the same hardware_type. The specific locations are vendor
724 * defined integers, referring to board-specific numbering schemes.
725 */
726 optional int32 hardware_location = 3;
727 /**
728 * failure_code is specific to the HardwareType of the failed hardware.
729 * It should use one of the enum values defined below.
730 */
731 enum HardwareErrorCode {
732 UNKNOWN = 0;
733 COMPLETE = 1;
734 SPEAKER_HIGH_Z = 2;
735 SPEAKER_SHORT = 3;
736 FINGERPRINT_SENSOR_BROKEN = 4;
737 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
738 DEGRADE = 6;
739 }
740 optional int32 failure_code = 4;
741}
742
743/**
744 * Log slow I/O operations on the primary storage.
745 */
746message VendorSlowIo {
747 // Classifications of IO Operations.
748 enum IoOperation {
749 UNKNOWN = 0;
750 READ = 1;
751 WRITE = 2;
752 UNMAP = 3;
753 SYNC = 4;
754 }
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700755 optional string reverse_domain_name = 1;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000756 optional IoOperation operation = 2;
757
758 // The number of slow IO operations of this type over 24 hours.
759 optional int32 count = 3;
760}
761
762/*
763 * Logs the reported speech DSP status.
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000764 * Logged from: Vendor audio implementation.
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000765 */
766message VendorSpeechDspStat {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700767 optional string reverse_domain_name = 1;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000768 // The total Speech DSP uptime in milliseconds.
769 optional int32 total_uptime_millis = 2;
770 // The total Speech DSP downtime in milliseconds.
771 optional int32 total_downtime_millis = 3;
772 optional int32 total_crash_count = 4;
773 optional int32 total_recover_count = 5;
774}
775
776/**
777 * Log an event when the device has been physically dropped.
778 * Reported from the /vendor partition.
779 */
780message VendorPhysicalDropDetected {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700781 optional string reverse_domain_name = 1;
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000782 // Confidence that the event was actually a drop, 0 -> 100
783 optional int32 confidence_pctg = 2;
784 // Peak acceleration of the drop, in 1/1000s of a g.
785 optional int32 accel_peak_thousandths_g = 3;
786 // Duration of freefall in ms
787 optional int32 freefall_time_millis = 4;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000788}
789
790/** Represents USB port overheat event. */
791message VendorUsbPortOverheat {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700792 optional string reverse_domain_name = 1;
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000793 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
794 optional int32 plug_temperature_deci_c = 2;
795 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree
796 * C. */
797 optional int32 max_temperature_deci_c = 3;
798 /* Time between USB plug event and overheat threshold trip, in seconds. */
799 optional int32 time_to_overheat_secs = 4;
800 /* Time between overheat threshold trip and hysteresis, in seconds. */
801 optional int32 time_to_hysteresis_secs = 5;
802 /* Time between hysteresis and active mitigation ending, in seconds. */
803 optional int32 time_to_inactive_secs = 6;
804}
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000805
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000806/**
807 * Log battery health snapshot.
808 *
809 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
810 * are snapshotted periodically over 24hrs.
811 */
812message VendorBatteryHealthSnapshot {
813 enum BatterySnapshotType {
814 BATTERY_SNAPSHOT_TYPE_UNKNOWN = 0;
815 BATTERY_SNAPSHOT_TYPE_MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
816 BATTERY_SNAPSHOT_TYPE_MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
817 BATTERY_SNAPSHOT_TYPE_MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
818 BATTERY_SNAPSHOT_TYPE_MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
819 BATTERY_SNAPSHOT_TYPE_MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
820 BATTERY_SNAPSHOT_TYPE_MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
821 BATTERY_SNAPSHOT_TYPE_MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
822 BATTERY_SNAPSHOT_TYPE_MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
823 BATTERY_SNAPSHOT_TYPE_MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
824 BATTERY_SNAPSHOT_TYPE_MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
825 BATTERY_SNAPSHOT_TYPE_AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
826 }
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700827 optional string reverse_domain_name = 1;
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000828 optional BatterySnapshotType type = 2;
829 // Temperature, in 1/10ths of degree C.
830 optional int32 temperature_deci_celsius = 3;
831 // Voltage Battery Voltage, in microVolts.
832 optional int32 voltage_micro_volt = 4;
833 // Current Battery current, in microAmps.
834 optional int32 current_micro_amps = 5;
835 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
836 optional int32 open_circuit_micro_volt = 6;
837 // Resistance Battery Resistance, in microOhms.
838 optional int32 resistance_micro_ohm = 7;
839 // Level Battery Level, as % of full.
840 optional int32 level_percent = 8;
841}
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000842
Vova Sharaienkodc6e6ba2021-03-24 02:10:12 +0000843/**
844 * Log battery caused shutdown with the last recorded voltage.
845 */
846message VendorBatteryCausedShutdown {
Jeffrey Huang5974bf52021-04-19 17:04:01 -0700847 optional string reverse_domain_name = 1;
848 // The last recorded battery voltage prior to shutdown.
849 optional int32 last_recorded_micro_volt = 2;
Vova Sharaienkoc5e3cb22021-03-16 02:58:08 +0000850}
Daeho Jeongb802fd42021-07-13 00:16:11 -0700851
852/**
George Lee73506ac2021-06-09 10:14:26 -0700853 * Log mitigation statistics.
854 */
855message PowerMitigationStats {
856 optional string reverse_domain_name = 1;
857 // The last triggered count: batoilo.
858 optional int32 batoilo_count = 2;
859 // The last triggered count: vdroop1.
860 optional int32 vdroop1_count = 3;
861 // The last triggered count: vdroop2.
862 optional int32 vdroop2_count = 4;
863 // The last triggered count: smpl_warn.
864 optional int32 smpl_warn_count = 5;
865 // The last triggered count: ocp_cpu1.
866 optional int32 ocp_cpu1_count = 6;
867 // The last triggered count: ocp_cpu2.
868 optional int32 ocp_cpu2_count = 7;
869 // The last triggered count: ocp_gpu.
870 optional int32 ocp_gpu_count = 8;
871 // The last triggered count: ocp_tpu.
872 optional int32 ocp_tpu_count = 9;
873 // The last triggered count: soft_ocp_cpu1.
874 optional int32 soft_ocp_cpu1_count = 10;
875 // The last triggered count: soft_ocp_cpu2.
876 optional int32 soft_ocp_cpu2_count = 11;
877 // The last triggered count: soft_ocp_gpu.
878 optional int32 soft_ocp_gpu_count = 12;
879 // The last triggered count: soft_ocp_tpu.
880 optional int32 soft_ocp_tpu_count = 13;
881 // The last triggered capacity: batoilo.
882 optional int32 batoilo_cap = 14;
883 // The last triggered capacity: vdroop1.
884 optional int32 vdroop1_cap = 15;
885 // The last triggered capacity: vdroop2.
886 optional int32 vdroop2_cap = 16;
887 // The last triggered capacity: smpl_warn.
888 optional int32 smpl_warn_cap = 17;
889 // The last triggered capacity: ocp_cpu1.
890 optional int32 ocp_cpu1_cap = 18;
891 // The last triggered capacity: ocp_cpu2.
892 optional int32 ocp_cpu2_cap = 19;
893 // The last triggered capacity: ocp_gpu.
894 optional int32 ocp_gpu_cap = 20;
895 // The last triggered capacity: ocp_tpu.
896 optional int32 ocp_tpu_cap = 21;
897 // The last triggered capacity: soft_ocp_cpu1.
898 optional int32 soft_ocp_cpu1_cap = 22;
899 // The last triggered capacity: soft_ocp_cpu2.
900 optional int32 soft_ocp_cpu2_cap = 23;
901 // The last triggered capacity: soft_ocp_gpu.
902 optional int32 soft_ocp_gpu_cap = 24;
903 // The last triggered capacity: soft_ocp_tpu.
904 optional int32 soft_ocp_tpu_cap = 25;
905}
906
907/**
Sayanna Chandula9e3b9452022-08-17 15:01:06 -0700908 * Log thermal statistics.
909 */
910message ThermalDfsStats {
911 optional string reverse_domain_name = 1;
912 // The last count of BIG cluster dfs triggers
913 optional int32 big_dfs_count = 2;
914 // The last count of MID cluster dfs triggers
915 optional int32 mid_dfs_count = 3;
916 // The last count of LITTLE cluster dfs triggers
917 optional int32 little_dfs_count = 4;
918 // The last count of GPU dfs triggers
919 optional int32 gpu_dfs_count = 5;
920 // The last count of TPU dfs triggers
921 optional int32 tpu_dfs_count = 6;
922 // The last count of DSP dfs triggers
923 optional int32 aur_dfs_count = 7;
924}
925
926/**
Daeho Jeongb802fd42021-07-13 00:16:11 -0700927 * Log how many segments have been reclaimed in a specific GC mode.
928 */
929message F2fsGcSegmentInfo {
930 optional string reverse_domain_name = 1;
931 /* Reclaimed segments in GC normal mode */
932 optional int32 reclaimed_segments_normal = 2;
933 /* Reclaimed segments in GC urgent high mode */
934 optional int32 reclaimed_segments_urgent_high = 3;
935 /* Reclaimed segments in GC urgent low mode */
936 optional int32 reclaimed_segments_urgent_low = 4;
Ocean Chen8985b562022-05-30 17:29:36 +0800937 /* Reclaimed segments in GC urgent mid mode */
938 optional int32 reclaimed_segments_urgent_mid = 5;
Daeho Jeongb802fd42021-07-13 00:16:11 -0700939}
Arthur Ishiguro0a731b02021-12-13 17:39:26 +0000940
941/**
942 * Logs an event indicating that a nanoapp loading has failed at the HAL.
943 */
944message ChreHalNanoappLoadFailed {
945 // Vendor reverse domain name (expecting "com.google.pixel").
946 optional string reverse_domain_name = 1;
947
948 enum Type {
949 TYPE_UNKNOWN = 0;
950 // Corresponds to preloaded nanoapps on the device.
951 TYPE_PRELOADED = 1;
952 // Dynamic loading of a nanoapp (e.g. code download).
953 TYPE_DYNAMIC = 2;
954 }
955
956 enum Reason {
957 REASON_UNKNOWN = 0;
958 // A generic error code that does not match any of the others.
959 REASON_ERROR_GENERIC = 1;
960 // Failure at the connection between HAL<->CHRE.
961 REASON_CONNECTION_ERROR = 2;
962 // System ran out of memory.
963 REASON_OOM = 3;
964 // Nanoapp did not have the right signing for loading.
965 REASON_SIGNATURE_MISMATCH = 4;
966 }
967
968 // The 64-bit unique nanoapp identifier of the nanoapp that failed.
969 optional int64 nanoapp_id = 2;
970
971 // The type of the load event.
972 optional Type type = 3;
973
974 // The reason for the failure.
975 optional Reason reason = 4;
976}
977
978/**
979 * An enum describing a module within CHRE.
980 */
981enum ChreModuleType {
982 CHRE_MODULE_TYPE_UNKNOWN = 0;
983 CHRE_MODULE_TYPE_CHRE = 1; // Core CHRE framework
984 CHRE_MODULE_TYPE_PAL = 2; // PAL module (could be CHPP)
985 CHRE_MODULE_TYPE_NANOAPP = 3;
986}
987
988/**
989 * An enum describing the CHRE PAL type.
990 */
991enum ChrePalType {
992 CHRE_PAL_TYPE_UNKNOWN = 0;
993 CHRE_PAL_TYPE_SENSOR = 1;
994 CHRE_PAL_TYPE_WIFI = 2;
995 CHRE_PAL_TYPE_GNSS = 3;
996 CHRE_PAL_TYPE_WWAN = 4;
997 CHRE_PAL_TYPE_AUDIO = 5;
998 CHRE_PAL_TYPE_BLE = 6;
999}
1000
1001/**
1002 * Logs an event indicating that a CHRE PAL open has failed.
1003 */
1004message ChrePalOpenFailed {
1005 // Vendor reverse domain name (expecting "com.google.pixel").
1006 optional string reverse_domain_name = 1;
1007
1008 enum Type {
1009 TYPE_UNKNOWN = 0;
1010 // Initial open when CHRE starts.
1011 INITIAL_OPEN = 1;
1012 // Any form of "reopen" event internally in the PAL.
1013 REOPEN = 2;
1014 }
1015
1016 // The PAL this failure event is for.
1017 optional ChrePalType pal = 2;
1018
1019 // The type of failure observed.
1020 optional Type type = 3;
1021}
1022
1023/**
1024 * The type of CHRE API request.
1025 */
1026enum ChreApiType {
1027 CHRE_API_TYPE_UNKNOWN = 0;
1028 CHRE_API_TYPE_WIFI_SCAN_MONITOR = 1;
1029 CHRE_API_TYPE_WIFI_ACTIVE_SCAN = 2;
1030 CHRE_API_TYPE_WIFI_RTT_RANGING = 3;
1031}
1032
1033/**
1034 * The type of CHRE API error.
1035 */
1036enum ChreError {
1037 CHRE_ERROR_UNKNOWN = 0;
1038
1039 // No error occurred.
1040 CHRE_ERROR_NONE = 1;
1041
1042 // An unspecified failure occurred.
1043 CHRE_ERROR = 2;
1044
1045 // One or more supplied arguments are invalid.
1046 CHRE_ERROR_INVALID_ARGUMENT = 3;
1047
1048 // Unable to satisfy request because the system is busy.
1049 CHRE_ERROR_BUSY = 4;
1050
1051 // Unable to allocate memory.
1052 CHRE_ERROR_NO_MEMORY = 5;
1053
1054 // The requested feature is not supported.
1055 CHRE_ERROR_NOT_SUPPORTED = 6;
1056
1057 // A timeout occurred while processing the request.
1058 CHRE_ERROR_TIMEOUT = 7;
1059
1060 // The relevant capability is disabled, for example due to a user
1061 // configuration that takes precedence over this request.
1062 CHRE_ERROR_FUNCTION_DISABLED = 8;
1063}
1064
1065/**
1066 * Distribution of CHRE API error codes.
1067 */
1068message ChreApiErrorCodeDistributionTaken {
1069 // Vendor reverse domain name (expecting "com.google.pixel").
1070 optional string reverse_domain_name = 1;
1071
1072 // The chreGetTime() value when this snapshot was taken, in milliseconds.
1073 optional int32 snapshot_chre_get_time_ms = 2;
1074
1075 // The CHRE API type.
1076 optional ChreApiType api_type = 3;
1077
1078 // Corresponds to the CHRE error code that occurred, as defined in the
1079 // "enum chreError" field in chre_api/chre/common.h.
1080 optional ChreError error_code = 4;
1081 optional int32 num_errors = 5;
1082}
1083
1084/**
1085 * Snapshot of the dynamic memory allocated in CHRE.
1086 */
1087message ChreDynamicMemorySnapshotReported {
1088 // Vendor reverse domain name (expecting "com.google.pixel").
1089 optional string reverse_domain_name = 1;
1090
1091 // The chreGetTime() value when this snapshot was taken, in milliseconds.
1092 optional int32 snapshot_chre_get_time_ms = 2;
1093
1094 // The type of the module.
1095 optional ChreModuleType module_type = 3;
1096
1097 // The unique 64-bit ID for a nanoapp, only used if the module_type is NANOAPP.
1098 // If module_type is PAL, then it represents the ChrePalType enum. If the module_type
1099 // is CHRE, then a zero value should be used.
1100 optional int64 pal_type_or_nanoapp_id = 4;
1101
1102 // The max allocation amount of this module in bytes.
1103 optional int32 max_allocation_bytes = 5;
1104
1105 // The current allocation amount of this module in bytes.
1106 optional int32 current_allocation_bytes = 6;
1107}
1108
1109/**
1110 * Snapshot of the event queue stats in CHRE.
1111 */
1112message ChreEventQueueSnapshotReported {
1113 // Vendor reverse domain name (expecting "com.google.pixel").
1114 optional string reverse_domain_name = 1;
1115
1116 // The chreGetTime() value when this snapshot was taken, in milliseconds.
1117 optional int32 snapshot_chre_get_time_ms = 2;
1118
1119 // The maximum size the event queue got to (i.e. num pending events).
1120 optional int32 max_event_queue_size = 3;
1121
1122 // The average size the event queue got to (i.e. num pending events).
1123 optional int32 mean_event_queue_size = 4;
1124
1125 // The number of events that were dropped due to capacity limits.
1126 optional int32 num_dropped_events = 5;
1127
1128 // The maximum amount of time it took for an event, from when it was received,
1129 // to when it was delivered to all interested modules. This value represents
1130 // the total delay within the CHRE subsystem.
1131 optional int64 max_queue_delay_us = 6;
1132
1133 // The mean value of the delay in microseconds.
1134 optional int64 mean_queue_delay_us = 7;
1135}
1136
1137/**
1138 * Indicates that a nanoapp has woken up the AP.
1139 */
1140message ChreApWakeUpOccurred {
1141 // Vendor reverse domain name (expecting "com.google.pixel").
1142 optional string reverse_domain_name = 1;
1143
1144 // The 64-bit unique nanoapp identifier that describes the entity that has caused an AP wake-up
1145 // from CHRE. Whenever this event occurs, this means that the nanoapp sent a message to
1146 // the AP causing a transition between suspend/wake-up.
1147 optional int64 nanoapp_id = 2;
1148}
Stephane Lee747d01f2022-04-27 13:19:31 -07001149
1150/**
1151 * Snapshot of the current battery health of the device.
1152 */
1153message BatteryHealthStatus {
1154 // Vendor reverse domain name (expecting "com.google.pixel").
1155 optional string reverse_domain_name = 1;
1156
1157 // The algorithm that computes how the health status and health indexes are calculated.
1158 optional int32 health_algorithm = 2;
1159
1160 enum HealthStatus {
1161 UNKNOWN = 0; // The health status is unknown due to a SW limitation or issue
1162 NOMINAL = 1; // The battery is operating as expected
1163 MARGINAL = 2; // The battery may need replacement soon
1164 NEEDS_REPLACEMENT = 3; // The battery needs replacement
1165 FAILED = 4; // The battery has failed and no longer operates as expected
1166 }
1167
1168 // HealthStatus calculated using health_index, health_perf_index.
1169 optional HealthStatus health_status = 3;
1170
1171 // A percentage measure of the health of the battery with 100% being perfectly healthy.
1172 optional int32 health_index = 4;
1173
1174 // A percentage measure of the battery capacity of the device, affected by cycle life degradation.
1175 optional int32 health_capacity_index = 5;
1176
1177 // A percentage measure of the max performance of the device, affected by impedance growth with 100% being perfectly healthy.
Stephane Leecbf14e72022-05-06 16:16:18 -07001178 optional int32 health_impedance_index = 6;
Stephane Lee747d01f2022-04-27 13:19:31 -07001179
1180 // An index that expresses the likelihood of swelling given the SOC residency stats.
1181 optional int32 swelling_cumulative = 7;
1182
1183 // The battery capacity used to determine the health index. This is the reference value from b/223759710.
1184 optional int32 health_full_capacity = 8;
1185
1186 // This is the Rslow (resistance) value used (in part) to determine the Perf Index. The activation impedance (b/223545817) can be calculated from it using the perf index.
1187 optional int32 current_impedance = 9;
1188
1189 // The (hours) value of TimeH (0xb3), a register value, multiplied by 3.2 hours.
1190 optional int32 battery_age = 10;
1191
1192 // The cycle count at the time of the log event.
1193 optional int32 cycle_count = 11;
Jack Wuaf7bc902022-05-05 20:51:26 +08001194
1195 enum BattDisconnectStatus {
1196 BPST_BATT_UNKNOWN = 0;
1197 BPST_BATT_CONNECT = 1;
1198 BPST_BATT_DISCONNECT = 2; // Result of single battery disconnect detection
1199 BPST_BATT_CELL_FAULT = 3; // Result of cell fault detection which means actual disconnection
1200 }
1201
1202 // Battery disconnect detection stats.
1203 optional BattDisconnectStatus battery_disconnect_status = 12;
Stephane Lee747d01f2022-04-27 13:19:31 -07001204}
Jenny Hoce127722022-02-22 19:52:41 +08001205
1206/**
1207 * Log battery SOC/temperature usage data.
1208 *
1209 * Each data represents cumulative time of the battery
1210 * spent over a specific SOC and over a specific temperature
1211 * while charging and while discharging in seconds.
1212 *
1213 * Logged from:
1214 * /sys/class/power_supply/battery/swelling_data, via Vendor.
1215 */
1216message BatteryHealthUsage {
1217 // Vendor reverse domain name (expecting "com.google.pixel").
1218 optional string reverse_domain_name = 1;
1219
1220 // The temperature limit (deg C) used to accumulate the time above this value.
1221 optional int32 temperature_limit_deci_c = 2;
1222
1223 // The SOC limit (%) used to accumulate the time above this value.
1224 optional int32 soc_limit = 3;
1225
1226 // Time (s) accumulated only during charge at the given thresholds.
1227 optional int32 charge_time_secs = 4;
1228
1229 // Time (s) accumulated only during discharge at the given thresholds.
1230 optional int32 discharge_time_secs = 5;
1231}
Ocean Chen03e386a2022-03-10 02:49:40 +08001232
1233/*
1234 * A Value of F2FS smart idle maintenance feature enabled
1235 */
1236message F2fsSmartIdleMaintEnabledStateChanged {
1237 optional string reverse_domain_name = 1;
1238 /* Smart idle maint is enabled */
1239 optional bool enabled = 2;
1240}
Ocean Chen652c5822022-06-06 02:47:16 +08001241
1242/*
1243 * Snapshot of the block layer read write stats
1244 */
1245message BlockStatsReported {
1246 optional string reverse_domain_name = 1;
1247 /* number of read I/Os processed */
1248 optional int64 read_io = 2;
1249 /* number of sectors read */
1250 optional int64 read_sectors = 3;
1251 /* total wait time for read requests */
1252 optional int64 read_ticks = 4;
1253 /* number of write I/Os processed */
1254 optional int64 write_io = 5;
1255 /* number of sectors written */
1256 optional int64 write_sectors = 6;
1257 /* total wait time for write requests */
1258 optional int64 write_ticks = 7;
Jack Wuaf7bc902022-05-05 20:51:26 +08001259}
Roger Fangc8dda042022-08-19 14:15:17 +08001260
1261/**
1262 * Logs the reported vendor audio hardware stats.
1263 */
1264message VendorAudioHardwareStatsReported {
Roger Fang7172d482022-08-24 05:42:19 +08001265 optional string reverse_domain_name = 1;
Roger Fangc8dda042022-08-19 14:15:17 +08001266 /* The percentage of calls in a day where auto-mic-switch triggered.
1267 * It represented as a fixed-point integer with three decimal place.
1268 * E.g.:12.345% is repsented by 12345.
1269 */
Roger Fangfa8cfd62022-08-25 15:23:03 +08001270 optional int32 milli_rate_of_ams_per_day = 2;
Roger Fangc8dda042022-08-19 14:15:17 +08001271}