Merge "powerstats: introduce Modem PCIe GEN state residency" into 24D1-dev

This commit is contained in:
Treehugger Robot 2024-05-06 04:15:32 +00:00 committed by Android (Google) Code Review
commit ef5be6ef04

View file

@ -475,6 +475,24 @@ void addPCIe(std::shared_ptr<PowerStats> p) {
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>( p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
"/sys/devices/platform/13120000.pcie/power_stats", pcieWifiCfgs)); "/sys/devices/platform/13120000.pcie/power_stats", pcieWifiCfgs));
// Add PCIe Modem GEN
const GenericStateResidencyDataProvider::StateResidencyConfig modemGenStateConfig = {
.entryCountSupported = true,
.entryCountPrefix = "count:",
.totalTimeSupported = true,
.totalTimePrefix = "duration msec:",
};
const std::vector<std::pair<std::string, std::string>> modemGenStateHeaders = {
std::make_pair("GEN1", "Gen1:"),
std::make_pair("GEN3", "Gen3:"),
};
const std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> modemGenCfgs = {
{generateGenericStateResidencyConfigs(modemGenStateConfig, modemGenStateHeaders),
"PCIe-Modem-GEN", "link_speed:"}
};
p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
"/sys/devices/platform/12100000.pcie/link_duration", modemGenCfgs));
} }
void addWifi(std::shared_ptr<PowerStats> p) { void addWifi(std::shared_ptr<PowerStats> p) {