]> sourceware.org Git - systemtap.git/commitdiff
Improved callback handling.
authorDavid Smith <dsmith@redhat.com>
Mon, 16 Jun 2008 21:41:33 +0000 (16:41 -0500)
committerDavid Smith <dsmith@redhat.com>
Mon, 16 Jun 2008 21:42:18 +0000 (16:42 -0500)
2008-06-16  David Smith  <dsmith@redhat.com>

* task_finder.c (stap_start_task_finder): Improved callback
handling.

runtime/ChangeLog
runtime/task_finder.c

index 3912a4cfb52c0d32a92d618e692af4bc25ef7b01..ca7bf0820334ae32a5718eca1dade74f3253140d 100644 (file)
@@ -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
index 8448f29c0b2876303bc6dd1dd0b2c369eacdc4b9..e853cb2a485564c3be1eca102fcc88aae90deda6 100644 (file)
@@ -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.
This page took 0.031777 seconds and 5 git commands to generate.