diff options
author | David Smith <dsmith@redhat.com> | 2008-04-15 15:58:23 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2008-04-16 08:14:02 -0500 |
commit | 935447c84ba1f04ca3468565a2d74b071a95d77b (patch) | |
tree | 5b43fec11c3c2fa2ea7c4cd4a6cd5ccf459a2899 /runtime/task_finder.c | |
parent | 10202d146ce3d8cbd427a3724b6adc04ef43616e (diff) | |
download | systemtap-steved-935447c84ba1f04ca3468565a2d74b071a95d77b.tar.gz systemtap-steved-935447c84ba1f04ca3468565a2d74b071a95d77b.tar.xz systemtap-steved-935447c84ba1f04ca3468565a2d74b071a95d77b.zip |
2008-04-15 David Smith <dsmith@redhat.com>
* 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 <dsmith@redhat.com>
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.
Diffstat (limited to 'runtime/task_finder.c')
-rw-r--r-- | runtime/task_finder.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; + } } } } |