ptp_convert_timestamp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ptp_convert_timestamp β€” the kernel API manual, bestie edition

okay so real talk, this is a page from the Kernel API Manual (ptp_convert_timestamp(9)) and it's honestly such a serve β€” it's literally just one function doing one lil glow-up on your timestamps ✨


πŸŽ€ NAME πŸŽ€

ptp_convert_timestamp β€” converts a timestamp into a ptp vclock time, no cap πŸ•βž‘οΈπŸ•


✨ SYNOPSIS ✨

ktime_t ptp_convert_timestamp (const ktime_t *hwtstamp , int
       vclock_index );

like, that's the whole signature, she's compact and iconic πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hwtstamp β€” the timestamp you're feeding in, bestie 🫢
  • vclock_index β€” the phc index of the ptp vclock. that's the one you gotta point at πŸ‘‘

🌸 RETURN 🌸

it hands you back the converted timestamp πŸŽ‰ β€” or 0 on error, which is the sad path 😭 (so like, always check, fr fr)


πŸ’– SEE ALSO πŸ’–

okay this list is long and honestly kind of a flex, so buckle up buttercup 🌈

first, the kernel file itself: ./include/linux/ptp_clock_kernel.h

and then the whole friend group πŸ’œ:

(and yes, ptp_clock_event(9) shows up twice in the original β€” she said main character energy so nice she listed it twice πŸ’€ iconic behavior honestly)


lowkey reminder: that ./include/linux/ptp_clock_kernel.h path and every single one of those (9) refs is exact β€” don't go editing them, iykyk πŸ”₯

🌈 and that's the whole page, bestie! this one's from ./include/linux, dated October 2026, and it's ptp_convert_timestamp(9) β€” periodt. go convert some timestamps and slay πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from