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) { return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); } + +unsigned long long cpu_clock(int cpu) +{ + unsigned long long clock; + unsigned long flags; + + local_irq_save(flags); + clock = sched_clock_cpu(cpu); + local_irq_restore(flags); + + return clock; +} +EXPORT_SYMBOL_GPL(cpu_clock); |