diff options
author | Christoph Lameter <cl@linux-foundation.org> | 2009-10-07 19:17:45 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-10-12 19:51:49 +0900 |
commit | 9288f99aa52d90a5b82573c4b769c97c55af2f56 (patch) | |
tree | 34d484799f1d779d7244e373be7cd5d7d2e684af /kernel/trace/trace.c | |
parent | 494f6a9e12f5137d355d3ce3f5789ef148b642bc (diff) | |
download | op-kernel-dev-9288f99aa52d90a5b82573c4b769c97c55af2f56.zip op-kernel-dev-9288f99aa52d90a5b82573c4b769c97c55af2f56.tar.gz |
this_cpu: Use this_cpu_xx for ftrace
this_cpu_xx can reduce the instruction count here and also
avoid address arithmetic.
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4506826..8439cdc 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -86,17 +86,17 @@ static int dummy_set_flag(u32 old_flags, u32 bit, int set) */ static int tracing_disabled = 1; -DEFINE_PER_CPU(local_t, ftrace_cpu_disabled); +DEFINE_PER_CPU(int, ftrace_cpu_disabled); static inline void ftrace_disable_cpu(void) { preempt_disable(); - local_inc(&__get_cpu_var(ftrace_cpu_disabled)); + __this_cpu_inc(per_cpu_var(ftrace_cpu_disabled)); } static inline void ftrace_enable_cpu(void) { - local_dec(&__get_cpu_var(ftrace_cpu_disabled)); + __this_cpu_dec(per_cpu_var(ftrace_cpu_disabled)); preempt_enable(); } @@ -1085,7 +1085,7 @@ trace_function(struct trace_array *tr, struct ftrace_entry *entry; /* If we are reading the ring buffer, don't trace */ - if (unlikely(local_read(&__get_cpu_var(ftrace_cpu_disabled)))) + if (unlikely(__this_cpu_read(per_cpu_var(ftrace_cpu_disabled)))) return; event = trace_buffer_lock_reserve(buffer, TRACE_FN, sizeof(*entry), |