diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 16 | ||||
-rw-r--r-- | include/linux/perf_event.h | 6 | ||||
-rw-r--r-- | include/trace/ftrace.h | 4 |
3 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 126071bc90ab..7024b7d1126f 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -133,7 +133,7 @@ struct ftrace_event_call { | |||
133 | void *data; | 133 | void *data; |
134 | 134 | ||
135 | int perf_refcount; | 135 | int perf_refcount; |
136 | void *perf_data; | 136 | struct hlist_head *perf_events; |
137 | int (*perf_event_enable)(struct ftrace_event_call *); | 137 | int (*perf_event_enable)(struct ftrace_event_call *); |
138 | void (*perf_event_disable)(struct ftrace_event_call *); | 138 | void (*perf_event_disable)(struct ftrace_event_call *); |
139 | }; | 139 | }; |
@@ -192,9 +192,11 @@ struct perf_event; | |||
192 | 192 | ||
193 | DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); | 193 | DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); |
194 | 194 | ||
195 | extern int perf_trace_enable(int event_id, void *data); | 195 | extern int perf_trace_init(struct perf_event *event); |
196 | extern void perf_trace_disable(int event_id); | 196 | extern void perf_trace_destroy(struct perf_event *event); |
197 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 197 | extern int perf_trace_enable(struct perf_event *event); |
198 | extern void perf_trace_disable(struct perf_event *event); | ||
199 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | ||
198 | char *filter_str); | 200 | char *filter_str); |
199 | extern void ftrace_profile_free_filter(struct perf_event *event); | 201 | extern void ftrace_profile_free_filter(struct perf_event *event); |
200 | extern void *perf_trace_buf_prepare(int size, unsigned short type, | 202 | extern void *perf_trace_buf_prepare(int size, unsigned short type, |
@@ -202,11 +204,9 @@ extern void *perf_trace_buf_prepare(int size, unsigned short type, | |||
202 | 204 | ||
203 | static inline void | 205 | static inline void |
204 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 206 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
205 | u64 count, struct pt_regs *regs, void *event) | 207 | u64 count, struct pt_regs *regs, void *head) |
206 | { | 208 | { |
207 | struct trace_entry *entry = raw_data; | 209 | perf_tp_event(addr, count, raw_data, size, regs, head); |
208 | |||
209 | perf_tp_event(entry->type, addr, count, raw_data, size, regs, event); | ||
210 | perf_swevent_put_recursion_context(rctx); | 210 | perf_swevent_put_recursion_context(rctx); |
211 | } | 211 | } |
212 | #endif | 212 | #endif |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index fe50347dc645..7cd7b356447d 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -727,6 +727,7 @@ struct perf_event { | |||
727 | perf_overflow_handler_t overflow_handler; | 727 | perf_overflow_handler_t overflow_handler; |
728 | 728 | ||
729 | #ifdef CONFIG_EVENT_TRACING | 729 | #ifdef CONFIG_EVENT_TRACING |
730 | struct ftrace_event_call *tp_event; | ||
730 | struct event_filter *filter; | 731 | struct event_filter *filter; |
731 | #endif | 732 | #endif |
732 | 733 | ||
@@ -992,8 +993,9 @@ static inline bool perf_paranoid_kernel(void) | |||
992 | } | 993 | } |
993 | 994 | ||
994 | extern void perf_event_init(void); | 995 | extern void perf_event_init(void); |
995 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, | 996 | extern void perf_tp_event(u64 addr, u64 count, void *record, |
996 | int entry_size, struct pt_regs *regs, void *event); | 997 | int entry_size, struct pt_regs *regs, |
998 | struct hlist_head *head); | ||
997 | extern void perf_bp_event(struct perf_event *event, void *data); | 999 | extern void perf_bp_event(struct perf_event *event, void *data); |
998 | 1000 | ||
999 | #ifndef perf_misc_flags | 1001 | #ifndef perf_misc_flags |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index f282885057dd..4eb2148f1321 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -768,6 +768,7 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
768 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 768 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
769 | struct ftrace_raw_##call *entry; \ | 769 | struct ftrace_raw_##call *entry; \ |
770 | u64 __addr = 0, __count = 1; \ | 770 | u64 __addr = 0, __count = 1; \ |
771 | struct hlist_head *head; \ | ||
771 | int __entry_size; \ | 772 | int __entry_size; \ |
772 | int __data_size; \ | 773 | int __data_size; \ |
773 | int rctx; \ | 774 | int rctx; \ |
@@ -790,8 +791,9 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
790 | \ | 791 | \ |
791 | { assign; } \ | 792 | { assign; } \ |
792 | \ | 793 | \ |
794 | head = per_cpu_ptr(event_call->perf_events, smp_processor_id());\ | ||
793 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 795 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
794 | __count, __regs, event_call->perf_data); \ | 796 | __count, __regs, head); \ |
795 | } | 797 | } |
796 | 798 | ||
797 | #undef DEFINE_EVENT | 799 | #undef DEFINE_EVENT |