perf_counter: Collapse inherit on read()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 24 Jul 2009 12:42:10 +0000 (14:42 +0200)
committerIngo Molnar <mingo@elte.hu>
Sun, 2 Aug 2009 11:47:54 +0000 (13:47 +0200)
commite53c0994709166b111fbe9162d1a16ece7dfc45b
tree5182e8f91bffae8fcbe05a9b86e761f84b0f079e
parent470a1396c25c27b4aff08b14d5c9cd9b3da15e09
perf_counter: Collapse inherit on read()

Currently the counter value returned by read() is the value of
the parent counter, to which child counters are only fed back
on child exit.

Thus read() can return rather erratic (and meaningless) numbers
depending on the state of the child processes.

Change this by always iterating the full child hierarchy on
read() and sum all counters.

Suggested-by: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c