ptp_convert_timestamp(9)
π 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β thephcindex 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 π:
struct ptp_clock_request(9)struct ptp_system_timestamp(9)struct ptp_clock_info(9)struct ptp_clock_event(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)
(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.hpath 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms