From 5a0aedaec90f2fd016fc971c6026a1917a4131bb Mon Sep 17 00:00:00 2001 From: Vishvam Mazumdar Date: Tue, 4 Jun 2024 18:17:45 +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: I9c31b4fbaf8adb35df27f4d19a7bf87ac33b05d3 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 5af853fc..6b755a0c 100644 --- a/dumpstate/dump_power.cpp +++ b/dumpstate/dump_power.cpp @@ -941,9 +941,21 @@ void dumpIrqDurationCounts() { } } +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();