diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-08-09 22:52:30 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-29 08:10:07 -0400 |
commit | 3f0a525ebf4b8ef041a332bbe4a73aee94bb064b (patch) | |
tree | 18c542b9896f8ac4b8d89db868ba46d38576228d /kernel/itimer.c | |
parent | c6a2a1770245f654f35f60e1458d4356680f9519 (diff) |
itimers: Add tracepoints for itimer
Add tracepoints for all itimer variants: ITIMER_REAL, ITIMER_VIRTUAL
and ITIMER_PROF.
[ tglx: Fixed comments and made the output more readable, parseable
and consistent. Replaced pid_vnr by pid_nr because the hrtimer
callback can happen in any namespace ]
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Anton Blanchard <anton@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Zhaolei <zhaolei@cn.fujitsu.com>
LKML-Reference: <4A7F8B6E.2010109@cn.fujitsu.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/itimer.c')
-rw-r--r-- | kernel/itimer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/itimer.c b/kernel/itimer.c index 8078a32d3b10..b03451ede528 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/time.h> | 12 | #include <linux/time.h> |
13 | #include <linux/posix-timers.h> | 13 | #include <linux/posix-timers.h> |
14 | #include <linux/hrtimer.h> | 14 | #include <linux/hrtimer.h> |
15 | #include <trace/events/timer.h> | ||
15 | 16 | ||
16 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
17 | 18 | ||
@@ -122,6 +123,7 @@ enum hrtimer_restart it_real_fn(struct hrtimer *timer) | |||
122 | struct signal_struct *sig = | 123 | struct signal_struct *sig = |
123 | container_of(timer, struct signal_struct, real_timer); | 124 | container_of(timer, struct signal_struct, real_timer); |
124 | 125 | ||
126 | trace_itimer_expire(ITIMER_REAL, sig->leader_pid, 0); | ||
125 | kill_pid_info(SIGALRM, SEND_SIG_PRIV, sig->leader_pid); | 127 | kill_pid_info(SIGALRM, SEND_SIG_PRIV, sig->leader_pid); |
126 | 128 | ||
127 | return HRTIMER_NORESTART; | 129 | return HRTIMER_NORESTART; |
@@ -166,6 +168,8 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id, | |||
166 | } | 168 | } |
167 | it->expires = nval; | 169 | it->expires = nval; |
168 | it->incr = ninterval; | 170 | it->incr = ninterval; |
171 | trace_itimer_state(clock_id == CPUCLOCK_VIRT ? | ||
172 | ITIMER_VIRTUAL : ITIMER_PROF, value, nval); | ||
169 | 173 | ||
170 | spin_unlock_irq(&tsk->sighand->siglock); | 174 | spin_unlock_irq(&tsk->sighand->siglock); |
171 | 175 | ||
@@ -217,6 +221,7 @@ again: | |||
217 | } else | 221 | } else |
218 | tsk->signal->it_real_incr.tv64 = 0; | 222 | tsk->signal->it_real_incr.tv64 = 0; |
219 | 223 | ||
224 | trace_itimer_state(ITIMER_REAL, value, 0); | ||
220 | spin_unlock_irq(&tsk->sighand->siglock); | 225 | spin_unlock_irq(&tsk->sighand->siglock); |
221 | break; | 226 | break; |
222 | case ITIMER_VIRTUAL: | 227 | case ITIMER_VIRTUAL: |