powerstats: set AoC clock for timestamp calculations
Bug: 233923713 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: I05639346ef89eb9540518e4d28f336634e293d48 Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
parent
39997d722c
commit
bfc6563cca
1 changed files with 5 additions and 3 deletions
|
@ -102,6 +102,8 @@ void addPlaceholderEnergyConsumers(std::shared_ptr<PowerStats> p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void addAoC(std::shared_ptr<PowerStats> p) {
|
void addAoC(std::shared_ptr<PowerStats> p) {
|
||||||
|
// AoC clock is synced from "libaoc.c"
|
||||||
|
static const uint64_t AOC_CLOCK = 24576;
|
||||||
std::string prefix = "/sys/devices/platform/19000000.aoc/control/";
|
std::string prefix = "/sys/devices/platform/19000000.aoc/control/";
|
||||||
|
|
||||||
// Add AoC cores (a32, ff1, hf0, and hf1)
|
// Add AoC cores (a32, ff1, hf0, and hf1)
|
||||||
|
@ -114,7 +116,7 @@ void addAoC(std::shared_ptr<PowerStats> p) {
|
||||||
std::vector<std::pair<std::string, std::string>> coreStates = {
|
std::vector<std::pair<std::string, std::string>> coreStates = {
|
||||||
{"DWN", "off"}, {"RET", "retention"}, {"WFI", "wfi"}};
|
{"DWN", "off"}, {"RET", "retention"}, {"WFI", "wfi"}};
|
||||||
p->addStateResidencyDataProvider(std::make_unique<AocStateResidencyDataProvider>(coreIds,
|
p->addStateResidencyDataProvider(std::make_unique<AocStateResidencyDataProvider>(coreIds,
|
||||||
coreStates));
|
coreStates, AOC_CLOCK));
|
||||||
|
|
||||||
// Add AoC voltage stats
|
// Add AoC voltage stats
|
||||||
std::vector<std::pair<std::string, std::string>> voltageIds = {
|
std::vector<std::pair<std::string, std::string>> voltageIds = {
|
||||||
|
@ -125,7 +127,7 @@ void addAoC(std::shared_ptr<PowerStats> p) {
|
||||||
{"UUD", "ultra_underdrive"},
|
{"UUD", "ultra_underdrive"},
|
||||||
{"UD", "underdrive"}};
|
{"UD", "underdrive"}};
|
||||||
p->addStateResidencyDataProvider(
|
p->addStateResidencyDataProvider(
|
||||||
std::make_unique<AocStateResidencyDataProvider>(voltageIds, voltageStates));
|
std::make_unique<AocStateResidencyDataProvider>(voltageIds, voltageStates, AOC_CLOCK));
|
||||||
|
|
||||||
// Add AoC monitor mode
|
// Add AoC monitor mode
|
||||||
std::vector<std::pair<std::string, std::string>> monitorIds = {
|
std::vector<std::pair<std::string, std::string>> monitorIds = {
|
||||||
|
@ -135,7 +137,7 @@ void addAoC(std::shared_ptr<PowerStats> p) {
|
||||||
{"MON", "mode"},
|
{"MON", "mode"},
|
||||||
};
|
};
|
||||||
p->addStateResidencyDataProvider(
|
p->addStateResidencyDataProvider(
|
||||||
std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates));
|
std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates, AOC_CLOCK));
|
||||||
|
|
||||||
// Add AoC restart count
|
// Add AoC restart count
|
||||||
const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
|
const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue