diff options
author | Yabin Cui <yabinc@google.com> | 2018-08-13 17:42:25 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-08-14 16:15:07 -0700 |
commit | 10bbd842e4ef7754280887952e9711c3258d2ece (patch) | |
tree | 5275f5e694707a3374addc646a4689e7ae4481ac /simpleperf/dso.cpp | |
parent | c051e742978ff17db4f1eb283c9db2359404b5b3 (diff) | |
download | extras-10bbd842e4ef7754280887952e9711c3258d2ece.tar.gz |
simpleperf: fix removing ART frames.
ART frames can also exist before or after JITed Java methods.
Bug: none
Test: run report_html.py manually, and check that ART frames
Test: near JITed Java methods are removed.
Change-Id: I771cb7503bb62e8d0fc71167bfd887abe069554f
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 8e641a89..50a3dc84 100644 --- a/simpleperf/dso.cpp +++ b/simpleperf/dso.cpp @@ -317,6 +317,20 @@ void Dso::AddUnknownSymbol(uint64_t vaddr_in_dso, const std::string& name) { unknown_symbols_.insert(std::make_pair(vaddr_in_dso, Symbol(name, vaddr_in_dso, 1))); } +bool Dso::IsForJavaMethod() { + if (type_ == DSO_DEX_FILE) { + return true; + } + if (type_ == DSO_ELF_FILE) { + // JIT symfiles for JITed Java methods are dumped as temporary files, whose name are in format + // "TemporaryFile-XXXXXX". + size_t pos = path_.rfind('/'); + pos = (pos == std::string::npos) ? 0 : pos + 1; + return strncmp(&path_[pos], "TemporaryFile", strlen("TemporaryFile")) == 0; + } + return false; +} + void Dso::Load() { is_loaded_ = true; std::vector<Symbol> symbols = LoadSymbols(); |