summaryrefslogtreecommitdiff
path: root/libunwindstack/Symbols.h
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-04-16 19:00:43 +0100
committerDavid Srbecky <dsrbecky@google.com>2021-04-16 19:00:43 +0100
commit537b5fb7b96af3b58c10a0f6e19cab4d4bd91ff6 (patch)
tree47d101ceae239b7ccae0d4bae933dda4ad61c161 /libunwindstack/Symbols.h
parent967fa7fe4e7d95b4ec346e7cf7aa3e62b0d1b7a6 (diff)
downloadunwinding-537b5fb7b96af3b58c10a0f6e19cab4d4bd91ff6.tar.gz
Cache Symbols::GetGlobal
The ART tests currently time out in this method after 24 hours. There is other unknown failure in unwinding of some frequent frame. This causes the unwinder to try JIT as well, however no JIT is used at all in those tests, which means the JIT is being re-initialized on excessive number of unwinds. In particular, taking a lot of time in the linear scan over symbols to find the magic global variable. There might be some better way to handle the JIT initialization, but the caching of the symbol lookup is good optimization anyway. Test: libunwindstack_unit_test Change-Id: I6b3d9a03b80da4d71a5e6bc61c551fe94a277164
Diffstat (limited to 'libunwindstack/Symbols.h')
-rw-r--r--libunwindstack/Symbols.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libunwindstack/Symbols.h b/libunwindstack/Symbols.h
index 1074ebf..c1967b0 100644
--- a/libunwindstack/Symbols.h
+++ b/libunwindstack/Symbols.h
@@ -22,6 +22,7 @@
#include <map>
#include <optional>
#include <string>
+#include <unordered_map>
#include <unwindstack/SharedString.h>
@@ -68,6 +69,9 @@ class Symbols {
std::map<uint64_t, Info> symbols_; // Cache of read symbols (keyed by function *end* address).
std::optional<std::vector<uint32_t>> remap_; // Indices of function symbols sorted by address.
+
+ // Cache of global data (non-function) symbols.
+ std::unordered_map<std::string, std::optional<uint64_t>> global_variables_;
};
} // namespace unwindstack