diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/ChangeLog | 7 | ||||
-rw-r--r-- | runtime/task_finder.c | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index d19a932f..b77e1a6c 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,10 @@ +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. + 2008-04-15 hunt <hunt@redhat.com> * print.c (_stp_pbuf_full): Delete. 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; + } } } } |