Merge "powerstats: add AoC restart count stats"

This commit is contained in:
Treehugger Robot 2022-03-28 07:32:15 +00:00 committed by Gerrit Code Review
commit 7dd7e93a03

View file

@ -79,6 +79,23 @@ void addAoC(std::shared_ptr<PowerStats> p) {
}; };
p->addStateResidencyDataProvider( p->addStateResidencyDataProvider(
std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates)); std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates));
// Add AoC restart count
const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
.entryCountSupported = true,
.entryCountPrefix = "",
.totalTimeSupported = false,
.lastEntrySupported = false,
};
const std::vector<std::pair<std::string, std::string>> restartCountHeaders = {
std::make_pair("RESTART", ""),
};
std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> cfgs;
cfgs.emplace_back(
generateGenericStateResidencyConfigs(restartCountConfig, restartCountHeaders),
"AoC-Count", "");
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
"/sys/devices/platform/19000000.aoc/restart_count", cfgs));
} }
void addDvfsStats(std::shared_ptr<PowerStats> p) { void addDvfsStats(std::shared_ptr<PowerStats> p) {