nmi_watchdog: support for oprofile
Re-arrange the code so that when someone disables nmi_watchdog
with:
echo 0 > /proc/sys/kernel/nmi_watchdog
it releases the hardware reservation on the PMUs. This allows
the oprofile module to grab those PMUs and do its thing.
Otherwise oprofile fails to load because the hardware is
reserved by the perf_events subsystem.
Tested using:
oprofile --vm-linux --start
and watched it failed when nmi_watchdog is enabled and succeed
when:
oprofile --deinit && echo 0 > /proc/sys/kernel/nmi_watchdog
is run.
Note: this has the side quirk of having the nmi_watchdog latch
onto the software events instead of hardware events if oprofile
has already reserved the hardware first. User beware! :-)
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: gorcunov@gmail.com
Cc: aris@redhat.com
Cc: eranian@google.com
LKML-Reference: <
1266357892-30504-1-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>