From 71543928efa30f6eb7042448a62afdcb65eec7f0 Mon Sep 17 00:00:00 2001 From: Ocean Chen Date: Thu, 13 Jan 2022 17:17:49 +0000 Subject: [PATCH] Pixelstats: add more UFS error count paths The UFS resume flow also increase the reset count. It makes the reset count cannot represent the real error count. So we use other count instead of reset count Bug: 199459367 Change-Id: I0249d806351a1037f7886368d4df1d22af4c0091 --- pixelstats/service.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index 4201207b..a265bac6 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -26,6 +26,7 @@ using android::hardware::google::pixel::SysfsCollector; using android::hardware::google::pixel::UeventListener; #define UFSHC_PATH(filename) "/dev/sys/block/bootdevice/" #filename +#define UFS_ERR_PATH(err_type) UFSHC_PATH(err_stats/) #err_type const struct SysfsCollector::SysfsPaths sysfs_paths = { .SlowioReadCntPath = UFSHC_PATH(slowio_read_cnt), .SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt), @@ -35,12 +36,21 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = { .UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a), .UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b), .UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c), - .UFSHostResetPath = UFSHC_PATH(err_stats/dev_reset_count), .F2fsStatsPath = "/sys/fs/f2fs/", .ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance", .CodecPath = "/sys/devices/platform/audiometrics/codec_state", .EEPROMPath = "/dev/battery_history", - .MitigationPath = "/sys/devices/virtual/pmic/mitigation"}; + .MitigationPath = "/sys/devices/virtual/pmic/mitigation", + .UFSErrStatsPath = { + UFS_ERR_PATH(pa_err_count), + UFS_ERR_PATH(dl_err_count), + UFS_ERR_PATH(nl_err_count), + UFS_ERR_PATH(tl_err_count), + UFS_ERR_PATH(dme_err_count), + UFS_ERR_PATH(fatal_err_count), + UFS_ERR_PATH(auto_hibern8_err_count) + } +}; const struct UeventListener::UeventPaths ueventPaths = { .AudioUevent = "/devices/virtual/amcs/amcs", .WirelessChargerPtmcPath = "/sys/class/power_supply/wireless/device/ptmc_id"};