Re: [Linuxptp-users] clock_nanosleep on /dev/ptpX (2022)
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: todd f. <tod...@gm...> - 2022-10-02 03:48:10
|
Okay, Richard, thanks for the confirmation and the suggestion. Could you say just a bit more about why it shouldn't be implemented? I'm a professional software engineer, and I had thought I might take a look at implementing it myself. But if you wouldn't recommend such a thing, I will avoid spending any time on it. -Todd On Sat, Oct 1, 2022 at 7:13 PM Richard Cochran <ric...@gm...> wrote: > > On Sat, Oct 01, 2022 at 10:10:37AM -0700, todd freed wrote: > > I gather from the ENOTSUPP return that it's also not implemented > > today. I'm running linux 5.19.7. Just wanted confirmation on that > > point? > > Correct. Will not ever happen. Big can of worms. > > > I could run phc2sys on these hosts and then sleep against > > CLOCK_MONOTONIC. But I had wanted to avoid that, simply because some > > of the devices (desktop pcs) are being used for things other than this > > specific application, and I'd not like to takeover the systemwide > > clock. > > If you really can't/won't use phc2sys, then you can also do > > clock_gettime(CLOCK_MONOTONIC, t1); > clock_gettime(phc, t2); > clock_gettime(CLOCK_MONOTONIC, t3); > > and calculate > > offset = ((t3 - t1) / 2) - t2 > > every once in a while, then use linear interpolation to convert > deadlines from the PHC time scale into monotonic deadlines. > > HTH, > Richard |