diff options
Diffstat (limited to 'arch/arm/kernel/sched_clock.c')
-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 f4515393248d..e21bac20d90d 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> |
@@ -27,6 +28,9 @@ struct clock_data { | |||
27 | 28 | ||
28 | static void sched_clock_poll(unsigned long wrap_ticks); | 29 | static void sched_clock_poll(unsigned long wrap_ticks); |
29 | static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); | 30 | static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); |
31 | static int irqtime = -1; | ||
32 | |||
33 | core_param(irqtime, irqtime, int, 0400); | ||
30 | 34 | ||
31 | static struct clock_data cd = { | 35 | static struct clock_data cd = { |
32 | .mult = NSEC_PER_SEC / HZ, | 36 | .mult = NSEC_PER_SEC / HZ, |
@@ -157,6 +161,10 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) | |||
157 | */ | 161 | */ |
158 | cd.epoch_ns = 0; | 162 | cd.epoch_ns = 0; |
159 | 163 | ||
164 | /* Enable IRQ time accounting if we have a fast enough sched_clock */ | ||
165 | if (irqtime > 0 || (irqtime == -1 && rate >= 1000000)) | ||
166 | enable_sched_clock_irqtime(); | ||
167 | |||
160 | pr_debug("Registered %pF as sched_clock source\n", read); | 168 | pr_debug("Registered %pF as sched_clock source\n", read); |
161 | } | 169 | } |
162 | 170 | ||