]> git.baikalelectronics.ru Git - kernel.git/commit
perf_counter: Implement more accurate per task statistics
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 24 Jun 2009 19:11:59 +0000 (21:11 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 25 Jun 2009 19:39:07 +0000 (21:39 +0200)
commit8c7802dcae7f991c581177a6bfb83f8058dc3840
tree9b165a3068b8a7976ea34e633013165855bb5f51
parented8bf66ff845502ebc5ee314fb1d94711c7957e9
perf_counter: Implement more accurate per task statistics

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: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/perf_counter.h
kernel/perf_counter.c