diff options
Diffstat (limited to 'kernel/sched_clock.c')
-rw-r--r-- | kernel/sched_clock.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index 8affbfd0cdb0..22ed55d1167f 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c | |||
@@ -330,3 +330,16 @@ unsigned long long __attribute__((weak)) sched_clock(void) | |||
330 | { | 330 | { |
331 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); | 331 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); |
332 | } | 332 | } |
333 | |||
334 | unsigned long long cpu_clock(int cpu) | ||
335 | { | ||
336 | unsigned long long clock; | ||
337 | unsigned long flags; | ||
338 | |||
339 | local_irq_save(flags); | ||
340 | clock = sched_clock_cpu(cpu); | ||
341 | local_irq_restore(flags); | ||
342 | |||
343 | return clock; | ||
344 | } | ||
345 | EXPORT_SYMBOL_GPL(cpu_clock); | ||