[SCSI] scsi: Added support for adapter and firmware reset
[linux-2.6.git] / kernel / itimer.c
index 8078a32..d802883 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/time.h>
 #include <linux/posix-timers.h>
 #include <linux/hrtimer.h>
+#include <trace/events/timer.h>
 
 #include <asm/uaccess.h>
 
@@ -122,6 +123,7 @@ enum hrtimer_restart it_real_fn(struct hrtimer *timer)
        struct signal_struct *sig =
                container_of(timer, struct signal_struct, real_timer);
 
+       trace_itimer_expire(ITIMER_REAL, sig->leader_pid, 0);
        kill_pid_info(SIGALRM, SEND_SIG_PRIV, sig->leader_pid);
 
        return HRTIMER_NORESTART;
@@ -144,6 +146,7 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
 {
        cputime_t cval, nval, cinterval, ninterval;
        s64 ns_ninterval, ns_nval;
+       u32 error, incr_error;
        struct cpu_itimer *it = &tsk->signal->it[clock_id];
 
        nval = timeval_to_cputime(&value->it_value);
@@ -151,8 +154,8 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
        ninterval = timeval_to_cputime(&value->it_interval);
        ns_ninterval = timeval_to_ns(&value->it_interval);
 
-       it->incr_error = cputime_sub_ns(ninterval, ns_ninterval);
-       it->error = cputime_sub_ns(nval, ns_nval);
+       error = cputime_sub_ns(nval, ns_nval);
+       incr_error = cputime_sub_ns(ninterval, ns_ninterval);
 
        spin_lock_irq(&tsk->sighand->siglock);
 
@@ -166,6 +169,10 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
        }
        it->expires = nval;
        it->incr = ninterval;
+       it->error = error;
+       it->incr_error = incr_error;
+       trace_itimer_state(clock_id == CPUCLOCK_VIRT ?
+                          ITIMER_VIRTUAL : ITIMER_PROF, value, nval);
 
        spin_unlock_irq(&tsk->sighand->siglock);
 
@@ -217,6 +224,7 @@ again:
                } else
                        tsk->signal->it_real_incr.tv64 = 0;
 
+               trace_itimer_state(ITIMER_REAL, value, 0);
                spin_unlock_irq(&tsk->sighand->siglock);
                break;
        case ITIMER_VIRTUAL: