From 9d2ebcfdbb206567ab1f3ca78da7d09dff001d37 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 30 May 2018 15:50:21 -0700 Subject: 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 --- simpleperf/Android.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'simpleperf/Android.mk') diff --git a/simpleperf/Android.mk b/simpleperf/Android.mk index 6a18f8c7..e3e99f53 100644 --- a/simpleperf/Android.mk +++ b/simpleperf/Android.mk @@ -368,6 +368,7 @@ simpleperf_unit_test_src_files := \ read_elf_test.cpp \ record_test.cpp \ sample_tree_test.cpp \ + thread_tree_test.cpp \ utils_test.cpp \ simpleperf_unit_test_src_files_linux := \ -- cgit v1.2.3