diff options
author | Yabin Cui <yabinc@google.com> | 2019-11-18 16:40:28 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2019-11-19 10:34:34 -0800 |
commit | a4496ada66451f5475f8f8c3d42ff23bde01258d (patch) | |
tree | 9d8ba8ccad2fea495b48f5009cf72ce43669d17e /simpleperf/dso.cpp | |
parent | 9fe57a62aeaaaa083b49f494643a9d9ca24daaac (diff) | |
download | extras-a4496ada66451f5475f8f8c3d42ff23bde01258d.tar.gz |
simpleperf: support libraries without build ids when recording.
Simpleperf can download unstripped libraries on device and use them
for unwinding during recording, through `app_profiler.py -lib` and
`simpleperf record --symfs` options. But it doesn't support libraries
without build ids.
To support them:
1. In app_profiler.py, download libraries without build ids in native
lib dir.
2. In DebugElfFileFinder in dso.cpp, check path with the same basename
in symfs_dir.
Also add document for downloading unstripped libraries on device.
Bug: none
Test: run simpleperf_unit_test.
Test: run test.py.
Change-Id: I5d9015e683f2ecb992d425a42f1f7303307b2cea
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r-- | simpleperf/dso.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp index ff3e41f8..6db0f6b7 100644 --- a/simpleperf/dso.cpp +++ b/simpleperf/dso.cpp @@ -135,14 +135,19 @@ std::string DebugElfFileFinder::FindDebugFile(const std::string& dso_path, bool } } } - // 2. Try concatenating symfs_dir and dso_path. if (!symfs_dir_.empty()) { + // 2. Try concatenating symfs_dir and dso_path. std::string path = GetPathInSymFsDir(dso_path); if (check_path(path)) { return path; } + // 3. Try concatenating symfs_dir and basename of dso_path. + path = symfs_dir_ + OS_PATH_SEPARATOR + android::base::Basename(dso_path); + if (check_path(path)) { + return path; + } } - // 3. Try concatenating /usr/lib/debug and dso_path. + // 4. Try concatenating /usr/lib/debug and dso_path. // Linux host can store debug shared libraries in /usr/lib/debug. if (check_path("/usr/lib/debug" + dso_path)) { return "/usr/lib/debug" + dso_path; |