]> git.baikalelectronics.ru Git - kernel.git/commit
perf/core: Rewrite event timekeeping
authorPeter Zijlstra <peterz@infradead.org>
Tue, 5 Sep 2017 12:16:28 +0000 (14:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 27 Oct 2017 08:31:59 +0000 (10:31 +0200)
commit8336a658d3480b6b3cb65a017984048543514228
tree829a0fcdecec3ba45aac39380fdc8e31acfc286a
parentbe51054a7bcd642887f4144102c6fe74b7ae3359
perf/core: Rewrite event timekeeping

The current even timekeeping, which computes enabled and running
times, uses 3 distinct timestamps to reflect the various event states:
OFF (stopped), INACTIVE (enabled) and ACTIVE (running).

Furthermore, the update rules are such that even INACTIVE events need
their timestamps updated. This is undesirable because we'd like to not
touch INACTIVE events if at all possible, this makes event scheduling
(much) more expensive than needed.

Rewrite the timekeeping to directly use event->state, this greatly
simplifies the code and results in only having to update things when
we change state, or an up-to-date value is requested (read).

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>
include/linux/perf_event.h
kernel/events/core.c