clk: timestamps

Subhashini Rao Beerisetty subhashbeerisetty at gmail.com
Wed Jun 27 04:42:03 EDT 2018


On Wed, Jun 27, 2018 at 1:17 PM, Yann Droneaud <ydroneaud at opteya.com> wrote:

> Hi,
>
> Le mardi 26 juin 2018 à 19:44 +0530, Subhashini Rao Beerisetty a
> écrit :
> >
> > In the kernel code I see it supports CLOCK_REALTIME \ CLOCK_MONOTONIC
> >  \ CLOCK_MONOTONIC_RAW timestamps. Can someone explain what’s major
> > difference between those three modes and when to use which one?
> >
>
> A generic answer could be found here:
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
>
> > I’ve N number of Linux machines in the network with the same software
> > running. Basically I need to collect the timestamps in kernel mode in
> > all the machines and then compare, which(either CLOCK_REALTIME or
> > CLOCK_MONOTIC_RAW or MONOTONIC) one would be the correct way?
> >
>
> Probably none. Anyway, please find some hints below:
>
> None of the monotonic clocks can be used because they're not supposed
> to be synchronized accross the network
>
> You're left with CLOCK_REALTIME, which is not synchronized accross the
> network by default.
>


Does printk log timestamp by default uses the CLOCK_REALTIME?

>
> So before doing timestamp comparison, you would need to setup time
> synchronisation between hosts on your network: NTP to synchronise hosts
>  to the same seconds with couple of millisecond precision, PTP for sub
> millisecond precision.
>
Can you point me on how to setup time synchronisation between hosts on
network.


>
> Time synchronisation is a tough problem but it's required if you want
> to be able to compare timestamp accross hosts in a network.
>
> Regards.
>
> --
> Yann Droneaud
> OPTEYA
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180627/794dba3f/attachment.html>


More information about the Kernelnewbies mailing list