diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-05-19 08:02:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-21 05:37:56 -0400 |
commit | 1c024eca51fdc965290acf342ae16a476c2189d0 (patch) | |
tree | 28dc160cc70a20eeb8b8825d6d52ea88a6188413 /include/linux/ftrace_event.h | |
parent | b7e2ecef92d2e7785e6d76b41e5ba8bcbc45259d (diff) |
perf, trace: Optimize tracepoints by using per-tracepoint-per-cpu hlist to track events
Avoid the swevent hash-table by using per-tracepoint
hlists.
Also, avoid conditionals on the fast path by ordering
with probe unregister so that we should never get on
the callback path without the data being there.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100521090710.473188012@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 16 |
1 files changed, 8 insertions, 8 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 |