summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_report_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-04-09 14:06:08 -0700
committerYabin Cui <yabinc@google.com>2018-04-10 17:19:36 -0700
commit40b70ffb58d830edefad2c82a9d33e1c7ce91138 (patch)
treed71c951e6f27018db90a0b0edafdb1632e039aab /simpleperf/cmd_report_test.cpp
parent5eb57e19b83b467784d0bcae4f7ff1fe14ce4a7b (diff)
downloadextras-40b70ffb58d830edefad2c82a9d33e1c7ce91138.tar.gz
simpleperf: Improve the way downloading native libs on device.
Apks are usually built with stripped native libs, so app_profiler.py supports downloading native libs on device, and pass the native lib directory to simpleperf via --symfs option. However, it has below problems: 1. It needs to download native libs each time profiling. 2. It needs to wait until the app starts and read the /proc/pid/maps to know which native libs are needed. This patch solves the problems as below: 1. When app_profiler.py downloads native libs, it will write a build_id_list file in the native lib directory, which is a map from build_id to debug library path. 2. Simpleperf searchs build_id_list in the native lib directory, and uses build_id to find the debug files it needs. 3. Before downloading libs, app_profiler.py checks build_id_list to find libs available on device, thus avoids downloading libs more than once. Add tests in simpleperf_unit_test and test.py. Update demos to Android Studio 3.2. In profiling.gradle, remove the logic preventing stripping native libs in apk to test this patch. Another reason to remove it is because I found it affects release builds. Bug: http://b/69165587 Test: run simpleperf_unit_test && python test.py. Change-Id: I8ecf7ba2c0f58c131c261c1b4546f4916aea1f82
Diffstat (limited to 'simpleperf/cmd_report_test.cpp')
-rw-r--r--simpleperf/cmd_report_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/simpleperf/cmd_report_test.cpp b/simpleperf/cmd_report_test.cpp
index 6ebbf31e..3eb3c918 100644
--- a/simpleperf/cmd_report_test.cpp
+++ b/simpleperf/cmd_report_test.cpp
@@ -374,7 +374,7 @@ TEST_F(ReportCommandTest, check_build_id) {
}
exit(0);
},
- testing::ExitedWithCode(0), "Build id mismatch");
+ testing::ExitedWithCode(0), "failed to read symbols from /elf_for_build_id_check");
}
TEST_F(ReportCommandTest, no_show_ip_option) {
@@ -415,7 +415,7 @@ TEST_F(ReportCommandTest, read_elf_file_warning) {
}
exit(0);
},
- testing::ExitedWithCode(0), "elf: Read failed");
+ testing::ExitedWithCode(0), "failed to read symbols from /elf: File not found");
}
TEST_F(ReportCommandTest, report_data_generated_by_linux_perf) {