aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
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 /kernel/perf_event.c
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 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a4fa381db3c2..17ac47f4bce6 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4468,8 +4468,9 @@ static int swevent_hlist_get(struct perf_event *event)
4468#ifdef CONFIG_EVENT_TRACING 4468#ifdef CONFIG_EVENT_TRACING
4469 4469
4470void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 4470void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4471 int entry_size, struct pt_regs *regs) 4471 int entry_size, struct pt_regs *regs, void *event)
4472{ 4472{
4473 const int type = PERF_TYPE_TRACEPOINT;
4473 struct perf_sample_data data; 4474 struct perf_sample_data data;
4474 struct perf_raw_record raw = { 4475 struct perf_raw_record raw = {
4475 .size = entry_size, 4476 .size = entry_size,
@@ -4479,9 +4480,13 @@ void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4479 perf_sample_data_init(&data, addr); 4480 perf_sample_data_init(&data, addr);
4480 data.raw = &raw; 4481 data.raw = &raw;
4481 4482
4482 /* Trace events already protected against recursion */ 4483 if (!event) {
4483 do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, 4484 do_perf_sw_event(type, event_id, count, 1, &data, regs);
4484 &data, regs); 4485 return;
4486 }
4487
4488 if (perf_swevent_match(event, type, event_id, &data, regs))
4489 perf_swevent_add(event, count, 1, &data, regs);
4485} 4490}
4486EXPORT_SYMBOL_GPL(perf_tp_event); 4491EXPORT_SYMBOL_GPL(perf_tp_event);
4487 4492
@@ -4514,7 +4519,7 @@ static const struct pmu *tp_perf_event_init(struct perf_event *event)
4514 !capable(CAP_SYS_ADMIN)) 4519 !capable(CAP_SYS_ADMIN))
4515 return ERR_PTR(-EPERM); 4520 return ERR_PTR(-EPERM);
4516 4521
4517 if (perf_trace_enable(event->attr.config)) 4522 if (perf_trace_enable(event->attr.config, event))
4518 return NULL; 4523 return NULL;
4519 4524
4520 event->destroy = tp_perf_event_destroy; 4525 event->destroy = tp_perf_event_destroy;