• Ingo Molnar's avatar
    x86, perfcounters: add support for fixed-function pmcs · 2f18d1e8
    Ingo Molnar authored
    Impact: extend performance counter support on x86 Intel CPUs
    
    Modern Intel CPUs have 3 "fixed-function" performance counters, which
    count these hardware events:
    
        Instr_Retired.Any
        CPU_CLK_Unhalted.Core
        CPU_CLK_Unhalted.Ref
    
    Add support for them to the performance counters subsystem.
    
    Their use is transparent to user-space: the counter scheduler is
    extended to automatically recognize the cases where a fixed-function
    PMC can be utilized instead of a generic PMC. In such cases the
    generic PMC is kept available for more counters.
    
    The above fixed-function events map to these generic counter hw events:
    
            PERF_COUNT_INSTRUCTIONS
            PERF_COUNT_CPU_CYCLES
            PERF_COUNT_BUS_CYCLES
    
    (The 'bus' cycles are in reality often CPU-ish cycles, just with a fixed
     frequency.)
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    2f18d1e8
perf_counter.c 17.6 KB