• 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 optimize_for = LITE_RUNTIME;
23
24option java_package = "android.hardware.google.pixel";
25option java_outer_classname = "PixelAtoms";
26
27import "frameworks/proto_logging/stats/atom_field_options.proto";
28
29/*
30 * Please note that the following features are not currently supported by
31 * the IStats->reportVendorAtom implementation:
32 *   - types outside of int, long, float, bool and string (ex. uint)
33 *   - submessages within an atom
34 *   - field # 1 - this will be occupied by the vendor namespace
35 */
36
37/* Allocated atom IDs. */
38message Atom {
39    oneof pushed {
40      // AOSP atom ID range starts at 105000
41      ChargeStats charge_stats = 105000;
42      VoltageTierStats voltage_tier_stats = 105001;
43      BatteryCapacity battery_capacity = 105002;
44      StorageUfsHealth storage_ufs_health = 105003;
45      F2fsStatsInfo f2fs_stats = 105004;
46      ZramMmStat zram_mm_stat = 105005;
47      ZramBdStat zram_bd_stat = 105006;
48      BootStatsInfo boot_stats = 105007;
49      // 105008 - 105009 is available.
50      BatteryCapacityFG fg_capacity = 105010;
51      PdVidPid pd_vid_pid = 105011;
52      BatteryEEPROM battery_eeprom = 105012;
53      VendorSpeakerImpedance vendor_speaker_impedance = 105013; // moved from atoms.proto
54      StorageUfsResetCount ufs_reset_count = 105014;
55      PixelMmMetricsPerHour pixel_mm_metrics_per_hour = 105015;
56      PixelMmMetricsPerDay pixel_mm_metrics_per_day = 105016;
57      F2fsCompressionInfo f2fs_compression_info = 105017;
58      VendorChargeCycles vendor_charge_cycles = 105018; // moved from atoms.proto
59      VendorHardwareFailed vendor_hardware_failed = 105019; // moved from atoms.proto
60      VendorSlowIo vendor_slow_io = 105020; // moved from atoms.proto
61      VendorSpeechDspStat vendor_speech_dsp_stat = 105021; // moved from atoms.proto
62      VendorPhysicalDropDetected vendor_physical_drop_detected = 105022; // moved from atoms.proto
63      VendorUsbPortOverheat vendor_usb_port_overheat = 105023; // moved from atoms.proto
64      CmaStatus cma_status = 105024;
65      CmaStatusExt cma_status_ext = 105025;
66      VendorBatteryHealthSnapshot vendor_battery_health_snapshot =
67                105026 [(android.os.statsd.module) = "pixelhealth"]; // moved from atoms.proto
68      VendorBatteryCausedShutdown vendor_battery_caused_shutdown =
69                105027 [(android.os.statsd.module) = "pixelhealth"]; // moved from atoms.proto
70      F2fsGcSegmentInfo f2fs_gc_segment_info = 105028;
71      PowerMitigationStats mitigation_stats = 105029; // moved from atoms.proto
72
73      CitadelVersion citadel_version = 100018; // moved from vendor proprietary
74      CitadelEvent citadel_event = 100019;  // moved from vendor proprietary
75      VendorSpeakerStatsReported vendor_speaker_stats_reported = 105030;
76
77      ChreHalNanoappLoadFailed chre_hal_nanoapp_load_failed =
78                105031 [(android.os.statsd.module) = "chre"];
79      ChrePalOpenFailed chre_pal_open_failed = 105032 [(android.os.statsd.module) = "chre"];
80      ChreApiErrorCodeDistributionTaken chre_api_error_code_distribution_taken =
81                105033 [(android.os.statsd.module) = "chre"];
82      ChreDynamicMemorySnapshotReported chre_dynamic_memory_snapshot_reported =
83                105034 [(android.os.statsd.module) = "chre"];
84      ChreEventQueueSnapshotReported chre_event_queue_snapshot_reported =
85                105035 [(android.os.statsd.module) = "chre"];
86      ChreApWakeUpOccurred chre_ap_wake_up_occurred = 105036 [(android.os.statsd.module) = "chre"];
87
88      BatteryHealthStatus battery_health_status = 105037;
89      BatteryHealthUsage battery_health_usage = 105038;
90      F2fsSmartIdleMaintEnabledStateChanged f2fs_smart_idle_maint_enabled_state_changed = 105039;
91      BlockStatsReported block_stats_reported = 105040;
92      VendorAudioHardwareStatsReported vendor_audio_hardware_stats_reported = 105041;
93
94      ThermalDfsStats thermal_dfs_stats = 105042;
95      VendorLongIRQStatsReported vendor_long_irq_stats_reported = 105043;
96      VendorResumeLatencyStats vendor_resume_latency_stats = 105044;
97      VendorTempResidencyStats vendor_temp_residency_stats = 105045;
98      BrownoutDetected brownout_detected = 105046;
99      PcieLinkStatsReported pcie_link_stats = 105047;
100      VendorSensorCoolingDeviceStats vendor_sensor_cooling_device_stats = 105048;
101
102      VibratorPlaycountReported vibrator_playcount_reported = 105049;
103      VibratorLatencyReported vibrator_latency_reported = 105050;
104      VibratorErrorsReported vibrator_errors_reported = 105051;
105      F2fsAtomicWriteInfo f2fs_atomic_write_info = 105052;
106      PartitionsUsedSpaceReported partition_used_space_reported = 105053;
107      PowerMitigationDurationCounts mitigation_duration = 105054; // moved from atoms.proto
108      DisplayPanelErrorStats display_panel_error_stats = 105055;
109      VendorAudioPdmStatsReported vendor_audio_pdm_stats_reported = 105056;
110      VendorAudioThirdPartyEffectStatsReported vendor_audio_third_party_effect_stats_reported = 105057;
111      VendorAudioAdaptedInfoStatsReported vendor_audio_adapted_info_stats_reported = 105058;
112      GpuEvent gpu_event = 105059;
113      VendorAudioPcmStatsReported vendor_audio_pcm_stats_reported = 105060;
114    }
115    // AOSP atom ID range ends at 109999
116    reserved 109997; // reserved for VtsVendorAtomJavaTest test atom
117    reserved 109998; // reserved for VtsVendorAtomJavaTest test atom
118    reserved 109999; // reserved for VtsVendorAtomJavaTest test atom
119}
120
121/* Supported reverse domain names. */
122message ReverseDomainNames {
123    optional string pixel = 1 [default = "com.google.pixel"];
124}
125
126/* A message containing detailed statistics and debug information about a charge session. */
127message ChargeStats {
128    /* Charge Adapter stats. */
129    enum AdapterType {
130        ADAPTER_TYPE_UNKNOWN = 0;
131        ADAPTER_TYPE_USB = 1;
132        ADAPTER_TYPE_USB_SDP = 2;
133        ADAPTER_TYPE_USB_DCP = 3;
134        ADAPTER_TYPE_USB_CDP = 4;
135        ADAPTER_TYPE_USB_ACA = 5;
136        ADAPTER_TYPE_USB_C = 6;
137        ADAPTER_TYPE_USB_PD = 7;
138        ADAPTER_TYPE_USB_PD_DRP = 8;
139        ADAPTER_TYPE_USB_PD_PPS = 9;
140        ADAPTER_TYPE_USB_PD_BRICKID = 10;
141        ADAPTER_TYPE_HVDCP = 11;
142        ADAPTER_TYPE_HVDCP3 = 12;
143        ADAPTER_TYPE_FLOAT = 13;
144        ADAPTER_TYPE_WLC  = 14;
145        ADAPTER_TYPE_WLC_EPP = 15;
146        ADAPTER_TYPE_WLC_SPP = 16;
147        ADAPTER_TYPE_GPP = 17;
148        ADAPTER_TYPE_10W = 18;
149        ADAPTER_TYPE_L7 = 19;
150        ADAPTER_TYPE_DL = 20;
151        ADAPTER_TYPE_WPC_EPP = 21;
152        ADAPTER_TYPE_WPC_GPP = 22;
153        ADAPTER_TYPE_WPC_10W = 23;
154        ADAPTER_TYPE_WPC_BPP = 24;
155        ADAPTER_TYPE_WPC_L7 = 25;
156        ADAPTER_TYPE_EXT = 26;
157        ADAPTER_TYPE_EXT1 = 27;
158        ADAPTER_TYPE_EXT2 = 28;
159        ADAPTER_TYPE_EXT_UNKNOWN = 29;
160        ADAPTER_TYPE_USB_UNKNOWN = 30;
161        ADAPTER_TYPE_WLC_UNKNOWN = 31;
162    }
163    optional string reverse_domain_name = 1;
164    /* Type of charge adapter, enumerated above. */
165    optional AdapterType adapter_type = 2;
166    /* Max negotiated voltage by charge adapter, in mV. */
167    optional int32 adapter_voltage = 3;
168    /* Max negotiated current by charge adapter current, in mA. */
169    optional int32 adapter_amperage = 4;
170
171    /* Stats at beginning of charge session. */
172    /* System State of Charge, in percent. */
173    optional int32 ssoc_in = 5;
174    /* Voltage in mV. */
175    optional int32 voltage_in = 6;
176
177    /* Stats at end of charge session. */
178    /* System State of Charge, in percent. */
179    optional int32 ssoc_out = 7;
180    /* Voltage in mV. */
181    optional int32 voltage_out = 8;
182
183    /**
184     * These values are  meant to represent status of the charging device, used
185     * to validate the charging algorithm and explain charging performances.
186     * Examples of the content of the register:
187     * - APDO, PDO (power capabilities of the device, eg. 5V3A, 9V2A, 20V2A) for wired charging
188     * - Wireless charging MFG code. This is the value of a register of the WLC integrated
189     *   circuit to identify the vendor and type of WLC pad
190     * - Receiver operating frequency
191     * - Register status
192     */
193    optional int32 adapter_capabilities0 = 9;
194    optional int32 adapter_capabilities1 = 10;
195    optional int32 adapter_capabilities2 = 11;
196    optional int32 adapter_capabilities3 = 12;
197    optional int32 adapter_capabilities4 = 13;
198
199    /**
200     * These are values which reports the state of the wireless receiver, which will help in
201     * debugging charging issues and alternate configurations.
202     */
203    optional int32 receiver_state0 = 14;
204    optional int32 receiver_state1 = 15;
205
206    /* AACR feature to record capacity */
207    optional int32 charge_capacity = 16;
208}
209
210/* A message containing stats from each charge voltage tier. */
211message VoltageTierStats {
212    optional string reverse_domain_name = 1;
213    /* Voltage tier number, custom to implementation, should be <= 3. */
214    optional int32 voltage_tier = 2;
215
216    /* Stats when entering voltage tier. */
217    /* State of charge, in percent. */
218    optional float soc_in = 3;
219    /* Coulomb count, in mAh. */
220    optional int32 cc_in = 4;
221    /* Battery temperature, in deciC. */
222    optional int32 temp_in = 5;
223
224    /* Time spent at various charge speeds, in seconds. */
225    optional int32 time_fast_secs = 6;
226    optional int32 time_taper_secs = 7;
227    optional int32 time_other_secs = 8;
228
229    /* Battery temperature stats, in deciC. */
230    optional int32 temp_min = 9;
231    optional int32 temp_avg = 10;
232    optional int32 temp_max = 11;
233
234    /* Battery current stats, in mA. */
235    optional int32 ibatt_min = 12;
236    optional int32 ibatt_avg = 13;
237    optional int32 ibatt_max = 14;
238
239    /* Input current limit stats, in mA. */
240    optional int32 icl_min = 15;
241    optional int32 icl_avg = 16;
242    optional int32 icl_max = 17;
243
244    /**
245     * Efficiency number, receiver operating frequency in kHz for wireless charging
246     * (alignment)
247     */
248    optional int32 charging_operating_point = 18;
249    /* The minimum power out of the adapter at the given charging tier */
250    optional int32 min_adapter_power_out = 19;
251    /* The time-averaged power out of the adapter at the given charging tier */
252    optional int32 time_avg_adapter_power_out = 20;
253    /* The maximum power out of the adapter at the given charging tier */
254    optional int32 max_adapter_power_out = 21;
255}
256
257/* A message containing an alternate proprietary full battery capacity estimate. */
258message BatteryCapacity {
259    optional string reverse_domain_name = 1;
260    /* Sum of the change in coulomb count. */
261    optional int32 delta_cc_sum = 2;
262    /* Sum of the change in state of charge (battery level). */
263    optional int32 delta_vfsoc_sum = 3;
264}
265
266/* A message containing health values of UFS */
267message StorageUfsHealth {
268    optional string reverse_domain_name = 1;
269    /* The value of lifetimeA for UFS health */
270    optional int32 lifetime_a = 2;
271    /* The value of lifetimeB for UFS health */
272    optional int32 lifetime_b = 3;
273    /* The value of lifetimeC for UFS health */
274    optional int32 lifetime_c = 4;
275}
276
277/* A message containing filesystem stats of F2FS */
278message F2fsStatsInfo {
279    optional string reverse_domain_name = 1;
280    /* The value of dirty segments of f2fs */
281    optional int32 dirty_segments = 2;
282    /* The value of free segments of f2fs */
283    optional int32 free_segments = 3;
284    /* The times of checkpoint function called in foreground*/
285    optional int32 cp_calls_fg = 4;
286    /* The times of checkpoint function called in background */
287    optional int32 cp_calls_bg = 5;
288    /* The times of garbage collection function called in foreground */
289    optional int32 gc_calls_fg = 6;
290    /* The times of garbage collection function called in background */
291    optional int32 gc_calls_bg = 7;
292    /* The amount of blocks been moved by garbage collection in foreground */
293    optional int32 moved_blocks_fg = 8;
294    /* The amount of blocks been moved by garbage collection in background */
295    optional int32 moved_blocks_bg = 9;
296    /* The average of how many valid blocks is in a segment */
297    optional int32 valid_blocks = 10;
298}
299
300message ZramMmStat {
301    optional string reverse_domain_name = 1;
302    /* The value of original memory size */
303    optional int64 orig_data_size = 2;
304    /* The value of compressed memory size */
305    optional int64 compr_data_size = 3;
306    /* The value of consumed memory size to store compressed memory */
307    optional int64 mem_used_total = 4;
308    /* The value of number of page filled with same elements data */
309    optional int64 same_pages = 5;
310    /* The value of number of incompressible page */
311    optional int64 huge_pages = 6;
312    /* The value of number of incompressible pages since boot */
313    optional int64 huge_pages_since_boot = 7;
314}
315
316message ZramBdStat {
317    optional string reverse_domain_name = 1;
318    /* the number of pages in backing device */
319    optional int64 bd_count = 2;
320    /* The number of pages readed from backing device */
321    optional int64 bd_reads = 3;
322    /* The number of pages written to backing device */
323    optional int64 bd_writes = 4;
324}
325
326/* A message containing boot times */
327message BootStatsInfo {
328    optional string reverse_domain_name = 1;
329    /* The F2FS fsck time in secs */
330    optional int32 fsck_time_sec = 2;
331    /* The F2FS mounted time in secs */
332    optional int32 mounted_time_sec = 3;
333    /* The F2FS checkpoint=disable time in secs */
334    optional int32 checkpoint_time_sec = 4;
335}
336
337/* A message containing wireless charging health info. */
338message WirelessChargingStats {
339    /* Captures if a google charger used when start wireless charging */
340    enum ChargerVendor {
341        VENDOR_UNKNOWN = 0;
342        VENDOR_GOOGLE = 1;
343    }
344
345    optional string reverse_domain_name = 1;
346    optional ChargerVendor charger_vendor = 2;
347}
348
349/* Current device Orientation */
350message DeviceOrientation {
351    enum Orientation {
352        ORIENTATION_UNKNOWN = 0;
353        ORIENTATION_0 = 1;
354        ORIENTATION_90 = 2;
355        ORIENTATION_180 = 3;
356        ORIENTATION_270 = 4;
357    }
358
359    optional string reverse_domain_name = 1;
360    /* Device orientation. */
361    optional Orientation orientation = 2;
362}
363
364/* Raw battery capacity stats */
365message BatteryCapacityFG {
366    enum LogReason {
367        LOG_REASON_UNKNOWN = 0;
368        LOG_REASON_CONNECTED = 1;
369        LOG_REASON_DISCONNECTED = 2;
370        LOG_REASON_FULL_CHARGE = 3;
371        LOG_REASON_PERCENT_SKIP = 4;
372        LOG_REASON_DIVERGING_FG = 5;
373    }
374
375    optional string reverse_domain_name = 1;
376    /* Uevent logging reason, enumerated above. */
377    optional LogReason capacity_log_reason = 2;
378
379    /* The battery capacity reported from the FG (fuel gauge) hardware  */
380    optional float capacity_gdf = 3;
381    /* The filtered system battery capacity reported to the UI */
382    optional float capacity_ssoc = 4;
383    /* The fuel gauge capacity curve midpoint FG (fuel gauge) value */
384    optional float capacity_gdf_curve = 5;
385    /* The fuel gauge capacity curve midpoint UI value */
386    optional float capacity_ssoc_curve = 6;
387}
388
389message  PdVidPid {
390    optional string reverse_domain_name = 1;
391    /* Vendor ID of wired charger */
392    optional int32 vid = 2;
393    /* Product ID of wired charger */
394    optional int32 pid = 3;
395}
396
397message BatteryEEPROM {
398    optional string reverse_domain_name = 1;
399   /* The cycle count number; record of charge/discharge times */
400    optional int32 cycle_cnt = 2;
401    /* The current full capacity of the battery under nominal conditions */
402    optional int32 full_cap = 3;
403    /* The battery equivalent series resistance */
404    optional int32 esr = 4;
405    /* Battery resistance related to temperature change */
406    optional int32 rslow = 5;
407    /* Battery health indicator reflecting the battery age state */
408    optional int32 soh = 6;
409    /* The battery temperature */
410    optional int32 batt_temp = 7;
411
412    /* Battery state of charge (SOC) shutdown point */
413    optional int32 cutoff_soc = 8;
414    /* Raw battery state of charge (SOC), based on battery current (CC = Coulomb Counter) */
415    optional int32 cc_soc = 9;
416    /* Estimated battery state of charge (SOC) from batt_soc with endpoint limiting (0% and 100%) */
417    optional int32 sys_soc = 10;
418    /* Filtered monotonic SOC, handles situations where the cutoff_soc is increased and
419     * then decreased from the battery physical properties
420     */
421    optional int32 msoc = 11;
422    /* Estimated SOC derived from cc_soc that provides voltage loop feedback correction using
423     * battery voltage, current, and status values
424     */
425    optional int32 batt_soc = 12;
426
427    /* Field used for data padding in the EEPROM data */
428    optional int32 reserve = 13;
429
430    /* The maximum battery temperature ever seen */
431    optional int32 max_temp = 14;
432    /* The minimum battery temperature ever seen */
433    optional int32 min_temp = 15;
434    /* The maximum battery voltage ever seen */
435    optional int32 max_vbatt = 16;
436    /* The minimum battery voltage ever seen */
437    optional int32 min_vbatt = 17;
438    /* The maximum battery current ever seen */
439    optional int32 max_ibatt = 18;
440    /* The minimum battery current ever seen */
441    optional int32 min_ibatt = 19;
442    /* Field used to verify the integrity of the EEPROM data */
443    optional int32 checksum = 20;
444
445    /* Extend data for P21 */
446    /* Temperature compensation information */
447    optional int32 tempco = 21;
448    /* Learned characterization related to the voltage gauge */
449    optional int32 rcomp0 = 22;
450    /* For time to monitor the life of cell */
451    optional int32 timer_h = 23;
452    /* The full capacity of the battery learning at the end of every charge cycle */
453    optional int32 full_rep = 24;
454}
455
456/* A message containing an exceptional event from citadel. */
457message CitadelEvent {
458  enum Event {
459    ALERT = 1;
460    REBOOTED = 2;
461    UPGRADED = 3;
462    ALERT_V2 = 4;
463    SEC_CH_STATE = 5;
464  };
465  optional string reverse_domain_name = 1;
466  optional Event event = 2;
467  optional int32 reset_count = 3;
468  optional int64 uptime_micros = 4;
469  enum Priority {
470    LOW = 0;
471    MEDIUM = 1;
472    HIGH = 2;
473  };
474  optional Priority priority = 5;
475
476  // ALERT-specific fields.  These fields correspond to the interrupt status
477  // bits for alerts within citadel.  When alerts fire one or more of these
478  // bits are set to indicate the alert source.
479  optional int32 intr_sts_0 = 6;
480  optional int32 intr_sts_1 = 7;
481  optional int32 intr_sts_2 = 8;
482
483  // REBOOTED-specific fields.  These fields correspond to the details of how
484  // the hardware reboot occurred.  A reboot is a noteworthy event for citadel,
485  // as it can be triggered by events like stack overflow or other software
486  // bugs.
487  optional int32 rstsrc = 9;
488  optional int32 exitpd = 10;
489  optional int32 which0 = 11;
490  optional int32 which1 = 12;
491
492  // UPGRADED-specific field. This field corresponds to the result of FW
493  // upgrade for citadel.
494  optional int32 upgrade_state = 13;
495
496  // ALERT_V2-specific field. This field corresponds to the GLOBALSEC Log
497  // which contains normal globalsec, camo, temp and buserr.
498  optional int32 alert_grp_0 = 14;
499  optional int32 alert_grp_1 = 15;
500  optional int32 alert_grp_2 = 16;
501  optional int32 alert_grp_3 = 17;
502  optional int32 camo_breaches_0 = 18;
503  optional int32 camo_breaches_1 = 19;
504  optional int32 temp_min = 20;
505  optional int32 temp_max = 21;
506  optional int32 bus_err = 22;
507
508  // SEC_CH_STATE-specific filed. This field corresponds to the state
509  // of GSA-GSC secure channel.
510  optional int32 sec_ch_state = 23;
511}
512
513/* A message containing the citadel firmware version. */
514message CitadelVersion {
515   optional string reverse_domain_name = 1;
516   optional string version = 2;
517}
518
519/* A message containing the speaker impedance. */
520 message VendorSpeakerImpedance {
521    optional string reverse_domain_name = 1;
522    optional int32 speaker_location = 2;
523    optional int32 impedance = 3;
524}
525
526/**
527 * Logs the reported vendor speaker health stats.
528 * Logged from: hardware/google/pixel/pixelstats/SysfsCollector.cpp
529 */
530message VendorSpeakerStatsReported {
531  /* Vendor reverse domain name (expecting "com.google.pixel") */
532  optional string reverse_domain_name = 1;
533  /* The location of speaker; 0 = left , 1 = right */
534  optional int32 speaker_location = 2;
535  /* The speaker's impedance value (milliOhm) */
536  optional int32 impedance = 3;
537  /* The speaker's maximum temperature (milliDegree C) */
538  optional int32 max_temperature = 4;
539  /* The speaker's execursion length (micrometer) */
540  optional int32 excursion = 5;
541  /* The speaker's heart beat count */
542  optional int32 heartbeat = 6;
543}
544
545/* A message containing how many times of ufs host reset */
546message StorageUfsResetCount {
547    optional string reverse_domain_name = 1;
548    /* How many UFS error reset are triggered */
549    optional int32 host_reset_count = 2;
550}
551
552/* A message containing Pixel memory metrics collected hourly. */
553message PixelMmMetricsPerHour {
554    optional string reverse_domain_name = 1;
555    optional int64 free_pages = 2;
556    optional int64 anon_pages = 3;
557    optional int64 file_pages = 4;
558    optional int64 slab_reclaimable = 5;
559    optional int64 zspages = 6;
560    optional int64 unevictable = 7;
561    optional int64 ion_total_pools = 8;
562    optional int64 gpu_memory = 9;
563    optional int64 slab_unreclaimable = 10;
564    optional int64 psi_cpu_some_total = 11;
565    optional int64 psi_io_full_total = 12;
566    optional int64 psi_io_some_total = 13;
567    optional int64 psi_mem_full_total = 14;
568    optional int64 psi_mem_some_total = 15;
569    optional int32 psi_cpu_some_avg10_min = 16;
570    optional int32 psi_cpu_some_avg10_max = 17;
571    optional int32 psi_cpu_some_avg10_avg = 18;
572    optional int32 psi_cpu_some_avg60_min = 19;
573    optional int32 psi_cpu_some_avg60_max = 20;
574    optional int32 psi_cpu_some_avg60_avg = 21;
575    optional int32 psi_cpu_some_avg300_min = 22;
576    optional int32 psi_cpu_some_avg300_max = 23;
577    optional int32 psi_cpu_some_avg300_avg = 24;
578    optional int32 psi_io_full_avg10_min = 25;
579    optional int32 psi_io_full_avg10_max = 26;
580    optional int32 psi_io_full_avg10_avg = 27;
581    optional int32 psi_io_full_avg60_min = 28;
582    optional int32 psi_io_full_avg60_max = 29;
583    optional int32 psi_io_full_avg60_avg = 30;
584    optional int32 psi_io_full_avg300_min = 31;
585    optional int32 psi_io_full_avg300_max = 32;
586    optional int32 psi_io_full_avg300_avg = 33;
587    optional int32 psi_io_some_avg10_min = 34;
588    optional int32 psi_io_some_avg10_max = 35;
589    optional int32 psi_io_some_avg10_avg = 36;
590    optional int32 psi_io_some_avg60_min = 37;
591    optional int32 psi_io_some_avg60_max = 38;
592    optional int32 psi_io_some_avg60_avg = 39;
593    optional int32 psi_io_some_avg300_min = 40;
594    optional int32 psi_io_some_avg300_max = 41;
595    optional int32 psi_io_some_avg300_avg = 42;
596    optional int32 psi_mem_full_avg10_min = 43;
597    optional int32 psi_mem_full_avg10_max = 44;
598    optional int32 psi_mem_full_avg10_avg = 45;
599    optional int32 psi_mem_full_avg60_min = 46;
600    optional int32 psi_mem_full_avg60_max = 47;
601    optional int32 psi_mem_full_avg60_avg = 48;
602    optional int32 psi_mem_full_avg300_min = 49;
603    optional int32 psi_mem_full_avg300_max = 50;
604    optional int32 psi_mem_full_avg300_avg = 51;
605    optional int32 psi_mem_some_avg10_min = 52;
606    optional int32 psi_mem_some_avg10_max = 53;
607    optional int32 psi_mem_some_avg10_avg = 54;
608    optional int32 psi_mem_some_avg60_min = 55;
609    optional int32 psi_mem_some_avg60_max = 56;
610    optional int32 psi_mem_some_avg60_avg = 57;
611    optional int32 psi_mem_some_avg300_min = 58;
612    optional int32 psi_mem_some_avg300_max = 59;
613    optional int32 psi_mem_some_avg300_avg = 60;
614}
615
616/* A message containing Pixel memory metrics collected daily. */
617message PixelMmMetricsPerDay {
618    optional string reverse_domain_name = 1;
619    optional int64 workingset_refault = 2;  /* refault_file */
620    optional int64 pswpin = 3;
621    optional int64 pswpout = 4;
622    optional int64 allocstall_dma = 5;
623    optional int64 allocstall_dma32 = 6;
624    optional int64 allocstall_normal = 7;
625    optional int64 allocstall_movable = 8;
626    optional int64 pgalloc_dma = 9;
627    optional int64 pgalloc_dma32 = 10;
628    optional int64 pgalloc_normal = 11;
629    optional int64 pgalloc_movable = 12;
630    optional int64 pgsteal_kswapd = 13;
631    optional int64 pgsteal_direct = 14;
632    optional int64 pgscan_kswapd = 15;
633    optional int64 pgscan_direct = 16;
634    optional int64 oom_kill = 17;
635    optional int64 pgalloc_high = 18;
636    optional int64 pgcache_hit = 19;
637    optional int64 pgcache_miss = 20;
638    optional int64 kswapd_stime_clks = 21;
639    optional int64 kcompactd_stime_clks = 22;
640    optional int64 direct_reclaim_native_latency_total_time = 23;
641    optional int64 direct_reclaim_native_latency0 = 24;
642    optional int64 direct_reclaim_native_latency1 = 25;
643    optional int64 direct_reclaim_native_latency2 = 26;
644    optional int64 direct_reclaim_native_latency3 = 27;
645    optional int64 direct_reclaim_visible_latency_total_time = 28;
646    optional int64 direct_reclaim_visible_latency0 = 29;
647    optional int64 direct_reclaim_visible_latency1 = 30;
648    optional int64 direct_reclaim_visible_latency2 = 31;
649    optional int64 direct_reclaim_visible_latency3 = 32;
650    optional int64 direct_reclaim_top_latency_total_time = 33;
651    optional int64 direct_reclaim_top_latency0 = 34;
652    optional int64 direct_reclaim_top_latency1 = 35;
653    optional int64 direct_reclaim_top_latency2 = 36;
654    optional int64 direct_reclaim_top_latency3 = 37;
655    optional int64 direct_reclaim_other_latency_total_time = 38;
656    optional int64 direct_reclaim_other_latency0 = 39;
657    optional int64 direct_reclaim_other_latency1 = 40;
658    optional int64 direct_reclaim_other_latency2 = 41;
659    optional int64 direct_reclaim_other_latency3 = 42;
660    optional int64 compaction_total_time = 43;
661    optional int64 compaction_ev_count0 = 44;
662    optional int64 compaction_ev_count1 = 45;
663    optional int64 compaction_ev_count2 = 46;
664    optional int64 compaction_ev_count3 = 47;
665    optional int64 compaction_ev_count4 = 48;
666    optional int64 workingset_refault_anon = 49;
667    optional int64 workingset_refault_file = 50;
668    optional int64 compact_success = 51;
669    optional int64 compact_fail = 52;
670    optional int64 kswapd_low_wmark_hq = 53;
671    optional int64 kswapd_high_wmark_hq = 54;
672    optional int64 thp_file_alloc = 55;
673    optional int64 thp_zero_page_alloc = 56;
674    optional int64 thp_split_page = 57;
675    optional int64 thp_migration_split = 58;
676    optional int64 thp_deferred_split_page = 59;
677}
678
679/* A message containing CMA metrics collected from dogfooding only. */
680message CmaStatus {
681  optional string reverse_domain_name = 1;
682  optional int32 type = 2;
683  optional int64 cma_alloc_pages_attempts = 3;
684  optional int64 cma_alloc_pages_soft_attempts = 4;
685  optional int64 cma_fail_pages = 5;
686  optional int64 cma_fail_soft_pages = 6;
687  optional int64 migrated_pages = 7;
688  optional string cma_heap_name = 8;
689}
690
691/* A message containing CMA metrics (External). */
692message CmaStatusExt {
693  optional string reverse_domain_name = 1;
694  optional int32 type = 2;
695  optional int64 cma_alloc_latency_low = 3;
696  optional int64 cma_alloc_latency_mid = 4;
697  optional int64 cma_alloc_latency_high = 5;
698  optional string cma_heap_name = 6;
699}
700
701message F2fsCompressionInfo {
702    optional string reverse_domain_name = 1;
703    /* Show the block count written after compression since mount */
704    optional int32 compr_written_blocks = 2;
705    /* Show the saved block count with compression since mount */
706    optional int32 compr_saved_blocks = 3;
707    /* Show the count of inode newly enabled for compression since mount */
708    optional int32 compr_new_inodes = 4;
709}
710
711/**
712 * Log bucketed battery charge cycles.
713 *
714 * Each bucket represents cycles of the battery past
715 * a given charge point.  For example, bucket 1 is the
716 * lowest 1/8th of the battery, and bucket 8 is 100%.
717 *
718 * Logged from:
719 * /sys/class/power_supply/bms/cycle_count, via Vendor.
720 */
721message VendorChargeCycles {
722    optional string reverse_domain_name = 1;
723    optional int32 cycle_bucket_1 = 2;
724    optional int32 cycle_bucket_2 = 3;
725    optional int32 cycle_bucket_3 = 4;
726    optional int32 cycle_bucket_4 = 5;
727    optional int32 cycle_bucket_5 = 6;
728    optional int32 cycle_bucket_6 = 7;
729    optional int32 cycle_bucket_7 = 8;
730    optional int32 cycle_bucket_8 = 9;
731    optional int32 cycle_bucket_9 = 10;
732    optional int32 cycle_bucket_10 = 11;
733}
734
735/**
736 * Logs the report of a failed hardware.
737 *
738 * Logged from:
739 *  Vendor HALs.
740 *
741 */
742message VendorHardwareFailed {
743    enum HardwareType {
744      HARDWARE_FAILED_UNKNOWN = 0;
745      HARDWARE_FAILED_MICROPHONE = 1;
746      HARDWARE_FAILED_CODEC = 2;
747      HARDWARE_FAILED_SPEAKER = 3;
748      HARDWARE_FAILED_FINGERPRINT = 4;
749    }
750    optional string reverse_domain_name = 1;
751    optional HardwareType hardware_type = 2;
752
753    /**
754     * hardware_location allows vendors to differentiate between multiple
755     * instances of the same hardware_type.  The specific locations are vendor
756     * defined integers, referring to board-specific numbering schemes.
757     */
758    optional int32 hardware_location = 3;
759    /**
760     * failure_code is specific to the HardwareType of the failed hardware.
761     * It should use one of the enum values defined below.
762     */
763    enum HardwareErrorCode {
764      UNKNOWN = 0;
765      COMPLETE = 1;
766      SPEAKER_HIGH_Z = 2;
767      SPEAKER_SHORT = 3;
768      FINGERPRINT_SENSOR_BROKEN = 4;
769      FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
770      DEGRADE = 6;
771    }
772    optional int32 failure_code = 4;
773}
774
775/**
776 * Log slow I/O operations on the primary storage.
777 */
778message VendorSlowIo {
779    // Classifications of IO Operations.
780    enum IoOperation {
781      UNKNOWN = 0;
782      READ = 1;
783      WRITE = 2;
784      UNMAP = 3;
785      SYNC = 4;
786    }
787    optional string reverse_domain_name = 1;
788    optional IoOperation operation = 2;
789
790    // The number of slow IO operations of this type over 24 hours.
791    optional int32 count = 3;
792}
793
794/*
795 * Logs the reported speech DSP status.
796 * Logged from: Vendor audio implementation.
797 */
798message VendorSpeechDspStat {
799    optional string reverse_domain_name = 1;
800    // The total Speech DSP uptime in milliseconds.
801    optional int32 total_uptime_millis = 2;
802    // The total Speech DSP downtime in milliseconds.
803    optional int32 total_downtime_millis = 3;
804    optional int32 total_crash_count = 4;
805    optional int32 total_recover_count = 5;
806}
807
808/**
809 * Log an event when the device has been physically dropped.
810 * Reported from the /vendor partition.
811 */
812message VendorPhysicalDropDetected {
813  optional string reverse_domain_name = 1;
814  // Confidence that the event was actually a drop, 0 -> 100
815  optional int32 confidence_pctg = 2;
816  // Peak acceleration of the drop, in 1/1000s of a g.
817  optional int32 accel_peak_thousandths_g = 3;
818  // Duration of freefall in ms
819  optional int32 freefall_time_millis = 4;
820}
821
822/** Represents USB port overheat event. */
823message VendorUsbPortOverheat {
824  optional string reverse_domain_name = 1;
825  /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
826  optional int32 plug_temperature_deci_c = 2;
827  /* Maximum temperature of USB port during overheat event, in 1/10ths of degree
828   * C. */
829  optional int32 max_temperature_deci_c = 3;
830  /* Time between USB plug event and overheat threshold trip, in seconds. */
831  optional int32 time_to_overheat_secs = 4;
832  /* Time between overheat threshold trip and hysteresis, in seconds. */
833  optional int32 time_to_hysteresis_secs = 5;
834  /* Time between hysteresis and active mitigation ending, in seconds. */
835  optional int32 time_to_inactive_secs = 6;
836}
837
838/**
839 * Log battery health snapshot.
840 *
841 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
842 * are snapshotted periodically over 24hrs.
843 */
844message VendorBatteryHealthSnapshot {
845  enum BatterySnapshotType {
846    BATTERY_SNAPSHOT_TYPE_UNKNOWN = 0;
847    BATTERY_SNAPSHOT_TYPE_MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
848    BATTERY_SNAPSHOT_TYPE_MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
849    BATTERY_SNAPSHOT_TYPE_MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
850    BATTERY_SNAPSHOT_TYPE_MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
851    BATTERY_SNAPSHOT_TYPE_MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
852    BATTERY_SNAPSHOT_TYPE_MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
853    BATTERY_SNAPSHOT_TYPE_MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
854    BATTERY_SNAPSHOT_TYPE_MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
855    BATTERY_SNAPSHOT_TYPE_MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
856    BATTERY_SNAPSHOT_TYPE_MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
857    BATTERY_SNAPSHOT_TYPE_AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
858  }
859  optional string reverse_domain_name = 1;
860  optional BatterySnapshotType type = 2;
861  // Temperature, in 1/10ths of degree C.
862  optional int32 temperature_deci_celsius = 3;
863  // Voltage Battery Voltage, in microVolts.
864  optional int32 voltage_micro_volt = 4;
865  // Current Battery current, in microAmps.
866  optional int32 current_micro_amps = 5;
867  // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
868  optional int32 open_circuit_micro_volt = 6;
869  // Resistance Battery Resistance, in microOhms.
870  optional int32 resistance_micro_ohm = 7;
871  // Level Battery Level, as % of full.
872  optional int32 level_percent = 8;
873}
874
875/**
876 * Log battery caused shutdown with the last recorded voltage.
877 */
878message VendorBatteryCausedShutdown {
879 optional string reverse_domain_name = 1;
880 // The last recorded battery voltage prior to shutdown.
881 optional int32 last_recorded_micro_volt = 2;
882}
883
884/**
885 * Log mitigation statistics.
886 */
887message PowerMitigationStats {
888 optional string reverse_domain_name = 1;
889 // The last triggered count: batoilo.
890 optional int32 batoilo_count = 2;
891 // The last triggered count: vdroop1.
892 optional int32 vdroop1_count = 3;
893 // The last triggered count: vdroop2.
894 optional int32 vdroop2_count = 4;
895 // The last triggered count: smpl_warn.
896 optional int32 smpl_warn_count = 5;
897 // The last triggered count: ocp_cpu1.
898 optional int32 ocp_cpu1_count = 6;
899 // The last triggered count: ocp_cpu2.
900 optional int32 ocp_cpu2_count = 7;
901 // The last triggered count: ocp_gpu.
902 optional int32 ocp_gpu_count = 8;
903 // The last triggered count: ocp_tpu.
904 optional int32 ocp_tpu_count = 9;
905 // The last triggered count: soft_ocp_cpu1.
906 optional int32 soft_ocp_cpu1_count = 10;
907 // The last triggered count: soft_ocp_cpu2.
908 optional int32 soft_ocp_cpu2_count = 11;
909 // The last triggered count: soft_ocp_gpu.
910 optional int32 soft_ocp_gpu_count = 12;
911 // The last triggered count: soft_ocp_tpu.
912 optional int32 soft_ocp_tpu_count = 13;
913 // The last triggered capacity: batoilo.
914 optional int32 batoilo_cap = 14;
915 // The last triggered capacity: vdroop1.
916 optional int32 vdroop1_cap = 15;
917 // The last triggered capacity: vdroop2.
918 optional int32 vdroop2_cap = 16;
919 // The last triggered capacity: smpl_warn.
920 optional int32 smpl_warn_cap = 17;
921 // The last triggered capacity: ocp_cpu1.
922 optional int32 ocp_cpu1_cap = 18;
923 // The last triggered capacity: ocp_cpu2.
924 optional int32 ocp_cpu2_cap = 19;
925 // The last triggered capacity: ocp_gpu.
926 optional int32 ocp_gpu_cap = 20;
927 // The last triggered capacity: ocp_tpu.
928 optional int32 ocp_tpu_cap = 21;
929 // The last triggered capacity: soft_ocp_cpu1.
930 optional int32 soft_ocp_cpu1_cap = 22;
931 // The last triggered capacity: soft_ocp_cpu2.
932 optional int32 soft_ocp_cpu2_cap = 23;
933 // The last triggered capacity: soft_ocp_gpu.
934 optional int32 soft_ocp_gpu_cap = 24;
935 // The last triggered capacity: soft_ocp_tpu.
936 optional int32 soft_ocp_tpu_cap = 25;
937}
938
939/**
940 * Log thermal statistics.
941 */
942message ThermalDfsStats {
943 optional string reverse_domain_name = 1;
944 // The last count of BIG cluster dfs triggers
945 optional int32 big_dfs_count = 2;
946 // The last count of MID cluster dfs triggers
947 optional int32 mid_dfs_count = 3;
948 // The last count of LITTLE cluster dfs triggers
949 optional int32 little_dfs_count = 4;
950 // The last count of GPU dfs triggers
951 optional int32 gpu_dfs_count = 5;
952 // The last count of TPU dfs triggers
953 optional int32 tpu_dfs_count = 6;
954 // The last count of DSP dfs triggers
955 optional int32 aur_dfs_count = 7;
956}
957
958/**
959 * Log Display Panel error statistics.
960 */
961message DisplayPanelErrorStats {
962 optional string reverse_domain_name = 1;
963 // The error count due to Tear Effect on primary display panel.
964 optional int32 primary_error_count_te = 2;
965 // The error count due to unknown reason on primary display panel.
966 optional int32 primary_error_count_unknown = 3;
967 // The error count due to Tear Effect on primary display panel.
968 optional int32 secondary_error_count_te = 4;
969 // The error count due to unknown reason on secondary display panel.
970 optional int32 secondary_error_count_unknown = 5;
971}
972
973/**
974 * Log how many segments have been reclaimed in a specific GC mode.
975 */
976message F2fsGcSegmentInfo {
977    optional string reverse_domain_name = 1;
978    /* Reclaimed segments in GC normal mode */
979    optional int32 reclaimed_segments_normal = 2;
980    /* Reclaimed segments in GC urgent high mode */
981    optional int32 reclaimed_segments_urgent_high = 3;
982    /* Reclaimed segments in GC urgent low mode */
983    optional int32 reclaimed_segments_urgent_low = 4;
984    /* Reclaimed segments in GC urgent mid mode */
985    optional int32 reclaimed_segments_urgent_mid = 5;
986}
987
988/**
989 * Logs an event indicating that a nanoapp loading has failed at the HAL.
990 */
991message ChreHalNanoappLoadFailed {
992  // Vendor reverse domain name (expecting "com.google.pixel").
993  optional string reverse_domain_name = 1;
994
995  enum Type {
996    TYPE_UNKNOWN = 0;
997    // Corresponds to preloaded nanoapps on the device.
998    TYPE_PRELOADED = 1;
999    // Dynamic loading of a nanoapp (e.g. code download).
1000    TYPE_DYNAMIC = 2;
1001  }
1002
1003  enum Reason {
1004    REASON_UNKNOWN = 0;
1005    // A generic error code that does not match any of the others.
1006    REASON_ERROR_GENERIC = 1;
1007    // Failure at the connection between HAL<->CHRE.
1008    REASON_CONNECTION_ERROR = 2;
1009    // System ran out of memory.
1010    REASON_OOM = 3;
1011    // Nanoapp did not have the right signing for loading.
1012    REASON_SIGNATURE_MISMATCH = 4;
1013  }
1014
1015  // The 64-bit unique nanoapp identifier of the nanoapp that failed.
1016  optional int64 nanoapp_id = 2;
1017
1018  // The type of the load event.
1019  optional Type type = 3;
1020
1021  // The reason for the failure.
1022  optional Reason reason = 4;
1023}
1024
1025/**
1026 * An enum describing a module within CHRE.
1027 */
1028enum ChreModuleType {
1029  CHRE_MODULE_TYPE_UNKNOWN = 0;
1030  CHRE_MODULE_TYPE_CHRE = 1; // Core CHRE framework
1031  CHRE_MODULE_TYPE_PAL = 2; // PAL module (could be CHPP)
1032  CHRE_MODULE_TYPE_NANOAPP = 3;
1033}
1034
1035/**
1036 * An enum describing the CHRE PAL type.
1037 */
1038enum ChrePalType {
1039  CHRE_PAL_TYPE_UNKNOWN = 0;
1040  CHRE_PAL_TYPE_SENSOR = 1;
1041  CHRE_PAL_TYPE_WIFI = 2;
1042  CHRE_PAL_TYPE_GNSS = 3;
1043  CHRE_PAL_TYPE_WWAN = 4;
1044  CHRE_PAL_TYPE_AUDIO = 5;
1045  CHRE_PAL_TYPE_BLE = 6;
1046}
1047
1048/**
1049 * Logs an event indicating that a CHRE PAL open has failed.
1050 */
1051message ChrePalOpenFailed {
1052  // Vendor reverse domain name (expecting "com.google.pixel").
1053  optional string reverse_domain_name = 1;
1054
1055  enum Type {
1056    TYPE_UNKNOWN = 0;
1057    // Initial open when CHRE starts.
1058    INITIAL_OPEN = 1;
1059    // Any form of "reopen" event internally in the PAL.
1060    REOPEN = 2;
1061  }
1062
1063  // The PAL this failure event is for.
1064  optional ChrePalType pal = 2;
1065
1066  // The type of failure observed.
1067  optional Type type = 3;
1068}
1069
1070/**
1071 * The type of CHRE API request.
1072 */
1073enum ChreApiType {
1074  CHRE_API_TYPE_UNKNOWN = 0;
1075  CHRE_API_TYPE_WIFI_SCAN_MONITOR = 1;
1076  CHRE_API_TYPE_WIFI_ACTIVE_SCAN = 2;
1077  CHRE_API_TYPE_WIFI_RTT_RANGING = 3;
1078}
1079
1080/**
1081 * The type of CHRE API error.
1082 */
1083enum ChreError {
1084  CHRE_ERROR_UNKNOWN = 0;
1085
1086  // No error occurred.
1087  CHRE_ERROR_NONE = 1;
1088
1089  // An unspecified failure occurred.
1090  CHRE_ERROR = 2;
1091
1092  // One or more supplied arguments are invalid.
1093  CHRE_ERROR_INVALID_ARGUMENT = 3;
1094
1095  // Unable to satisfy request because the system is busy.
1096  CHRE_ERROR_BUSY = 4;
1097
1098  // Unable to allocate memory.
1099  CHRE_ERROR_NO_MEMORY = 5;
1100
1101  // The requested feature is not supported.
1102  CHRE_ERROR_NOT_SUPPORTED = 6;
1103
1104  // A timeout occurred while processing the request.
1105  CHRE_ERROR_TIMEOUT = 7;
1106
1107  // The relevant capability is disabled, for example due to a user
1108  // configuration that takes precedence over this request.
1109  CHRE_ERROR_FUNCTION_DISABLED = 8;
1110}
1111
1112/**
1113 * Distribution of CHRE API error codes.
1114 */
1115message ChreApiErrorCodeDistributionTaken {
1116  // Vendor reverse domain name (expecting "com.google.pixel").
1117  optional string reverse_domain_name = 1;
1118
1119  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1120  optional int32 snapshot_chre_get_time_ms = 2;
1121
1122  // The CHRE API type.
1123  optional ChreApiType api_type = 3;
1124
1125  // Corresponds to the CHRE error code that occurred, as defined in the
1126  // "enum chreError" field in chre_api/chre/common.h.
1127  optional ChreError error_code = 4;
1128  optional int32 num_errors = 5;
1129}
1130
1131/**
1132 * Snapshot of the dynamic memory allocated in CHRE.
1133 */
1134message ChreDynamicMemorySnapshotReported {
1135  // Vendor reverse domain name (expecting "com.google.pixel").
1136  optional string reverse_domain_name = 1;
1137
1138  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1139  optional int32 snapshot_chre_get_time_ms = 2;
1140
1141  // The type of the module.
1142  optional ChreModuleType module_type = 3;
1143
1144  // The unique 64-bit ID for a nanoapp, only used if the module_type is NANOAPP.
1145  // If module_type is PAL, then it represents the ChrePalType enum. If the module_type
1146  // is CHRE, then a zero value should be used.
1147  optional int64 pal_type_or_nanoapp_id = 4;
1148
1149  // The max allocation amount of this module in bytes.
1150  optional int32 max_allocation_bytes = 5;
1151
1152  // The current allocation amount of this module in bytes.
1153  optional int32 current_allocation_bytes = 6;
1154}
1155
1156/**
1157 * Snapshot of the event queue stats in CHRE.
1158 */
1159message ChreEventQueueSnapshotReported {
1160  // Vendor reverse domain name (expecting "com.google.pixel").
1161  optional string reverse_domain_name = 1;
1162
1163  // The chreGetTime() value when this snapshot was taken, in milliseconds.
1164  optional int32 snapshot_chre_get_time_ms = 2;
1165
1166  // The maximum size the event queue got to (i.e. num pending events).
1167  optional int32 max_event_queue_size = 3;
1168
1169  // The average size the event queue got to (i.e. num pending events).
1170  optional int32 mean_event_queue_size = 4;
1171
1172  // The number of events that were dropped due to capacity limits.
1173  optional int32 num_dropped_events = 5;
1174
1175  // The maximum amount of time it took for an event, from when it was received,
1176  // to when it was delivered to all interested modules. This value represents
1177  // the total delay within the CHRE subsystem.
1178  optional int64 max_queue_delay_us = 6;
1179
1180  // The mean value of the delay in microseconds.
1181  optional int64 mean_queue_delay_us = 7;
1182}
1183
1184/**
1185 * Indicates that a nanoapp has woken up the AP.
1186 */
1187message ChreApWakeUpOccurred {
1188  // Vendor reverse domain name (expecting "com.google.pixel").
1189  optional string reverse_domain_name = 1;
1190
1191  // The 64-bit unique nanoapp identifier that describes the entity that has caused an AP wake-up
1192  // from CHRE. Whenever this event occurs, this means that the nanoapp sent a message to
1193  // the AP causing a transition between suspend/wake-up.
1194  optional int64 nanoapp_id = 2;
1195}
1196
1197/**
1198 * Snapshot of the current battery health of the device.
1199 */
1200message BatteryHealthStatus {
1201  // Vendor reverse domain name (expecting "com.google.pixel").
1202  optional string reverse_domain_name = 1;
1203
1204  // The algorithm that computes how the health status and health indexes are calculated.
1205  optional int32 health_algorithm = 2;
1206
1207  enum HealthStatus {
1208    UNKNOWN = -1; // The health status is unknown due to a SW limitation or issue
1209    NOMINAL = 0; // The battery is operating as expected
1210    MARGINAL = 1; // The battery may need replacement soon
1211    NEEDS_REPLACEMENT = 2; // The battery needs replacement
1212    FAILED = 3; // The battery has failed and no longer operates as expected
1213    NOT_AVAILABLE = 4; // This is a temporary state when cycle count is insufficient
1214    INCONSISTENT = 5; // The battery recalibration is pending
1215  }
1216
1217  // HealthStatus calculated using health_index, health_perf_index.
1218  optional HealthStatus health_status = 3;
1219
1220  // A percentage measure of the health of the battery with 100% being perfectly healthy.
1221  optional int32 health_index = 4;
1222
1223  // A percentage measure of the battery capacity of the device, affected by cycle life degradation.
1224  optional int32 health_capacity_index = 5;
1225
1226  // A percentage measure of the max performance of the device, affected by impedance growth with 100% being perfectly healthy.
1227  optional int32 health_impedance_index = 6;
1228
1229  // An index that expresses the likelihood of swelling given the SOC residency stats.
1230  optional int32 swelling_cumulative = 7;
1231
1232  // The battery capacity used to determine the health index. This is the reference value from b/223759710.
1233  optional int32 health_full_capacity = 8;
1234
1235  // 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.
1236  optional int32 current_impedance = 9;
1237
1238  // The (hours) value of TimeH (0xb3), a register value, multiplied by 3.2 hours.
1239  optional int32 battery_age = 10;
1240
1241  // The cycle count at the time of the log event.
1242  optional int32 cycle_count = 11;
1243
1244  enum BattDisconnectStatus {
1245    BPST_BATT_UNKNOWN = 0;
1246    BPST_BATT_CONNECT = 1;
1247    BPST_BATT_DISCONNECT = 2; // Result of single battery disconnect detection
1248    BPST_BATT_CELL_FAULT = 3; // Result of cell fault detection which means actual disconnection
1249  }
1250
1251  // Battery disconnect detection stats.
1252  optional BattDisconnectStatus battery_disconnect_status = 12;
1253}
1254
1255/**
1256 * Log battery SOC/temperature usage data.
1257 *
1258 * Each data represents cumulative time of the battery
1259 * spent over a specific SOC and over a specific temperature
1260 * while charging and while discharging in seconds.
1261 *
1262 * Logged from:
1263 * /sys/class/power_supply/battery/swelling_data, via Vendor.
1264 */
1265message BatteryHealthUsage {
1266  // Vendor reverse domain name (expecting "com.google.pixel").
1267  optional string reverse_domain_name = 1;
1268
1269  // The temperature limit (deg C) used to accumulate the time above this value.
1270  optional int32 temperature_limit_deci_c = 2;
1271
1272  // The SOC limit (%) used to accumulate the time above this value.
1273  optional int32 soc_limit = 3;
1274
1275  // Time (s) accumulated only during charge at the given thresholds.
1276  optional int32 charge_time_secs = 4;
1277
1278  // Time (s) accumulated only during discharge at the given thresholds.
1279  optional int32 discharge_time_secs = 5;
1280}
1281
1282/*
1283 * A Value of F2FS smart idle maintenance feature enabled
1284 */
1285message F2fsSmartIdleMaintEnabledStateChanged {
1286    optional string reverse_domain_name = 1;
1287    /* Smart idle maint is enabled */
1288    optional bool enabled = 2;
1289}
1290
1291/*
1292 * Snapshot of the block layer read write stats
1293 */
1294message BlockStatsReported {
1295    optional string reverse_domain_name = 1;
1296        /* number of read I/Os processed */
1297        optional int64 read_io = 2;
1298        /* number of sectors read */
1299        optional int64 read_sectors = 3;
1300        /* total wait time for read requests */
1301        optional int64 read_ticks = 4;
1302        /* number of write I/Os processed */
1303        optional int64 write_io = 5;
1304        /* number of sectors written */
1305        optional int64 write_sectors = 6;
1306        /* total wait time for write requests */
1307        optional int64 write_ticks = 7;
1308}
1309
1310/**
1311 * Logs the reported vendor audio hardware stats.
1312 */
1313message VendorAudioHardwareStatsReported {
1314  optional string reverse_domain_name = 1;
1315  /* The number of calls in a day where CCA is active.
1316   * CCA can only be applied under some radio bands.
1317   */
1318  optional int32 milli_rate_of_ams_per_day = 2;
1319
1320  // cca_active: obsoleted UI enable & algorithm is active (C1)
1321  // replaced by cca_active_count_per_day
1322  optional int32 rate_of_cca_active_per_day = 3 [deprecated = true];
1323
1324  // cca_enable: obsoleted UI enable & algorithm is inactive field (C2)
1325  // replaced by cca_enable_count_per_day
1326  optional int32 rate_of_cca_enable_per_day = 4 [deprecated = true];
1327
1328  enum Source {
1329    VOIP = 0;
1330    VOICE = 1;
1331  }
1332
1333  /* source: identify whether this atom is for voice or voip case. */
1334  optional Source source = 5;
1335
1336  /* total_call_count_per_day: count total number of call per day. */
1337  optional int32 total_call_count_per_day = 6;
1338
1339  /* cca_active: UI enable & algorithm is active (C1 or C3) */
1340  optional int32 cca_active_count_per_day = 7;
1341
1342  /* cca_enable: UI enable & algorithm is inactive (C2 or C4) */
1343  optional int32 cca_enable_count_per_day = 8;
1344}
1345
1346/**
1347 * Logs the reported vendor audio PDM stats.
1348 * PDM stats are used to show background noise level during voice/voip calling.
1349 * Each of the atom will show only one type of background noises. There are at most 4 types.
1350 * Thus, this atoms will be reported at most 4 times to show all types.
1351 */
1352message VendorAudioPdmStatsReported {
1353  optional string reverse_domain_name = 1;
1354
1355  /* index of the pdm to report. There are 4 pdm instances. So, the value is in the range 1-4 */
1356  optional int32 pdm_index = 2;
1357
1358  /* State of the pdm to report. There is only two value 1 for good and 0 for bad. */
1359  optional int32 state = 3;
1360}
1361
1362/*
1363 * Logs vendor stats about long IRQs.
1364 *
1365 * IRQ is considered long when it exceeds a threshold (currently 1 ms).
1366 * Stats include top 5 slowest IRQs: their numbers and the worst latency.
1367 * Stats are reset after every report.
1368 */
1369message VendorLongIRQStatsReported {
1370  optional string reverse_domain_name = 1;
1371
1372  // Count of long soft IRQ since last report.
1373  optional int64 long_softirq_count = 2;
1374
1375  optional int64 top1_softirq_num = 3;
1376  optional int64 top1_softirq_latency_us = 4;
1377  optional int64 top2_softirq_num = 5;
1378  optional int64 top2_softirq_latency_us = 6;
1379  optional int64 top3_softirq_num = 7;
1380  optional int64 top3_softirq_latency_us = 8;
1381  optional int64 top4_softirq_num = 9;
1382  optional int64 top4_softirq_latency_us = 10;
1383  optional int64 top5_softirq_num = 11;
1384  optional int64 top5_softirq_latency_us = 12;
1385
1386  // Count of long IRQ since last report.
1387  optional int64 long_irq_count = 13;
1388
1389  optional int64 top1_irq_num = 14;
1390  optional int64 top1_irq_latency_us = 15;
1391  optional int64 top2_irq_num = 16;
1392  optional int64 top2_irq_latency_us = 17;
1393  optional int64 top3_irq_num = 18;
1394  optional int64 top3_irq_latency_us = 19;
1395  optional int64 top4_irq_num = 20;
1396  optional int64 top4_irq_latency_us = 21;
1397  optional int64 top5_irq_num = 22;
1398  optional int64 top5_irq_latency_us = 23;
1399
1400  optional int64 storm_irq_top1_num = 24;
1401  optional int64 storm_irq_top1_count = 25;
1402  optional int64 storm_irq_top2_num = 26;
1403  optional int64 storm_irq_top2_count = 27;
1404  optional int64 storm_irq_top3_num = 28;
1405  optional int64 storm_irq_top3_count = 29;
1406  optional int64 storm_irq_top4_num = 30;
1407  optional int64 storm_irq_top4_count = 31;
1408  optional int64 storm_irq_top5_num= 32;
1409  optional int64 storm_irq_top5_count = 33;
1410}
1411
1412/**
1413 * Logs the Temperature residency stats per thermal zone.
1414 */
1415message VendorTempResidencyStats {
1416  optional string reverse_domain_name = 1;
1417  // Thermal zone name
1418  optional string sensor_name = 2;
1419
1420  // Time since last collect of this thermal zone
1421  optional int64 since_last_update_ms = 3;
1422
1423  // Temperature residency stats is measured by time in ms that a temperature zone's temperature
1424  // lay within some temperature thresholds
1425  // e.g.
1426  // With temperature thresholds predefined as thresholds_i, thresholds_i+1,
1427  // temp_residency_ms_bucket_i measures how much time the sensor lay within this two thresholds
1428  optional int64 temp_residency_ms_bucket_1 = 4;
1429  optional int64 temp_residency_ms_bucket_2 = 5;
1430  optional int64 temp_residency_ms_bucket_3 = 6;
1431  optional int64 temp_residency_ms_bucket_4 = 7;
1432  optional int64 temp_residency_ms_bucket_5 = 8;
1433  optional int64 temp_residency_ms_bucket_6 = 9;
1434  optional int64 temp_residency_ms_bucket_7 = 10;
1435  optional int64 temp_residency_ms_bucket_8 = 11;
1436  optional int64 temp_residency_ms_bucket_9 = 12;
1437  optional int64 temp_residency_ms_bucket_10 = 13;
1438  optional int64 temp_residency_ms_bucket_11 = 14;
1439  optional int64 temp_residency_ms_bucket_12 = 15;
1440  optional int64 temp_residency_ms_bucket_13 = 16;
1441  optional int64 temp_residency_ms_bucket_14 = 17;
1442  optional int64 temp_residency_ms_bucket_15 = 18;
1443  optional int64 temp_residency_ms_bucket_16 = 19;
1444  optional int64 temp_residency_ms_bucket_17 = 20;
1445  optional int64 temp_residency_ms_bucket_18 = 21;
1446  optional int64 temp_residency_ms_bucket_19 = 22;
1447  optional int64 temp_residency_ms_bucket_20 = 23;
1448
1449  // The maximum and minimum temperature observed for the sensor along with the
1450  // timestamp of occurrence in terms of time_t.
1451  optional float max_temp = 24;
1452  optional int64 max_temp_timestamp = 25;
1453  optional float min_temp = 26;
1454  optional int64 min_temp_timestamp = 27;
1455}
1456
1457/**
1458 * Logs the Resume Latency stats.
1459 */
1460message VendorResumeLatencyStats {
1461  optional string reverse_domain_name = 1;
1462  optional int64 max_latency_ms = 2;
1463  optional int64 avg_latency_ms = 3;
1464
1465  // Resume Latency stats is measured by count of resumes that lay within some latency thresholds
1466  // e.g.
1467  // With resume times thresholds predefined as thresholds_i, thresholds_i+1,
1468  // resume_count_bucket_i measures count of resumes that lay within this two thresholds
1469  optional int64 resume_count_bucket_1 = 4;
1470  optional int64 resume_count_bucket_2 = 5;
1471  optional int64 resume_count_bucket_3 = 6;
1472  optional int64 resume_count_bucket_4 = 7;
1473  optional int64 resume_count_bucket_5 = 8;
1474  optional int64 resume_count_bucket_6 = 9;
1475  optional int64 resume_count_bucket_7 = 10;
1476  optional int64 resume_count_bucket_8 = 11;
1477  optional int64 resume_count_bucket_9 = 12;
1478  optional int64 resume_count_bucket_10 = 13;
1479  optional int64 resume_count_bucket_11 = 14;
1480  optional int64 resume_count_bucket_12 = 15;
1481  optional int64 resume_count_bucket_13 = 16;
1482  optional int64 resume_count_bucket_14 = 17;
1483  optional int64 resume_count_bucket_15 = 18;
1484  optional int64 resume_count_bucket_16 = 19;
1485  optional int64 resume_count_bucket_17 = 20;
1486  optional int64 resume_count_bucket_18 = 21;
1487  optional int64 resume_count_bucket_19 = 22;
1488  optional int64 resume_count_bucket_20 = 23;
1489  optional int64 resume_count_bucket_21 = 24;
1490  optional int64 resume_count_bucket_22 = 25;
1491  optional int64 resume_count_bucket_23 = 26;
1492  optional int64 resume_count_bucket_24 = 27;
1493  optional int64 resume_count_bucket_25 = 28;
1494  optional int64 resume_count_bucket_26 = 29;
1495  optional int64 resume_count_bucket_27 = 30;
1496  optional int64 resume_count_bucket_28 = 31;
1497  optional int64 resume_count_bucket_29 = 32;
1498  optional int64 resume_count_bucket_30 = 33;
1499  optional int64 resume_count_bucket_31 = 34;
1500  optional int64 resume_count_bucket_32 = 35;
1501  optional int64 resume_count_bucket_33 = 36;
1502  optional int64 resume_count_bucket_34 = 37;
1503  optional int64 resume_count_bucket_35 = 38;
1504  optional int64 resume_count_bucket_36 = 39;
1505}
1506
1507/*
1508 * Log the Brownout events.
1509 */
1510message BrownoutDetected {
1511    enum IRQType {
1512        UVLO1 = 0;
1513        SMPL_WARN = 1;
1514        UVLO2 = 2;
1515        BATOILO = 3;
1516    }
1517
1518    enum BrownoutReason {
1519        UNKNOWN = 0;
1520        UVLO_IF = 1;
1521        OCP_IF = 2;
1522        UVLO_MAIN = 3;
1523        UVLO_SUB = 4;
1524        OCP_B1M = 5;
1525        OCP_B2M = 6;
1526        OCP_B3M = 7;
1527        OCP_B4M = 8;
1528        OCP_B5M = 9;
1529        OCP_B6M = 10;
1530        OCP_B7M = 11;
1531        OCP_B8M = 12;
1532        OCP_B9M = 13;
1533        OCP_B10M = 14;
1534        OCP_B1S = 15;
1535        OCP_B2S = 16;
1536        OCP_B3S = 17;
1537        OCP_B4S = 18;
1538        OCP_B5S = 19;
1539        OCP_B6S = 20;
1540        OCP_B7S = 21;
1541        OCP_B8S = 22;
1542        OCP_B9S = 23;
1543        OCP_B10S = 24;
1544        OCP_BAS = 25;
1545        OCP_BBS = 26;
1546        OCP_BCS = 27;
1547        OCP_BDS = 28;
1548    }
1549
1550    // Reverse domain name. (e.g. Pixel)
1551    optional string reverse_domain_name = 1;
1552    // Triggered mitigation IRQ
1553    optional IRQType triggered_irq = 2;
1554    // Triggered timestamp
1555    optional int64 triggered_timestamp = 3;
1556    // Triggered battery temperature
1557    optional int32 battery_temp = 4;
1558    // Triggered battery age
1559    optional int32 battery_cycle = 5;
1560    // Triggered battery soc
1561    optional int32 battery_soc = 6;
1562    // Triggered FG Reading: Voltage Now
1563    optional int32 voltage_now = 7;
1564    // Triggered ODPM Reading: Channel 1
1565    optional int32 odpm_channel01 = 8;
1566    // Triggered ODPM Reading: Channel 2
1567    optional int32 odpm_channel02 = 9;
1568    // Triggered ODPM Reading: Channel 3
1569    optional int32 odpm_channel03 = 10;
1570    // Triggered ODPM Reading: Channel 4
1571    optional int32 odpm_channel04 = 11;
1572    // Triggered ODPM Reading: Channel 5
1573    optional int32 odpm_channel05 = 12;
1574    // Triggered ODPM Reading: Channel 6
1575    optional int32 odpm_channel06 = 13;
1576    // Triggered ODPM Reading: Channel 7
1577    optional int32 odpm_channel07 = 14;
1578    // Triggered ODPM Reading: Channel 8
1579    optional int32 odpm_channel08 = 15;
1580    // Triggered ODPM Reading: Channel 9
1581    optional int32 odpm_channel09 = 16;
1582    // Triggered ODPM Reading: Channel 10
1583    optional int32 odpm_channel10 = 17;
1584    // Triggered ODPM Reading: Channel 11
1585    optional int32 odpm_channel11 = 18;
1586    // Triggered ODPM Reading: Channel 12
1587    optional int32 odpm_channel12 = 19;
1588    // Triggered ODPM Reading: Channel 13
1589    optional int32 odpm_channel13 = 20;
1590    // Triggered ODPM Reading: Channel 14
1591    optional int32 odpm_channel14 = 21;
1592    // Triggered ODPM Reading: Channel 15
1593    optional int32 odpm_channel15 = 22;
1594    // Triggered ODPM Reading: Channel 16
1595    optional int32 odpm_channel16 = 23;
1596    // Triggered ODPM Reading: Channel 17
1597    optional int32 odpm_channel17 = 24;
1598    // Triggered ODPM Reading: Channel 18
1599    optional int32 odpm_channel18 = 25;
1600    // Triggered ODPM Reading: Channel 19
1601    optional int32 odpm_channel19 = 26;
1602    // Triggered ODPM Reading: Channel 20
1603    optional int32 odpm_channel20 = 27;
1604    // Triggered ODPM Reading: Channel 21
1605    optional int32 odpm_channel21 = 28;
1606    // Triggered ODPM Reading: Channel 22
1607    optional int32 odpm_channel22 = 29;
1608    // Triggered ODPM Reading: Channel 23
1609    optional int32 odpm_channel23 = 30;
1610    // Triggered ODPM Reading: Channel 24
1611    optional int32 odpm_channel24 = 31;
1612    // Triggered DVFS State: Channel 1
1613    optional int32 dvfs_channel1 = 32;
1614    // Triggered DVFS State: Channel 2
1615    optional int32 dvfs_channel2 = 33;
1616    // Triggered DVFS State: Channel 3
1617    optional int32 dvfs_channel3 = 34;
1618    // Triggered DVFS State: Channel 4
1619    optional int32 dvfs_channel4 = 35;
1620    // Triggered DVFS State: Channel 5
1621    optional int32 dvfs_channel5  = 36;
1622    // Triggered DVFS State: Channel 6
1623    optional int32 dvfs_channel6 = 37;
1624    // brownout reason
1625    optional BrownoutReason brownout_reason = 38;
1626}
1627
1628/*
1629 * PCIe Link Statistics
1630 */
1631message PcieLinkStatsReported {
1632    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1633    optional string reverse_domain_name = 1;
1634
1635    /* Count of new PCIe Link Down events on the modem interface */
1636    optional int32 modem_pcie_linkdowns = 2;
1637    /* Count of new PCIe Completion Timeout events on the modem interface */
1638    optional int32 modem_pcie_completion_timeouts = 3;
1639    /* Count of new PCIe Link Up Failure events on the modem interface */
1640    optional int32 modem_pcie_linkup_failures = 4;
1641    /* Average pll lock time (uS) during PCIe Link Up on modem interface */
1642    optional int32 modem_pcie_pll_lock_avg = 5;
1643    /* Average time (uS) for successful PCIe Link Up on modem interface */
1644    optional int32 modem_pcie_link_up_avg = 6;
1645
1646    /* Count of new PCIe Link Down events on the wifi interface */
1647    optional int32 wifi_pcie_linkdowns = 7;
1648    /* Count of new PCIe Completion Timeout events on the wifi interface */
1649    optional int32 wifi_pcie_completion_timeouts = 8;
1650    /* Count of new PCIe Link Up Failure events on the wifi interface */
1651    optional int32 wifi_pcie_linkup_failures = 9;
1652    /* Average pll lock time (uS) during PCIe Link Up on wifi interface */
1653    optional int32 wifi_pcie_pll_lock_avg = 10;
1654    /* Average time (uS) for successful PCIe Link Up on wifi interface */
1655    optional int32 wifi_pcie_link_up_avg = 11;
1656
1657    /* Count of new PCIe Link Recovery Failure events on the modem interface */
1658    optional int32 modem_pcie_link_recovery_failures = 12;
1659    /* Count of new PCIe Link Recovery Failure events on the wifi interface */
1660    optional int32 wifi_pcie_link_recovery_failures = 13;
1661}
1662
1663/**
1664 * Log the CDEV request stats per sensor, binded cooling device.
1665 * Logged from: hardware/google/pixel/thermal/utils/thermal_stats_helper.cpp
1666 */
1667message VendorSensorCoolingDeviceStats {
1668 optional string reverse_domain_name = 1;
1669 // Sensor name which is making the cooling device request
1670 optional string  trigger_sensor_name = 2;
1671
1672 // Cooling device name for which request is being made
1673 optional string  cooling_device_name = 3;
1674
1675 // Time duration for which stats are recorded
1676 optional int64 since_last_update_ms = 4;
1677
1678 // Sequence of values corresponding to time spent in each request state
1679 optional int64 time_in_state_ms_bucket_1 = 5;
1680 optional int64 time_in_state_ms_bucket_2 = 6;
1681 optional int64 time_in_state_ms_bucket_3 = 7;
1682 optional int64 time_in_state_ms_bucket_4 = 8;
1683 optional int64 time_in_state_ms_bucket_5 = 9;
1684 optional int64 time_in_state_ms_bucket_6 = 10;
1685 optional int64 time_in_state_ms_bucket_7 = 11;
1686 optional int64 time_in_state_ms_bucket_8 = 12;
1687 optional int64 time_in_state_ms_bucket_9 = 13;
1688 optional int64 time_in_state_ms_bucket_10 = 14;
1689 optional int64 time_in_state_ms_bucket_11 = 15;
1690 optional int64 time_in_state_ms_bucket_12 = 16;
1691 optional int64 time_in_state_ms_bucket_13 = 17;
1692 optional int64 time_in_state_ms_bucket_14 = 18;
1693 optional int64 time_in_state_ms_bucket_15 = 19;
1694 optional int64 time_in_state_ms_bucket_16 = 20;
1695 optional int64 time_in_state_ms_bucket_17 = 21;
1696 optional int64 time_in_state_ms_bucket_18 = 22;
1697 optional int64 time_in_state_ms_bucket_19 = 23;
1698 optional int64 time_in_state_ms_bucket_20 = 24;
1699}
1700
1701/* Log playcount of effects in Vibrator HAL
1702 *
1703 * Logged from:
1704 *     hardware/google/pixel/vibrator/
1705 */
1706message VibratorPlaycountReported {
1707  // Vendor reverse domain name (expecting "com.google.pixel").
1708  optional string reverse_domain_name = 1;
1709
1710  // Playcount for each primitive
1711  // Each index tracks the count for that index in the waveform
1712  repeated int32 waveform_counts = 2;
1713
1714  // Playcount for each 50ms range.
1715  // Each index tracks [50ms * i, 50ms * (i + 1))
1716  repeated int32 duration_counts = 3;
1717}
1718
1719/* Log latency encountered in Vibrator HAL
1720 *
1721 * Logged from:
1722 *     hardware/google/pixel/vibrator/
1723 */
1724message VibratorLatencyReported {
1725  // Vendor reverse domain name (expecting "com.google.pixel").
1726  optional string reverse_domain_name = 1;
1727
1728  // Minimum latency seen
1729  // 0 Prebaked and primitives
1730  // 1 Composed effects
1731  // 2 PWLE effects
1732  repeated int32 min_latencies = 2;
1733
1734  // Maximum latency seen
1735  // 0 Prebaked and primitives
1736  // 1 Composed effects
1737  // 2 PWLE effects
1738  repeated int32 max_latencies = 3;
1739
1740  // Average latency seen
1741  // 0 Prebaked and primitives
1742  // 1 Composed effects
1743  // 2 PWLE effects
1744  repeated int32 avg_latencies = 4;
1745}
1746
1747/* Log errors encountered in Vibrator HAL
1748 *
1749 * Logged from:
1750 *     hardware/google/pixel/vibrator/
1751 */
1752message VibratorErrorsReported {
1753  // Vendor reverse domain name (expecting "com.google.pixel").
1754  optional string reverse_domain_name = 1;
1755
1756  // Count for each error
1757  // 0 HwAPI Error
1758  // 1 HwCAL Error
1759  // 2 Compose Fail Error
1760  // 3 ALSA Fail Error
1761  // 4 Async Fail Error
1762  // 5 Bad Timeout Error
1763  // 6 Bad Amplitude Error
1764  // 7 Bad Effect Error
1765  // 8 Bad Effect Strength Error
1766  // 9 Bad Primitive Error
1767  // 10 Bad Composite Error
1768  // 11 PWLE Construction Fail Error
1769  // 12 Unsupported Method Error
1770  repeated int32 error_counts = 2;
1771}
1772
1773/* A message containing F2FS Atomic Write information */
1774message F2fsAtomicWriteInfo {
1775    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1776    optional string reverse_domain_name = 1;
1777    /* Show the peak value of total current atomic write block count after boot */
1778    optional int32 peak_atomic_write = 2;
1779    /* Show the accumulated total committed atomic write block count after boot */
1780    optional int32 committed_atomic_block = 3;
1781    /* Show the accumulated total revoked atomic write block count after boot */
1782    optional int32 revoked_atomic_block = 4;
1783}
1784
1785/* A message containing Partition Used Spaced information */
1786message PartitionsUsedSpaceReported {
1787    enum Directory {
1788        UNKNOWN = 0;
1789        PERSIST = 1;
1790    }
1791    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1792    optional string reverse_domain_name = 1;
1793
1794    /* used space of directory information */
1795    optional Directory directory = 2;
1796    optional int64 free_bytes = 3;
1797    optional int64 total_bytes = 4;
1798}
1799
1800message GpuEvent {
1801    enum GpuEventType {
1802      MALI_TYPE_NONE = 0;
1803      MALI_KMD_ERROR = 1;
1804      MALI_GPU_RESET = 2;
1805    }
1806    enum GpuEventInfo {
1807      MALI_INFO_NONE = 0;
1808      MALI_CSG_REQ_STATUS_UPDATE = 1;
1809      MALI_CSG_SUSPEND = 2;
1810      MALI_CSG_SLOTS_SUSPEND = 3;
1811      MALI_CSG_GROUP_SUSPEND = 4;
1812      MALI_CSG_EP_CFG = 5;
1813      MALI_CSG_SLOTS_START = 6;
1814      MALI_GROUP_TERM = 7;
1815      MALI_QUEUE_START = 8;
1816      MALI_QUEUE_STOP = 9;
1817      MALI_QUEUE_STOP_ACK = 10;
1818      MALI_CSG_SLOT_READY = 11;
1819      MALI_L2_PM_TIMEOUT = 12;
1820      MALI_PM_TIMEOUT = 13;
1821      MALI_CSF_RESET_OK = 14;
1822      MALI_CSF_RESET_FAILED = 15;
1823    }
1824
1825    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1826    optional string reverse_domain_name = 1;
1827    /*
1828     * Type of the GPU event. Possible values depend on the platform GPU.
1829     * Eg, MALI_KMD_ERROR, MALI_GPU_RESET.
1830     */
1831    optional GpuEventType gpu_event_type = 2;
1832    /*
1833     * Additional information about the GPU event. Possible values depend
1834     * on the platform GPU.
1835     * Eg, MALI_PM_TIMEOUT, MALI_CSF_RESET_OK.
1836     */
1837    optional GpuEventInfo gpu_event_info = 3;
1838}
1839/**
1840 * Log mitigation duration.
1841 */
1842message PowerMitigationDurationCounts {
1843 optional string reverse_domain_name = 1;
1844 // Count of UVLO1 greater than threshold without any other concurrent IRQs.
1845 optional int32 greater_than_thresh_uvlo1_none = 2;
1846 // Count of UVLO1 IRQ + MMWAVE IRQ with duration greater than threshold.
1847 optional int32 greater_than_thresh_uvlo1_mmwave = 3;
1848 // Count of UVLO1 IRQ + RFFE IRQ with duration greater than threshold.
1849 optional int32 greater_than_thresh_uvlo1_rffe = 4;
1850 // Count of UVLO2 greater than threshold without any other concurrent IRQs.
1851 optional int32 greater_than_thresh_uvlo2_none = 5;
1852 // Count of UVLO2 IRQ + MMWAVE IRQ with duration greater than threshold.
1853 optional int32 greater_than_thresh_uvlo2_mmwave = 6;
1854 // Count of UVLO2 IRQ + RFFE IRQ with duration greater than threshold.
1855 optional int32 greater_than_thresh_uvlo2_rffe = 7;
1856 // Count of BATOILO greater than threshold without any other concurrent IRQs.
1857 optional int32 greater_than_thresh_batoilo_none = 8;
1858 // Count of BATOILO IRQ + MMWAVE IRQ with duration greater than threshold.
1859 optional int32 greater_than_thresh_batoilo_mmwave = 9;
1860 // Count of BATOILO IRQ + RFFE IRQ with duration greater than threshold.
1861 optional int32 greater_than_thresh_batoilo_rffe = 10;
1862
1863 // IRQ duration of main regulator indices 0-11 greater than threshold.
1864 optional int32 greater_than_thresh_main_0 = 11;
1865 optional int32 greater_than_thresh_main_1 = 12;
1866 optional int32 greater_than_thresh_main_2 = 13;
1867 optional int32 greater_than_thresh_main_3 = 14;
1868 optional int32 greater_than_thresh_main_4 = 15;
1869 optional int32 greater_than_thresh_main_5 = 16;
1870 optional int32 greater_than_thresh_main_6 = 17;
1871 optional int32 greater_than_thresh_main_7 = 18;
1872 optional int32 greater_than_thresh_main_8 = 19;
1873 optional int32 greater_than_thresh_main_9 = 20;
1874 optional int32 greater_than_thresh_main_10 = 21;
1875 optional int32 greater_than_thresh_main_11 = 22;
1876
1877 // IRQ duration of sub regulator indices 0-11 greater than threshold.
1878 optional int32 greater_than_thresh_sub_0 = 23;
1879 optional int32 greater_than_thresh_sub_1 = 24;
1880 optional int32 greater_than_thresh_sub_2 = 25;
1881 optional int32 greater_than_thresh_sub_3 = 26;
1882 optional int32 greater_than_thresh_sub_4 = 27;
1883 optional int32 greater_than_thresh_sub_5 = 28;
1884 optional int32 greater_than_thresh_sub_6 = 29;
1885 optional int32 greater_than_thresh_sub_7 = 30;
1886 optional int32 greater_than_thresh_sub_8 = 31;
1887 optional int32 greater_than_thresh_sub_9 = 32;
1888 optional int32 greater_than_thresh_sub_10 = 33;
1889 optional int32 greater_than_thresh_sub_11 = 34;
1890}
1891
1892/*
1893 * Logs the third party audio effects stats.
1894 * Third party audio effects stats includes duration in milliseconds for each
1895 * instance of the effects (speaker, USB, etc.).
1896 */
1897message VendorAudioThirdPartyEffectStatsReported {
1898    /* Vendor reverse domain name (expecting "com.google.pixel"). */
1899    optional string reverse_domain_name = 1;
1900
1901    enum InstanceId {
1902        OTHER = 0;
1903        SPEAKER = 1;
1904        USB = 2;
1905        BT_A2DP = 3;
1906        BT_LE = 4;
1907    }
1908    /* Instance of the effect. */
1909    optional InstanceId instance = 2;
1910    /* Active duration in milliseconds per day for volume range 0. */
1911    optional int32 volume_range_0_active_ms_per_day = 3;
1912    /* Active duration in milliseconds per day for volume range 1. */
1913    optional int32 volume_range_1_active_ms_per_day = 4;
1914    /* Active duration in milliseconds per day for volume range 2. */
1915    optional int32 volume_range_2_active_ms_per_day = 5;
1916    /* Active duration in milliseconds per day for volume range 3. */
1917    optional int32 volume_range_3_active_ms_per_day = 6;
1918    /* Active duration in milliseconds per day for volume range 4. */
1919    optional int32 volume_range_4_active_ms_per_day = 7;
1920    /* Active duration in milliseconds per day for volume range 5. */
1921    optional int32 volume_range_5_active_ms_per_day = 8;
1922    /* Active duration in milliseconds per day for volume range 6. */
1923    optional int32 volume_range_6_active_ms_per_day = 9;
1924    /* Active duration in milliseconds per day for volume range 7. */
1925    optional int32 volume_range_7_active_ms_per_day = 10;
1926    /* Active duration in milliseconds per day for volume range 8. */
1927    optional int32 volume_range_8_active_ms_per_day = 11;
1928    /* Active duration in milliseconds per day for volume range 9. */
1929    optional int32 volume_range_9_active_ms_per_day = 12;
1930}
1931
1932/*
1933 * Logs the Audio Adapted information stats.
1934 * Two stats are recorded, count and duration (in ms) per features.
1935 */
1936message VendorAudioAdaptedInfoStatsReported {
1937  /* Vendor reverse domain name */
1938  optional string reverse_domain_name = 1;
1939
1940  enum AdaptedInfoFeature {
1941    UNKNOWN = 0;
1942    BATTERY_ADAPTED_AUDIO_CONTROL = 1;
1943    MEDIA_PLAYBACK_THERMAL_THROTTLE = 2;
1944    TELEPHONY_THERMAL_THROTTLE = 3;
1945    ACOUSTIC_SHOCK = 4;
1946    SPATIAL_AUDIO = 5;
1947  };
1948  /* Feature to record the stats */
1949  optional AdaptedInfoFeature feature_id = 2;
1950  /* Number of time the feature is active */
1951  optional int32 active_counts_per_day = 3;
1952  /* Duration the feature is active in milliseconds */
1953  optional int32 active_duration_ms_per_day = 4;
1954}
1955
1956/*
1957 * Logs the audio PCM usage stats.
1958 * PCM usage includes average latency and total active count per day.
1959 */
1960message VendorAudioPcmStatsReported {
1961  /* Vendor reverse domain name */
1962  optional string reverse_domain_name = 1;
1963
1964  enum HalPcmType {
1965    UNKNOWN = 0;
1966    DEEPBUFFER = 1;
1967    LOWLATENCY = 2;
1968    MMAP_PLAY = 3;
1969    RAW_PLAY = 4;
1970    IMMERSIVE = 5;
1971    HAPTIC = 6;
1972    COMPRESS = 7;
1973    MMAP_REC = 8;
1974    RAW_REC = 9;
1975    AUDIO_REC = 10;
1976    HIFI_RX = 11;
1977    HIFI_TX = 12;
1978    IMMUTABLE_RX = 13;
1979    CUSTOM_PCM_1 = 14;
1980    CUSTOM_PCM_2 = 15;
1981    CUSTOM_PCM_3 = 16;
1982    CUSTOM_PCM_4 = 17;
1983    CUSTOM_PCM_5 = 18;
1984  };
1985  /* Type of PCM */
1986  optional HalPcmType type = 2;
1987  /* Average latency in millisecond of the pcm type per day. */
1988  optional int32 pcm_open_latency_avg_ms_per_day = 3;
1989  /* Total active count of the pcm type per day. */
1990  optional int32 pcm_active_counts_per_day = 4;
1991}
1992