• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
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
34/* Allocated atom IDs. */
35message 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
66      F2fsGcSegmentInfo f2fs_gc_segment_info = 105028;
67      PowerMitigationStats mitigation_stats = 105029; // moved from atoms.proto
68
69      CitadelVersion citadel_version = 100018; // moved from vendor proprietary
70      CitadelEvent citadel_event = 100019;  // moved from vendor proprietary
71      VendorSpeakerStatsReported vendor_speaker_stats_reported = 105030;
72
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;
79
80      BatteryHealthStatus battery_health_status = 105037;
81      BatteryHealthUsage battery_health_usage = 105038;
82      F2fsSmartIdleMaintEnabledStateChanged f2fs_smart_idle_maint_enabled_state_changed = 105039;
83      BlockStatsReported block_stats_reported = 105040;
84      VendorAudioHardwareStatsReported vendor_audio_hardware_stats_reported = 105041;
85
86      ThermalDfsStats thermal_dfs_stats = 105042;
87      VendorLongIRQStatsReported vendor_long_irq_stats_reported = 105043;
88      VendorResumeLatencyStats vendor_resume_latency_stats = 105044;
89      VendorTempResidencyStats vendor_temp_residency_stats = 105045;
90
91      PcieLinkStatsReported pcie_link_stats = 105047;
92    }
93    // AOSP atom ID range ends at 109999
94}
95
96/* Supported reverse domain names. */
97message ReverseDomainNames {
98    optional string pixel = 1 [default = "com.google.pixel"];
99}
100
101/* A message containing detailed statistics and debug information about a charge session. */
102message ChargeStats {
103    /* Charge Adapter stats. */
104    enum AdapterType {
105        ADAPTER_TYPE_UNKNOWN = 0;
106        ADAPTER_TYPE_USB = 1;
107        ADAPTER_TYPE_USB_SDP = 2;
108        ADAPTER_TYPE_USB_DCP = 3;
109        ADAPTER_TYPE_USB_CDP = 4;
110        ADAPTER_TYPE_USB_ACA = 5;
111        ADAPTER_TYPE_USB_C = 6;
112        ADAPTER_TYPE_USB_PD = 7;
113        ADAPTER_TYPE_USB_PD_DRP = 8;
114        ADAPTER_TYPE_USB_PD_PPS = 9;
115        ADAPTER_TYPE_USB_PD_BRICKID = 10;
116        ADAPTER_TYPE_HVDCP = 11;
117        ADAPTER_TYPE_HVDCP3 = 12;
118        ADAPTER_TYPE_FLOAT = 13;
119        ADAPTER_TYPE_WLC  = 14;
120        ADAPTER_TYPE_WLC_EPP = 15;
121        ADAPTER_TYPE_WLC_SPP = 16;
122        ADAPTER_TYPE_GPP = 17;
123        ADAPTER_TYPE_10W = 18;
124        ADAPTER_TYPE_L7 = 19;
125        ADAPTER_TYPE_DL = 20;
126        ADAPTER_TYPE_WPC_EPP = 21;
127        ADAPTER_TYPE_WPC_GPP = 22;
128        ADAPTER_TYPE_WPC_10W = 23;
129        ADAPTER_TYPE_WPC_BPP = 24;
130        ADAPTER_TYPE_WPC_L7 = 25;
131        ADAPTER_TYPE_EXT = 26;
132        ADAPTER_TYPE_EXT1 = 27;
133        ADAPTER_TYPE_EXT2 = 28;
134        ADAPTER_TYPE_EXT_UNKNOWN = 29;
135    }
136    optional string reverse_domain_name = 1;
137    /* Type of charge adapter, enumerated above. */
138    optional AdapterType adapter_type = 2;
139    /* Max negotiated voltage by charge adapter, in mV. */
140    optional int32 adapter_voltage = 3;
141    /* Max negotiated current by charge adapter current, in mA. */
142    optional int32 adapter_amperage = 4;
143
144    /* Stats at beginning of charge session. */
145    /* System State of Charge, in percent. */
146    optional int32 ssoc_in = 5;
147    /* Voltage in mV. */
148    optional int32 voltage_in = 6;
149
150    /* Stats at end of charge session. */
151    /* System State of Charge, in percent. */
152    optional int32 ssoc_out = 7;
153    /* Voltage in mV. */
154    optional int32 voltage_out = 8;
155
156    /**
157     * These values are  meant to represent status of the charging device, used
158     * to validate the charging algorithm and explain charging performances.
159     * Examples of the content of the register:
160     * - APDO, PDO (power capabilities of the device, eg. 5V3A, 9V2A, 20V2A) for wired charging
161     * - Wireless charging MFG code. This is the value of a register of the WLC integrated
162     *   circuit to identify the vendor and type of WLC pad
163     * - Receiver operating frequency
164     * - Register status
165     */
166    optional int32 adapter_capabilities0 = 9;
167    optional int32 adapter_capabilities1 = 10;
168    optional int32 adapter_capabilities2 = 11;
169    optional int32 adapter_capabilities3 = 12;
170    optional int32 adapter_capabilities4 = 13;
171
172    /**
173     * These are values which reports the state of the wireless receiver, which will help in
174     * debugging charging issues and alternate configurations.
175     */
176    optional int32 receiver_state0 = 14;
177    optional int32 receiver_state1 = 15;
178
179    /* AACR feature to record capacity */
180    optional int32 charge_capacity = 16;
181}
182
183/* A message containing stats from each charge voltage tier. */
184message VoltageTierStats {
185    optional string reverse_domain_name = 1;
186    /* Voltage tier number, custom to implementation, should be <= 3. */
187    optional int32 voltage_tier = 2;
188
189    /* Stats when entering voltage tier. */
190    /* State of charge, in percent. */
191    optional float soc_in = 3;
192    /* Coulomb count, in mAh. */
193    optional int32 cc_in = 4;
194    /* Battery temperature, in deciC. */
195    optional int32 temp_in = 5;
196
197    /* Time spent at various charge speeds, in seconds. */
198    optional int32 time_fast_secs = 6;
199    optional int32 time_taper_secs = 7;
200    optional int32 time_other_secs = 8;
201
202    /* Battery temperature stats, in deciC. */
203    optional int32 temp_min = 9;
204    optional int32 temp_avg = 10;
205    optional int32 temp_max = 11;
206
207    /* Battery current stats, in mA. */
208    optional int32 ibatt_min = 12;
209    optional int32 ibatt_avg = 13;
210    optional int32 ibatt_max = 14;
211
212    /* Input current limit stats, in mA. */
213    optional int32 icl_min = 15;
214    optional int32 icl_avg = 16;
215    optional int32 icl_max = 17;
216
217    /**
218     * Efficiency number, receiver operating frequency in kHz for wireless charging
219     * (alignment)
220     */
221    optional int32 charging_operating_point = 18;
222    /* The minimum power out of the adapter at the given charging tier */
223    optional int32 min_adapter_power_out = 19;
224    /* The time-averaged power out of the adapter at the given charging tier */
225    optional int32 time_avg_adapter_power_out = 20;
226    /* The maximum power out of the adapter at the given charging tier */
227    optional int32 max_adapter_power_out = 21;
228}
229
230/* A message containing an alternate proprietary full battery capacity estimate. */
231message BatteryCapacity {
232    optional string reverse_domain_name = 1;
233    /* Sum of the change in coulomb count. */
234    optional int32 delta_cc_sum = 2;
235    /* Sum of the change in state of charge (battery level). */
236    optional int32 delta_vfsoc_sum = 3;
237}
238
239/* A message containing health values of UFS */
240message StorageUfsHealth {
241    optional string reverse_domain_name = 1;
242    /* The value of lifetimeA for UFS health */
243    optional int32 lifetime_a = 2;
244    /* The value of lifetimeB for UFS health */
245    optional int32 lifetime_b = 3;
246    /* The value of lifetimeC for UFS health */
247    optional int32 lifetime_c = 4;
248}
249
250/* A message containing filesystem stats of F2FS */
251message F2fsStatsInfo {
252    optional string reverse_domain_name = 1;
253    /* The value of dirty segments of f2fs */
254    optional int32 dirty_segments = 2;
255    /* The value of free segments of f2fs */
256    optional int32 free_segments = 3;
257    /* The times of checkpoint function called in foreground*/
258    optional int32 cp_calls_fg = 4;
259    /* The times of checkpoint function called in background */
260    optional int32 cp_calls_bg = 5;
261    /* The times of garbage collection function called in foreground */
262    optional int32 gc_calls_fg = 6;
263    /* The times of garbage collection function called in background */
264    optional int32 gc_calls_bg = 7;
265    /* The amount of blocks been moved by garbage collection in foreground */
266    optional int32 moved_blocks_fg = 8;
267    /* The amount of blocks been moved by garbage collection in background */
268    optional int32 moved_blocks_bg = 9;
269    /* The average of how many valid blocks is in a segment */
270    optional int32 valid_blocks = 10;
271}
272
273message ZramMmStat {
274    optional string reverse_domain_name = 1;
275    /* The value of original memory size */
276    optional int64 orig_data_size = 2;
277    /* The value of compressed memory size */
278    optional int64 compr_data_size = 3;
279    /* The value of consumed memory size to store compressed memory */
280    optional int64 mem_used_total = 4;
281    /* The value of number of page filled with same elements data */
282    optional int64 same_pages = 5;
283    /* The value of number of incompressible page */
284    optional int64 huge_pages = 6;
285    /* The value of number of incompressible pages since boot */
286    optional int64 huge_pages_since_boot = 7;
287}
288
289message ZramBdStat {
290    optional string reverse_domain_name = 1;
291    /* the number of pages in backing device */
292    optional int64 bd_count = 2;
293    /* The number of pages readed from backing device */
294    optional int64 bd_reads = 3;
295    /* The number of pages written to backing device */
296    optional int64 bd_writes = 4;
297}
298
299/* A message containing boot times */
300message BootStatsInfo {
301    optional string reverse_domain_name = 1;
302    /* The F2FS fsck time in secs */
303    optional int32 fsck_time_sec = 2;
304    /* The F2FS mounted time in secs */
305    optional int32 mounted_time_sec = 3;
306    /* The F2FS checkpoint=disable time in secs */
307    optional int32 checkpoint_time_sec = 4;
308}
309
310/* A message containing wireless charging health info. */
311message WirelessChargingStats {
312    /* Captures if a google charger used when start wireless charging */
313    enum ChargerVendor {
314        VENDOR_UNKNOWN = 0;
315        VENDOR_GOOGLE = 1;
316    }
317
318    optional string reverse_domain_name = 1;
319    optional ChargerVendor charger_vendor = 2;
320}
321
322/* Current device Orientation */
323message DeviceOrientation {
324    enum Orientation {
325        ORIENTATION_UNKNOWN = 0;
326        ORIENTATION_0 = 1;
327        ORIENTATION_90 = 2;
328        ORIENTATION_180 = 3;
329        ORIENTATION_270 = 4;
330    }
331
332    optional string reverse_domain_name = 1;
333    /* Device orientation. */
334    optional Orientation orientation = 2;
335}
336
337/* Raw battery capacity stats */
338message BatteryCapacityFG {
339    enum LogReason {
340        LOG_REASON_UNKNOWN = 0;
341        LOG_REASON_CONNECTED = 1;
342        LOG_REASON_DISCONNECTED = 2;
343        LOG_REASON_FULL_CHARGE = 3;
344        LOG_REASON_PERCENT_SKIP = 4;
345        LOG_REASON_DIVERGING_FG = 5;
346    }
347
348    optional string reverse_domain_name = 1;
349    /* Uevent logging reason, enumerated above. */
350    optional LogReason capacity_log_reason = 2;
351
352    /* The battery capacity reported from the FG (fuel gauge) hardware  */
353    optional float capacity_gdf = 3;
354    /* The filtered system battery capacity reported to the UI */
355    optional float capacity_ssoc = 4;
356    /* The fuel gauge capacity curve midpoint FG (fuel gauge) value */
357    optional float capacity_gdf_curve = 5;
358    /* The fuel gauge capacity curve midpoint UI value */
359    optional float capacity_ssoc_curve = 6;
360}
361
362message  PdVidPid {
363    optional string reverse_domain_name = 1;
364    /* Vendor ID of wired charger */
365    optional int32 vid = 2;
366    /* Product ID of wired charger */
367    optional int32 pid = 3;
368}
369
370message BatteryEEPROM {
371    optional string reverse_domain_name = 1;
372   /* The cycle count number; record of charge/discharge times */
373    optional int32 cycle_cnt = 2;
374    /* The current full capacity of the battery under nominal conditions */
375    optional int32 full_cap = 3;
376    /* The battery equivalent series resistance */
377    optional int32 esr = 4;
378    /* Battery resistance related to temperature change */
379    optional int32 rslow = 5;
380    /* Battery health indicator reflecting the battery age state */
381    optional int32 soh = 6;
382    /* The battery temperature */
383    optional int32 batt_temp = 7;
384
385    /* Battery state of charge (SOC) shutdown point */
386    optional int32 cutoff_soc = 8;
387    /* Raw battery state of charge (SOC), based on battery current (CC = Coulomb Counter) */
388    optional int32 cc_soc = 9;
389    /* Estimated battery state of charge (SOC) from batt_soc with endpoint limiting (0% and 100%) */
390    optional int32 sys_soc = 10;
391    /* Filtered monotonic SOC, handles situations where the cutoff_soc is increased and
392     * then decreased from the battery physical properties
393     */
394    optional int32 msoc = 11;
395    /* Estimated SOC derived from cc_soc that provides voltage loop feedback correction using
396     * battery voltage, current, and status values
397     */
398    optional int32 batt_soc = 12;
399
400    /* Field used for data padding in the EEPROM data */
401    optional int32 reserve = 13;
402
403    /* The maximum battery temperature ever seen */
404    optional int32 max_temp = 14;
405    /* The minimum battery temperature ever seen */
406    optional int32 min_temp = 15;
407    /* The maximum battery voltage ever seen */
408    optional int32 max_vbatt = 16;
409    /* The minimum battery voltage ever seen */
410    optional int32 min_vbatt = 17;
411    /* The maximum battery current ever seen */
412    optional int32 max_ibatt = 18;
413    /* The minimum battery current ever seen */
414    optional int32 min_ibatt = 19;
415    /* Field used to verify the integrity of the EEPROM data */
416    optional int32 checksum = 20;
417
418    /* Extend data for P21 */
419    /* Temperature compensation information */
420    optional int32 tempco = 21;
421    /* Learned characterization related to the voltage gauge */
422    optional int32 rcomp0 = 22;
423    /* For time to monitor the life of cell */
424    optional int32 timer_h = 23;
425    /* The full capacity of the battery learning at the end of every charge cycle */
426    optional int32 full_rep = 24;
427}
428
429/* A message containing an exceptional event from citadel. */
430message CitadelEvent {
431  enum Event {
432    ALERT = 1;
433    REBOOTED = 2;
434    UPGRADED = 3;
435    ALERT_V2 = 4;
436    SEC_CH_STATE = 5;
437  };
438  optional string reverse_domain_name = 1;
439  optional Event event = 2;
440  optional int32 reset_count = 3;
441  optional int64 uptime_micros = 4;
442  enum Priority {
443    LOW = 0;
444    MEDIUM = 1;
445    HIGH = 2;
446  };
447  optional Priority priority = 5;
448
449  // ALERT-specific fields.  These fields correspond to the interrupt status
450  // bits for alerts within citadel.  When alerts fire one or more of these
451  // bits are set to indicate the alert source.
452  optional int32 intr_sts_0 = 6;
453  optional int32 intr_sts_1 = 7;
454  optional int32 intr_sts_2 = 8;
455
456  // REBOOTED-specific fields.  These fields correspond to the details of how
457  // the hardware reboot occurred.  A reboot is a noteworthy event for citadel,
458  // as it can be triggered by events like stack overflow or other software
459  // bugs.
460  optional int32 rstsrc = 9;
461  optional int32 exitpd = 10;
462  optional int32 which0 = 11;
463  optional int32 which1 = 12;
464
465  // UPGRADED-specific field. This field corresponds to the result of FW
466  // upgrade for citadel.
467  optional int32 upgrade_state = 13;
468
469  // ALERT_V2-specific field. This field corresponds to the GLOBALSEC Log
470  // which contains normal globalsec, camo, temp and buserr.
471  optional int32 alert_grp_0 = 14;
472  optional int32 alert_grp_1 = 15;
473  optional int32 alert_grp_2 = 16;
474  optional int32 alert_grp_3 = 17;
475  optional int32 camo_breaches_0 = 18;
476  optional int32 camo_breaches_1 = 19;
477  optional int32 temp_min = 20;
478  optional int32 temp_max = 21;
479  optional int32 bus_err = 22;
480
481  // SEC_CH_STATE-specific filed. This field corresponds to the state
482  // of GSA-GSC secure channel.
483  optional int32 sec_ch_state = 23;
484}
485
486/* A message containing the citadel firmware version. */
487message CitadelVersion {
488   optional string reverse_domain_name = 1;
489   optional string version = 2;
490}
491
492/* A message containing the speaker impedance. */
493 message VendorSpeakerImpedance {
494    optional string reverse_domain_name = 1;
495    optional int32 speaker_location = 2;
496    optional int32 impedance = 3;
497}
498
499/**
500 * Logs the reported vendor speaker health stats.
501 * Logged from: hardware/google/pixel/pixelstats/SysfsCollector.cpp
502 */
503message VendorSpeakerStatsReported {
504  /* Vendor reverse domain name (expecting "com.google.pixel") */
505  optional string reverse_domain_name = 1;
506  /* The location of speaker; 0 = left , 1 = right */
507  optional int32 speaker_location = 2;
508  /* The speaker's impedance value (milliOhm) */
509  optional int32 impedance = 3;
510  /* The speaker's maximum temperature (milliDegree C) */
511  optional int32 max_temperature = 4;
512  /* The speaker's execursion length (micrometer) */
513  optional int32 excursion = 5;
514  /* The speaker's heart beat count */
515  optional int32 heartbeat = 6;
516}
517
518/* A message containing how many times of ufs host reset */
519message StorageUfsResetCount {
520    optional string reverse_domain_name = 1;
521    /* How many UFS error reset are triggered */
522    optional int32 host_reset_count = 2;
523}
524
525/* A message containing Pixel memory metrics collected hourly. */
526message PixelMmMetricsPerHour {
527    optional string reverse_domain_name = 1;
528    optional int64 free_pages = 2;
529    optional int64 anon_pages = 3;
530    optional int64 file_pages = 4;
531    optional int64 slab_reclaimable = 5;
532    optional int64 zspages = 6;
533    optional int64 unevictable = 7;
534    optional int64 ion_total_pools = 8;
535    optional int64 gpu_memory = 9;
536    optional int64 slab_unreclaimable = 10;
537    optional int64 psi_cpu_some_total = 11;
538    optional int64 psi_io_full_total = 12;
539    optional int64 psi_io_some_total = 13;
540    optional int64 psi_mem_full_total = 14;
541    optional int64 psi_mem_some_total = 15;
542    optional int32 psi_cpu_some_avg10_min = 16;
543    optional int32 psi_cpu_some_avg10_max = 17;
544    optional int32 psi_cpu_some_avg10_avg = 18;
545    optional int32 psi_cpu_some_avg60_min = 19;
546    optional int32 psi_cpu_some_avg60_max = 20;
547    optional int32 psi_cpu_some_avg60_avg = 21;
548    optional int32 psi_cpu_some_avg300_min = 22;
549    optional int32 psi_cpu_some_avg300_max = 23;
550    optional int32 psi_cpu_some_avg300_avg = 24;
551    optional int32 psi_io_full_avg10_min = 25;
552    optional int32 psi_io_full_avg10_max = 26;
553    optional int32 psi_io_full_avg10_avg = 27;
554    optional int32 psi_io_full_avg60_min = 28;
555    optional int32 psi_io_full_avg60_max = 29;
556    optional int32 psi_io_full_avg60_avg = 30;
557    optional int32 psi_io_full_avg300_min = 31;
558    optional int32 psi_io_full_avg300_max = 32;
559    optional int32 psi_io_full_avg300_avg = 33;
560    optional int32 psi_io_some_avg10_min = 34;
561    optional int32 psi_io_some_avg10_max = 35;
562    optional int32 psi_io_some_avg10_avg = 36;
563    optional int32 psi_io_some_avg60_min = 37;
564    optional int32 psi_io_some_avg60_max = 38;
565    optional int32 psi_io_some_avg60_avg = 39;
566    optional int32 psi_io_some_avg300_min = 40;
567    optional int32 psi_io_some_avg300_max = 41;
568    optional int32 psi_io_some_avg300_avg = 42;
569    optional int32 psi_mem_full_avg10_min = 43;
570    optional int32 psi_mem_full_avg10_max = 44;
571    optional int32 psi_mem_full_avg10_avg = 45;
572    optional int32 psi_mem_full_avg60_min = 46;
573    optional int32 psi_mem_full_avg60_max = 47;
574    optional int32 psi_mem_full_avg60_avg = 48;
575    optional int32 psi_mem_full_avg300_min = 49;
576    optional int32 psi_mem_full_avg300_max = 50;
577    optional int32 psi_mem_full_avg300_avg = 51;
578    optional int32 psi_mem_some_avg10_min = 52;
579    optional int32 psi_mem_some_avg10_max = 53;
580    optional int32 psi_mem_some_avg10_avg = 54;
581    optional int32 psi_mem_some_avg60_min = 55;
582    optional int32 psi_mem_some_avg60_max = 56;
583    optional int32 psi_mem_some_avg60_avg = 57;
584    optional int32 psi_mem_some_avg300_min = 58;
585    optional int32 psi_mem_some_avg300_max = 59;
586    optional int32 psi_mem_some_avg300_avg = 60;
587}
588
589/* A message containing Pixel memory metrics collected daily. */
590message PixelMmMetricsPerDay {
591    optional string reverse_domain_name = 1;
592    optional int64 workingset_refault = 2;  /* refault_file */
593    optional int64 pswpin = 3;
594    optional int64 pswpout = 4;
595    optional int64 allocstall_dma = 5;
596    optional int64 allocstall_dma32 = 6;
597    optional int64 allocstall_normal = 7;
598    optional int64 allocstall_movable = 8;
599    optional int64 pgalloc_dma = 9;
600    optional int64 pgalloc_dma32 = 10;
601    optional int64 pgalloc_normal = 11;
602    optional int64 pgalloc_movable = 12;
603    optional int64 pgsteal_kswapd = 13;
604    optional int64 pgsteal_direct = 14;
605    optional int64 pgscan_kswapd = 15;
606    optional int64 pgscan_direct = 16;
607    optional int64 oom_kill = 17;
608    optional int64 pgalloc_high = 18;
609    optional int64 pgcache_hit = 19;
610    optional int64 pgcache_miss = 20;
611    optional int64 kswapd_stime_clks = 21;
612    optional int64 kcompactd_stime_clks = 22;
613    optional int64 direct_reclaim_native_latency_total_time = 23;
614    optional int64 direct_reclaim_native_latency0 = 24;
615    optional int64 direct_reclaim_native_latency1 = 25;
616    optional int64 direct_reclaim_native_latency2 = 26;
617    optional int64 direct_reclaim_native_latency3 = 27;
618    optional int64 direct_reclaim_visible_latency_total_time = 28;
619    optional int64 direct_reclaim_visible_latency0 = 29;
620    optional int64 direct_reclaim_visible_latency1 = 30;
621    optional int64 direct_reclaim_visible_latency2 = 31;
622    optional int64 direct_reclaim_visible_latency3 = 32;
623    optional int64 direct_reclaim_top_latency_total_time = 33;
624    optional int64 direct_reclaim_top_latency0 = 34;
625    optional int64 direct_reclaim_top_latency1 = 35;
626    optional int64 direct_reclaim_top_latency2 = 36;
627    optional int64 direct_reclaim_top_latency3 = 37;
628    optional int64 direct_reclaim_other_latency_total_time = 38;
629    optional int64 direct_reclaim_other_latency0 = 39;
630    optional int64 direct_reclaim_other_latency1 = 40;
631    optional int64 direct_reclaim_other_latency2 = 41;
632    optional int64 direct_reclaim_other_latency3 = 42;
633    optional int64 compaction_total_time = 43;
634    optional int64 compaction_ev_count0 = 44;
635    optional int64 compaction_ev_count1 = 45;
636    optional int64 compaction_ev_count2 = 46;
637    optional int64 compaction_ev_count3 = 47;
638    optional int64 compaction_ev_count4 = 48;
639    optional int64 workingset_refault_anon = 49;
640    optional int64 workingset_refault_file = 50;
641    optional int64 compact_success = 51;
642    optional int64 compact_fail = 52;
643    optional int64 kswapd_low_wmark_hq = 53;
644    optional int64 kswapd_high_wmark_hq = 54;
645    optional int64 thp_file_alloc = 55;
646    optional int64 thp_zero_page_alloc = 56;
647    optional int64 thp_split_page = 57;
648    optional int64 thp_migration_split = 58;
649    optional int64 thp_deferred_split_page = 59;
650}
651
652/* A message containing CMA metrics collected from dogfooding only. */
653message CmaStatus {
654  optional string reverse_domain_name = 1;
655  optional int32 type = 2;
656  optional int64 cma_alloc_pages_attempts = 3;
657  optional int64 cma_alloc_pages_soft_attempts = 4;
658  optional int64 cma_fail_pages = 5;
659  optional int64 cma_fail_soft_pages = 6;
660  optional int64 migrated_pages = 7;
661  optional string cma_heap_name = 8;
662}
663
664/* A message containing CMA metrics (External). */
665message CmaStatusExt {
666  optional string reverse_domain_name = 1;
667  optional int32 type = 2;
668  optional int64 cma_alloc_latency_low = 3;
669  optional int64 cma_alloc_latency_mid = 4;
670  optional int64 cma_alloc_latency_high = 5;
671  optional string cma_heap_name = 6;
672}
673
674message F2fsCompressionInfo {
675    optional string reverse_domain_name = 1;
676    /* Show the block count written after compression since mount */
677    optional int32 compr_written_blocks = 2;
678    /* Show the saved block count with compression since mount */
679    optional int32 compr_saved_blocks = 3;
680    /* Show the count of inode newly enabled for compression since mount */
681    optional int32 compr_new_inodes = 4;
682}
683
684/**
685 * Log bucketed battery charge cycles.
686 *
687 * Each bucket represents cycles of the battery past
688 * a given charge point.  For example, bucket 1 is the
689 * lowest 1/8th of the battery, and bucket 8 is 100%.
690 *
691 * Logged from:
692 * /sys/class/power_supply/bms/cycle_count, via Vendor.
693 */
694message VendorChargeCycles {
695    optional string reverse_domain_name = 1;
696    optional int32 cycle_bucket_1 = 2;
697    optional int32 cycle_bucket_2 = 3;
698    optional int32 cycle_bucket_3 = 4;
699    optional int32 cycle_bucket_4 = 5;
700    optional int32 cycle_bucket_5 = 6;
701    optional int32 cycle_bucket_6 = 7;
702    optional int32 cycle_bucket_7 = 8;
703    optional int32 cycle_bucket_8 = 9;
704    optional int32 cycle_bucket_9 = 10;
705    optional int32 cycle_bucket_10 = 11;
706}
707
708/**
709 * Logs the report of a failed hardware.
710 *
711 * Logged from:
712 *  Vendor HALs.
713 *
714 */
715message VendorHardwareFailed {
716    enum HardwareType {
717      HARDWARE_FAILED_UNKNOWN = 0;
718      HARDWARE_FAILED_MICROPHONE = 1;
719      HARDWARE_FAILED_CODEC = 2;
720      HARDWARE_FAILED_SPEAKER = 3;
721      HARDWARE_FAILED_FINGERPRINT = 4;
722    }
723    optional string reverse_domain_name = 1;
724    optional HardwareType hardware_type = 2;
725
726    /**
727     * hardware_location allows vendors to differentiate between multiple
728     * instances of the same hardware_type.  The specific locations are vendor
729     * defined integers, referring to board-specific numbering schemes.
730     */
731    optional int32 hardware_location = 3;
732    /**
733     * failure_code is specific to the HardwareType of the failed hardware.
734     * It should use one of the enum values defined below.
735     */
736    enum HardwareErrorCode {
737      UNKNOWN = 0;
738      COMPLETE = 1;
739      SPEAKER_HIGH_Z = 2;
740      SPEAKER_SHORT = 3;
741      FINGERPRINT_SENSOR_BROKEN = 4;
742      FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
743      DEGRADE = 6;
744    }
745    optional int32 failure_code = 4;
746}
747
748/**
749 * Log slow I/O operations on the primary storage.
750 */
751message VendorSlowIo {
752    // Classifications of IO Operations.
753    enum IoOperation {
754      UNKNOWN = 0;
755      READ = 1;
756      WRITE = 2;
757      UNMAP = 3;
758      SYNC = 4;
759    }
760    optional string reverse_domain_name = 1;
761    optional IoOperation operation = 2;
762
763    // The number of slow IO operations of this type over 24 hours.
764    optional int32 count = 3;
765}
766
767/*
768 * Logs the reported speech DSP status.
769 * Logged from: Vendor audio implementation.
770 */
771message VendorSpeechDspStat {
772    optional string reverse_domain_name = 1;
773    // The total Speech DSP uptime in milliseconds.
774    optional int32 total_uptime_millis = 2;
775    // The total Speech DSP downtime in milliseconds.
776    optional int32 total_downtime_millis = 3;
777    optional int32 total_crash_count = 4;
778    optional int32 total_recover_count = 5;
779}
780
781/**
782 * Log an event when the device has been physically dropped.
783 * Reported from the /vendor partition.
784 */
785message VendorPhysicalDropDetected {
786  optional string reverse_domain_name = 1;
787  // Confidence that the event was actually a drop, 0 -> 100
788  optional int32 confidence_pctg = 2;
789  // Peak acceleration of the drop, in 1/1000s of a g.
790  optional int32 accel_peak_thousandths_g = 3;
791  // Duration of freefall in ms
792  optional int32 freefall_time_millis = 4;
793}
794
795/** Represents USB port overheat event. */
796message VendorUsbPortOverheat {
797  optional string reverse_domain_name = 1;
798  /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
799  optional int32 plug_temperature_deci_c = 2;
800  /* Maximum temperature of USB port during overheat event, in 1/10ths of degree
801   * C. */
802  optional int32 max_temperature_deci_c = 3;
803  /* Time between USB plug event and overheat threshold trip, in seconds. */
804  optional int32 time_to_overheat_secs = 4;
805  /* Time between overheat threshold trip and hysteresis, in seconds. */
806  optional int32 time_to_hysteresis_secs = 5;
807  /* Time between hysteresis and active mitigation ending, in seconds. */
808  optional int32 time_to_inactive_secs = 6;
809}
810
811/**
812 * Log battery health snapshot.
813 *
814 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
815 * are snapshotted periodically over 24hrs.
816 */
817message VendorBatteryHealthSnapshot {
818  enum BatterySnapshotType {
819    BATTERY_SNAPSHOT_TYPE_UNKNOWN = 0;
820    BATTERY_SNAPSHOT_TYPE_MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
821    BATTERY_SNAPSHOT_TYPE_MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
822    BATTERY_SNAPSHOT_TYPE_MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
823    BATTERY_SNAPSHOT_TYPE_MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
824    BATTERY_SNAPSHOT_TYPE_MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
825    BATTERY_SNAPSHOT_TYPE_MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
826    BATTERY_SNAPSHOT_TYPE_MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
827    BATTERY_SNAPSHOT_TYPE_MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
828    BATTERY_SNAPSHOT_TYPE_MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
829    BATTERY_SNAPSHOT_TYPE_MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
830    BATTERY_SNAPSHOT_TYPE_AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
831  }
832  optional string reverse_domain_name = 1;
833  optional BatterySnapshotType type = 2;
834  // Temperature, in 1/10ths of degree C.
835  optional int32 temperature_deci_celsius = 3;
836  // Voltage Battery Voltage, in microVolts.
837  optional int32 voltage_micro_volt = 4;
838  // Current Battery current, in microAmps.
839  optional int32 current_micro_amps = 5;
840  // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
841  optional int32 open_circuit_micro_volt = 6;
842  // Resistance Battery Resistance, in microOhms.
843  optional int32 resistance_micro_ohm = 7;
844  // Level Battery Level, as % of full.
845  optional int32 level_percent = 8;
846}
847
848/**
849 * Log battery caused shutdown with the last recorded voltage.
850 */
851message VendorBatteryCausedShutdown {
852 optional string reverse_domain_name = 1;
853 // The last recorded battery voltage prior to shutdown.
854 optional int32 last_recorded_micro_volt = 2;
855}
856
857/**
858 * Log mitigation statistics.
859 */
860message PowerMitigationStats {
861 optional string reverse_domain_name = 1;
862 // The last triggered count: batoilo.
863 optional int32 batoilo_count = 2;
864 // The last triggered count: vdroop1.
865 optional int32 vdroop1_count = 3;
866 // The last triggered count: vdroop2.
867 optional int32 vdroop2_count = 4;
868 // The last triggered count: smpl_warn.
869 optional int32 smpl_warn_count = 5;
870 // The last triggered count: ocp_cpu1.
871 optional int32 ocp_cpu1_count = 6;
872 // The last triggered count: ocp_cpu2.
873 optional int32 ocp_cpu2_count = 7;
874 // The last triggered count: ocp_gpu.
875 optional int32 ocp_gpu_count = 8;
876 // The last triggered count: ocp_tpu.
877 optional int32 ocp_tpu_count = 9;
878 // The last triggered count: soft_ocp_cpu1.
879 optional int32 soft_ocp_cpu1_count = 10;
880 // The last triggered count: soft_ocp_cpu2.
881 optional int32 soft_ocp_cpu2_count = 11;
882 // The last triggered count: soft_ocp_gpu.
883 optional int32 soft_ocp_gpu_count = 12;
884 // The last triggered count: soft_ocp_tpu.
885 optional int32 soft_ocp_tpu_count = 13;
886 // The last triggered capacity: batoilo.
887 optional int32 batoilo_cap = 14;
888 // The last triggered capacity: vdroop1.
889 optional int32 vdroop1_cap = 15;
890 // The last triggered capacity: vdroop2.
891 optional int32 vdroop2_cap = 16;
892 // The last triggered capacity: smpl_warn.
893 optional int32 smpl_warn_cap = 17;
894 // The last triggered capacity: ocp_cpu1.
895 optional int32 ocp_cpu1_cap = 18;
896 // The last triggered capacity: ocp_cpu2.
897 optional int32 ocp_cpu2_cap = 19;
898 // The last triggered capacity: ocp_gpu.
899 optional int32 ocp_gpu_cap = 20;
900 // The last triggered capacity: ocp_tpu.
901 optional int32 ocp_tpu_cap = 21;
902 // The last triggered capacity: soft_ocp_cpu1.
903 optional int32 soft_ocp_cpu1_cap = 22;
904 // The last triggered capacity: soft_ocp_cpu2.
905 optional int32 soft_ocp_cpu2_cap = 23;
906 // The last triggered capacity: soft_ocp_gpu.
907 optional int32 soft_ocp_gpu_cap = 24;
908 // The last triggered capacity: soft_ocp_tpu.
909 optional int32 soft_ocp_tpu_cap = 25;
910}
911
912/**
913 * Log thermal statistics.
914 */
915message ThermalDfsStats {
916 optional string reverse_domain_name = 1;
917 // The last count of BIG cluster dfs triggers
918 optional int32 big_dfs_count = 2;
919 // The last count of MID cluster dfs triggers
920 optional int32 mid_dfs_count = 3;
921 // The last count of LITTLE cluster dfs triggers
922 optional int32 little_dfs_count = 4;
923 // The last count of GPU dfs triggers
924 optional int32 gpu_dfs_count = 5;
925 // The last count of TPU dfs triggers
926 optional int32 tpu_dfs_count = 6;
927 // The last count of DSP dfs triggers
928 optional int32 aur_dfs_count = 7;
929}
930
931/**
932 * Log how many segments have been reclaimed in a specific GC mode.
933 */
934message F2fsGcSegmentInfo {
935    optional string reverse_domain_name = 1;
936    /* Reclaimed segments in GC normal mode */
937    optional int32 reclaimed_segments_normal = 2;
938    /* Reclaimed segments in GC urgent high mode */
939    optional int32 reclaimed_segments_urgent_high = 3;
940    /* Reclaimed segments in GC urgent low mode */
941    optional int32 reclaimed_segments_urgent_low = 4;
942    /* Reclaimed segments in GC urgent mid mode */
943    optional int32 reclaimed_segments_urgent_mid = 5;
944}
945
946/**
947 * Logs an event indicating that a nanoapp loading has failed at the HAL.
948 */
949message ChreHalNanoappLoadFailed {
950  // Vendor reverse domain name (expecting "com.google.pixel").
951  optional string reverse_domain_name = 1;
952
953  enum Type {
954    TYPE_UNKNOWN = 0;
955    // Corresponds to preloaded nanoapps on the device.
956    TYPE_PRELOADED = 1;
957    // Dynamic loading of a nanoapp (e.g. code download).
958    TYPE_DYNAMIC = 2;
959  }
960
961  enum Reason {
962    REASON_UNKNOWN = 0;
963    // A generic error code that does not match any of the others.
964    REASON_ERROR_GENERIC = 1;
965    // Failure at the connection between HAL<->CHRE.
966    REASON_CONNECTION_ERROR = 2;
967    // System ran out of memory.
968    REASON_OOM = 3;
969    // Nanoapp did not have the right signing for loading.
970    REASON_SIGNATURE_MISMATCH = 4;
971  }
972
973  // The 64-bit unique nanoapp identifier of the nanoapp that failed.
974  optional int64 nanoapp_id = 2;
975
976  // The type of the load event.
977  optional Type type = 3;
978
979  // The reason for the failure.
980  optional Reason reason = 4;
981}
982
983/**
984 * An enum describing a module within CHRE.
985 */
986enum ChreModuleType {
987  CHRE_MODULE_TYPE_UNKNOWN = 0;
988  CHRE_MODULE_TYPE_CHRE = 1; // Core CHRE framework
989  CHRE_MODULE_TYPE_PAL = 2; // PAL module (could be CHPP)
990  CHRE_MODULE_TYPE_NANOAPP = 3;
991}
992
993/**
994 * An enum describing the CHRE PAL type.
995 */
996enum ChrePalType {
997  CHRE_PAL_TYPE_UNKNOWN = 0;
998  CHRE_PAL_TYPE_SENSOR = 1;
999  CHRE_PAL_TYPE_WIFI = 2;
1000  CHRE_PAL_TYPE_GNSS = 3;
1001  CHRE_PAL_TYPE_WWAN = 4;
1002  CHRE_PAL_TYPE_AUDIO = 5;
1003  CHRE_PAL_TYPE_BLE = 6;
1004}
1005
1006/**
1007 * Logs an event indicating that a CHRE PAL open has failed.
1008 */
1009message ChrePalOpenFailed {
1010  // Vendor reverse domain name (expecting "com.google.pixel").
1011  optional string reverse_domain_name = 1;
1012
1013  enum Type {
1014    TYPE_UNKNOWN = 0;
1015    // Initial open when CHRE starts.
1016    INITIAL_OPEN = 1;
1017    // Any form of "reopen" event internally in the PAL.
1018    REOPEN = 2;
1019  }
1020
1021  // The PAL this failure event is for.
1022  optional ChrePalType pal = 2;
1023
1024  // The type of failure observed.
1025  optional Type type = 3;
1026}
1027
1028/**
1029 * The type of CHRE API request.
1030 */
1031enum ChreApiType {
1032  CHRE_API_TYPE_UNKNOWN = 0;
1033  CHRE_API_TYPE_WIFI_SCAN_MONITOR = 1;
1034  CHRE_API_TYPE_WIFI_ACTIVE_SCAN = 2;
1035  CHRE_API_TYPE_WIFI_RTT_RANGING = 3;
1036}
1037
1038/**
1039 * The type of CHRE API error.
1040 */
1041enum ChreError {
1042  CHRE_ERROR_UNKNOWN = 0;
1043
1044  // No error occurred.
1045  CHRE_ERROR_NONE = 1;
1046
1047  // An unspecified failure occurred.
1048  CHRE_ERROR = 2;
1049
1050  // One or more supplied arguments are invalid.
1051  CHRE_ERROR_INVALID_ARGUMENT = 3;
1052
1053  // Unable to satisfy request because the system is busy.
1054  CHRE_ERROR_BUSY = 4;
1055
1056  // Unable to allocate memory.
1057  CHRE_ERROR_NO_MEMORY = 5;
1058
1059  // The requested feature is not supported.
1060  CHRE_ERROR_NOT_SUPPORTED = 6;
1061
1062  // A timeout occurred while processing the request.
1063  CHRE_ERROR_TIMEOUT = 7;
1064
1065  // The relevant capability is disabled, for example due to a user
1066  // configuration that takes precedence over this request.
1067  CHRE_ERROR_FUNCTION_DISABLED = 8;
1068}
1069
1070/**
1071 * Distribution of CHRE API error codes.
1072 */
1073message ChreApiErrorCodeDistributionTaken {
1074  // Vendor reverse domain name (expecting "com.google.pixel").
1075  optional string reverse_domain_name = 1;
1076
1077  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1078  optional int32 snapshot_chre_get_time_ms = 2;
1079
1080  // The CHRE API type.
1081  optional ChreApiType api_type = 3;
1082
1083  // Corresponds to the CHRE error code that occurred, as defined in the
1084  // "enum chreError" field in chre_api/chre/common.h.
1085  optional ChreError error_code = 4;
1086  optional int32 num_errors = 5;
1087}
1088
1089/**
1090 * Snapshot of the dynamic memory allocated in CHRE.
1091 */
1092message ChreDynamicMemorySnapshotReported {
1093  // Vendor reverse domain name (expecting "com.google.pixel").
1094  optional string reverse_domain_name = 1;
1095
1096  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1097  optional int32 snapshot_chre_get_time_ms = 2;
1098
1099  // The type of the module.
1100  optional ChreModuleType module_type = 3;
1101
1102  // The unique 64-bit ID for a nanoapp, only used if the module_type is NANOAPP.
1103  // If module_type is PAL, then it represents the ChrePalType enum. If the module_type
1104  // is CHRE, then a zero value should be used.
1105  optional int64 pal_type_or_nanoapp_id = 4;
1106
1107  // The max allocation amount of this module in bytes.
1108  optional int32 max_allocation_bytes = 5;
1109
1110  // The current allocation amount of this module in bytes.
1111  optional int32 current_allocation_bytes = 6;
1112}
1113
1114/**
1115 * Snapshot of the event queue stats in CHRE.
1116 */
1117message ChreEventQueueSnapshotReported {
1118  // Vendor reverse domain name (expecting "com.google.pixel").
1119  optional string reverse_domain_name = 1;
1120
1121  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1122  optional int32 snapshot_chre_get_time_ms = 2;
1123
1124  // The maximum size the event queue got to (i.e. num pending events).
1125  optional int32 max_event_queue_size = 3;
1126
1127  // The average size the event queue got to (i.e. num pending events).
1128  optional int32 mean_event_queue_size = 4;
1129
1130  // The number of events that were dropped due to capacity limits.
1131  optional int32 num_dropped_events = 5;
1132
1133  // The maximum amount of time it took for an event, from when it was received,
1134  // to when it was delivered to all interested modules. This value represents
1135  // the total delay within the CHRE subsystem.
1136  optional int64 max_queue_delay_us = 6;
1137
1138  // The mean value of the delay in microseconds.
1139  optional int64 mean_queue_delay_us = 7;
1140}
1141
1142/**
1143 * Indicates that a nanoapp has woken up the AP.
1144 */
1145message ChreApWakeUpOccurred {
1146  // Vendor reverse domain name (expecting "com.google.pixel").
1147  optional string reverse_domain_name = 1;
1148
1149  // The 64-bit unique nanoapp identifier that describes the entity that has caused an AP wake-up
1150  // from CHRE. Whenever this event occurs, this means that the nanoapp sent a message to
1151  // the AP causing a transition between suspend/wake-up.
1152  optional int64 nanoapp_id = 2;
1153}
1154
1155/**
1156 * Snapshot of the current battery health of the device.
1157 */
1158message BatteryHealthStatus {
1159  // Vendor reverse domain name (expecting "com.google.pixel").
1160  optional string reverse_domain_name = 1;
1161
1162  // The algorithm that computes how the health status and health indexes are calculated.
1163  optional int32 health_algorithm = 2;
1164
1165  enum HealthStatus {
1166    UNKNOWN = -1; // The health status is unknown due to a SW limitation or issue
1167    NOMINAL = 0; // The battery is operating as expected
1168    MARGINAL = 1; // The battery may need replacement soon
1169    NEEDS_REPLACEMENT = 2; // The battery needs replacement
1170    FAILED = 3; // The battery has failed and no longer operates as expected
1171  }
1172
1173  // HealthStatus calculated using health_index, health_perf_index.
1174  optional HealthStatus health_status = 3;
1175
1176  // A percentage measure of the health of the battery with 100% being perfectly healthy.
1177  optional int32 health_index = 4;
1178
1179  // A percentage measure of the battery capacity of the device, affected by cycle life degradation.
1180  optional int32 health_capacity_index = 5;
1181
1182  // A percentage measure of the max performance of the device, affected by impedance growth with 100% being perfectly healthy.
1183  optional int32 health_impedance_index = 6;
1184
1185  // An index that expresses the likelihood of swelling given the SOC residency stats.
1186  optional int32 swelling_cumulative = 7;
1187
1188  // The battery capacity used to determine the health index. This is the reference value from b/223759710.
1189  optional int32 health_full_capacity = 8;
1190
1191  // 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.
1192  optional int32 current_impedance = 9;
1193
1194  // The (hours) value of TimeH (0xb3), a register value, multiplied by 3.2 hours.
1195  optional int32 battery_age = 10;
1196
1197  // The cycle count at the time of the log event.
1198  optional int32 cycle_count = 11;
1199
1200  enum BattDisconnectStatus {
1201    BPST_BATT_UNKNOWN = 0;
1202    BPST_BATT_CONNECT = 1;
1203    BPST_BATT_DISCONNECT = 2; // Result of single battery disconnect detection
1204    BPST_BATT_CELL_FAULT = 3; // Result of cell fault detection which means actual disconnection
1205  }
1206
1207  // Battery disconnect detection stats.
1208  optional BattDisconnectStatus battery_disconnect_status = 12;
1209}
1210
1211/**
1212 * Log battery SOC/temperature usage data.
1213 *
1214 * Each data represents cumulative time of the battery
1215 * spent over a specific SOC and over a specific temperature
1216 * while charging and while discharging in seconds.
1217 *
1218 * Logged from:
1219 * /sys/class/power_supply/battery/swelling_data, via Vendor.
1220 */
1221message BatteryHealthUsage {
1222  // Vendor reverse domain name (expecting "com.google.pixel").
1223  optional string reverse_domain_name = 1;
1224
1225  // The temperature limit (deg C) used to accumulate the time above this value.
1226  optional int32 temperature_limit_deci_c = 2;
1227
1228  // The SOC limit (%) used to accumulate the time above this value.
1229  optional int32 soc_limit = 3;
1230
1231  // Time (s) accumulated only during charge at the given thresholds.
1232  optional int32 charge_time_secs = 4;
1233
1234  // Time (s) accumulated only during discharge at the given thresholds.
1235  optional int32 discharge_time_secs = 5;
1236}
1237
1238/*
1239 * A Value of F2FS smart idle maintenance feature enabled
1240 */
1241message F2fsSmartIdleMaintEnabledStateChanged {
1242    optional string reverse_domain_name = 1;
1243    /* Smart idle maint is enabled */
1244    optional bool enabled = 2;
1245}
1246
1247/*
1248 * Snapshot of the block layer read write stats
1249 */
1250message BlockStatsReported {
1251    optional string reverse_domain_name = 1;
1252        /* number of read I/Os processed */
1253        optional int64 read_io = 2;
1254        /* number of sectors read */
1255        optional int64 read_sectors = 3;
1256        /* total wait time for read requests */
1257        optional int64 read_ticks = 4;
1258        /* number of write I/Os processed */
1259        optional int64 write_io = 5;
1260        /* number of sectors written */
1261        optional int64 write_sectors = 6;
1262        /* total wait time for write requests */
1263        optional int64 write_ticks = 7;
1264}
1265
1266/**
1267 * Logs the reported vendor audio hardware stats.
1268 */
1269message VendorAudioHardwareStatsReported {
1270  optional string reverse_domain_name = 1;
1271  /* The percentage of calls in a day where auto-mic-switch triggered.
1272   * It represented as a fixed-point integer with three decimal place.
1273   * E.g.:12.345% is repsented by 12345.
1274   */
1275  optional int32 milli_rate_of_ams_per_day = 2;
1276
1277  /* The percentage of calls in a day where CCA is active.
1278  * It represented as a fixed-point and rounded integer.
1279  * E.g.:12.345% is represented by 12.
1280  * CCA can only be applied under some radio bands.
1281  */
1282
1283  /* cca_active: UI enable & algorithm is active (C1) */
1284  optional int32 rate_of_cca_active_per_day = 3;
1285
1286  /* cca_enable: UI enable & algorithm is inactive. (C2) */
1287  optional int32 rate_of_cca_enable_per_day = 4;
1288}
1289
1290/*
1291 * Logs vendor stats about long IRQs.
1292 *
1293 * IRQ is considered long when it exceeds a threshold (currently 1 ms).
1294 * Stats include top 5 slowest IRQs: their numbers and the worst latency.
1295 * Stats are reset after every report.
1296 */
1297message VendorLongIRQStatsReported {
1298  optional string reverse_domain_name = 1;
1299
1300  // Count of long soft IRQ since last report.
1301  optional int64 long_softirq_count = 2;
1302
1303  optional int64 top1_softirq_num = 3;
1304  optional int64 top1_softirq_latency_us = 4;
1305  optional int64 top2_softirq_num = 5;
1306  optional int64 top2_softirq_latency_us = 6;
1307  optional int64 top3_softirq_num = 7;
1308  optional int64 top3_softirq_latency_us = 8;
1309  optional int64 top4_softirq_num = 9;
1310  optional int64 top4_softirq_latency_us = 10;
1311  optional int64 top5_softirq_num = 11;
1312  optional int64 top5_softirq_latency_us = 12;
1313
1314  // Count of long IRQ since last report.
1315  optional int64 long_irq_count = 13;
1316
1317  optional int64 top1_irq_num = 14;
1318  optional int64 top1_irq_latency_us = 15;
1319  optional int64 top2_irq_num = 16;
1320  optional int64 top2_irq_latency_us = 17;
1321  optional int64 top3_irq_num = 18;
1322  optional int64 top3_irq_latency_us = 19;
1323  optional int64 top4_irq_num = 20;
1324  optional int64 top4_irq_latency_us = 21;
1325  optional int64 top5_irq_num = 22;
1326  optional int64 top5_irq_latency_us = 23;
1327}
1328
1329/**
1330 * Logs the Temperature residency stats per thermal zone.
1331 */
1332message VendorTempResidencyStats {
1333  optional string reverse_domain_name = 1;
1334  // Thermal zone name
1335  optional string sensor_name = 2;
1336
1337  // Time since last collect of this thermal zone
1338  optional int64 since_last_update_ms = 3;
1339
1340  // Temperature residency stats is measured by time in ms that a temperature zone's temperature
1341  // lay within some temperature thresholds
1342  // e.g.
1343  // With temperature thresholds predefined as thresholds_i, thresholds_i+1,
1344  // temp_residency_ms_bucket_i measures how much time the sensor lay within this two thresholds
1345  optional int64 temp_residency_ms_bucket_1 = 4;
1346  optional int64 temp_residency_ms_bucket_2 = 5;
1347  optional int64 temp_residency_ms_bucket_3 = 6;
1348  optional int64 temp_residency_ms_bucket_4 = 7;
1349  optional int64 temp_residency_ms_bucket_5 = 8;
1350  optional int64 temp_residency_ms_bucket_6 = 9;
1351  optional int64 temp_residency_ms_bucket_7 = 10;
1352  optional int64 temp_residency_ms_bucket_8 = 11;
1353  optional int64 temp_residency_ms_bucket_9 = 12;
1354  optional int64 temp_residency_ms_bucket_10 = 13;
1355  optional int64 temp_residency_ms_bucket_11 = 14;
1356  optional int64 temp_residency_ms_bucket_12 = 15;
1357  optional int64 temp_residency_ms_bucket_13 = 16;
1358  optional int64 temp_residency_ms_bucket_14 = 17;
1359  optional int64 temp_residency_ms_bucket_15 = 18;
1360  optional int64 temp_residency_ms_bucket_16 = 19;
1361  optional int64 temp_residency_ms_bucket_17 = 20;
1362  optional int64 temp_residency_ms_bucket_18 = 21;
1363  optional int64 temp_residency_ms_bucket_19 = 22;
1364  optional int64 temp_residency_ms_bucket_20 = 23;
1365}
1366
1367/**
1368 * Logs the Resume Latency stats.
1369 */
1370message VendorResumeLatencyStats {
1371  optional string reverse_domain_name = 1;
1372  optional int64 max_latency_ms = 2;
1373  optional int64 avg_latency_ms = 3;
1374
1375  // Resume Latency stats is measured by count of resumes that lay within some latency thresholds
1376  // e.g.
1377  // With resume times thresholds predefined as thresholds_i, thresholds_i+1,
1378  // resume_count_bucket_i measures count of resumes that lay within this two thresholds
1379  optional int64 resume_count_bucket_1 = 4;
1380  optional int64 resume_count_bucket_2 = 5;
1381  optional int64 resume_count_bucket_3 = 6;
1382  optional int64 resume_count_bucket_4 = 7;
1383  optional int64 resume_count_bucket_5 = 8;
1384  optional int64 resume_count_bucket_6 = 9;
1385  optional int64 resume_count_bucket_7 = 10;
1386  optional int64 resume_count_bucket_8 = 11;
1387  optional int64 resume_count_bucket_9 = 12;
1388  optional int64 resume_count_bucket_10 = 13;
1389  optional int64 resume_count_bucket_11 = 14;
1390  optional int64 resume_count_bucket_12 = 15;
1391  optional int64 resume_count_bucket_13 = 16;
1392  optional int64 resume_count_bucket_14 = 17;
1393  optional int64 resume_count_bucket_15 = 18;
1394  optional int64 resume_count_bucket_16 = 19;
1395  optional int64 resume_count_bucket_17 = 20;
1396  optional int64 resume_count_bucket_18 = 21;
1397  optional int64 resume_count_bucket_19 = 22;
1398  optional int64 resume_count_bucket_20 = 23;
1399  optional int64 resume_count_bucket_21 = 24;
1400  optional int64 resume_count_bucket_22 = 25;
1401  optional int64 resume_count_bucket_23 = 26;
1402  optional int64 resume_count_bucket_24 = 27;
1403  optional int64 resume_count_bucket_25 = 28;
1404  optional int64 resume_count_bucket_26 = 29;
1405  optional int64 resume_count_bucket_27 = 30;
1406  optional int64 resume_count_bucket_28 = 31;
1407  optional int64 resume_count_bucket_29 = 32;
1408  optional int64 resume_count_bucket_30 = 33;
1409  optional int64 resume_count_bucket_31 = 34;
1410  optional int64 resume_count_bucket_32 = 35;
1411  optional int64 resume_count_bucket_33 = 36;
1412  optional int64 resume_count_bucket_34 = 37;
1413  optional int64 resume_count_bucket_35 = 38;
1414  optional int64 resume_count_bucket_36 = 39;
1415}
1416
1417/*
1418 * PCIe Link Statistics
1419 */
1420message PcieLinkStatsReported {
1421    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1422    optional string reverse_domain_name = 1;
1423
1424    /* Count of new PCIe Link Down events on the modem interface */
1425    optional int32 modem_pcie_linkdowns = 2;
1426    /* Count of new PCIe Completion Timeout events on the modem interface */
1427    optional int32 modem_pcie_completion_timeouts = 3;
1428    /* Count of new PCIe Link Up Failure events on the modem interface */
1429    optional int32 modem_pcie_linkup_failures = 4;
1430    /* Average pll lock time (uS) during PCIe Link Up on modem interface */
1431    optional int32 modem_pcie_pll_lock_avg = 5;
1432    /* Average time (uS) for successful PCIe Link Up on modem interface */
1433    optional int32 modem_pcie_link_up_avg = 6;
1434
1435    /* Count of new PCIe Link Down events on the wifi interface */
1436    optional int32 wifi_pcie_linkdowns = 7;
1437    /* Count of new PCIe Completion Timeout events on the wifi interface */
1438    optional int32 wifi_pcie_completion_timeouts = 8;
1439    /* Count of new PCIe Link Up Failure events on the wifi interface */
1440    optional int32 wifi_pcie_linkup_failures = 9;
1441    /* Average pll lock time (uS) during PCIe Link Up on wifi interface */
1442    optional int32 wifi_pcie_pll_lock_avg = 10;
1443    /* Average time (uS) for successful PCIe Link Up on wifi interface */
1444    optional int32 wifi_pcie_link_up_avg = 11;
1445}
1446