• Vince Weaver's avatar
    perf_counter: Add P6 PMU support · 11d1578f
    Vince Weaver authored
    Add basic P6 PMU support. The P6 uses the EVNTSEL0 EN bit to
    enable/disable both its counters. We use this for the
    global enable/disable, and clear all config bits (except EN)
    to disable individual counters.
    
    Actual ia32 hardware doesn't support lfence, so use a locked
    op without side-effect to implement a full barrier.
    
    perf stat and perf record seem to function correctly.
    
    [a.p.zijlstra@chello.nl: cleanups and complete the enable/disable code]
    Signed-off-by: default avatarVince Weaver <vince@deater.net>
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <Pine.LNX.4.64.0907081718450.2715@pianoman.cluster.toy>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    11d1578f
perf_counter.c 44.9 KB