diff options
Diffstat (limited to 'include/linux/sched/clock.h')
-rw-r--r-- | include/linux/sched/clock.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/linux/sched/clock.h b/include/linux/sched/clock.h index 867d588314e0..196f0ca351a2 100644 --- a/include/linux/sched/clock.h +++ b/include/linux/sched/clock.h @@ -12,7 +12,16 @@ * * Please use one of the three interfaces below. */ -extern unsigned long long notrace sched_clock(void); +extern u64 sched_clock(void); + +#if defined(CONFIG_ARCH_WANTS_NO_INSTR) || defined(CONFIG_GENERIC_SCHED_CLOCK) +extern u64 sched_clock_noinstr(void); +#else +static __always_inline u64 sched_clock_noinstr(void) +{ + return sched_clock(); +} +#endif /* * See the comment in kernel/sched/clock.c @@ -45,7 +54,12 @@ static inline u64 cpu_clock(int cpu) return sched_clock(); } -static inline u64 local_clock(void) +static __always_inline u64 local_clock_noinstr(void) +{ + return sched_clock_noinstr(); +} + +static __always_inline u64 local_clock(void) { return sched_clock(); } @@ -79,10 +93,9 @@ static inline u64 cpu_clock(int cpu) return sched_clock_cpu(cpu); } -static inline u64 local_clock(void) -{ - return sched_clock_cpu(raw_smp_processor_id()); -} +extern u64 local_clock_noinstr(void); +extern u64 local_clock(void); + #endif #ifdef CONFIG_IRQ_TIME_ACCOUNTING |