usbnet: ratelimit warning messages invoked from callback handler
[safe/jmp/linux-2.6] / kernel / trace / trace_clock.c
index 2d4953f..b588fd8 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/percpu.h>
 #include <linux/sched.h>
 #include <linux/ktime.h>
+#include <linux/trace_clock.h>
 
 /*
  * trace_clock_local(): the simplest and least coherent tracing clock.
  */
 u64 notrace trace_clock_local(void)
 {
+       unsigned long flags;
+       u64 clock;
+
        /*
         * sched_clock() is an architecture implemented, fast, scalable,
         * lockless clock. It is not guaranteed to be coherent across
         * CPUs, nor across CPU idle events.
         */
-       return sched_clock();
+       raw_local_irq_save(flags);
+       clock = sched_clock();
+       raw_local_irq_restore(flags);
+
+       return clock;
 }
 
 /*