summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-09-17 18:35:12 -0700
committerJosh Stone <jistone@redhat.com>2009-09-17 18:35:12 -0700
commita9b593471a5d22c820333938d4c4210efd63bd3a (patch)
treecd8b863d70edc5f47bdd6a2e439a4238b014553f /tapsets.cxx
parent5c34cc891d6929ff9cd52b6fe725873c181b094e (diff)
downloadsystemtap-steved-a9b593471a5d22c820333938d4c4210efd63bd3a.tar.gz
systemtap-steved-a9b593471a5d22c820333938d4c4210efd63bd3a.tar.xz
systemtap-steved-a9b593471a5d22c820333938d4c4210efd63bd3a.zip
Simplify the sdt semaphore decrement in utrace
The decrement can happen at the same time that the utrace detach is called. However, I'm concerned that this code isn't correctly handling the case where multiple tasks may register the same probe, so for now I've noted those places. I think task finder may have to help in fixing this... * tapset-utrace.cxx (utrace_derived_probe_group::emit_module_init): As noted in uprobes-land, there's no need to tear down anything. (utrace_derived_probe_group::emit_module_exit): Unify the detach and semaphore decrement, and note a concern about multiple tasks. (utrace_derived_probe_group::emit_module_decls): Note same concern. * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Ditto. (uprobe_derived_probe_group::emit_module_exit): Ditto.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index ed9e1d56..03239ad6 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4623,6 +4623,7 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
//----------
s.op->newline() << "if (sups->sdt_sem_address != 0) {";
s.op->newline(1) << "size_t sdt_semaphore;";
+ // XXX sups could get registered to more than one task!
s.op->newline() << "sups->tsk = tsk;";
s.op->newline() << "__access_process_vm (tsk, relocation + sups->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 0);";
s.op->newline() << "sdt_semaphore += 1;";
@@ -4717,6 +4718,7 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
//----------
s.op->newline() << "if (sups->sdt_sem_address != 0) {";
s.op->newline(1) << "size_t sdt_semaphore;";
+ // XXX sups could get registered to more than one task!
s.op->newline() << "sups->tsk = tsk;";
s.op->newline() << "__access_process_vm (tsk, sups->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 0);";
s.op->newline() << "sdt_semaphore += 1;";
@@ -4850,6 +4852,7 @@ uprobe_derived_probe_group::emit_module_exit (systemtap_session& s)
//----------
s.op->newline() << "if (sups->sdt_sem_address != 0) {";
s.op->newline(1) << "size_t sdt_semaphore;";
+ // XXX sups could get registered to more than one task!
s.op->newline() << "__access_process_vm (sups->tsk, sups->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 0);";
s.op->newline() << "sdt_semaphore -= 1;";
s.op->newline() << "__access_process_vm (sups->tsk, sups->sdt_sem_address, &sdt_semaphore, sizeof (sdt_semaphore), 1);";