summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-03-20 14:57:00 +0100
committerMark Wielaard <mjw@redhat.com>2009-03-20 14:57:00 +0100
commitc9a05b1c5a3219dcc6b9f4060b98e76a67f5795b (patch)
tree3fa2f415ff33881a7d3f2144b8103b47404db3ec
parent8813a27cd47e035806cb3d859cfd95d3e0fb76bc (diff)
downloadsystemtap-steved-c9a05b1c5a3219dcc6b9f4060b98e76a67f5795b.tar.gz
systemtap-steved-c9a05b1c5a3219dcc6b9f4060b98e76a67f5795b.tar.xz
systemtap-steved-c9a05b1c5a3219dcc6b9f4060b98e76a67f5795b.zip
Emit vma callbacks for uprobes.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Emit vma callbacks. (uprobe_derived_probe_group::emit_module_init): Activate vma callbacks. * testsuite/systemtap.context/usymbols.exp: Track through uprobes, so as to make sure we have the symbols.
-rw-r--r--tapsets.cxx20
-rw-r--r--testsuite/systemtap.context/usymbols.exp3
2 files changed, 22 insertions, 1 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 8118c838..d6f89563 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -7490,6 +7490,19 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
s.op->newline(-1) << "} stap_uprobes [MAXUPROBES];";
s.op->newline() << "DEFINE_MUTEX(stap_uprobes_lock);"; // protects against concurrent registration/unregistration
+ // Emit vma callbacks.
+ s.op->newline() << "static struct stap_task_finder_target stap_uprobe_vmcbs[] = {";
+ s.op->indent(1);
+ for (unsigned i = 0; i < probes.size(); i++)
+ {
+ uprobe_derived_probe* p = probes[i];
+ if (p->pid != 0)
+ emit_vma_callback_probe_decl (s, "", p->pid);
+ else
+ emit_vma_callback_probe_decl (s, p->module, (int64_t)0);
+ }
+ s.op->newline(-1) << "};";
+
s.op->newline() << "static struct stap_uprobe_spec {";
s.op->newline(1) << "struct stap_task_finder_target finder;";
s.op->newline() << "unsigned long address;";
@@ -7690,6 +7703,13 @@ void
uprobe_derived_probe_group::emit_module_init (systemtap_session& s)
{
if (probes.empty()) return;
+ s.op->newline() << "/* ---- uprobe vma callbacks ---- */";
+ s.op->newline() << "for (i=0; i<ARRAY_SIZE(stap_uprobe_vmcbs); i++) {";
+ s.op->indent(1);
+ s.op->newline() << "struct stap_task_finder_target *r = &stap_uprobe_vmcbs[i];";
+ s.op->newline() << "rc = stap_register_task_finder_target(r);";
+ s.op->newline(-1) << "}";
+
s.op->newline() << "/* ---- user probes ---- */";
s.op->newline() << "for (j=0; j<MAXUPROBES; j++) {";
diff --git a/testsuite/systemtap.context/usymbols.exp b/testsuite/systemtap.context/usymbols.exp
index 6892fc21..65f0a263 100644
--- a/testsuite/systemtap.context/usymbols.exp
+++ b/testsuite/systemtap.context/usymbols.exp
@@ -37,7 +37,8 @@ set testscript {
printf("handler: %%s\n", symbolname(handler));
}
}
- probe process("%s").syscall { printf(""); /* XXX trigger tracker */ }
+ /* track through uprobes, so as to make sure we have the symbols */
+ probe process("%s").function("*") { printf(""); }
}
set output {handler: main_handler