]> sourceware.org Git - systemtap.git/commitdiff
Fix PR17127 by fixing task_finder2.
authorDavid Smith <dsmith@redhat.com>
Tue, 8 Jul 2014 20:14:38 +0000 (15:14 -0500)
committerDavid Smith <dsmith@redhat.com>
Tue, 8 Jul 2014 20:14:38 +0000 (15:14 -0500)
* runtime/linux/task_finder2.c (stap_task_finder_post_init): Only try to
  interrupt tasks in the TASK_INTERRUPTIBLE state.

runtime/linux/task_finder2.c

index e88543a81039cc12a6fa7d9fb4b61edcca2d64d2..f6dd9a52c3cf962c6e50d47b7613188ad1690d81 100644 (file)
@@ -1801,17 +1801,23 @@ stap_task_finder_post_init(void)
                                                    UTRACE_ATTACH_MATCH_OPS,
                                                    &tgt->ops, tgt);
                        if (engine != NULL && !IS_ERR(engine)) {
-                               /* We found a target task. Stop it. */
-                               int rc = utrace_control(tsk, engine,
-                                                       UTRACE_INTERRUPT);
-                               /* If utrace_control() returns
-                                * EINPROGRESS when we're trying to
-                                * stop/interrupt, that means the task
-                                * hasn't stopped quite yet, but will
-                                * soon.  Ignore this error. */
-                               if (rc != 0 && rc != -EINPROGRESS) {
-                                       _stp_error("utrace_control returned error %d on pid %d",
-                                                  rc, (int)tsk->pid);
+                               /* Only try to interrupt tasks in the
+                                * TASK_INTERRUPTIBLE state. */
+                               if (tsk->state == TASK_INTERRUPTIBLE) {
+                                       /* We found a target task. Stop it. */
+                                       int rc = utrace_control(tsk, engine,
+                                                               UTRACE_INTERRUPT);
+                                       /* If utrace_control() returns
+                                        * EINPROGRESS when we're
+                                        * trying to stop/interrupt,
+                                        * that means the task hasn't
+                                        * stopped quite yet, but will
+                                        * soon.  Ignore this
+                                        * error. */
+                                       if (rc != 0 && rc != -EINPROGRESS) {
+                                               _stp_error("utrace_control returned error %d on pid %d",
+                                                          rc, (int)tsk->pid);
+                                       }
                                }
                                utrace_engine_put(engine);
 
This page took 0.031079 seconds and 5 git commands to generate.