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

@ -51,6 +51,9 @@ class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataPro
*/
std::unordered_map<std::string, std::vector<State>> getInfo() override;
protected:
std::vector<Config> mPowerEntities;
private:
int32_t matchEntity(char const *line);
int32_t matchState(char const *line, const Config& powerEntity);
@ -58,7 +61,6 @@ class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataPro
const std::string mPath;
const uint64_t mClockRate;
std::vector<Config> mPowerEntities;
};
} // namespace stats