]> sourceware.org Git - systemtap.git/commitdiff
Fixed BZ661424 by checking for $prev_p first in __scheduler.ctxswitch.kp.
authorDavid Smith <dsmith@redhat.com>
Thu, 27 Jan 2011 20:54:13 +0000 (14:54 -0600)
committerDavid Smith <dsmith@redhat.com>
Thu, 27 Jan 2011 20:54:13 +0000 (14:54 -0600)
* tapset/scheduler.stp: Checks for '$prev_p' before checking for '$prev'
  so that i386 RHEL5 (which has both arguments) works correctly.

tapset/scheduler.stp

index 75e6a670715f4738254ac7f33449780d5e0bf4b8..f25d825fde53c43cd99885442f9a9557b3760002 100644 (file)
@@ -126,15 +126,14 @@ probe __scheduler.ctxswitch.kp =
        kernel.function("context_switch")
 %)
 {
-       if (@defined($prev)) {
-               prev_priority = $prev->prio
-               prev_pid = $prev->tgid
-               prev_tid = $prev->pid
-               prev_task = $prev
-               prev_task_name = task_execname($prev)
-               prevtsk_state = $prev->state
-       }
-       else {
+       /*
+        * Note that we prefer '$prev_p' here because on RHEL5
+        * (2.6.18-238.1.1.el5) the '__switch_to()' function has both
+        * a '$prev_p' and a '$prev' argument.  Since '$prev_p' is of
+        * the correct type (struct task_struct *), we need to look
+        * for it first.
+        */
+       if (@defined($prev_p)) {
                prev_priority = $prev_p->prio
                prev_pid = $prev_p->tgid
                prev_tid = $prev_p->pid
@@ -142,6 +141,14 @@ probe __scheduler.ctxswitch.kp =
                prev_task_name = task_execname($prev_p)
                prevtsk_state = $prev_p->state
        }
+       else {
+               prev_priority = $prev->prio
+               prev_pid = $prev->tgid
+               prev_tid = $prev->pid
+               prev_task = $prev
+               prev_task_name = task_execname($prev)
+               prevtsk_state = $prev->state
+       }
 
        if (@defined($next)) {
                next_priority = $next->prio
This page took 0.058936 seconds and 5 git commands to generate.