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: I0c62a993293325902d70805bbb0b736561bd1413 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1675,6 +1675,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
|
|
||||||
String mLastWakeupReason = null;
|
String mLastWakeupReason = null;
|
||||||
long mLastWakeupUptimeMs = 0;
|
long mLastWakeupUptimeMs = 0;
|
||||||
|
long mLastWakeupElapsedTimeMs = 0;
|
||||||
private final HashMap<String, SamplingTimer> mWakeupReasonStats = new HashMap<>();
|
private final HashMap<String, SamplingTimer> mWakeupReasonStats = new HashMap<>();
|
||||||
|
|
||||||
public Map<String, ? extends Timer> getWakeupReasonStats() {
|
public Map<String, ? extends Timer> getWakeupReasonStats() {
|
||||||
@@ -5048,7 +5049,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
SamplingTimer timer = getWakeupReasonTimerLocked(mLastWakeupReason);
|
SamplingTimer timer = getWakeupReasonTimerLocked(mLastWakeupReason);
|
||||||
timer.add(deltaUptimeMs * 1000, 1, elapsedRealtimeMs); // time in in microseconds
|
timer.add(deltaUptimeMs * 1000, 1, elapsedRealtimeMs); // time in in microseconds
|
||||||
FrameworkStatsLog.write(FrameworkStatsLog.KERNEL_WAKEUP_REPORTED, mLastWakeupReason,
|
FrameworkStatsLog.write(FrameworkStatsLog.KERNEL_WAKEUP_REPORTED, mLastWakeupReason,
|
||||||
/* duration_usec */ deltaUptimeMs * 1000);
|
/* duration_usec */ deltaUptimeMs * 1000, mLastWakeupElapsedTimeMs);
|
||||||
mLastWakeupReason = null;
|
mLastWakeupReason = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5059,6 +5060,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
mHistory.recordWakeupEvent(elapsedRealtimeMs, uptimeMs, reason);
|
mHistory.recordWakeupEvent(elapsedRealtimeMs, uptimeMs, reason);
|
||||||
mLastWakeupReason = reason;
|
mLastWakeupReason = reason;
|
||||||
mLastWakeupUptimeMs = uptimeMs;
|
mLastWakeupUptimeMs = uptimeMs;
|
||||||
|
mLastWakeupElapsedTimeMs = elapsedRealtimeMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GuardedBy("this")
|
@GuardedBy("this")
|
||||||
|
|||||||
Reference in New Issue
Block a user