• Peter Zijlstra's avatar
    perf_counter: Implement more accurate per task statistics · bfbd3381
    Peter Zijlstra authored
    With the introduction of PERF_EVENT_READ we have the
    possibility to provide accurate counter values for
    individual tasks in a task hierarchy.
    
    However, due to the lazy context switching used for similar
    counter contexts our current per task counts are way off.
    
    In order to maintain some of the lazy switch benefits we
    don't disable it out-right, but simply iterate the active
    counters and flip the values between the contexts.
    
    This only reads the counters but does not need to reprogram
    the full PMU.
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <new-submission>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    bfbd3381
perf_counter.c 106 KB