Merge "Log the time of the wakeup in KernelWakeupReported" into udc-dev am: cdb63f90d7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23154994

Change-Id: I324855fe068b9e1eaad4ee9f75f5e6788990e32f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Suprabh Shukla
2023-05-11 22:37:11 +00:00
committed by Automerger Merge Worker

View File

@@ -1675,6 +1675,7 @@ public class BatteryStatsImpl extends BatteryStats {
String mLastWakeupReason = null;
long mLastWakeupUptimeMs = 0;
long mLastWakeupElapsedTimeMs = 0;
private final HashMap<String, SamplingTimer> mWakeupReasonStats = new HashMap<>();
public Map<String, ? extends Timer> getWakeupReasonStats() {
@@ -5048,7 +5049,7 @@ public class BatteryStatsImpl extends BatteryStats {
SamplingTimer timer = getWakeupReasonTimerLocked(mLastWakeupReason);
timer.add(deltaUptimeMs * 1000, 1, elapsedRealtimeMs); // time in in microseconds
FrameworkStatsLog.write(FrameworkStatsLog.KERNEL_WAKEUP_REPORTED, mLastWakeupReason,
/* duration_usec */ deltaUptimeMs * 1000);
/* duration_usec */ deltaUptimeMs * 1000, mLastWakeupElapsedTimeMs);
mLastWakeupReason = null;
}
}
@@ -5059,6 +5060,7 @@ public class BatteryStatsImpl extends BatteryStats {
mHistory.recordWakeupEvent(elapsedRealtimeMs, uptimeMs, reason);
mLastWakeupReason = reason;
mLastWakeupUptimeMs = uptimeMs;
mLastWakeupElapsedTimeMs = elapsedRealtimeMs;
}
@GuardedBy("this")