diff options
author | Yabin Cui <yabinc@google.com> | 2019-10-09 17:14:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-10-09 17:14:43 +0000 |
commit | 7ea25d629c7c86c1a626337451738c3e844ef7de (patch) | |
tree | 2434fdf9971e796a3dff3cc90765dfff66bda544 | |
parent | bf9f91a149664b1e30ddababa8b44abf8af66b6c (diff) | |
parent | 39ccd9ca2fd92b7208c03e4d0215069bbe820cbd (diff) | |
download | extras-ndk-sysroot-r21.tar.gz |
Merge "simpleperf: create one map for each jit symbol."ndk-sysroot-r21
-rw-r--r-- | simpleperf/JITDebugReader.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/simpleperf/JITDebugReader.cpp b/simpleperf/JITDebugReader.cpp index c4406c96..8c5386dc 100644 --- a/simpleperf/JITDebugReader.cpp +++ b/simpleperf/JITDebugReader.cpp @@ -499,18 +499,6 @@ void JITDebugReader::ReadJITCodeDebugInfo(Process& process, if (!IsValidElfFileMagic(data.data(), jit_entry.symfile_size)) { continue; } - uint64_t min_addr = UINT64_MAX; - uint64_t max_addr = 0; - auto callback = [&](const ElfFileSymbol& symbol) { - min_addr = std::min(min_addr, symbol.vaddr); - max_addr = std::max(max_addr, symbol.vaddr + symbol.len); - LOG(VERBOSE) << "JITSymbol " << symbol.name << " at [" << std::hex << symbol.vaddr - << " - " << (symbol.vaddr + symbol.len) << " with size " << symbol.len; - }; - if (ParseSymbolsFromElfFileInMemory(data.data(), jit_entry.symfile_size, callback) != - ElfStatus::NO_ERROR || min_addr >= max_addr) { - continue; - } std::unique_ptr<TemporaryFile> tmp_file = ScopedTempFiles::CreateTempFile(!keep_symfiles_); if (tmp_file == nullptr || !android::base::WriteFully(tmp_file->fd, data.data(), jit_entry.symfile_size)) { @@ -519,8 +507,13 @@ void JITDebugReader::ReadJITCodeDebugInfo(Process& process, if (keep_symfiles_) { tmp_file->DoNotRemove(); } - debug_info->emplace_back(process.pid, jit_entry.timestamp, min_addr, max_addr - min_addr, - tmp_file->path); + auto callback = [&](const ElfFileSymbol& symbol) { + LOG(VERBOSE) << "JITSymbol " << symbol.name << " at [" << std::hex << symbol.vaddr + << " - " << (symbol.vaddr + symbol.len) << " with size " << symbol.len; + debug_info->emplace_back(process.pid, jit_entry.timestamp, symbol.vaddr, symbol.len, + tmp_file->path); + }; + ParseSymbolsFromElfFileInMemory(data.data(), jit_entry.symfile_size, callback); } } |