# Re: \[patch 01/24\] timekeeping: Provide ktime\_get\_snapshot\_id()

- From: David Woodhouse \<dwmw2@infradead.org\>
- Date: 2026-05-26 23:39:17 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/05/17033756
- Thread: https://ratatoskr.run/kvmarm/2026/05/17032577/t.md

```text
On Tue, 26 May 2026 19:13:33 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() provides a snapshot of the underlying clocksource
> counter value and the corresponding CLOCK_MONOTONIC_RAW, CLOCK_REALTIME and
> CLOCK_BOOTTIME timestamps.
>
> There is no usage of CLOCK_REALTIME and CLOCK_BOOTTIME at the same time and
> CLOCK_BOOTTIME support was just added for the ARM64 KVM tracing mechanism,
> which needs CLOCK_BOOTTIME and the underlying clocksource counter value.
>
> ktime_get_snapshot() is also not suitable for usage with CLOCK_AUX, but
> that's a prerequisite to support PTP hardware timestamping for CLOCK_AUX
> steering.
>
> As a first step, rename ktime_get_snapshot() to ktime_get_snapshot_id(),
> which now takes a clockid argument to select the clock which needs to be
> captured. The result is stored in system_time_snapshot::sys, which will
> replace the system_time_snapshot::real/boot members once all usage sites
> have been converted.
>
> ktime_get_snapshot() is a simple wrapper which hands in CLOCK_REALTIME as
> clockid argument for the conversion period. That means CLOCK_REALTIME is
> now captured twice, but that redunancy is only temporary.
>
> No functional change vs. current users of ktime_get_snapshot()
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>

Reviewed-by: David Woodhouse <redacted>
Tested-by: David Woodhouse <redacted>

```

## Attachments

- [smime.p7s](https://ratatoskr.run/netdev/2026/05/17033756/attachment/0) (application/pkcs7-signature, 5069 bytes)
