diff options
Diffstat (limited to 'kernel/trace/trace_event_profile.c')
| -rw-r--r-- | kernel/trace/trace_event_profile.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c index e0d351b01f5a..d9c60f80aa0d 100644 --- a/kernel/trace/trace_event_profile.c +++ b/kernel/trace/trace_event_profile.c | |||
| @@ -9,31 +9,33 @@ | |||
| 9 | #include "trace.h" | 9 | #include "trace.h" |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | struct perf_trace_buf *perf_trace_buf; | 12 | char *perf_trace_buf; |
| 13 | EXPORT_SYMBOL_GPL(perf_trace_buf); | 13 | EXPORT_SYMBOL_GPL(perf_trace_buf); |
| 14 | 14 | ||
| 15 | struct perf_trace_buf *perf_trace_buf_nmi; | 15 | char *perf_trace_buf_nmi; |
| 16 | EXPORT_SYMBOL_GPL(perf_trace_buf_nmi); | 16 | EXPORT_SYMBOL_GPL(perf_trace_buf_nmi); |
| 17 | 17 | ||
| 18 | typedef typeof(char [FTRACE_MAX_PROFILE_SIZE]) perf_trace_t ; | ||
| 19 | |||
| 18 | /* Count the events in use (per event id, not per instance) */ | 20 | /* Count the events in use (per event id, not per instance) */ |
| 19 | static int total_profile_count; | 21 | static int total_profile_count; |
| 20 | 22 | ||
| 21 | static int ftrace_profile_enable_event(struct ftrace_event_call *event) | 23 | static int ftrace_profile_enable_event(struct ftrace_event_call *event) |
| 22 | { | 24 | { |
| 23 | struct perf_trace_buf *buf; | 25 | char *buf; |
| 24 | int ret = -ENOMEM; | 26 | int ret = -ENOMEM; |
| 25 | 27 | ||
| 26 | if (atomic_inc_return(&event->profile_count)) | 28 | if (atomic_inc_return(&event->profile_count)) |
| 27 | return 0; | 29 | return 0; |
| 28 | 30 | ||
| 29 | if (!total_profile_count) { | 31 | if (!total_profile_count) { |
| 30 | buf = alloc_percpu(struct perf_trace_buf); | 32 | buf = (char *)alloc_percpu(perf_trace_t); |
| 31 | if (!buf) | 33 | if (!buf) |
| 32 | goto fail_buf; | 34 | goto fail_buf; |
| 33 | 35 | ||
| 34 | rcu_assign_pointer(perf_trace_buf, buf); | 36 | rcu_assign_pointer(perf_trace_buf, buf); |
| 35 | 37 | ||
| 36 | buf = alloc_percpu(struct perf_trace_buf); | 38 | buf = (char *)alloc_percpu(perf_trace_t); |
| 37 | if (!buf) | 39 | if (!buf) |
| 38 | goto fail_buf_nmi; | 40 | goto fail_buf_nmi; |
| 39 | 41 | ||
| @@ -79,7 +81,7 @@ int ftrace_profile_enable(int event_id) | |||
| 79 | 81 | ||
| 80 | static void ftrace_profile_disable_event(struct ftrace_event_call *event) | 82 | static void ftrace_profile_disable_event(struct ftrace_event_call *event) |
| 81 | { | 83 | { |
| 82 | struct perf_trace_buf *buf, *nmi_buf; | 84 | char *buf, *nmi_buf; |
| 83 | 85 | ||
| 84 | if (!atomic_add_negative(-1, &event->profile_count)) | 86 | if (!atomic_add_negative(-1, &event->profile_count)) |
| 85 | return; | 87 | return; |
