-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CLOCK_REALTIME when logging and CLOCK_MONOTONIC when timing #290
Conversation
Change update_current_time() so that current_time is set from CLOCK_REALTIME and current_time_ms is set from CLOCK_MONOTONIC. This way log messages display wall clock time while any timing calculations use monotonic time. See schweikert#203 In seqmap_add(), before checking to see if .time_ts wrapped, check that .time_ts was set. See schweikert#288
This looks good, thank you! Could you have a look at the failing test and check whether the failure is caused by this change? |
looking |
The test is broken by fping.c line 1500 I hope this helps with the analysis |
Off hand, would you know which clock:
the Linux kernel uses for this? |
I'm pretty sure it is CLOCK_REALTIME, which, on linux, leads to:
it's looking like a better option is to just and only use CLOCK_REALTIME and live with delta changes. |
Unconfirmed and unknowingly, I would say yes. https://www.kernel.org/doc/html/latest/core-api/timekeeping.html |
Your patch seems to work on FreeBSD. My example with your change b00622c |
My thought, having worked through this, is to reject this patch and instead simplify the conditional code so it always uses CLOCK_REALTIME. The real cause of the FreeBSD problems is their out-of-date package. I'll poke them. The ideal clock source is probably CLOCK_BOOTTIME but that's linux only and won't work with timestamp. |
Is there still ambition of improving this branch? I am looking for a project. |
@rowingdude you are free to look for a final solution. Currently, only a part without CLOCK_MONOTONIC is used as the primary time specification. You can see the reason for this in the previous posts. Otherwise I would close the pull request at the end of the month. |
Closed because the pull request is not functional. There is also no corrected version. |
Change update_current_time() so that current_time is set from CLOCK_REALTIME and current_time_ms is set from CLOCK_MONOTONIC. This way log messages display wall clock time while any timing calculations use monotonic time.
See #203
In seqmap_add(), before checking to see if .time_ts wrapped, check that .time_ts was set.
See #288