summaryrefslogtreecommitdiff
path: root/simpleperf/dso.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-11-28 17:28:08 -0800
committerYabin Cui <yabinc@google.com>2016-11-29 09:44:13 -0800
commit52c6369cd3bc5dfb5f05b4e3b2c66aec47065c04 (patch)
tree346a70442086015babe4f7f861ceb82c6283722f /simpleperf/dso.cpp
parent89bf4d4276ebe302722d2f929d4be41b0e155e00 (diff)
downloadextras-52c6369cd3bc5dfb5f05b4e3b2c66aec47065c04.tar.gz
simpleperf: add stuff in report_lib_interface.
It's a preparation to annotate binaries, containing following changes: 1. Export build_id for binaries. 2. Export function virtual addresses. 3. Add unit tests in simpleperf_report_lib.py. Bug: http://b/32834638 Test: simpleperf_unit_test. Test: run `python simpleperf_report_lib.py`. Change-Id: Ieed40935ff9ede44bf823ba9c88ad87806ffac0a
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r--simpleperf/dso.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp
index c8894160..d52c445f 100644
--- a/simpleperf/dso.cpp
+++ b/simpleperf/dso.cpp
@@ -118,14 +118,18 @@ void Dso::SetBuildIds(
build_id_map_ = std::move(map);
}
-BuildId Dso::GetExpectedBuildId() {
- auto it = build_id_map_.find(path_);
+BuildId Dso::FindExpectedBuildIdForPath(const std::string& path) {
+ auto it = build_id_map_.find(path);
if (it != build_id_map_.end()) {
return it->second;
}
return BuildId();
}
+BuildId Dso::GetExpectedBuildId() {
+ return FindExpectedBuildIdForPath(path_);
+}
+
std::unique_ptr<Dso> Dso::CreateDso(DsoType dso_type,
const std::string& dso_path) {
return std::unique_ptr<Dso>(new Dso(dso_type, dso_path));