diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-28 18:01:51 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-08-28 18:47:34 -0700 |
commit | 8d7a7bd9456c6067e874dabf6ee08b0a4e0de7d0 (patch) | |
tree | 0aef83c1f1a789d938a4583a84fa0e9c050b0c1c /dwflpp.h | |
parent | 3a45db133bc306fdbdb2b0c8f3aa7f15f1890d9e (diff) | |
download | systemtap-steved-8d7a7bd9456c6067e874dabf6ee08b0a4e0de7d0.tar.gz systemtap-steved-8d7a7bd9456c6067e874dabf6ee08b0a4e0de7d0.tar.xz systemtap-steved-8d7a7bd9456c6067e874dabf6ee08b0a4e0de7d0.zip |
Cache inline instance lookups
We used to call dwarf_func_inline_instances to get the locations where
inlines are used. This function has to iterate through nearly all DIEs
to find instances, which is a lot of redundant work when we're probing
multiple inline functions.
Now we have our own dwarf iterator to cache all inline instances back to
their origin. This only needs to be called once for each CU, and all
further inlines are just a map lookup. Some quick benchmarks:
stap -l Before After
kernel.function("*") 25010ms 2110ms
module("*").function("*") 86550ms 16920ms
process("stap").function("*") 41330ms 580ms
* dwflpp.cxx (dwflpp::cu_inl_function_caching_callback): Removed.
(dwflpp::cache_inline_instances): New caching iterator.
(dwflpp::iterate_over_inline_instances): Cache each CU once.
Diffstat (limited to 'dwflpp.h')
-rw-r--r-- | dwflpp.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -296,8 +296,9 @@ private: module_cu_cache_t module_cu_cache; + std::set<void*> cu_inl_function_cache_done; // CUs that are already cached cu_inl_function_cache_t cu_inl_function_cache; - static int cu_inl_function_caching_callback (Dwarf_Die* func, void *arg); + void cache_inline_instances (Dwarf_Die* die); /* The global alias cache is used to resolve any DIE found in a * module that is stubbed out with DW_AT_declaration with a defining |