powerstats: add AoC restart count stats

Bug: 226173008
Test: dump power stats and verify restart count increased
Change-Id: Ia0cfcd9f9dae68dc21c33074147e8b6db547ebc9
Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
Darren Hsu 2022-03-24 07:56:43 +08:00 committed by TreeHugger Robot
parent 264b325dd1
commit cce5e9f8b0

View file

@ -79,6 +79,23 @@ void addAoC(std::shared_ptr<PowerStats> p) {
};
p->addStateResidencyDataProvider(
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) {