summaryrefslogtreecommitdiff
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorCarsten Emde <C.Emde@osadl.org>2011-07-19 14:03:41 +0100
committerClark Williams <williams@redhat.com>2012-04-10 16:40:02 -0500
commit31416f0f11405b220cd6f63f8b773a9de3a47da5 (patch)
tree34196ae2505f0c189ae64d4fcc3a4542a9c87311 /kernel/hrtimer.c
parentedfc15acc3b2353fb21f674bc00338d06e86f0f3 (diff)
latency-hist.patch
This patch provides a recording mechanism to store data of potential sources of system latencies. The recordings separately determine the latency caused by a delayed timer expiration, by a delayed wakeup of the related user space program and by the sum of both. The histograms can be enabled and reset individually. The data are accessible via the debug filesystem. For details please consult Documentation/trace/histograms.txt. Signed-off-by: Carsten Emde <C.Emde@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index ae34bf51682b..1a3695e32b4b 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -49,6 +49,7 @@
#include <asm/uaccess.h>
#include <trace/events/timer.h>
+#include <trace/events/hist.h>
/*
* The timer bases:
@@ -1236,6 +1237,8 @@ static void __run_hrtimer(struct hrtimer *timer, ktime_t *now)
#ifdef CONFIG_HIGH_RES_TIMERS
+static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer);
+
/*
* High resolution timer interrupt
* Called with interrupts disabled
@@ -1280,6 +1283,14 @@ retry:
timer = container_of(node, struct hrtimer, node);
+ trace_hrtimer_interrupt(raw_smp_processor_id(),
+ ktime_to_ns(ktime_sub(
+ hrtimer_get_expires(timer), basenow)),
+ current,
+ timer->function == hrtimer_wakeup ?
+ container_of(timer, struct hrtimer_sleeper,
+ timer)->task : NULL);
+
/*
* The immediate goal for using the softexpires is
* minimizing wakeups, not running timers at the