summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2019-09-12 14:09:26 -0700
committerConnor O'Brien <connoro@google.com>2020-02-14 21:01:45 -0800
commit5065db05727935642088142513c2b6db92f7c90f (patch)
tree459d9def7a372c21bb326577351ae6db3af9cc3b /tools/aapt2/java/JavaClassGenerator_test.cpp
parent9a5d3ad5e08ae4e53aeb8b732c1f4a7cb95099c2 (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 Test: KernelCpu*TimeReaderTests and KernelCpuUidBpfMapReaderTest pass Test: no regressions in BatteryStatsTests Change-Id: Ie7c0b11a47289e16f72fd6868de4185e858c7e4f Signed-off-by: Connor O'Brien <connoro@google.com>
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions