powerstats: introduce AdaptiveDvfsStateResidency data provider

This is a new data provider to get state residency from fvp_stats,
which is similar with DVFS data provider. But the difference is that
CPU frequency table is read from cpufreq sysfs and not predefined in
the config.

Bug: 272642210
Bug: 267638537
Test: dumpsys android.hardware.power.stats.IPowerStats/default
Change-Id: I22451b55dee5dfb0a1b36497533c2063984d5483
Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
Darren Hsu 2023-03-13 11:11:55 +08:00
parent dffac4331d
commit 5f32222576
4 changed files with 141 additions and 2 deletions

View file

@ -37,7 +37,7 @@ namespace stats {
DvfsStateResidencyDataProvider::DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate,
std::vector<Config> cfgs)
: mPath(std::move(path)), mClockRate(clockRate), mPowerEntities(std::move(cfgs)) {}
: mPowerEntities(std::move(cfgs)), mPath(std::move(path)), mClockRate(clockRate) {}
int32_t DvfsStateResidencyDataProvider::matchEntity(char const *line) {
for (int32_t i = 0; i < mPowerEntities.size(); i++) {