powerstats: include sleep duration for core down state
Bug: 263276734
Test: dumpsys android.hardware.power.stats.IPowerStats/default
Change-Id: Ia9c1ed8c7ca68d03e73da35674ac299d7cf22045
Signed-off-by: Darren Hsu <darrenhsu@google.com>
diff --git a/powerstats/include/CpupmStateResidencyDataProvider.h b/powerstats/include/CpupmStateResidencyDataProvider.h
index c04e11e..be8ee46 100644
--- a/powerstats/include/CpupmStateResidencyDataProvider.h
+++ b/powerstats/include/CpupmStateResidencyDataProvider.h
@@ -34,10 +34,16 @@
std::vector<std::pair<std::string, std::string>> states;
};
+ typedef std::vector<std::string> SleepConfig;
+
/*
* path - path to cpupm sysfs node.
*/
- CpupmStateResidencyDataProvider(const std::string &path, const Config &config);
+ CpupmStateResidencyDataProvider(
+ const std::string &path,
+ const Config &config,
+ const std::string &sleepPath,
+ const SleepConfig &sleepConfig);
~CpupmStateResidencyDataProvider() = default;
/*
@@ -58,9 +64,13 @@
// A constant to represent the number of microseconds in one millisecond.
const uint64_t US_TO_MS = 1000;
+ // A constant to represent the number of nanoseconds in one millisecond.
+ const uint64_t NS_TO_MS = 1000000;
const std::string mPath;
const Config mConfig;
+ const std::string mSleepPath;
+ const SleepConfig mSleepConfig;
};
} // namespace stats