perf, x86: Fix double enable calls
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Sat, 6 Mar 2010 12:24:58 +0000 (13:24 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 10 Mar 2010 12:22:35 +0000 (13:22 +0100)
commitf3d46b2e6fa57547f9884330798792afc83f4b04
tree1c695a1706daf6ef67c940c20a558fb7b9acbfb7
parent19925ce778f9fc371b9607625de3bff04c60121e
perf, x86: Fix double enable calls

hw_perf_enable() would enable already enabled events.

This causes problems with code that assumes that ->enable/->disable calls
are balanced (like the LBR code does).

What happens is that events that were already running and left in place
would get enabled again.

Avoid this by only enabling new events that match their previous
assignment.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: paulus@samba.org
Cc: eranian@google.com
Cc: robert.richter@amd.com
Cc: fweisbec@gmail.com
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_event.c