Merge tag 's3c24xx-pinctrl-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene...
[firefly-linux-kernel-4.4.55.git] / kernel / trace / trace_clock.c
index aa8f5f48dae610566f4b777119e1b3735b43170f..26dc348332b798eeb43a77cf2d89357512d9e8c0 100644 (file)
@@ -57,6 +57,16 @@ u64 notrace trace_clock(void)
        return local_clock();
 }
 
+/*
+ * trace_jiffy_clock(): Simply use jiffies as a clock counter.
+ */
+u64 notrace trace_clock_jiffies(void)
+{
+       u64 jiffy = jiffies - INITIAL_JIFFIES;
+
+       /* Return nsecs */
+       return (u64)jiffies_to_usecs(jiffy) * 1000ULL;
+}
 
 /*
  * trace_clock_global(): special globally coherent trace clock