summaryrefslogtreecommitdiff
path: root/simpleperf/dso.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-07-20 17:12:13 -0700
committerYabin Cui <yabinc@google.com>2018-07-23 10:51:11 -0700
commit3939b9dd836c7dadeb2fe74ecef7e658d837c36d (patch)
treeb5f877ece7092b02d2e6b45b4bdc714a7d392b36 /simpleperf/dso.h
parent3a51155fd7f7c61c333564d72fbe713feefb3674 (diff)
downloadextras-3939b9dd836c7dadeb2fe74ecef7e658d837c36d.tar.gz
simpleperf: add --symdir option in report-sample command.
--symdir option is used to provide a directory containing files with symbols. Mutliple --symdir options can be used to provide more than one directories. For each symbol directory, simpleperf collects build id for all elf files under it recursively. Then simpleperf can use the collected build ids to find files with symbols. Also fix an error in GetCompleteProcessName(). Bug: 111687223 Test: run simpleperf_unit_test. Change-Id: Ieac5ebf7451ae85ca15c3eae37bac3c89615580b
Diffstat (limited to 'simpleperf/dso.h')
-rw-r--r--simpleperf/dso.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/simpleperf/dso.h b/simpleperf/dso.h
index 4bd0779a..83f4f651 100644
--- a/simpleperf/dso.h
+++ b/simpleperf/dso.h
@@ -36,11 +36,14 @@ class DebugElfFileFinder {
public:
void Reset();
bool SetSymFsDir(const std::string& symfs_dir);
+ bool AddSymbolDir(const std::string& symbol_dir);
void SetVdsoFile(const std::string& vdso_file, bool is_64bit);
std::string FindDebugFile(const std::string& dso_path, bool force_64bit,
BuildId& build_id);
private:
+ void CollectBuildIdInDir(const std::string& dir);
+
std::string vdso_64bit_;
std::string vdso_32bit_;
std::string symfs_dir_;
@@ -110,7 +113,13 @@ class Dso {
public:
static void SetDemangle(bool demangle);
static std::string Demangle(const std::string& name);
+ // SymFsDir is used to provide an alternative root directory looking for files with symbols.
+ // For example, if we are searching symbols for /system/lib/libc.so and SymFsDir is /data/symbols,
+ // then we will also search file /data/symbols/system/lib/libc.so.
static bool SetSymFsDir(const std::string& symfs_dir);
+ // SymbolDir is used to add a directory containing files with symbols. Each file under it will
+ // be searched recursively to build a build_id_map.
+ static bool AddSymbolDir(const std::string& symbol_dir);
static void SetVmlinux(const std::string& vmlinux);
static void SetKallsyms(std::string kallsyms) {
if (!kallsyms.empty()) {