perf/core: Fix perf_event_read()
authorPeter Zijlstra <peterz@infradead.org>
Tue, 5 Sep 2017 14:26:44 +0000 (16:26 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 27 Oct 2017 08:31:59 +0000 (10:31 +0200)
commit0c1cbc18df9e38182a0604b15535699c84d7342a
tree85c7d42284fd594af32ca8d176aa8fc44e618a60
parent7f0ec32526d2446fdd79b0c6c6d08e64ef9fb1f3
perf/core: Fix perf_event_read()

perf_event_read() has a number of issues regarding the timekeeping bits.

 - The IPI didn't update group times when it found INACTIVE

 - The direct call would not re-check ->state after taking ctx->lock
   which can result in ->count and timestamps getting out of sync.

And we can make use of the ordering introduced for perf_event_stop()
to make it more accurate for ACTIVE.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c