Skip to content

Commit

Permalink
tracing: Replace __get_cpu_var uses with this_cpu_ptr
Browse files Browse the repository at this point in the history
Replace uses of &__get_cpu_var for address calculation with this_cpu_ptr.

Link: http://lkml.kernel.org/p/alpine.DEB.2.10.1404291415560.18364@gentwo.org

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Christoph Lameter authored and Steven Rostedt committed May 6, 2014
1 parent 3415c28 commit bdffd89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/linux/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static inline void reset_current_kprobe(void)

static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
{
return (&__get_cpu_var(kprobe_ctlblk));
return this_cpu_ptr(&kprobe_ctlblk);
}

int register_kprobe(struct kprobe *p);
Expand Down
4 changes: 2 additions & 2 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip,

local_irq_save(flags);

stat = &__get_cpu_var(ftrace_profile_stats);
stat = this_cpu_ptr(&ftrace_profile_stats);
if (!stat->hash || !ftrace_profile_enabled)
goto out;

Expand Down Expand Up @@ -853,7 +853,7 @@ static void profile_graph_return(struct ftrace_graph_ret *trace)
unsigned long flags;

local_irq_save(flags);
stat = &__get_cpu_var(ftrace_profile_stats);
stat = this_cpu_ptr(&ftrace_profile_stats);
if (!stat->hash || !ftrace_profile_enabled)
goto out;

Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
*/
barrier();
if (use_stack == 1) {
trace.entries = &__get_cpu_var(ftrace_stack).calls[0];
trace.entries = this_cpu_ptr(ftrace_stack.calls);
trace.max_entries = FTRACE_STACK_MAX_ENTRIES;

if (regs)
Expand Down

0 comments on commit bdffd89

Please sign in to comment.