simpleperf: refactor code managing thread maps.
1. In ThreadTree class, replace FixOverlappedMap with InsertMap,
which improves the avg time from O(N) to O(lgN).
2. Use std::map instead of std::set in MapSet. This avoids the
need to construct a MapEntry in FindMapByAddr().
3. Remove unused time variable in MapEntry.
4. Add code to merge maps in ThreadTree::ForkThread(). So maps
received before fork record are not removed. This allows us
to process JIT symfile maps before kernel records in
UpdateJITDebugInfo(), which makes more sample records see
the JIT symfile maps.
5. Add tests for code managing thread maps.
Bug: http://b/79118393
Test: run simpleperf_unit_test.
Test: run simpleperf on apps manually.
Change-Id: I3f1e3b68504d16803ca7c86c6ccca519a2f8b966
7 files changed