Skip to content
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

Rework time related code #64

Closed
wants to merge 3 commits into from
Closed

Conversation

qlyoung
Copy link
Member

@qlyoung qlyoung commented Jan 11, 2017

This is a set of changes that aim to clean up timing code.
Summary of changes:

  • Move all time related code into its own module
  • Make sane the public interface for time code
  • Remove global state from time code
  • Decouple thread.c time caching from time code
  • Add conversion functions between timespec and timeval
  • Add arithmetic functions for timespec and timeval
  • Remove false comment about quagga_get_relative updating recent_time on systems where gettimeofday() is used to compute a relative system time, since this never happens
  • Fix bug on APPLE where the argument to quagga_get_relative is not actually set with the computed system monotonic time
  • Remove thread.[ch] global variable recent_time because it is never used
  • Add TU_CLK_REALTIME to supported clocks
  • Document new and existing functionality
  • Rename quagga_* time functions to timeutil_* time functions
  • Refactor codebase to use timeutil.h where necessary

These changes begin the process of decoupling timing code
from threading code, adding additional timing functionality,
and removing unused functionality.

* Add conversion functions between timespec and timeval
* Add arithmetic functions for timespec and timeval
* Make sane the public interface for internal timing functions
* Remove false comment about quagga_get_relative updating
  recent_time on systems where gettimeofday() is used to compute
  a relative system time, since this never happens...
* Fix bug on __APPLE__ where the argument to quagga_get_relative
  is not actually set with the computed system monotonic time
* Decouple thread.c time caching from actual timing logic
* Remove global variable recent_time because it is never used
* Add FRR_CLK_REALTIME to supported clocks
* Document new and existing functionality.
* Rename quagga_* time functions to frr_* time functions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Include timeutil.h where necessary
* Rename frr_* time functions to be project name agnostic
* Refactor to use renamed time functions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
@NetDEF-CI
Copy link
Collaborator

Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-35/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@NetDEF-CI
Copy link
Collaborator

Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-36/

This is a comment from an EXPERIMENTAL automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@eqvinox
Copy link
Contributor

eqvinox commented Jan 17, 2017

Mhm. I'd go in a somewhat different direction in reworking this, particularly I don't see the point of TU_CLK_REALTIME. Need to put some brain-cycles on it. I fully agree with ripping out recent_time and splitting it off thread.c though.

Also, the first commit on this is marked WIP, does that mean the pull request will change further?

@qlyoung
Copy link
Member Author

qlyoung commented Jan 17, 2017

@eqvinox and myself discussed these changes some more. We came to the conclusion that the intent is no longer to pretend to emulate various system time calls; timeutil.[ch] will now provide exactly one clock -- a monotonic clock -- and the rest of the codebase will use gettimeofday() for wall time. Per this move the various wrappers for a monotonic clock will be removed.

Closing this PR as @eqvinox will submit a combined patch with these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants