powerstats: add new parameter to provide aoc clock am: 2756ac31ff am: 46a9f0ac04
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/18966586 Change-Id: I54761bf9a3af8761fe680eea41077f8401fe9072 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
af4ed69699
@ -24,12 +24,12 @@ namespace hardware {
|
||||
namespace power {
|
||||
namespace stats {
|
||||
|
||||
AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector<std::pair<std::string,
|
||||
std::string>> ids, std::vector<std::pair<std::string, std::string>> states) {
|
||||
// AoC stats are reported in ticks of 244.140625ns. The transform
|
||||
// function converts ticks to milliseconds.
|
||||
// 1000000 / 244.140625 = 4096.
|
||||
static const uint64_t AOC_CLK = 4096;
|
||||
AocStateResidencyDataProvider::AocStateResidencyDataProvider(
|
||||
std::vector<std::pair<std::string, std::string>> ids,
|
||||
std::vector<std::pair<std::string, std::string>> states,
|
||||
const uint64_t aocClock) {
|
||||
// AoC stats are reported in ticks.
|
||||
static const uint64_t AOC_CLK = aocClock;
|
||||
std::function<uint64_t(uint64_t)> aocTickToMs = [](uint64_t a) { return a / AOC_CLK; };
|
||||
GenericStateResidencyDataProvider::StateResidencyConfig config = {
|
||||
.entryCountSupported = true,
|
||||
|
@ -28,8 +28,9 @@ namespace stats {
|
||||
AocTimedStateResidencyDataProvider::AocTimedStateResidencyDataProvider(
|
||||
std::vector<std::pair<std::string, std::string>> ids,
|
||||
std::vector<std::pair<std::string, std::string>> states,
|
||||
const uint64_t timeoutMillis)
|
||||
: AocStateResidencyDataProvider(ids, states) {
|
||||
const uint64_t timeoutMillis,
|
||||
const uint64_t aocClock)
|
||||
: AocStateResidencyDataProvider(ids, states, aocClock) {
|
||||
static const uint64_t DEFAULT_MAX_TIME_PER_STATE_MILLIS = 120;
|
||||
|
||||
mTimeoutMillis =
|
||||
|
@ -27,7 +27,8 @@ namespace stats {
|
||||
class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
|
||||
public:
|
||||
AocStateResidencyDataProvider(std::vector<std::pair<std::string, std::string>> ids,
|
||||
std::vector<std::pair<std::string, std::string>> states);
|
||||
std::vector<std::pair<std::string, std::string>> states,
|
||||
const uint64_t aocClock);
|
||||
~AocStateResidencyDataProvider() = default;
|
||||
bool getStateResidencies(
|
||||
std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
|
||||
|
@ -39,7 +39,8 @@ class AocTimedStateResidencyDataProvider : public AocStateResidencyDataProvider
|
||||
AocTimedStateResidencyDataProvider(
|
||||
std::vector<std::pair<std::string, std::string>> ids,
|
||||
std::vector<std::pair<std::string, std::string>> states,
|
||||
const uint64_t timeoutMillis);
|
||||
const uint64_t timeoutMillis,
|
||||
const uint64_t aocClock);
|
||||
~AocTimedStateResidencyDataProvider() = default;
|
||||
|
||||
bool getStateResidencies(
|
||||
|
Loading…
x
Reference in New Issue
Block a user