perf_counter: Optimize perf_swcounter_event()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 19 Jun 2009 16:27:26 +0000 (18:27 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 23 Jun 2009 09:42:44 +0000 (11:42 +0200)
commitf29ac756a40d0f1bb07d682ea521e7b666ff06d5
tree6fabe2f38ae10f824e57fdd5b035ba81b75a71a8
parent3d906ef10a539ff336010afab8f6f9c4fe379695
perf_counter: Optimize perf_swcounter_event()

Similar to tracepoints, use an enable variable to reduce
overhead when unused.

Only look for a counter of a particular event type when we know
there is at least one in the system.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/perf_counter.h
kernel/perf_counter.c