From: Peter Zijlstra Date: Thu, 20 May 2010 18:54:31 +0000 (+0200) Subject: perf: Optimize perf_tp_event_match() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=580d607cd666dfabfc1c7b0fb08c8ac690c7c87f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker Cc: Paul Mackerras Cc: Mike Galbraith Cc: Steven Rostedt LKML-Reference: <20100521090710.904944001@chello.nl> Signed-off-by: Ingo Molnar --- 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, struct perf_sample_data *data, struct pt_regs *regs) { - if (perf_exclude_event(event, regs)) + /* + * All tracepoints are from kernel-space. + */ + if (event->attr.exclude_kernel) return 0; if (!perf_tp_filter_match(event, data))