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    // AOSP atom ID range ends at 109999
74}
75
76/* Supported reverse domain names. */
77message ReverseDomainNames {
78    optional string pixel = 1 [default = "com.google.pixel"];
79}
80
81/* A message containing detailed statistics and debug information about a charge session. */
82message ChargeStats {
83    /* Charge Adapter stats. */
84    enum AdapterType {
85        ADAPTER_TYPE_UNKNOWN = 0;
86        ADAPTER_TYPE_USB = 1;
87        ADAPTER_TYPE_USB_SDP = 2;
88        ADAPTER_TYPE_USB_DCP = 3;
89        ADAPTER_TYPE_USB_CDP = 4;
90        ADAPTER_TYPE_USB_ACA = 5;
91        ADAPTER_TYPE_USB_C = 6;
92        ADAPTER_TYPE_USB_PD = 7;
93        ADAPTER_TYPE_USB_PD_DRP = 8;
94        ADAPTER_TYPE_USB_PD_PPS = 9;
95        ADAPTER_TYPE_USB_PD_BRICKID = 10;
96        ADAPTER_TYPE_HVDCP = 11;
97        ADAPTER_TYPE_HVDCP3 = 12;
98        ADAPTER_TYPE_FLOAT = 13;
99        ADAPTER_TYPE_WLC  = 14;
100        ADAPTER_TYPE_WLC_EPP = 15;
101        ADAPTER_TYPE_WLC_SPP = 16;
102        ADAPTER_TYPE_GPP = 17;
103        ADAPTER_TYPE_10W = 18;
104        ADAPTER_TYPE_L7 = 19;
105        ADAPTER_TYPE_DL = 20;
106        ADAPTER_TYPE_WPC_EPP = 21;
107        ADAPTER_TYPE_WPC_GPP = 22;
108        ADAPTER_TYPE_WPC_10W = 23;
109        ADAPTER_TYPE_WPC_BPP = 24;
110        ADAPTER_TYPE_WPC_L7 = 25;
111    }
112    optional string reverse_domain_name = 1;
113    /* Type of charge adapter, enumerated above. */
114    optional AdapterType adapter_type = 2;
115    /* Max negotiated voltage by charge adapter, in mV. */
116    optional int32 adapter_voltage = 3;
117    /* Max negotiated current by charge adapter current, in mA. */
118    optional int32 adapter_amperage = 4;
119
120    /* Stats at beginning of charge session. */
121    /* System State of Charge, in percent. */
122    optional int32 ssoc_in = 5;
123    /* Voltage in mV. */
124    optional int32 voltage_in = 6;
125
126    /* Stats at end of charge session. */
127    /* System State of Charge, in percent. */
128    optional int32 ssoc_out = 7;
129    /* Voltage in mV. */
130    optional int32 voltage_out = 8;
131
132    /**
133     * These values are  meant to represent status of the charging device, used
134     * to validate the charging algorithm and explain charging performances.
135     * Examples of the content of the register:
136     * - APDO, PDO (power capabilities of the device, eg. 5V3A, 9V2A, 20V2A) for wired charging
137     * - Wireless charging MFG code. This is the value of a register of the WLC integrated
138     *   circuit to identify the vendor and type of WLC pad
139     * - Receiver operating frequency
140     * - Register status
141     */
142    optional int32 adapter_capabilities0 = 9;
143    optional int32 adapter_capabilities1 = 10;
144    optional int32 adapter_capabilities2 = 11;
145    optional int32 adapter_capabilities3 = 12;
146    optional int32 adapter_capabilities4 = 13;
147
148    /**
149     * These are values which reports the state of the wireless receiver, which will help in
150     * debugging charging issues and alternate configurations.
151     */
152    optional int32 receiver_state0 = 14;
153    optional int32 receiver_state1 = 15;
154}
155
156/* A message containing stats from each charge voltage tier. */
157message VoltageTierStats {
158    optional string reverse_domain_name = 1;
159    /* Voltage tier number, custom to implementation, should be <= 3. */
160    optional int32 voltage_tier = 2;
161
162    /* Stats when entering voltage tier. */
163    /* State of charge, in percent. */
164    optional float soc_in = 3;
165    /* Coulomb count, in mAh. */
166    optional int32 cc_in = 4;
167    /* Battery temperature, in deciC. */
168    optional int32 temp_in = 5;
169
170    /* Time spent at various charge speeds, in seconds. */
171    optional int32 time_fast_secs = 6;
172    optional int32 time_taper_secs = 7;
173    optional int32 time_other_secs = 8;
174
175    /* Battery temperature stats, in deciC. */
176    optional int32 temp_min = 9;
177    optional int32 temp_avg = 10;
178    optional int32 temp_max = 11;
179
180    /* Battery current stats, in mA. */
181    optional int32 ibatt_min = 12;
182    optional int32 ibatt_avg = 13;
183    optional int32 ibatt_max = 14;
184
185    /* Input current limit stats, in mA. */
186    optional int32 icl_min = 15;
187    optional int32 icl_avg = 16;
188    optional int32 icl_max = 17;
189
190    /**
191     * Efficiency number, receiver operating frequency in kHz for wireless charging
192     * (alignment)
193     */
194    optional int32 charging_operating_point = 18;
195    /* The minimum power out of the adapter at the given charging tier */
196    optional int32 min_adapter_power_out = 19;
197    /* The time-averaged power out of the adapter at the given charging tier */
198    optional int32 time_avg_adapter_power_out = 20;
199    /* The maximum power out of the adapter at the given charging tier */
200    optional int32 max_adapter_power_out = 21;
201}
202
203/* A message containing an alternate proprietary full battery capacity estimate. */
204message BatteryCapacity {
205    optional string reverse_domain_name = 1;
206    /* Sum of the change in coulomb count. */
207    optional int32 delta_cc_sum = 2;
208    /* Sum of the change in state of charge (battery level). */
209    optional int32 delta_vfsoc_sum = 3;
210}
211
212/* A message containing health values of UFS */
213message StorageUfsHealth {
214    optional string reverse_domain_name = 1;
215    /* The value of lifetimeA for UFS health */
216    optional int32 lifetime_a = 2;
217    /* The value of lifetimeB for UFS health */
218    optional int32 lifetime_b = 3;
219    /* The value of lifetimeC for UFS health */
220    optional int32 lifetime_c = 4;
221}
222
223/* A message containing filesystem stats of F2FS */
224message F2fsStatsInfo {
225    optional string reverse_domain_name = 1;
226    /* The value of dirty segments of f2fs */
227    optional int32 dirty_segments = 2;
228    /* The value of free segments of f2fs */
229    optional int32 free_segments = 3;
230    /* The times of checkpoint function called in foreground*/
231    optional int32 cp_calls_fg = 4;
232    /* The times of checkpoint function called in background */
233    optional int32 cp_calls_bg = 5;
234    /* The times of garbage collection function called in foreground */
235    optional int32 gc_calls_fg = 6;
236    /* The times of garbage collection function called in background */
237    optional int32 gc_calls_bg = 7;
238    /* The amount of blocks been moved by garbage collection in foreground */
239    optional int32 moved_blocks_fg = 8;
240    /* The amount of blocks been moved by garbage collection in background */
241    optional int32 moved_blocks_bg = 9;
242    /* The average of how many valid blocks is in a segment */
243    optional int32 valid_blocks = 10;
244}
245
246message ZramMmStat {
247    optional string reverse_domain_name = 1;
248    /* The value of original memory size */
249    optional int64 orig_data_size = 2;
250    /* The value of compressed memory size */
251    optional int64 compr_data_size = 3;
252    /* The value of consumed memory size to store compressed memory */
253    optional int64 mem_used_total = 4;
254    /* The value of number of page filled with same elements data */
255    optional int64 same_pages = 5;
256    /* The value of number of incompressible page */
257    optional int64 huge_pages = 6;
258    /* The value of number of incompressible pages since boot */
259    optional int64 huge_pages_since_boot = 7;
260}
261
262message ZramBdStat {
263    optional string reverse_domain_name = 1;
264    /* the number of pages in backing device */
265    optional int64 bd_count = 2;
266    /* The number of pages readed from backing device */
267    optional int64 bd_reads = 3;
268    /* The number of pages written to backing device */
269    optional int64 bd_writes = 4;
270}
271
272/* A message containing boot times */
273message BootStatsInfo {
274    optional string reverse_domain_name = 1;
275    /* The F2FS fsck time in secs */
276    optional int32 fsck_time_sec = 2;
277    /* The F2FS mounted time in secs */
278    optional int32 mounted_time_sec = 3;
279    /* The F2FS checkpoint=disable time in secs */
280    optional int32 checkpoint_time_sec = 4;
281}
282
283/* A message containing wireless charging health info. */
284message WirelessChargingStats {
285    /* Captures if a google charger used when start wireless charging */
286    enum ChargerVendor {
287        VENDOR_UNKNOWN = 0;
288        VENDOR_GOOGLE = 1;
289    }
290
291    optional string reverse_domain_name = 1;
292    optional ChargerVendor charger_vendor = 2;
293}
294
295/* Current device Orientation */
296message DeviceOrientation {
297    enum Orientation {
298        ORIENTATION_UNKNOWN = 0;
299        ORIENTATION_0 = 1;
300        ORIENTATION_90 = 2;
301        ORIENTATION_180 = 3;
302        ORIENTATION_270 = 4;
303    }
304
305    optional string reverse_domain_name = 1;
306    /* Device orientation. */
307    optional Orientation orientation = 2;
308}
309
310/* Raw battery capacity stats */
311message BatteryCapacityFG {
312    enum LogReason {
313        LOG_REASON_UNKNOWN = 0;
314        LOG_REASON_CONNECTED = 1;
315        LOG_REASON_DISCONNECTED = 2;
316        LOG_REASON_FULL_CHARGE = 3;
317        LOG_REASON_PERCENT_SKIP = 4;
318        LOG_REASON_DIVERGING_FG = 5;
319    }
320
321    optional string reverse_domain_name = 1;
322    /* Uevent logging reason, enumerated above. */
323    optional LogReason capacity_log_reason = 2;
324
325    /* The battery capacity reported from the FG (fuel gauge) hardware  */
326    optional float capacity_gdf = 3;
327    /* The filtered system battery capacity reported to the UI */
328    optional float capacity_ssoc = 4;
329    /* The fuel gauge capacity curve midpoint FG (fuel gauge) value */
330    optional float capacity_gdf_curve = 5;
331    /* The fuel gauge capacity curve midpoint UI value */
332    optional float capacity_ssoc_curve = 6;
333}
334
335message  PdVidPid {
336    optional string reverse_domain_name = 1;
337    /* Vendor ID of wired charger */
338    optional int32 vid = 2;
339    /* Product ID of wired charger */
340    optional int32 pid = 3;
341}
342
343message BatteryEEPROM {
344    optional string reverse_domain_name = 1;
345   /* The cycle count number; record of charge/discharge times */
346    optional int32 cycle_cnt = 2;
347    /* The current full capacity of the battery under nominal conditions */
348    optional int32 full_cap = 3;
349    /* The battery equivalent series resistance */
350    optional int32 esr = 4;
351    /* Battery resistance related to temperature change */
352    optional int32 rslow = 5;
353    /* Battery health indicator reflecting the battery age state */
354    optional int32 soh = 6;
355    /* The battery temperature */
356    optional int32 batt_temp = 7;
357
358    /* Battery state of charge (SOC) shutdown point */
359    optional int32 cutoff_soc = 8;
360    /* Raw battery state of charge (SOC), based on battery current (CC = Coulomb Counter) */
361    optional int32 cc_soc = 9;
362    /* Estimated battery state of charge (SOC) from batt_soc with endpoint limiting (0% and 100%) */
363    optional int32 sys_soc = 10;
364    /* Filtered monotonic SOC, handles situations where the cutoff_soc is increased and
365     * then decreased from the battery physical properties
366     */
367    optional int32 msoc = 11;
368    /* Estimated SOC derived from cc_soc that provides voltage loop feedback correction using
369     * battery voltage, current, and status values
370     */
371    optional int32 batt_soc = 12;
372
373    /* Field used for data padding in the EEPROM data */
374    optional int32 reserve = 13;
375
376    /* The maximum battery temperature ever seen */
377    optional int32 max_temp = 14;
378    /* The minimum battery temperature ever seen */
379    optional int32 min_temp = 15;
380    /* The maximum battery voltage ever seen */
381    optional int32 max_vbatt = 16;
382    /* The minimum battery voltage ever seen */
383    optional int32 min_vbatt = 17;
384    /* The maximum battery current ever seen */
385    optional int32 max_ibatt = 18;
386    /* The minimum battery current ever seen */
387    optional int32 min_ibatt = 19;
388    /* Field used to verify the integrity of the EEPROM data */
389    optional int32 checksum = 20;
390}
391
392/* A message containing an exceptional event from citadel. */
393message CitadelEvent {
394  enum Event {
395    ALERT = 1;
396    REBOOTED = 2;
397    UPGRADED = 3;
398    ALERT_V2 = 4;
399  };
400  optional string reverse_domain_name = 1;
401  optional Event event = 2;
402  optional int32 reset_count = 3;
403  optional int64 uptime_micros = 4;
404  enum Priority {
405    LOW = 0;
406    MEDIUM = 1;
407    HIGH = 2;
408  };
409  optional Priority priority = 5;
410
411  // ALERT-specific fields.  These fields correspond to the interrupt status
412  // bits for alerts within citadel.  When alerts fire one or more of these
413  // bits are set to indicate the alert source.
414  optional int32 intr_sts_0 = 6;
415  optional int32 intr_sts_1 = 7;
416  optional int32 intr_sts_2 = 8;
417
418  // REBOOTED-specific fields.  These fields correspond to the details of how
419  // the hardware reboot occurred.  A reboot is a noteworthy event for citadel,
420  // as it can be triggered by events like stack overflow or other software
421  // bugs.
422  optional int32 rstsrc = 9;
423  optional int32 exitpd = 10;
424  optional int32 which0 = 11;
425  optional int32 which1 = 12;
426
427  // UPGRADED-specific field. This field corresponds to the result of FW
428  // upgrade for citadel.
429  optional int32 upgrade_state = 13;
430
431  // ALERT_V2-specific field. This field corresponds to the GLOBALSEC Log
432  // which contains normal globalsec, camo, temp and buserr.
433  optional int32 alert_grp_0 = 14;
434  optional int32 alert_grp_1 = 15;
435  optional int32 alert_grp_2 = 16;
436  optional int32 alert_grp_3 = 17;
437  optional int32 camo_breaches_0 = 18;
438  optional int32 camo_breaches_1 = 19;
439  optional int32 temp_min = 20;
440  optional int32 temp_max = 21;
441  optional int32 bus_err = 22;
442}
443
444/* A message containing the citadel firmware version. */
445message CitadelVersion {
446   optional string reverse_domain_name = 1;
447   optional string version = 2;
448}
449
450/* A message containing the speaker impedance. */
451 message VendorSpeakerImpedance {
452    optional string reverse_domain_name = 1;
453    optional int32 speaker_location = 2;
454    optional int32 impedance = 3;
455}
456
457/**
458 * Logs the reported vendor speaker health stats.
459 * Logged from: hardware/google/pixel/pixelstats/SysfsCollector.cpp
460 */
461message VendorSpeakerStatsReported {
462  /* Vendor reverse domain name (expecting "com.google.pixel") */
463  optional string reverse_domain_name = 1;
464  /* The location of speaker; 0 = left , 1 = right */
465  optional int32 speaker_location = 2;
466  /* The speaker's impedance value (milliOhm) */
467  optional int32 impedance = 3;
468  /* The speaker's maximum temperature (milliDegree C) */
469  optional int32 max_temperature = 4;
470  /* The speaker's execursion length (micrometer) */
471  optional int32 excursion = 5;
472  /* The speaker's heart beat count */
473  optional int32 heartbeat = 6;
474}
475
476/* A message containing how many times of ufs host reset */
477message StorageUfsResetCount {
478    optional string reverse_domain_name = 1;
479    /* How many UFS error reset are triggered */
480    optional int32 host_reset_count = 2;
481}
482
483/* A message containing Pixel memory metrics collected hourly. */
484message PixelMmMetricsPerHour {
485    optional string reverse_domain_name = 1;
486    optional int64 free_pages = 2;
487    optional int64 anon_pages = 3;
488    optional int64 file_pages = 4;
489    optional int64 slab_reclaimable = 5;
490    optional int64 zspages = 6;
491    optional int64 unevictable = 7;
492    optional int64 ion_total_pools = 8;
493    optional int64 gpu_memory = 9;
494}
495
496/* A message containing Pixel memory metrics collected daily. */
497message PixelMmMetricsPerDay {
498    optional string reverse_domain_name = 1;
499    optional int64 workingset_refault = 2;
500    optional int64 pswpin = 3;
501    optional int64 pswpout = 4;
502    optional int64 allocstall_dma = 5;
503    optional int64 allocstall_dma32 = 6;
504    optional int64 allocstall_normal = 7;
505    optional int64 allocstall_movable = 8;
506    optional int64 pgalloc_dma = 9;
507    optional int64 pgalloc_dma32 = 10;
508    optional int64 pgalloc_normal = 11;
509    optional int64 pgalloc_movable = 12;
510    optional int64 pgsteal_kswapd = 13;
511    optional int64 pgsteal_direct = 14;
512    optional int64 pgscan_kswapd = 15;
513    optional int64 pgscan_direct = 16;
514    optional int64 oom_kill = 17;
515    optional int64 pgalloc_high = 18;
516    optional int64 pgcache_hit = 19;
517    optional int64 pgcache_miss = 20;
518    optional int64 kswapd_stime_clks = 21;
519    optional int64 kcompactd_stime_clks = 22;
520}
521
522/* A message containing CMA metrics collected from dogfooding only. */
523message CmaStatus {
524  optional string reverse_domain_name = 1;
525  optional int32 type = 2;
526  optional int64 cma_alloc_pages_attempts = 3;
527  optional int64 cma_alloc_pages_soft_attempts = 4;
528  optional int64 cma_fail_pages = 5;
529  optional int64 cma_fail_soft_pages = 6;
530  optional int64 migrated_pages = 7;
531}
532
533/* A message containing CMA metrics (External). */
534message CmaStatusExt {
535  optional string reverse_domain_name = 1;
536  optional int32 type = 2;
537  optional int64 cma_alloc_latency_low = 3;
538  optional int64 cma_alloc_latency_mid = 4;
539  optional int64 cma_alloc_latency_high = 5;
540}
541
542message F2fsCompressionInfo {
543    optional string reverse_domain_name = 1;
544    /* Show the block count written after compression since mount */
545    optional int32 compr_written_blocks = 2;
546    /* Show the saved block count with compression since mount */
547    optional int32 compr_saved_blocks = 3;
548    /* Show the count of inode newly enabled for compression since mount */
549    optional int32 compr_new_inodes = 4;
550}
551
552/**
553 * Log bucketed battery charge cycles.
554 *
555 * Each bucket represents cycles of the battery past
556 * a given charge point.  For example, bucket 1 is the
557 * lowest 1/8th of the battery, and bucket 8 is 100%.
558 *
559 * Logged from:
560 * /sys/class/power_supply/bms/cycle_count, via Vendor.
561 */
562message VendorChargeCycles {
563    optional string reverse_domain_name = 1;
564    optional int32 cycle_bucket_1 = 2;
565    optional int32 cycle_bucket_2 = 3;
566    optional int32 cycle_bucket_3 = 4;
567    optional int32 cycle_bucket_4 = 5;
568    optional int32 cycle_bucket_5 = 6;
569    optional int32 cycle_bucket_6 = 7;
570    optional int32 cycle_bucket_7 = 8;
571    optional int32 cycle_bucket_8 = 9;
572    optional int32 cycle_bucket_9 = 10;
573    optional int32 cycle_bucket_10 = 11;
574}
575
576/**
577 * Logs the report of a failed hardware.
578 *
579 * Logged from:
580 *  Vendor HALs.
581 *
582 */
583message VendorHardwareFailed {
584    enum HardwareType {
585      HARDWARE_FAILED_UNKNOWN = 0;
586      HARDWARE_FAILED_MICROPHONE = 1;
587      HARDWARE_FAILED_CODEC = 2;
588      HARDWARE_FAILED_SPEAKER = 3;
589      HARDWARE_FAILED_FINGERPRINT = 4;
590    }
591    optional string reverse_domain_name = 1;
592    optional HardwareType hardware_type = 2;
593
594    /**
595     * hardware_location allows vendors to differentiate between multiple
596     * instances of the same hardware_type.  The specific locations are vendor
597     * defined integers, referring to board-specific numbering schemes.
598     */
599    optional int32 hardware_location = 3;
600    /**
601     * failure_code is specific to the HardwareType of the failed hardware.
602     * It should use one of the enum values defined below.
603     */
604    enum HardwareErrorCode {
605      UNKNOWN = 0;
606      COMPLETE = 1;
607      SPEAKER_HIGH_Z = 2;
608      SPEAKER_SHORT = 3;
609      FINGERPRINT_SENSOR_BROKEN = 4;
610      FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
611      DEGRADE = 6;
612    }
613    optional int32 failure_code = 4;
614}
615
616/**
617 * Log slow I/O operations on the primary storage.
618 */
619message VendorSlowIo {
620    // Classifications of IO Operations.
621    enum IoOperation {
622      UNKNOWN = 0;
623      READ = 1;
624      WRITE = 2;
625      UNMAP = 3;
626      SYNC = 4;
627    }
628    optional string reverse_domain_name = 1;
629    optional IoOperation operation = 2;
630
631    // The number of slow IO operations of this type over 24 hours.
632    optional int32 count = 3;
633}
634
635/*
636 * Logs the reported speech DSP status.
637 * Logged from: Vendor audio implementation.
638 */
639message VendorSpeechDspStat {
640    optional string reverse_domain_name = 1;
641    // The total Speech DSP uptime in milliseconds.
642    optional int32 total_uptime_millis = 2;
643    // The total Speech DSP downtime in milliseconds.
644    optional int32 total_downtime_millis = 3;
645    optional int32 total_crash_count = 4;
646    optional int32 total_recover_count = 5;
647}
648
649/**
650 * Log an event when the device has been physically dropped.
651 * Reported from the /vendor partition.
652 */
653message VendorPhysicalDropDetected {
654  optional string reverse_domain_name = 1;
655  // Confidence that the event was actually a drop, 0 -> 100
656  optional int32 confidence_pctg = 2;
657  // Peak acceleration of the drop, in 1/1000s of a g.
658  optional int32 accel_peak_thousandths_g = 3;
659  // Duration of freefall in ms
660  optional int32 freefall_time_millis = 4;
661}
662
663/** Represents USB port overheat event. */
664message VendorUsbPortOverheat {
665  optional string reverse_domain_name = 1;
666  /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
667  optional int32 plug_temperature_deci_c = 2;
668  /* Maximum temperature of USB port during overheat event, in 1/10ths of degree
669   * C. */
670  optional int32 max_temperature_deci_c = 3;
671  /* Time between USB plug event and overheat threshold trip, in seconds. */
672  optional int32 time_to_overheat_secs = 4;
673  /* Time between overheat threshold trip and hysteresis, in seconds. */
674  optional int32 time_to_hysteresis_secs = 5;
675  /* Time between hysteresis and active mitigation ending, in seconds. */
676  optional int32 time_to_inactive_secs = 6;
677}
678
679/**
680 * Log battery health snapshot.
681 *
682 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
683 * are snapshotted periodically over 24hrs.
684 */
685message VendorBatteryHealthSnapshot {
686  enum BatterySnapshotType {
687    BATTERY_SNAPSHOT_TYPE_UNKNOWN = 0;
688    BATTERY_SNAPSHOT_TYPE_MIN_TEMP = 1;         // Snapshot at min batt temp over 24hrs.
689    BATTERY_SNAPSHOT_TYPE_MAX_TEMP = 2;         // Snapshot at max batt temp over 24hrs.
690    BATTERY_SNAPSHOT_TYPE_MIN_RESISTANCE = 3;   // Snapshot at min batt resistance over 24hrs.
691    BATTERY_SNAPSHOT_TYPE_MAX_RESISTANCE = 4;   // Snapshot at max batt resistance over 24hrs.
692    BATTERY_SNAPSHOT_TYPE_MIN_VOLTAGE = 5;      // Snapshot at min batt voltage over 24hrs.
693    BATTERY_SNAPSHOT_TYPE_MAX_VOLTAGE = 6;      // Snapshot at max batt voltage over 24hrs.
694    BATTERY_SNAPSHOT_TYPE_MIN_CURRENT = 7;      // Snapshot at min batt current over 24hrs.
695    BATTERY_SNAPSHOT_TYPE_MAX_CURRENT = 8;      // Snapshot at max batt current over 24hrs.
696    BATTERY_SNAPSHOT_TYPE_MIN_BATT_LEVEL = 9;   // Snapshot at min battery level (SoC) over 24hrs.
697    BATTERY_SNAPSHOT_TYPE_MAX_BATT_LEVEL = 10;  // Snapshot at max battery level (SoC) over 24hrs.
698    BATTERY_SNAPSHOT_TYPE_AVG_RESISTANCE = 11;  // Snapshot at average battery resistance over 24hrs.
699  }
700  optional string reverse_domain_name = 1;
701  optional BatterySnapshotType type = 2;
702  // Temperature, in 1/10ths of degree C.
703  optional int32 temperature_deci_celsius = 3;
704  // Voltage Battery Voltage, in microVolts.
705  optional int32 voltage_micro_volt = 4;
706  // Current Battery current, in microAmps.
707  optional int32 current_micro_amps = 5;
708  // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
709  optional int32 open_circuit_micro_volt = 6;
710  // Resistance Battery Resistance, in microOhms.
711  optional int32 resistance_micro_ohm = 7;
712  // Level Battery Level, as % of full.
713  optional int32 level_percent = 8;
714}
715
716/**
717 * Log battery caused shutdown with the last recorded voltage.
718 */
719message VendorBatteryCausedShutdown {
720 optional string reverse_domain_name = 1;
721 // The last recorded battery voltage prior to shutdown.
722 optional int32 last_recorded_micro_volt = 2;
723}
724
725/**
726 * Log mitigation statistics.
727 */
728message PowerMitigationStats {
729 optional string reverse_domain_name = 1;
730 // The last triggered count: batoilo.
731 optional int32 batoilo_count = 2;
732 // The last triggered count: vdroop1.
733 optional int32 vdroop1_count = 3;
734 // The last triggered count: vdroop2.
735 optional int32 vdroop2_count = 4;
736 // The last triggered count: smpl_warn.
737 optional int32 smpl_warn_count = 5;
738 // The last triggered count: ocp_cpu1.
739 optional int32 ocp_cpu1_count = 6;
740 // The last triggered count: ocp_cpu2.
741 optional int32 ocp_cpu2_count = 7;
742 // The last triggered count: ocp_gpu.
743 optional int32 ocp_gpu_count = 8;
744 // The last triggered count: ocp_tpu.
745 optional int32 ocp_tpu_count = 9;
746 // The last triggered count: soft_ocp_cpu1.
747 optional int32 soft_ocp_cpu1_count = 10;
748 // The last triggered count: soft_ocp_cpu2.
749 optional int32 soft_ocp_cpu2_count = 11;
750 // The last triggered count: soft_ocp_gpu.
751 optional int32 soft_ocp_gpu_count = 12;
752 // The last triggered count: soft_ocp_tpu.
753 optional int32 soft_ocp_tpu_count = 13;
754 // The last triggered capacity: batoilo.
755 optional int32 batoilo_cap = 14;
756 // The last triggered capacity: vdroop1.
757 optional int32 vdroop1_cap = 15;
758 // The last triggered capacity: vdroop2.
759 optional int32 vdroop2_cap = 16;
760 // The last triggered capacity: smpl_warn.
761 optional int32 smpl_warn_cap = 17;
762 // The last triggered capacity: ocp_cpu1.
763 optional int32 ocp_cpu1_cap = 18;
764 // The last triggered capacity: ocp_cpu2.
765 optional int32 ocp_cpu2_cap = 19;
766 // The last triggered capacity: ocp_gpu.
767 optional int32 ocp_gpu_cap = 20;
768 // The last triggered capacity: ocp_tpu.
769 optional int32 ocp_tpu_cap = 21;
770 // The last triggered capacity: soft_ocp_cpu1.
771 optional int32 soft_ocp_cpu1_cap = 22;
772 // The last triggered capacity: soft_ocp_cpu2.
773 optional int32 soft_ocp_cpu2_cap = 23;
774 // The last triggered capacity: soft_ocp_gpu.
775 optional int32 soft_ocp_gpu_cap = 24;
776 // The last triggered capacity: soft_ocp_tpu.
777 optional int32 soft_ocp_tpu_cap = 25;
778}
779
780/**
781 * Log how many segments have been reclaimed in a specific GC mode.
782 */
783message F2fsGcSegmentInfo {
784    optional string reverse_domain_name = 1;
785    /* Reclaimed segments in GC normal mode */
786    optional int32 reclaimed_segments_normal = 2;
787    /* Reclaimed segments in GC urgent high mode */
788    optional int32 reclaimed_segments_urgent_high = 3;
789    /* Reclaimed segments in GC urgent low mode */
790    optional int32 reclaimed_segments_urgent_low = 4;
791}
792