From 33552445b8237b1222f50295c3af478321ea5067 Mon Sep 17 00:00:00 2001 From: Sam Dubey Date: Fri, 10 Jun 2022 03:23:56 +0000 Subject: [PATCH] Revert "Use libaoc to provide consistent timestamp calculations" Revert "Allow libaoc to be used in more contexts" Revert submission 18605412-b-233923713 Reason for revert: Completely broke master-without-vendor Bug: 235533674 Reverted Changes: Iacd541815:Use libaoc to provide consistent timestamp calcula... Id31ee3439:Allow libaoc to be used in more contexts Change-Id: I3345d0e4baa8d5dce22be20f0213ad1421ce1a90 --- powerstats/Android.bp | 1 - powerstats/AocStateResidencyDataProvider.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/powerstats/Android.bp b/powerstats/Android.bp index 2dbf8db..74935c7 100644 --- a/powerstats/Android.bp +++ b/powerstats/Android.bp @@ -20,6 +20,5 @@ cc_library { shared_libs: [ "android.hardware.power.stats-impl.pixel", - "libaoc", ], } diff --git a/powerstats/AocStateResidencyDataProvider.cpp b/powerstats/AocStateResidencyDataProvider.cpp index 6ab54db..c64496d 100644 --- a/powerstats/AocStateResidencyDataProvider.cpp +++ b/powerstats/AocStateResidencyDataProvider.cpp @@ -18,8 +18,6 @@ #include -#include - namespace aidl { namespace android { namespace hardware { @@ -28,8 +26,11 @@ namespace stats { AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector> ids, std::vector> states) { - // AoC stats are reported in ticks - std::function aocTickToMs = [](uint64_t a) { return aoc_ticks_to_nanoseconds(a) / 1000000; }; + // 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; + std::function aocTickToMs = [](uint64_t a) { return a / AOC_CLK; }; GenericStateResidencyDataProvider::StateResidencyConfig config = { .entryCountSupported = true, .entryCountPrefix = "Counter:",