diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-09-29 16:45:37 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-09-29 16:45:37 +0200 |
commit | 68983551cc9390aa2bddd8e62ed0f0e3eca1edb6 (patch) | |
tree | 98dc1f189dac99351989f7167b84a88f39d6a86c /translate.cxx | |
parent | 497f19d74912d0b6adf729f88509c71a45cacdd4 (diff) | |
download | systemtap-steved-68983551cc9390aa2bddd8e62ed0f0e3eca1edb6.tar.gz systemtap-steved-68983551cc9390aa2bddd8e62ed0f0e3eca1edb6.tar.xz systemtap-steved-68983551cc9390aa2bddd8e62ed0f0e3eca1edb6.zip |
Cache Dwfl's for reuse between pass 2 and pass 3.
* setupdwfl.h: Introduce DwflPtr.
* setupdwfl.cxx: Cache kernel_dwfl and user_dwfl. Keep track of last used
module strings. Return cached versions if same query used.
* dwflpp.h: Use DwflPtr instead of Dwfl*.
* dwflpp.cxx: Use DwflPtr and don't dwfl_end().
* translate.cxx: Likewise. Run through dwfl_getmodules() with returned
ptr offset.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/translate.cxx b/translate.cxx index 0f53dc78..a3246d9c 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4962,7 +4962,8 @@ emit_symbol_data (systemtap_session& s) offline searches. */ offline_search_modules.insert (foo); } - Dwfl *dwfl = setup_dwfl_kernel (offline_search_modules, &count, s); + DwflPtr dwfl_ptr = setup_dwfl_kernel (offline_search_modules, &count, s); + Dwfl *dwfl = dwfl_ptr.get()->dwfl; dwfl_assert("all kernel modules found", count >= offline_search_modules.size()); @@ -4971,12 +4972,11 @@ emit_symbol_data (systemtap_session& s) { if (pending_interrupts) return; if (ctx.undone_unwindsym_modules.empty()) break; - off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, 0); + off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, off); } while (off > 0); dwfl_assert("dwfl_getmodules", off == 0); - dwfl_end(dwfl); - + dwfl_ptr.reset(); // ---- step 2: process any user modules (files) listed for (std::set<std::string>::iterator it = s.unwindsym_modules.begin(); @@ -4986,7 +4986,8 @@ emit_symbol_data (systemtap_session& s) string modname = *it; assert (modname.length() != 0); if (! is_user_module (modname)) continue; - Dwfl *dwfl = setup_dwfl_user (modname); + DwflPtr dwfl_ptr = setup_dwfl_user (modname); + Dwfl *dwfl = dwfl_ptr.get()->dwfl; if (dwfl != NULL) // tolerate missing data; will warn below { ptrdiff_t off = 0; @@ -4994,12 +4995,12 @@ emit_symbol_data (systemtap_session& s) { if (pending_interrupts) return; if (ctx.undone_unwindsym_modules.empty()) break; - off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, 0); + off = dwfl_getmodules (dwfl, &dump_unwindsyms, (void *) &ctx, off); } while (off > 0); dwfl_assert("dwfl_getmodules", off == 0); } - dwfl_end(dwfl); + dwfl_ptr.reset(); } emit_symbol_data_done (&ctx, s); |