simpleperf: support JIT/interpreted java code in system wide profiling.
It contains below changes:
1. Support monitoring multiple processes in JITDebugReader.
2. Switch from 100ms period to 100ms interval when scanning JIT debug
info changes.
3. Limit read entry length by seqlock different instead of a fixed
value.
4. Support disable/enable periodic events in IOEventLoop.
5. Remove duplicated dex file offsets in DexFileDso.
6. Enable JITDebugReader for recording on Android P.
7. Remove " (deleted)" suffix in filenames of maps, because some vdex
files in map file have this suffix.
Bug: http://b/79118393
Test: run `simpleperf record -a` manually.
Test: run simpleperf_unit_test.
Change-Id: Ia398ddd7bc74cbc5fdca6caa6f548a62447d9729
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp
index 223866d..a9c86f4 100644
--- a/simpleperf/dso.cpp
+++ b/simpleperf/dso.cpp
@@ -333,7 +333,12 @@
: Dso(DSO_DEX_FILE, path, debug_file_path) {}
void AddDexFileOffset(uint64_t dex_file_offset) override {
- dex_file_offsets_.push_back(dex_file_offset);
+ auto it = std::lower_bound(dex_file_offsets_.begin(), dex_file_offsets_.end(),
+ dex_file_offset);
+ if (it != dex_file_offsets_.end() && *it == dex_file_offset) {
+ return;
+ }
+ dex_file_offsets_.insert(it, dex_file_offset);
}
const std::vector<uint64_t>* DexFileOffsets() override {