Skip to content

Commit

Permalink
perf, tracing: add missing __percpu markups
Browse files Browse the repository at this point in the history
ftrace_event_call->perf_events, perf_trace_buf,
fgraph_data->cpu_data and some local variables are percpu pointers
missing __percpu markups. Add them.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <1281498479-28551-1-git-send-email-namhyung@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Namhyung Kim authored and Frederic Weisbecker committed Aug 18, 2010
1 parent 7ae07ea commit 6016ee1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ struct ftrace_event_call {
unsigned int flags;

#ifdef CONFIG_PERF_EVENTS
int perf_refcount;
struct hlist_head *perf_events;
int perf_refcount;
struct hlist_head __percpu *perf_events;
#endif
};

Expand Down
15 changes: 8 additions & 7 deletions kernel/trace/trace_event_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <linux/kprobes.h>
#include "trace.h"

static char *perf_trace_buf[PERF_NR_CONTEXTS];
static char __percpu *perf_trace_buf[PERF_NR_CONTEXTS];

/*
* Force it to be aligned to unsigned long to avoid misaligned accesses
Expand All @@ -24,7 +24,7 @@ static int total_ref_count;
static int perf_trace_event_init(struct ftrace_event_call *tp_event,
struct perf_event *p_event)
{
struct hlist_head *list;
struct hlist_head __percpu *list;
int ret = -ENOMEM;
int cpu;

Expand All @@ -42,11 +42,11 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event,
tp_event->perf_events = list;

if (!total_ref_count) {
char *buf;
char __percpu *buf;
int i;

for (i = 0; i < PERF_NR_CONTEXTS; i++) {
buf = (char *)alloc_percpu(perf_trace_t);
buf = (char __percpu *)alloc_percpu(perf_trace_t);
if (!buf)
goto fail;

Expand Down Expand Up @@ -102,13 +102,14 @@ int perf_trace_init(struct perf_event *p_event)
int perf_trace_enable(struct perf_event *p_event)
{
struct ftrace_event_call *tp_event = p_event->tp_event;
struct hlist_head __percpu *pcpu_list;
struct hlist_head *list;

list = tp_event->perf_events;
if (WARN_ON_ONCE(!list))
pcpu_list = tp_event->perf_events;
if (WARN_ON_ONCE(!pcpu_list))
return -EINVAL;

list = this_cpu_ptr(list);
list = this_cpu_ptr(pcpu_list);
hlist_add_head_rcu(&p_event->hlist_entry, list);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct fgraph_cpu_data {
};

struct fgraph_data {
struct fgraph_cpu_data *cpu_data;
struct fgraph_cpu_data __percpu *cpu_data;

/* Place to preserve last processed entry. */
struct ftrace_graph_ent_entry ent;
Expand Down

0 comments on commit 6016ee1

Please sign in to comment.