From f9f8c562760fd655ffa05def8e39cd95e0276438 Mon Sep 17 00:00:00 2001 From: sashwinbalaji Date: Fri, 5 May 2023 11:01:28 +0800 Subject: [PATCH] thermal: Update path reading for temperature residency metrics Add temperature residency reset path chown to system to reset from pixelstats Bug: 193833982 Test: Local build and verify statsD logs adb shell cmd stats print-logs && adb logcat -b all | grep -i 105045 Change-Id: Iec5956f803cab3893aaf9c1e9d818fc02c582f31 --- conf/init.zumapro.rc | 3 +++ pixelstats/service.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/conf/init.zumapro.rc b/conf/init.zumapro.rc index 97f35d9..7ab5a60 100644 --- a/conf/init.zumapro.rc +++ b/conf/init.zumapro.rc @@ -952,6 +952,9 @@ on fs on post-fs-data mkdir /data/vendor/powerstats 0771 system system chown system system /data/vendor/powerstats + # Thermal Residency Stats (write 1 to reset) + chown system system /sys/kernel/metrics/thermal/tr_by_group/tmu/stats_reset + chown system system /sys/kernel/metrics/thermal/tr_by_group/spmic/stats_reset on property:vendor.thermal.link_ready=1 # BCL diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index ca151a1..c76da2c 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -61,9 +61,15 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = { .AmsRatePath = "/sys/devices/platform/audiometrics/ams_rate_read_once", .ResumeLatencyMetricsPath = "/sys/kernel/metrics/resume_latency/resume_latency_metrics", .LongIRQMetricsPath = "/sys/kernel/metrics/irq/long_irq_metrics", - .TempResidencyPaths = { + .TempResidencyAndResetPaths = { + { "/sys/kernel/metrics/thermal/tr_by_group/tmu/stats", + "/sys/kernel/metrics/thermal/tr_by_group/tmu/stats_reset" + }, + { "/sys/kernel/metrics/thermal/tr_by_group/spmic/stats", + "/sys/kernel/metrics/thermal/tr_by_group/spmic/stats_reset" + } }, .ModemPcieLinkStatsPath = "/sys/devices/platform/12100000.pcie/link_stats", .WifiPcieLinkStatsPath = "/sys/devices/platform/13120000.pcie/link_stats"