summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-04-05 16:29:45 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-04-05 14:46:13 +0000
commitf147dde52f8bc6157fe10fe43fed6b2e406c6854 (patch)
tree2c82260c0a9e052d7e7f538bff670235ae9b1f6b
parent8b14373797dc92cc404a907029b1d3bb54b05120 (diff)
Do report overlapping modules from lookupFrame()
We always get many modules that overlap ld.so. We have to report them when we find them, or otherwise the unwinding will fail. dwfl apparently doesn't mind the overlap in this case, so we don't have to clear the cache before. Change-Id: I68e9f6fe1653073b555755f546e743621e8c7919 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r--app/perfsymboltable.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp
index 6daf0a6..0004f48 100644
--- a/app/perfsymboltable.cpp
+++ b/app/perfsymboltable.cpp
@@ -394,8 +394,20 @@ int PerfSymbolTable::lookupFrame(Dwarf_Addr ip, quint64 timestamp, bool isKernel
if (elfIt != m_elfs.constEnd()) {
binaryId = m_unwind->resolveString(elfIt.value().file.fileName().toLocal8Bit());
elfStart = elfIt.key();
- if (m_dwfl && !mod)
- mod = reportElf(elfIt);
+ if (m_dwfl) {
+ if (mod) {
+ // If dwfl has a module and it's not the same as what we want, report the module
+ // we want. Many modules overlap ld.so, so if we've reported even one sample from
+ // ld.so we would otherwise be blocked from reporting anything that overlaps it.
+ Dwarf_Addr mod_start = 0;
+ dwfl_module_info(mod, nullptr, &mod_start, nullptr, nullptr, nullptr, nullptr,
+ nullptr);
+ if (elfIt.key() != mod_start)
+ mod = reportElf(elfIt);
+ } else {
+ mod = reportElf(elfIt);
+ }
+ }
}
PerfUnwind::Location addressLocation(