diff options
-rw-r--r-- | kernel/sched_clock.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index 22ed55d1167f..5a2dc7d8fd98 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c | |||
@@ -32,6 +32,15 @@ | |||
32 | #include <linux/ktime.h> | 32 | #include <linux/ktime.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | 34 | ||
35 | /* | ||
36 | * Scheduler clock - returns current time in nanosec units. | ||
37 | * This is default implementation. | ||
38 | * Architectures and sub-architectures can override this. | ||
39 | */ | ||
40 | unsigned long long __attribute__((weak)) sched_clock(void) | ||
41 | { | ||
42 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); | ||
43 | } | ||
35 | 44 | ||
36 | #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 45 | #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK |
37 | 46 | ||
@@ -321,16 +330,6 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event); | |||
321 | 330 | ||
322 | #endif | 331 | #endif |
323 | 332 | ||
324 | /* | ||
325 | * Scheduler clock - returns current time in nanosec units. | ||
326 | * This is default implementation. | ||
327 | * Architectures and sub-architectures can override this. | ||
328 | */ | ||
329 | unsigned long long __attribute__((weak)) sched_clock(void) | ||
330 | { | ||
331 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); | ||
332 | } | ||
333 | |||
334 | unsigned long long cpu_clock(int cpu) | 333 | unsigned long long cpu_clock(int cpu) |
335 | { | 334 | { |
336 | unsigned long long clock; | 335 | unsigned long long clock; |