Use libaoc to provide consistent timestamp calculations
Bug: 233923713 Change-Id: Iacd541815f40adef879e05d9bd8ded056e9a760d
This commit is contained in:
parent
391f601be6
commit
9f4ac2c565
@ -20,5 +20,6 @@ cc_library {
|
|||||||
|
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"android.hardware.power.stats-impl.pixel",
|
"android.hardware.power.stats-impl.pixel",
|
||||||
|
"libaoc",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include <android-base/logging.h>
|
#include <android-base/logging.h>
|
||||||
|
|
||||||
|
#include <aoc.h>
|
||||||
|
|
||||||
namespace aidl {
|
namespace aidl {
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
@ -26,11 +28,8 @@ namespace stats {
|
|||||||
|
|
||||||
AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector<std::pair<std::string,
|
AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector<std::pair<std::string,
|
||||||
std::string>> ids, std::vector<std::pair<std::string, std::string>> states) {
|
std::string>> ids, std::vector<std::pair<std::string, std::string>> states) {
|
||||||
// AoC stats are reported in ticks of 244.140625ns. The transform
|
// AoC stats are reported in ticks
|
||||||
// function converts ticks to milliseconds.
|
std::function<uint64_t(uint64_t)> aocTickToMs = [](uint64_t a) { return aoc_ticks_to_nanoseconds(a) / 1000000; };
|
||||||
// 1000000 / 244.140625 = 4096.
|
|
||||||
static const uint64_t AOC_CLK = 4096;
|
|
||||||
std::function<uint64_t(uint64_t)> aocTickToMs = [](uint64_t a) { return a / AOC_CLK; };
|
|
||||||
GenericStateResidencyDataProvider::StateResidencyConfig config = {
|
GenericStateResidencyDataProvider::StateResidencyConfig config = {
|
||||||
.entryCountSupported = true,
|
.entryCountSupported = true,
|
||||||
.entryCountPrefix = "Counter:",
|
.entryCountPrefix = "Counter:",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user