Merge "Log the time of the wakeup in KernelWakeupReported" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cdb63f90d7
@@ -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