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-19 00:20:52 +0000
commit57635c976b6f3a69112cb6442cf021daacf7c730 (patch)
treef7cf5d6a201aeb3a53c0f7e6a1fd2ca2bb73105a /tools/aapt2/java/JavaClassGenerator_test.cpp
parent617b4b00e3aad9f70673eee84992747e8d7b26fe (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: Ia092e896028e5f647f6c182de05fa76c7e2e3180 Merged-In: 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