Skip to content

Commit

Permalink
perf: Optimize perf_tp_event_match()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 21, 2010
1 parent a94ffaa commit 580d607
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 580d607

Please sign in to comment.