aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_clock.c')
-rw-r--r--kernel/trace/trace_clock.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
index 84a3a7ba072a..685a67d55db0 100644
--- a/kernel/trace/trace_clock.c
+++ b/kernel/trace/trace_clock.c
@@ -13,6 +13,7 @@
13 * Tracer plugins will chose a default from these clocks. 13 * Tracer plugins will chose a default from these clocks.
14 */ 14 */
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/irqflags.h>
16#include <linux/hardirq.h> 17#include <linux/hardirq.h>
17#include <linux/module.h> 18#include <linux/module.h>
18#include <linux/percpu.h> 19#include <linux/percpu.h>
@@ -31,16 +32,15 @@
31u64 notrace trace_clock_local(void) 32u64 notrace trace_clock_local(void)
32{ 33{
33 u64 clock; 34 u64 clock;
34 int resched;
35 35
36 /* 36 /*
37 * sched_clock() is an architecture implemented, fast, scalable, 37 * sched_clock() is an architecture implemented, fast, scalable,
38 * lockless clock. It is not guaranteed to be coherent across 38 * lockless clock. It is not guaranteed to be coherent across
39 * CPUs, nor across CPU idle events. 39 * CPUs, nor across CPU idle events.
40 */ 40 */
41 resched = ftrace_preempt_disable(); 41 preempt_disable_notrace();
42 clock = sched_clock(); 42 clock = sched_clock();
43 ftrace_preempt_enable(resched); 43 preempt_enable_notrace();
44 44
45 return clock; 45 return clock;
46} 46}
@@ -55,7 +55,7 @@ u64 notrace trace_clock_local(void)
55 */ 55 */
56u64 notrace trace_clock(void) 56u64 notrace trace_clock(void)
57{ 57{
58 return cpu_clock(raw_smp_processor_id()); 58 return local_clock();
59} 59}
60 60
61 61
@@ -83,7 +83,7 @@ u64 notrace trace_clock_global(void)
83 int this_cpu; 83 int this_cpu;
84 u64 now; 84 u64 now;
85 85
86 raw_local_irq_save(flags); 86 local_irq_save(flags);
87 87
88 this_cpu = raw_smp_processor_id(); 88 this_cpu = raw_smp_processor_id();
89 now = cpu_clock(this_cpu); 89 now = cpu_clock(this_cpu);
@@ -109,7 +109,7 @@ u64 notrace trace_clock_global(void)
109 arch_spin_unlock(&trace_clock_struct.lock); 109 arch_spin_unlock(&trace_clock_struct.lock);
110 110
111 out: 111 out:
112 raw_local_irq_restore(flags); 112 local_irq_restore(flags);
113 113
114 return now; 114 return now;
115} 115}