summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramStore.java
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2019-09-12 14:09:26 -0700
committerBill Peckham <bpeckham@google.com>2020-10-23 12:16:57 -0700
commiteae9b3730e7489683264ee8eb2433fd4f76d2aad (patch)
tree2a69c535eb41bc02bc92d6d2980ae4cf69141812 /rs/java/android/renderscript/ProgramStore.java
parente06db235ab62b991545fa483602b3abcd4104d8a (diff)
Use bpf data when available for per-UID cpu stats
Update KernelCpuUidTimeReader and its subclasses to support reading frequency, active & cluster times from BPF maps rather than proc files on devices that support this approach. BPF-based accounting offers improved accuracy as it can detect every context switch, whereas the proc files attribute a full tick period to whatever happens to be running when the tick occurs. Add a KernelCpuUidBpfMapReader class modeled on KernelCpuProcStringReader, with singletons for reading each distinct set of data. These follow the locking approach used by KernelCpuProcStringReader to ensure thread safety, but they collect data by calling libtimeinstate functions via JNI rather than reading text from proc files. They also provide a getDataDimensions() function to retrieve information currently provided by the header rows of the proc files, such as the list of available freqs or the number of cores on each cluster. Extend the KernelCpu*TimeReaderTest classes to exercise the BPF path for each reader class, and add a KernelCpuUidBpfMapReaderTest modeled on KernelProcStringReaderTest. Bug: 138317993 Bug: 163003172 Test: KernelCpu*TimeReaderTests and KernelCpuUidBpfMapReaderTest pass Test: no regressions in BatteryStatsTests Change-Id: Ie7c0b11a47289e16f72fd6868de4185e858c7e4f Signed-off-by: Connor O'Brien <connoro@google.com> (cherry picked from commit 5065db05727935642088142513c2b6db92f7c90f)
Diffstat (limited to 'rs/java/android/renderscript/ProgramStore.java')
0 files changed, 0 insertions, 0 deletions