STRUCT PTP_CLOCK_EVENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ptp_clock_event(9) πŸ’…

okay so before we even get into it β€” hi bestie, welcome to the Kernel API Manual, this page is literally all about struct ptp_clock_event. and no, i'm not gonna gatekeep the spelling situation from the original: it's the struct that describes a PTP hardware clock event. that's the whole vibe. PTP girlies rise πŸ•βœ¨


πŸŽ€ SYNOPSIS πŸŽ€

here's the shape of it, copy it exactly bestie, no freestyling:

struct ptp_clock_event {
    int type;
    int index;
    union {
      u64 timestamp;
      s64 offset;
      struct pps_event_time pps_times;
    };
 };

like look at that little anonymous union sitting there all mysterious, we love a main character with no name 🫢


🌸 Members 🌸

okay so every single one of these, no skipping, i promised:

  • type β€” this one's one of the ptp_clock_events enumeration values. periodt, that's the whole job.
  • index β€” identifies the source of the event. like, where did this whole thing even come from, yk?
  • {unnamed_union} β€” anonymous! it has no name! it's literally just vibing there unnamed πŸ’€
  • timestamp β€” when the event occurred. PTP_CLOCK_EXTTS only β€” do not come for this field with any other type, it's not for you πŸ™ˆ
  • offset β€” when the event occurred. PTP_CLOCK_EXTOFF only β€” same energy, different field, know the difference bestie πŸ’–
  • pps_times β€” when the event occurred. PTP_CLOCK_PPSUSR only β€” yes it's the third "when the event occurred", no i'm not tired of saying it πŸ¦‹
quick vibe check: those three union members are mutually exclusive-ish, each one is tagged to its own PTP_CLOCK_* event type. read the parentheticals, they're the whole plot πŸ”₯

✨ SEE ALSO ✨

you want the whole friend group? here's the whole friend group, i'm not leaving a single one out, they'd notice:

Kernel file ./include/linux/ptp_clock_kernel.h, plus struct ptp_clock_request(9), struct ptp_system_timestamp(9), struct ptp_clock_info(9), scaled_ppm_to_ppb(9), diff_by_scaled_ppm(9), adjust_by_scaled_ppm(9), ptp_clock_register(9), ptp_clock_unregister(9), ptp_clock_event(9), ptp_clock_index(9), ptp_clock_index_by_of_node(9), ptp_clock_index_by_dev(9), ptp_find_pin(9), ptp_find_pin_unlocked(9), ptp_schedule_worker(9), ptp_cancel_worker_sync(9), ptp_get_vclocks_index(9), ptp_convert_timestamp(9).


and that's the page!! πŸŽ€ ok final sign-off bestie: this one lives under ./include/linux, it's dated October 2026, and it goes by struct ptp_clock_event(9) β€” go be iconic with your timestamps πŸ’œπŸŒˆβ­

πŸ“¦ where this page comes from