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,
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.
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
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@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/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
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
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
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.
participants (5)
-
Greg KH -
kipade -
Subhashini Rao Beerisetty -
valdis.kletnieks@vt.edu -
Yann Droneaud