]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/kernel/sched_clock.c
Merge branches 'atags', 'cache-l2x0', 'clkdev', 'fixes', 'integrator', 'misc', 'opcod...
[karo-tx-linux.git] / arch / arm / kernel / sched_clock.c
index f4515393248dab76b97700f55ef17bba68e6cd0a..e21bac20d90da1558000125586623bdb9cbe328c 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
+#include <linux/moduleparam.h>
 #include <linux/sched.h>
 #include <linux/syscore_ops.h>
 #include <linux/timer.h>
@@ -27,6 +28,9 @@ struct clock_data {
 
 static void sched_clock_poll(unsigned long wrap_ticks);
 static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);
+static int irqtime = -1;
+
+core_param(irqtime, irqtime, int, 0400);
 
 static struct clock_data cd = {
        .mult   = NSEC_PER_SEC / HZ,
@@ -157,6 +161,10 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
         */
        cd.epoch_ns = 0;
 
+       /* Enable IRQ time accounting if we have a fast enough sched_clock */
+       if (irqtime > 0 || (irqtime == -1 && rate >= 1000000))
+               enable_sched_clock_irqtime();
+
        pr_debug("Registered %pF as sched_clock source\n", read);
 }