]> git.baikalelectronics.ru Git - kernel.git/commit
perf_counter: Accurate period data
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 10 Jun 2009 19:34:59 +0000 (21:34 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 11 Jun 2009 00:39:02 +0000 (02:39 +0200)
commit62716b1ebb60cd57b8a197a513822aa8c108f0cd
treed0f311bcf49d887e6d488ea72b2913cb00eaf910
parent7363c2df20063fd06b0808490d96494a243c4a4f
perf_counter: Accurate period data

We currently log hw.sample_period for PERF_SAMPLE_PERIOD, however this is
incorrect. When we adjust the period, it will only take effect the next
cycle but report it for the current cycle. So when we adjust the period
for every cycle, we're always wrong.

Solve this by keeping track of the last_period.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/kernel/perf_counter.c
arch/x86/kernel/cpu/perf_counter.c
include/linux/perf_counter.h
kernel/perf_counter.c