diff options
Diffstat (limited to 'kernel/sched_clock.c')
-rw-r--r-- | kernel/sched_clock.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index ce05271219ab..3c696db59452 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c | |||
@@ -244,3 +244,15 @@ unsigned long long __attribute__((weak)) sched_clock(void) | |||
244 | { | 244 | { |
245 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); | 245 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); |
246 | } | 246 | } |
247 | |||
248 | unsigned long long cpu_clock(int cpu) | ||
249 | { | ||
250 | unsigned long long clock; | ||
251 | unsigned long flags; | ||
252 | |||
253 | raw_local_irq_save(flags); | ||
254 | clock = sched_clock_cpu(cpu); | ||
255 | raw_local_irq_restore(flags); | ||
256 | |||
257 | return clock; | ||
258 | } | ||