Consume the first sample of KernelUidCpuTimeReader
If the system_server crashes, when it starts back up it will assume that the entries in kernelUidCpuTimeReader are all fresh and we will end up double counting cpu time and power. Bug:29163081 Change-Id: I73e693199c170229af57efd610950e90263ac9bc
This commit is contained in:
@@ -84,7 +84,8 @@ public class KernelUidCpuTimeReader {
|
||||
powerMaUs = 0;
|
||||
}
|
||||
|
||||
if (callback != null) {
|
||||
// Only report if there is a callback and if this is not the first read.
|
||||
if (callback != null && mLastTimeReadUs != 0) {
|
||||
long userTimeDeltaUs = userTimeUs;
|
||||
long systemTimeDeltaUs = systemTimeUs;
|
||||
long powerDeltaMaUs = powerMaUs;
|
||||
|
||||
Reference in New Issue
Block a user