diff options
author | Evgeny Eltsin <eaeltsin@google.com> | 2020-08-27 15:46:09 +0200 |
---|---|---|
committer | Evgeny Eltsin <eaeltsin@google.com> | 2020-08-27 19:59:47 +0200 |
commit | 91dbae0b24eb1943e45c82487d6a0dea7bdf6f3a (patch) | |
tree | 1e552e2cea9ecb352742e19b5a417f08acb51083 /simpleperf/dso.cpp | |
parent | 020f929a3a17a08fe3213733bd60d0b302c662d3 (diff) | |
download | extras-91dbae0b24eb1943e45c82487d6a0dea7bdf6f3a.tar.gz |
simpleperf: add perf symbol map dso + test
Bug: 164091700
Test: simpleperf_unit_test
Change-Id: I73c56d87518e22146dd7ec62c52ed80640369b59
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r-- | simpleperf/dso.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp index f4239a60..efe65721 100644 --- a/simpleperf/dso.cpp +++ b/simpleperf/dso.cpp @@ -691,6 +691,16 @@ class KernelModuleDso : public Dso { } }; +class SymbolMapFileDso : public Dso { + public: + SymbolMapFileDso(const std::string& path) : Dso(DSO_SYMBOL_MAP_FILE, path, path) {} + + uint64_t IpToVaddrInFile(uint64_t ip, uint64_t, uint64_t) override { return ip; } + + protected: + std::vector<Symbol> LoadSymbols() override { return {}; } +}; + class UnknownDso : public Dso { public: UnknownDso(const std::string& path) : Dso(DSO_UNKNOWN_FILE, path, path) {} @@ -722,6 +732,8 @@ std::unique_ptr<Dso> Dso::CreateDso(DsoType dso_type, const std::string& dso_pat } case DSO_DEX_FILE: return std::unique_ptr<Dso>(new DexFileDso(dso_path, dso_path)); + case DSO_SYMBOL_MAP_FILE: + return std::unique_ptr<Dso>(new SymbolMapFileDso(dso_path)); case DSO_UNKNOWN_FILE: return std::unique_ptr<Dso>(new UnknownDso(dso_path)); default: @@ -745,6 +757,8 @@ const char* DsoTypeToString(DsoType dso_type) { return "dso_elf_file"; case DSO_DEX_FILE: return "dso_dex_file"; + case DSO_SYMBOL_MAP_FILE: + return "dso_symbol_map_file"; default: return "unknown"; } |