diff options
-rw-r--r-- | include/linux/ftrace_event.h | 4 | ||||
-rw-r--r-- | kernel/trace/trace_event_perf.c | 15 | ||||
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 02b8b24f8f51..5f8ad7bec636 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -191,8 +191,8 @@ struct ftrace_event_call { | |||
191 | unsigned int flags; | 191 | unsigned int flags; |
192 | 192 | ||
193 | #ifdef CONFIG_PERF_EVENTS | 193 | #ifdef CONFIG_PERF_EVENTS |
194 | int perf_refcount; | 194 | int perf_refcount; |
195 | struct hlist_head *perf_events; | 195 | struct hlist_head __percpu *perf_events; |
196 | #endif | 196 | #endif |
197 | }; | 197 | }; |
198 | 198 | ||
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index db2eae2efcf2..92f5477a006a 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/kprobes.h> | 9 | #include <linux/kprobes.h> |
10 | #include "trace.h" | 10 | #include "trace.h" |
11 | 11 | ||
12 | static char *perf_trace_buf[PERF_NR_CONTEXTS]; | 12 | static char __percpu *perf_trace_buf[PERF_NR_CONTEXTS]; |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * Force it to be aligned to unsigned long to avoid misaligned accesses | 15 | * Force it to be aligned to unsigned long to avoid misaligned accesses |
@@ -24,7 +24,7 @@ static int total_ref_count; | |||
24 | static int perf_trace_event_init(struct ftrace_event_call *tp_event, | 24 | static int perf_trace_event_init(struct ftrace_event_call *tp_event, |
25 | struct perf_event *p_event) | 25 | struct perf_event *p_event) |
26 | { | 26 | { |
27 | struct hlist_head *list; | 27 | struct hlist_head __percpu *list; |
28 | int ret = -ENOMEM; | 28 | int ret = -ENOMEM; |
29 | int cpu; | 29 | int cpu; |
30 | 30 | ||
@@ -42,11 +42,11 @@ static int perf_trace_event_init(struct ftrace_event_call *tp_event, | |||
42 | tp_event->perf_events = list; | 42 | tp_event->perf_events = list; |
43 | 43 | ||
44 | if (!total_ref_count) { | 44 | if (!total_ref_count) { |
45 | char *buf; | 45 | char __percpu *buf; |
46 | int i; | 46 | int i; |
47 | 47 | ||
48 | for (i = 0; i < PERF_NR_CONTEXTS; i++) { | 48 | for (i = 0; i < PERF_NR_CONTEXTS; i++) { |
49 | buf = (char *)alloc_percpu(perf_trace_t); | 49 | buf = (char __percpu *)alloc_percpu(perf_trace_t); |
50 | if (!buf) | 50 | if (!buf) |
51 | goto fail; | 51 | goto fail; |
52 | 52 | ||
@@ -102,13 +102,14 @@ int perf_trace_init(struct perf_event *p_event) | |||
102 | int perf_trace_enable(struct perf_event *p_event) | 102 | int perf_trace_enable(struct perf_event *p_event) |
103 | { | 103 | { |
104 | struct ftrace_event_call *tp_event = p_event->tp_event; | 104 | struct ftrace_event_call *tp_event = p_event->tp_event; |
105 | struct hlist_head __percpu *pcpu_list; | ||
105 | struct hlist_head *list; | 106 | struct hlist_head *list; |
106 | 107 | ||
107 | list = tp_event->perf_events; | 108 | pcpu_list = tp_event->perf_events; |
108 | if (WARN_ON_ONCE(!list)) | 109 | if (WARN_ON_ONCE(!pcpu_list)) |
109 | return -EINVAL; | 110 | return -EINVAL; |
110 | 111 | ||
111 | list = this_cpu_ptr(list); | 112 | list = this_cpu_ptr(pcpu_list); |
112 | hlist_add_head_rcu(&p_event->hlist_entry, list); | 113 | hlist_add_head_rcu(&p_event->hlist_entry, list); |
113 | 114 | ||
114 | return 0; | 115 | return 0; |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 6bff23625781..fcb5a542cd21 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -23,7 +23,7 @@ struct fgraph_cpu_data { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct fgraph_data { | 25 | struct fgraph_data { |
26 | struct fgraph_cpu_data *cpu_data; | 26 | struct fgraph_cpu_data __percpu *cpu_data; |
27 | 27 | ||
28 | /* Place to preserve last processed entry. */ | 28 | /* Place to preserve last processed entry. */ |
29 | struct ftrace_graph_ent_entry ent; | 29 | struct ftrace_graph_ent_entry ent; |