diff options
author | David Smith <dsmith@redhat.com> | 2008-06-16 16:41:33 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2008-06-16 16:42:18 -0500 |
commit | 50446916683379f963eaaedb965654d464cd049f (patch) | |
tree | 3b0640751d09f6450c0d4fd6779da1be0a6769c5 | |
parent | f719ec7cc85a79206bbfe2521786fd84a6608bac (diff) | |
download | systemtap-steved-50446916683379f963eaaedb965654d464cd049f.tar.gz systemtap-steved-50446916683379f963eaaedb965654d464cd049f.tar.xz systemtap-steved-50446916683379f963eaaedb965654d464cd049f.zip |
Improved callback handling.
2008-06-16 David Smith <dsmith@redhat.com>
* task_finder.c (stap_start_task_finder): Improved callback
handling.
-rw-r--r-- | runtime/ChangeLog | 5 | ||||
-rw-r--r-- | runtime/task_finder.c | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 3912a4cf..ca7bf082 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,8 @@ +2008-06-16 David Smith <dsmith@redhat.com> + + * task_finder.c (stap_start_task_finder): Improved callback + handling. + 2008-06-10 David Smith <dsmith@redhat.com> * task_finder.c (struct stap_task_finder_target): Added diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 8448f29c..e853cb2a 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -654,19 +654,21 @@ stap_start_task_finder(void) cb_tgt = list_entry(cb_node, struct stap_task_finder_target, callback_list); - if (cb_tgt == NULL || cb_tgt->callback == NULL) + if (cb_tgt == NULL) continue; // Call the callback. Assume that if // the thread is a thread group // leader, it is a process. - rc = cb_tgt->callback(tsk, 1, - (tsk->pid == tsk->tgid), - cb_tgt); - if (rc != 0) { - _stp_error("attach callback for %d failed: %d", - (int)tsk->pid, rc); - goto stf_err; + if (cb_tgt->callback != NULL) { + rc = cb_tgt->callback(tsk, 1, + (tsk->pid == tsk->tgid), + cb_tgt); + if (rc != 0) { + _stp_error("attach callback for %d failed: %d", + (int)tsk->pid, rc); + goto stf_err; + } } // Set up events we need for attached tasks. |