From cae96e4e503faaf690da9690dd51b29215d2b5e7 Mon Sep 17 00:00:00 2001 From: Vishvam Mazumdar Date: Tue, 4 Jun 2024 18:02:35 +0000 Subject: [PATCH] Add CPU Idle Histogram Stats to dumpstate board file. This change is to allow the CPU Idle Histogram Stats to be dumped in bugreports so that there is more insight into the idle behavior of devices in the field. Test: Build/Flash Test: adb bugreport Bug: 344908619 Flag: EXEMPT bugfix Change-Id: I3b7b0d573bfd5f7e5e9f05c333b5a38940f3d8d6 Signed-off-by: Vishvam Mazumdar --- dumpstate/dump_power.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dumpstate/dump_power.cpp b/dumpstate/dump_power.cpp index e8989f0..b77e386 100644 --- a/dumpstate/dump_power.cpp +++ b/dumpstate/dump_power.cpp @@ -1028,9 +1028,21 @@ void dumpEvtCounter() { } } +void dumpCpuIdleHistogramStats() { + const char* cpuIdleHistogramTitle = "CPU Idle Histogram"; + const char* cpuIdleHistogramFile = "/sys/kernel/metrics/cpuidle_histogram/" + "cpuidle_histogram"; + const char* cpuClusterHistogramTitle = "CPU Cluster Histogram"; + const char* cpuClusterHistogramFile = "/sys/kernel/metrics/" + "cpuidle_histogram/cpucluster_histogram"; + dumpFileContent(cpuIdleHistogramTitle, cpuIdleHistogramFile); + dumpFileContent(cpuClusterHistogramTitle, cpuClusterHistogramFile); +} + int main() { dumpPowerStatsTimes(); dumpAcpmStats(); + dumpCpuIdleHistogramStats(); dumpPowerSupplyStats(); dumpMaxFg(); dumpPowerSupplyDock();