• Peter Zijlstra's avatar
    perf, x86: Fix double disable calls · 19925ce7
    Peter Zijlstra authored
    hw_perf_enable() would disable events that were not yet enabled.
    
    This causes problems with code that assumes that ->enable/->disable calls
    are balanced (like the LBR code does).
    
    What happens is that we disable newly added counters that match their
    previous assignment, even though they are not yet programmed on the
    hardware.
    
    Avoid this by only doing the first pass over the existing events.
    Signed-off-by: default avatarPeter 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: default avatarIngo Molnar <mingo@elte.hu>
    19925ce7
perf_event.c 36.9 KB