diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-09-09 13:39:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-09-15 16:43:31 -0400 |
commit | a42c362980430be74b77ec8f374964f61062379f (patch) | |
tree | f49ca2d6f045d49e4cd659a9f8cedb5824481676 /arch/arm/kernel | |
parent | a67e1ce145785d884b29b17e4d82a6ecd67bb97a (diff) |
ARM: Add irqtime accounting support
Add support for irq time accounting. This commit prepares ARM by adding
the call to enable_sched_clock_irqtime() in sched_clock(). We introduce
a new kernel parameter - irqtime - which takes an integer. -1 for auto,
0 for disabled, and 1 for enabled. Auto mode selects IRQ accounting if
we have a sched_clock() tick rate greater than 1MHz.
Frederic Weisbecker is working on a patch set which moves the
IRQ_TIME_ACCOUNTING into arch/, so that part is not incorporated into
this patch; this facility becomes available on ARM only when both this
patch and Frederic's patches are merged.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/sched_clock.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c index 27d186abbc0..9b8451a4330 100644 --- a/arch/arm/kernel/sched_clock.c +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/jiffies.h> | 10 | #include <linux/jiffies.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/moduleparam.h> | ||
12 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
13 | #include <linux/syscore_ops.h> | 14 | #include <linux/syscore_ops.h> |
14 | #include <linux/timer.h> | 15 | #include <linux/timer.h> |
@@ -25,6 +26,9 @@ struct clock_data { | |||
25 | 26 | ||
26 | static void sched_clock_poll(unsigned long wrap_ticks); | 27 | static void sched_clock_poll(unsigned long wrap_ticks); |
27 | static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); | 28 | static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); |
29 | static int irqtime = -1; | ||
30 | |||
31 | core_param(irqtime, irqtime, int, 0400); | ||
28 | 32 | ||
29 | static struct clock_data cd = { | 33 | static struct clock_data cd = { |
30 | .mult = NSEC_PER_SEC / HZ, | 34 | .mult = NSEC_PER_SEC / HZ, |
@@ -145,6 +149,10 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) | |||
145 | */ | 149 | */ |
146 | cd.epoch_ns = 0; | 150 | cd.epoch_ns = 0; |
147 | 151 | ||
152 | /* Enable IRQ time accounting if we have a fast enough sched_clock */ | ||
153 | if (irqtime > 0 || (irqtime == -1 && rate >= 1000000)) | ||
154 | enable_sched_clock_irqtime(); | ||
155 | |||
148 | pr_debug("Registered %pF as sched_clock source\n", read); | 156 | pr_debug("Registered %pF as sched_clock source\n", read); |
149 | } | 157 | } |
150 | 158 | ||