summaryrefslogtreecommitdiff
path: root/simpleperf/thread_tree.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-10-19 15:06:29 -0700
committerYabin Cui <yabinc@google.com>2016-11-10 15:38:58 -0800
commit16501ffbd73483c498dde1ea4ad2670da7c9df55 (patch)
tree3c7c3a7f69ff65a7b984a93a3b96818f4f5acf7f /simpleperf/thread_tree.cpp
parentf94f3d3d43aaaec680fffa43b12eaa7d6c83d98a (diff)
downloadextras-16501ffbd73483c498dde1ea4ad2670da7c9df55.tar.gz
simpleperf: use file records in protobuf output.
Dump file name and symbol name for each CallChainEntry takes too much space. So instead we store file_id and symbol_id for each CallChainEntry, and store file records separately. In CallChainEntry, replace ip with vaddr_in_file, because vaddr_in_file is more useful in finding instructions in elf file. Bug: http://b/32210800 Test: simpleperf_unit_test. Change-Id: I85542db21acbaa4d81b3c3aa7f9215f2d23c4878
Diffstat (limited to 'simpleperf/thread_tree.cpp')
-rw-r--r--simpleperf/thread_tree.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/simpleperf/thread_tree.cpp b/simpleperf/thread_tree.cpp
index 5868502b..84cfb599 100644
--- a/simpleperf/thread_tree.cpp
+++ b/simpleperf/thread_tree.cpp
@@ -209,14 +209,10 @@ const MapEntry* ThreadTree::FindMap(const ThreadEntry* thread, uint64_t ip) {
}
const Symbol* ThreadTree::FindSymbol(const MapEntry* map, uint64_t ip,
- uint64_t* pvaddr_in_file) {
+ uint64_t* pvaddr_in_file, Dso** pdso) {
uint64_t vaddr_in_file;
Dso* dso = map->dso;
- if (dso == kernel_dso_.get()) {
- vaddr_in_file = ip;
- } else {
- vaddr_in_file = ip - map->start_addr + map->dso->MinVirtualAddress();
- }
+ vaddr_in_file = ip - map->start_addr + map->dso->MinVirtualAddress();
const Symbol* symbol = dso->FindSymbol(vaddr_in_file);
if (symbol == nullptr && map->in_kernel && dso != kernel_dso_.get()) {
// It is in a kernel module, but we can't find the kernel module file, or
@@ -241,6 +237,9 @@ const Symbol* ThreadTree::FindSymbol(const MapEntry* map, uint64_t ip,
if (pvaddr_in_file != nullptr) {
*pvaddr_in_file = vaddr_in_file;
}
+ if (pdso != nullptr) {
+ *pdso = dso;
+ }
return symbol;
}