All of lore.kernel.org
 help / color / mirror / Atom feed
* clk: timestamps
@ 2018-06-26 14:14 Subhashini Rao Beerisetty
  2018-06-27  5:52 ` where and when the kernel destroy devices memory if there were no matched driver for it? kipade
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Subhashini Rao Beerisetty @ 2018-06-26 14:14 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

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?


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?

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180626/40f5b091/attachment.html>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* where and when the kernel destroy devices memory if there were no matched driver for it?
  2018-06-26 14:14 clk: timestamps Subhashini Rao Beerisetty
@ 2018-06-27  5:52 ` kipade
  2018-06-27  5:57   ` Greg KH
  2018-06-27  7:47 ` clk: timestamps Yann Droneaud
  2018-06-27 20:50 ` valdis.kletnieks at vt.edu
  2 siblings, 1 reply; 8+ messages in thread
From: kipade @ 2018-06-27  5:52 UTC (permalink / raw)
  To: kernelnewbies

Hi, all

As my question, would kernel destroy deivces struct if there were no matched
driver attached on it? If so, what's a suite time to drop them, and where?

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* where and when the kernel destroy devices memory if there were no matched driver for it?
  2018-06-27  5:52 ` where and when the kernel destroy devices memory if there were no matched driver for it? kipade
@ 2018-06-27  5:57   ` Greg KH
  2018-06-27  8:57     ` kipade
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2018-06-27  5:57 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jun 27, 2018 at 01:52:55PM +0800, kipade wrote:
> Hi, all
> 
> As my question, would kernel destroy deivces struct if there were no matched
> driver attached on it?

No, only when the device is removed from the system does that structure
get destroyed.

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* clk: timestamps
  2018-06-26 14:14 clk: timestamps Subhashini Rao Beerisetty
  2018-06-27  5:52 ` where and when the kernel destroy devices memory if there were no matched driver for it? kipade
@ 2018-06-27  7:47 ` Yann Droneaud
  2018-06-27  8:42   ` Subhashini Rao Beerisetty
  2018-06-27 20:50 ` valdis.kletnieks at vt.edu
  2 siblings, 1 reply; 8+ messages in thread
From: Yann Droneaud @ 2018-06-27  7:47 UTC (permalink / raw)
  To: kernelnewbies

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.

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.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* clk: timestamps
  2018-06-27  7:47 ` clk: timestamps Yann Droneaud
@ 2018-06-27  8:42   ` Subhashini Rao Beerisetty
  0 siblings, 0 replies; 8+ messages in thread
From: Subhashini Rao Beerisetty @ 2018-06-27  8:42 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jun 27, 2018 at 1:17 PM, Yann Droneaud <ydroneaud@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>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* where and when the kernel destroy devices memory if there were no matched driver for it?
  2018-06-27  5:57   ` Greg KH
@ 2018-06-27  8:57     ` kipade
  2018-06-27 12:06       ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: kipade @ 2018-06-27  8:57 UTC (permalink / raw)
  To: kernelnewbies

If so, I make a driver was compiled as module and inserted by insmod
after some time the system booted, the driver could find the device if it
did not compiled as module. But, the fact is, my driver could not find
its device which was created during booting from device tree.

On 2018?06?27? 13:57, Greg KH wrote:
> On Wed, Jun 27, 2018 at 01:52:55PM +0800, kipade wrote:
>> Hi, all
>>
>> As my question, would kernel destroy deivces struct if there were no matched
>> driver attached on it?
> No, only when the device is removed from the system does that structure
> get destroyed.
>
> greg k-h
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 8+ messages in thread

* where and when the kernel destroy devices memory if there were no matched driver for it?
  2018-06-27  8:57     ` kipade
@ 2018-06-27 12:06       ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2018-06-27 12:06 UTC (permalink / raw)
  To: kernelnewbies

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Wed, Jun 27, 2018 at 04:57:56PM +0800, kipade wrote:
> If so, I make a driver was compiled as module and inserted by insmod
> after some time the system booted, the driver could find the device if it
> did not compiled as module. But, the fact is, my driver could not find
> its device which was created during booting from device tree.

I don't know, sorry, you are going to have to be a lot more specific.
Do you see the device in /sys/devices/ ?  If so, are you sure your
driver probe function is called?  If not, then work on fixing that.

Do you have a pointer to your driver code anywhere we can review it to
see what you are trying to do?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* clk: timestamps
  2018-06-26 14:14 clk: timestamps Subhashini Rao Beerisetty
  2018-06-27  5:52 ` where and when the kernel destroy devices memory if there were no matched driver for it? kipade
  2018-06-27  7:47 ` clk: timestamps Yann Droneaud
@ 2018-06-27 20:50 ` valdis.kletnieks at vt.edu
  2 siblings, 0 replies; 8+ messages in thread
From: valdis.kletnieks at vt.edu @ 2018-06-27 20:50 UTC (permalink / raw)
  To: kernelnewbies

On Tue, 26 Jun 2018 19:44:21 +0530, Subhashini Rao Beerisetty said:

> 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?

That depends a lot on what question you're trying to answer by
comparing timestamps.  Read up on the behavior of all three (as
they have different semantics), and see which one is the best fit
for your specific problem.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-27 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-26 14:14 clk: timestamps Subhashini Rao Beerisetty
2018-06-27  5:52 ` where and when the kernel destroy devices memory if there were no matched driver for it? kipade
2018-06-27  5:57   ` Greg KH
2018-06-27  8:57     ` kipade
2018-06-27 12:06       ` Greg KH
2018-06-27  7:47 ` clk: timestamps Yann Droneaud
2018-06-27  8:42   ` Subhashini Rao Beerisetty
2018-06-27 20:50 ` valdis.kletnieks at vt.edu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.