]> sourceware.org Git - systemtap.git/commitdiff
Tweak schedtime.stp example for 2.6.35
authorWenji Huang <wenji.huang@oracle.com>
Tue, 8 Jun 2010 02:20:23 +0000 (10:20 +0800)
committerWenji Huang <wenji.huang@oracle.com>
Tue, 8 Jun 2010 02:20:23 +0000 (10:20 +0800)
$rq is removed from tracepoint in 2.6.35. Guard access using
@defined predicate.

testsuite/systemtap.examples/process/schedtimes.stp

index e964dd585b3c1d16dffe40e8f7808116b968edf9..077ddc9fbd6268439262b344e2dd5865591fcef4 100755 (executable)
@@ -55,7 +55,7 @@ probe kernel.trace("sched_switch") {
       run_time[previous_pid] += (t - previous_timestamp[previous_pid]);
       previous_timestamp[previous_pid] = t;
       if ($prev->state > 0) {
-        if ((get_iowait($rq) - io_wait_count[previous_pid]) > 0)
+        if (@defined($rq) && (get_iowait($rq) - io_wait_count[previous_pid]) > 0)
           io_wait_incremented[previous_pid] = 1;  
         pid_state[previous_pid] = SLEEPING;
       } else if ($prev->state == 0) {
@@ -73,7 +73,8 @@ probe kernel.trace("sched_switch") {
     }
   }
   if (next_pid) {
-    io_wait_count[next_pid] = get_iowait($rq);
+    if (@defined($rq))
+      io_wait_count[next_pid] = get_iowait($rq);
     if (!([next_pid] in pid_state)) {
       //use this state as entry into state machine
       previous_timestamp[next_pid] =  gettimeofday_us();
This page took 0.028147 seconds and 5 git commands to generate.