• P
    perf_counter: Fix the cpu_clock software counter · 9abf8a08
    Paul Mackerras 提交于
    Impact: bug fix
    
    Currently if you do (e.g.) timec -e -1 ls, it will report 0 for the
    value of the cpu_clock counter.  The reason is that the core assumes
    that a counter's count field is up-to-date when the counter is inactive,
    and doesn't call the counter's read function.  However, the cpu_clock
    counter code only updates the count in the read function.
    
    This fixes it by making both the read and disable functions update the
    count.  It also makes the counter ignore time passing while the counter
    is disabled, by making the enable function update the hw.prev_count field.
    Signed-off-by: NPaul Mackerras <paulus@samba.org>
    9abf8a08
perf_counter.c 39.3 KB