• Peter Zijlstra's avatar
    perf, x86: Fix double enable calls · f3d46b2e
    Peter Zijlstra authored
    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: 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>
    f3d46b2e
perf_event.c 36.9 KB