powerstats: re-enable AoC power stats reporting with timeout
Bug: 219630658 Test: dumpsys android.hardware.power.stats.IPowerStats/default Change-Id: Icb1433bed3438ed4525816e3d3be28b4e0261e89 Signed-off-by: Darren Hsu <darrenhsu@google.com>
This commit is contained in:
parent
60ccbd668e
commit
313fe7709c
1 changed files with 11 additions and 9 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include <PowerStatsAidl.h>
|
#include <PowerStatsAidl.h>
|
||||||
#include <Gs201CommonDataProviders.h>
|
#include <Gs201CommonDataProviders.h>
|
||||||
#include <AocStateResidencyDataProvider.h>
|
#include <AocTimedStateResidencyDataProvider.h>
|
||||||
#include <DevfreqStateResidencyDataProvider.h>
|
#include <DevfreqStateResidencyDataProvider.h>
|
||||||
#include <DvfsStateResidencyDataProvider.h>
|
#include <DvfsStateResidencyDataProvider.h>
|
||||||
#include <UfsStateResidencyDataProvider.h>
|
#include <UfsStateResidencyDataProvider.h>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
#include <android/binder_process.h>
|
#include <android/binder_process.h>
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
|
||||||
using aidl::android::hardware::power::stats::AocStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::AocTimedStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::DevfreqStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::DvfsStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::DvfsStateResidencyDataProvider;
|
||||||
using aidl::android::hardware::power::stats::UfsStateResidencyDataProvider;
|
using aidl::android::hardware::power::stats::UfsStateResidencyDataProvider;
|
||||||
|
@ -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) {
|
||||||
|
// When the given timeout is 0, the timeout will be replaced with "120ms * statesCount".
|
||||||
|
static const uint64_t TIMEOUT_MILLIS = 0;
|
||||||
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)
|
||||||
|
@ -113,8 +115,8 @@ 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<AocTimedStateResidencyDataProvider>(coreIds,
|
||||||
coreStates));
|
coreStates, TIMEOUT_MILLIS));
|
||||||
|
|
||||||
// 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,8 @@ 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<AocTimedStateResidencyDataProvider>(voltageIds, voltageStates,
|
||||||
|
TIMEOUT_MILLIS));
|
||||||
|
|
||||||
// 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 +138,8 @@ void addAoC(std::shared_ptr<PowerStats> p) {
|
||||||
{"MON", "mode"},
|
{"MON", "mode"},
|
||||||
};
|
};
|
||||||
p->addStateResidencyDataProvider(
|
p->addStateResidencyDataProvider(
|
||||||
std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates));
|
std::make_unique<AocTimedStateResidencyDataProvider>(monitorIds, monitorStates,
|
||||||
|
TIMEOUT_MILLIS));
|
||||||
|
|
||||||
// Add AoC restart count
|
// Add AoC restart count
|
||||||
const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
|
const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
|
||||||
|
@ -642,9 +646,7 @@ void addGs201CommonDataProviders(std::shared_ptr<PowerStats> p) {
|
||||||
setEnergyMeter(p);
|
setEnergyMeter(p);
|
||||||
|
|
||||||
addPixelStateResidencyDataProvider(p);
|
addPixelStateResidencyDataProvider(p);
|
||||||
// TODO(b/220032540): Re-enable AoC reporting when AoC long latency issue is fixed or
|
addAoC(p);
|
||||||
// the timeout mechanism is merged.
|
|
||||||
//addAoC(p);
|
|
||||||
addDvfsStats(p);
|
addDvfsStats(p);
|
||||||
addSoC(p);
|
addSoC(p);
|
||||||
addCPUclusters(p);
|
addCPUclusters(p);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue