aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-05-18 12:08:32 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-18 12:35:46 -0400
commit4f41c013f553957765902fb01475972f0af3e8e7 (patch)
treeddaa54947cc990094a4b270f2f8b3d6da195044f /include
parentef4f30f54e265c2f6f9ac9eda4db158a4e16050b (diff)
perf/ftrace: Optimize perf/tracepoint interaction for single events
When we've got but a single event per tracepoint there is no reason to try and multiplex it so don't. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Tested-by: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ftrace_event.h8
-rw-r--r--include/linux/perf_event.h2
-rw-r--r--include/trace/ftrace.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c0f4b364c71..c8091001b94 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -132,6 +132,7 @@ struct ftrace_event_call {
132 void *data; 132 void *data;
133 133
134 int perf_refcount; 134 int perf_refcount;
135 void *perf_data;
135 int (*perf_event_enable)(struct ftrace_event_call *); 136 int (*perf_event_enable)(struct ftrace_event_call *);
136 void (*perf_event_disable)(struct ftrace_event_call *); 137 void (*perf_event_disable)(struct ftrace_event_call *);
137}; 138};
@@ -190,7 +191,7 @@ struct perf_event;
190 191
191DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); 192DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
192 193
193extern int perf_trace_enable(int event_id); 194extern int perf_trace_enable(int event_id, void *data);
194extern void perf_trace_disable(int event_id); 195extern void perf_trace_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 196extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str); 197 char *filter_str);
@@ -201,11 +202,12 @@ perf_trace_buf_prepare(int size, unsigned short type, int *rctxp,
201 202
202static inline void 203static inline void
203perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 204perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
204 u64 count, unsigned long irq_flags, struct pt_regs *regs) 205 u64 count, unsigned long irq_flags, struct pt_regs *regs,
206 void *event)
205{ 207{
206 struct trace_entry *entry = raw_data; 208 struct trace_entry *entry = raw_data;
207 209
208 perf_tp_event(entry->type, addr, count, raw_data, size, regs); 210 perf_tp_event(entry->type, addr, count, raw_data, size, regs, event);
209 perf_swevent_put_recursion_context(rctx); 211 perf_swevent_put_recursion_context(rctx);
210 local_irq_restore(irq_flags); 212 local_irq_restore(irq_flags);
211} 213}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3fd5c82e0e1..0b521fc8f5b 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -994,7 +994,7 @@ static inline bool perf_paranoid_kernel(void)
994 994
995extern void perf_event_init(void); 995extern void perf_event_init(void);
996extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 996extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
997 int entry_size, struct pt_regs *regs); 997 int entry_size, struct pt_regs *regs, void *event);
998extern void perf_bp_event(struct perf_event *event, void *data); 998extern void perf_bp_event(struct perf_event *event, void *data);
999 999
1000#ifndef perf_misc_flags 1000#ifndef perf_misc_flags
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 882c64832ff..0a29df09292 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -785,7 +785,8 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \
785 { assign; } \ 785 { assign; } \
786 \ 786 \
787 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 787 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
788 __count, irq_flags, __regs); \ 788 __count, irq_flags, __regs, \
789 event_call->perf_data); \
789} 790}
790 791
791#undef DEFINE_EVENT 792#undef DEFINE_EVENT