summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-08-13 22:53:44 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-08-14 09:04:18 -0400
commit671ceda847955e31bc3ab310eb180fdc687a2ca8 (patch)
tree9fcfa58a88eef99b3c326da8ed641c9a93ffa610 /translate.cxx
parentb9bee53ec058c142ac5ba010224dd75669d61ad5 (diff)
downloadsystemtap-steved-671ceda847955e31bc3ab310eb180fdc687a2ca8.tar.gz
systemtap-steved-671ceda847955e31bc3ab310eb180fdc687a2ca8.tar.xz
systemtap-steved-671ceda847955e31bc3ab310eb180fdc687a2ca8.zip
PR10228: use task_finder_vma for -d /user/object files.
* main.cxx (main): For "-d /path" arguments, enable task finder. * runtime/sym.h (_stp_module): Add *vmcb member. * task_finder{.cxx,.h} (emit_vma_callback_probe_decl): Zap. * tapset-itrace.cxx, tapset-utrace.cxx: Use unwindsyms_modules instead. * tapsets.cxx (uprobe::emit_module_decls): Ditto. * translate.cxx (emit_module_init): Emit task finder registrations for vmcb's associated with _stp_modules. (dump_unwindsyms): Associate vmcbs with user-space unwindsyms entries.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/translate.cxx b/translate.cxx
index b8e22e49..69b16304 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -1140,6 +1140,22 @@ c_unparser::emit_module_init ()
o->newline(-1) << "}";
o->newline() << "#endif";
+ // PR10228: set up symbol table-related task finders
+ o->newline() << "#ifdef STP_NEED_VMA_TRACKER";
+ o->newline() << "_stp_sym_init();";
+ o->newline() << "for (i=0; i<_stp_num_modules; i++) {";
+ o->newline(1) << "if (_stp_modules[i]->vmcb) {";
+ o->newline(1) << "rc = stap_register_task_finder_target (_stp_modules[i]->vmcb);";
+ o->newline() << "if (rc) {";
+ o->newline(1) << "_stp_error ("
+ << "\"couldn't initialize task-finder for %s\\n\","
+ << "_stp_modules[i]->vmcb->pathname);";
+ o->newline() << "goto out;";
+ o->newline(-1) << "}";
+ o->newline(-1) << "}";
+ o->newline(-1) << "}";
+ o->newline() << "#endif";
+
o->newline() << "(void) probe_point;";
o->newline() << "(void) i;";
o->newline() << "(void) j;";
@@ -4814,12 +4830,27 @@ dump_unwindsyms (Dwfl_Module *m,
}
c->output << "};\n";
+ mainfile = canonicalize_file_name(mainfile);
+
+ // PR10228: populate the task_finder_vmcb.
+ if (mainfile[0] == '/') // user-space module
+ {
+ // NB: runtime/sym.c
+ c->output << "static struct stap_task_finder_target _stp_vmcb_" << stpmod_idx << "= {\n";
+ c->output << ".pathname = " << lex_cast_qstring (mainfile) << ",\n";
+ c->output << ".mmap_callback = &_stp_tf_mmap_cb,\n";
+ c->output << ".munmap_callback = &_stp_tf_munmap_cb,\n";
+ c->output << "};\n";
+ }
+
c->output << "static struct _stp_module _stp_module_" << stpmod_idx << " = {\n";
c->output << ".name = " << lex_cast_qstring (modname) << ", \n";
-
- mainfile = canonicalize_file_name(mainfile);
c->output << ".path = " << lex_cast_qstring (mainfile) << ",\n";
+ // PR10228: populate the task_finder_vmcb.
+ if (mainfile[0] == '/') // user-space module
+ c->output << ".vmcb = & _stp_vmcb_" << stpmod_idx << ",\n";
+
c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", \n";
c->output << ".eh_frame_addr = 0x" << hex << eh_addr << dec << ", \n";