aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-05-20 14:54:31 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-21 05:38:00 -0400
commit580d607cd666dfabfc1c7b0fb08c8ac690c7c87f (patch)
tree6d7c87d60b12adbacd4dbcb8c784975bc1203228 /kernel/perf_event.c
parenta94ffaaf55552769af328eaca9260fe6291c66c7 (diff)
perf: Optimize perf_tp_event_match()
Since we know tracepoints come from kernel context, avoid conditionals that try and establish that very fact. 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.904944001@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index d25c864cadbf..e099650cd249 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4496,7 +4496,10 @@ static int perf_tp_event_match(struct perf_event *event,
4496 struct perf_sample_data *data, 4496 struct perf_sample_data *data,
4497 struct pt_regs *regs) 4497 struct pt_regs *regs)
4498{ 4498{
4499 if (perf_exclude_event(event, regs)) 4499 /*
4500 * All tracepoints are from kernel-space.
4501 */
4502 if (event->attr.exclude_kernel)
4500 return 0; 4503 return 0;
4501 4504
4502 if (!perf_tp_filter_match(event, data)) 4505 if (!perf_tp_filter_match(event, data))