summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-05-21 12:59:56 -0500
committerDavid Smith <dsmith@redhat.com>2008-05-28 12:07:50 -0500
commitcfac4b1fc487712e0ce5b11630b74bdaea5f8966 (patch)
tree4db0936d4d1c7f8b4433e4053f6ee86d5c9a04a4 /tapsets.cxx
parent9319dbe79bfc893bc7f7e35938151a01bb8a2d32 (diff)
downloadsystemtap-steved-cfac4b1fc487712e0ce5b11630b74bdaea5f8966.tar.gz
systemtap-steved-cfac4b1fc487712e0ce5b11630b74bdaea5f8966.tar.xz
systemtap-steved-cfac4b1fc487712e0ce5b11630b74bdaea5f8966.zip
Minor improvement to multi-threaded support.
2008-05-21 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Added new 'event_flag' parameter to task_finder callback. Only calls probe handlers if we received the correct event. 2008-05-21 David Smith <dsmith@redhat.com> * task_finder.c (__stp_utrace_attach_match_filename): Added event_flag parameter of event to pass to callback. (__stp_utrace_task_finder_target_death): Ditto. (__stp_utrace_task_finder_report_clone): Calls __stp_utrace_attach_match_filename() with new argument. (__stp_utrace_task_finder_report_exec): Ditto. (stap_start_task_finder): Calls callback with an invalid event_flag since this callback call isn't related to an event.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 8203c568..c1bc88b0 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5487,7 +5487,7 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
// Output task finder callback routine that gets called for all
// utrace probe types.
- s.op->newline() << "static int _stp_utrace_probe_cb(struct task_struct *tsk, int register_p, struct stap_task_finder_target *tgt) {";
+ s.op->newline() << "static int _stp_utrace_probe_cb(struct task_struct *tsk, int register_p, unsigned long event_flag, struct stap_task_finder_target *tgt) {";
s.op->indent(1);
s.op->newline() << "int rc = 0;";
s.op->newline() << "struct stap_utrace_probe *p = container_of(tgt, struct stap_utrace_probe, tgt);";
@@ -5508,7 +5508,10 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
{
s.op->newline() << "case UTRACE_EVENT(EXEC):";
s.op->indent(1);
+ s.op->newline() << "if (event_flag == UTRACE_EVENT(EXEC)) {";
+ s.op->indent(1);
s.op->newline() << "stap_utrace_probe_handler(tsk, p);";
+ s.op->newline(-1) << "}";
s.op->newline() << "break;";
s.op->indent(-1);
}
@@ -5561,7 +5564,7 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
// For death probes, go ahead and call the probe directly.
if (flags_seen[UDPF_DEATH])
{
- s.op->newline() << "if (p->flags == UTRACE_EVENT(DEATH)) {";
+ s.op->newline() << "if (p->flags == UTRACE_EVENT(DEATH) && event_flag == UTRACE_EVENT(DEATH)) {";
s.op->indent(1);
s.op->newline() << "stap_utrace_probe_handler(tsk, p);";
s.op->newline(-1) << "}";