History log of /frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
363ccf7282787898c3eea2926adce3078611f394 01-Mar-2018 Mike Ma <yanmin@google.com> More granular logging when proc file not exist

KernelCpuProcReader records a horrifying exception when the proc file
does not exist, creating confusion that this is the source of error.
Bug: 74074575
Test: KernelCpuProcReaderTest

Change-Id: Ib35e114cd78e1e9f424adf66da5eb85da9f6fe5f
/frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader.java
2ab014426647bbc8960fdb4dadfe480b9806676e 13-Feb-2018 Mike Ma <yanmin@google.com> Binary Cpu Time Proc File Reader

Kernel now exposes cpu time proc files in binary format to save cpu
cycles. New proc files are:
Per uid freq time: /proc/uid_cpupower/time_in_state
Per uid active time: /proc/uid_cpupower/concurrent_active_time
Per uid cluster time: /proc/uid_cpupower/concurrent_policy_time
(See PowerProfile.java on how these data are used)
KernelUidCpuActiveTimeReader, KernelUidCpuClusterTimeReader and
KernelUidCpuFreqTimeReader are modified to use these new data.

Meanwhile, statsd needs these data too. So the actual reading
fuctionality is delegated to singletons in KernelCpuProcReader to
accomodate concurrent access of these proc files by more than one
party. When multiple read requests hit the singleton within the
throttle interval, the singleton will return stale data.

Optimization
KernelCpuProcReader reuses the same ByteBuffer to save results.
KernelUid***Reader all reuse the same long[] array to send results
back to BatteryStatsImpl. Estimated saving of ~200 KB GC effort
per read request.

Add a flag to control throttle interval:
kernel_uid_readers_throttle_time

Bug: 72763654
Bug: 71906435
Bug: 71905885
Bug: 70517018
Fixes: 73166477
Fixes: 72172569
Test: BatteryStatsCpuTimesTest
Test: KernelUidCpuActiveTimeReaderTest
Test: KernelUidCpuClusterTimeReaderTest
Test: KernelUidCpuFreqTimeReaderTest
Test: KernelCpuProcReaderTest
Change-Id: I1012667ce3b9eb35e37882a058bd4bceccabbbe9
/frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader.java