sched_clock: Expose struct clock_read_data
authorPeter Zijlstra <peterz@infradead.org>
Thu, 16 Jul 2020 05:11:24 +0000 (13:11 +0800)
committerWill Deacon <will@kernel.org>
Mon, 20 Jul 2020 10:50:47 +0000 (11:50 +0100)
commit1b86abc1c645ad5c9c7bf70910cb3ce73939d2d7
tree8f72d9b938e23f26de7f0be72a0e11efc77c8b1c
parent539707caa1a89ee4efc57b4e4231c20c46575ccc
sched_clock: Expose struct clock_read_data

In order to support perf_event_mmap_page::cap_time features, an
architecture needs, aside from a userspace readable counter register,
to expose the exact clock data so that userspace can convert the
counter register into a correct timestamp.

Provide struct clock_read_data and two (seqcount) helpers so that
architectures (arm64 in specific) can expose the numbers to userspace.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20200716051130.4359-2-leo.yan@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/sched_clock.h
kernel/time/sched_clock.c