From 935447c84ba1f04ca3468565a2d74b071a95d77b Mon Sep 17 00:00:00 2001 From: David Smith Date: Tue, 15 Apr 2008 15:58:23 -0500 Subject: 2008-04-15 David Smith * session.h (struct systemtap_session): Added utrace_derived_probe group and task_finder_derived_probe_group members. * elaborate.cxx (systemtap_session::systemtap_session): Added initialization of utrace_derived_probes and task_finder_derived_probes. * tapsets.cxx (struct task_finder_derived_probe_group): New derived_probe_group to handle task_finder framework. (struct utrace_derived_probe_group): New derived_probe_group to handle utrace probes. 2008-04-15 David Smith PR 5961 (partial) * task_finder.c (stap_start_task_finder): When an interesting thread is found that is already running, make sure to set up thread death notification. --- runtime/task_finder.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'runtime/task_finder.c') diff --git a/runtime/task_finder.c b/runtime/task_finder.c index d2e57a6b..dabcdafd 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -394,6 +394,25 @@ stap_start_task_finder(void) (int)tsk->pid, rc); break; } + + // Set up thread death notification. + memset(&cb_tgt->ops, 0, sizeof(cb_tgt->ops)); + cb_tgt->ops.report_death + = &__stp_utrace_task_finder_death; + + engine = utrace_attach(tsk, + UTRACE_ATTACH_CREATE, + &cb_tgt->ops, cb_tgt); + if (IS_ERR(engine)) { + _stp_error("attach to %d failed: %ld", + (int)tsk->pid, + PTR_ERR(engine)); + } + else { + utrace_set_flags(tsk, engine, + __STP_UTRACE_ATTACHED_TASK_EVENTS); + cb_tgt->engine_attached = 1; + } } } } -- cgit