Hi!
(sorry for double post - forgot to include the list)

Thanks for the answer, now I am completely confused ;)

So there is no easy way to just get the difference from a PHC to the (PC)
system clock (unless the PHC is synced to the PC clock - which makes the
necessity of the difference obsolete).

The problem here is that the ntp time server that must be used on the PC is
very unreliable and the time is drifting a lot. So the idea was to mark
each operation with a second more exact and reliable timestamp (PTP) to be
able to retrace some important operations.

So conclusion for me is - there is nothing in the output of existing
programs (ptp4l, phc2sys, pmc) I can use to either get a timestamp or at
least an offset (i first thought I could use the master_offset from pmc)
but rather write a new programm based on phc2sys and use clock_gettime to
somehow get a PHC and a PC time and compare these two.

Is this correct?

thanks and best regards
Werner

On Tue, May 19, 2020 at 5:56 PM Richard Cochran <richardcoch...@gmail.com>
wrote:

> > On Tue, May 19, 2020 at 4:36 PM Chris Caudle <ch...@chriscaudle.org>
> wrote:
> >
> > > As far as I am aware the PHC in the NIC is not used for anything other
> > > than network time synchronization using PTP, and the PHC has no
> relation
> > > to the system clock unless you also run phc2sys to transfer time from
> the
> > > PHC to the system (software) clock.
>
> +1  good point
>
> On Tue, May 19, 2020 at 04:59:51PM +0200, Werner Macho wrote:
> > The system (Server) MUST be synced with NTP with a given timeserver.
> > Directly attached to the Server is a PTP Device:
> > ---
> >  ethtool -T ens2f1
> > Time stamping parameters for ens2f1:
> > Capabilities:
> >         hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
> >         software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
> >         hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
> >         software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
> >         software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
> >         hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
> > PTP Hardware Clock: 1
> > Hardware Transmit Timestamp Modes:
> >         off                   (HWTSTAMP_TX_OFF)
> >         on                    (HWTSTAMP_TX_ON)
> > Hardware Receive Filter Modes:
> >         none                  (HWTSTAMP_FILTER_NONE)
> >         ptpv1-l4-event        (HWTSTAMP_FILTER_PTP_V1_L4_EVENT)
> >         ptpv2-l4-event        (HWTSTAMP_FILTER_PTP_V2_L4_EVENT)
> >         ptpv2-l2-event        (HWTSTAMP_FILTER_PTP_V2_L2_EVENT)
> > ---
> > So the hardware clock (which I meant) is the server HW clock, this must
> be
> > leaved untouched and continue to sync with the given time server.
>
> In this case, you don't need to use --free_running.  Simply let ptp4l
> control the PHC and synchronize it to the PTP network time.
>
> All you need is a little program that periodically reads two time
> values, the PHC and the Linux system time, and computes the offset.
>
> (the phc2sys program shows how to do this)
>
> Then you interpolate the PHC time for a given Linux system time stamp.
>
> HTH,
> Richard
>
>
>
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to