STRUCT SYSTEM_TIME_SNAPSHOT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

struct system_time_snapshot β€” bestie, it's a simultaneous time capture 🫢 like it grabs the monotonic raw time, a selected CLOCK_*, and the clocksource counter value all in one go, no cap.


✨ SYNOPSIS ✨

struct system_time_snapshot {
    u64 cycles;
    u64 hw_cycles;
    ktime_t systime;
    ktime_t monoraw;
    enum clocksource_ids    cs_id;
    enum clocksource_ids    hw_csid;
    u32 clock_was_set_seq;
    u8 cs_was_changed_seq;
    u8 valid;
 };

πŸŽ€ MEMBERS πŸŽ€

🌸 the member breakdown, iykyk

  • cycles β€” the clocksource counter value that's literally what produces the system times πŸ’«
  • hw_cycles β€” for derived clocksources, this is the hardware counter value that cycles was derived from πŸ¦‹
  • systime β€” the system time of whichever CLOCK ID you selected πŸ‘‘
  • monoraw β€” the monotonic raw system time ⭐
  • cs_id β€” the clocksource ID, iconic, no notes πŸ’…
  • hw_csid β€” the clocksource ID of the underlying hardware counter for derived clocksources that implement the read_snapshot callback πŸ”₯
  • clock_was_set_seq β€” the sequence number of clock-was-set events πŸ•°οΈ
  • cs_was_changed_seq β€” the sequence number of clocksource change events πŸ”„
  • valid β€” true if the snapshot is valid βœ… like, the vibe check result fr fr

πŸ’– DESCRIPTION πŸ’–

Okay so monoraw is CLOCK_MONOTONIC_RAW for system time CLOCK ids. 🫢

But for CLOCK_AUX$N clock ids, it's the monotonic raw time related to the AUX clock β€” which is CLOCK_MONOTONIC_RAW plus an AUX clock specific offset. 🧚 tiny little offset, big main character energy, you get it.


🌈 SEE ALSO 🌈

Kernel file ./include/linux/timekeeping.h and honestly the whole friend group:


ok that's the whole page bestie, go read the source, it's giving main character kernel file πŸ’€βœ¨

Lots of love from ./include/linux πŸ’œ β€” October 2026 edition, struct system_time_snapshot(9), periodt. πŸŽ€

πŸ“¦ where this page comes from