On Mon, Feb 17, 2014 at 02:21:10PM +0000, Koehrer Mathias (ETAS/ESW5) wrote:
> > You can simply do the same as in the slave case.
> >
> > phc2sys -s /dev/ptp -w
> >
> > The grand master node will adjust its system time to the free running
> > PTP Hardware Clock. You will want to set the correct time in the PHC
> > before doing this!
> OK that makes sense! Which tool can I use to set the correct time in the PHC
> before starting phc2sys?
> Can I use phc2sys or is there another tool required for this?
> I assume, in this case I have to consider the 35s offset...
One easy way would be to use the testptp program from
Documentation/ptp in the Linux kernel sources. You could do
testptp -s # set the ptp clock time from the system time
followed by
testptp -t val # shift the ptp clock time by 'val' seconds
in order to set the correct UTC offset. If you need something more
fancy than that, then you can always write a little C program.
> phc2sys is responsible to adapt the system clock, thus I'd expected
> phc2sys to deliver this information somehow. However I do not find
> anything like that in the code or man page.
The phc2sys does not have a management interface like ptp4l. It can
place summary statistics in the syslog or on stdout/stderr. So you
would have to grep/tail this from the syslog or redirect the output
into a fifo. You could script a file like the one you first
mentioned. For example:
while [ 1 ]; do
grep phc2sys /var/log/syslog | grep rms | tail -n 1 > /tmp/status
sleep 2
done
I don't know what your timing requirements are, but be beware that
the phc2sys output is only an estimate, and there may be an additional
offset between the Linux system time and the PHC.
HTH,
Richard
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-users