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

Trace uses imprecise timer in POSIX [CORE3970] #4303

Closed
firebird-automations opened this issue Oct 30, 2012 · 7 comments
Closed

Trace uses imprecise timer in POSIX [CORE3970] #4303

firebird-automations opened this issue Oct 30, 2012 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dmitry-starodubov

Assigned to: @dmitry-starodubov

There is query_performance_counter/query_performance_frequency functions, used by trace:
#⁠if defined(WIN_NT)
...
#⁠elif defined(HAVE_CLOCK_GETTIME)
// Use high-resolution clock
struct timespec tp;
if (clock_gettime(CLOCK_REALTIME, &tp) != 0)
return 0;
return static_cast<SINT64>(tp.tv_sec) * BILLION + tp.tv_nsec;
#⁠else
// This is not safe because of possible wrapping and very imprecise
return clock();
#⁠endif

But HAVE_CLOCK_GETTIME marco is not defined in POSIX (at least in CentOS 6.2, Mandriva 2010.2, OpenSuSE 11.1).
So trace use imprecise timer although high-resolution clock is available in http://librt.so.

I suppose to add in http://configure.in something like this:

AC_CHECK_LIB(rt, clock_gettime, XE_APPEND(-lrt, LIBS); AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define this if clock_gettime works on the platform]))

Commits: 540390e

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.3 [ 10461 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

summary: Trace uses impresice timer in POSIX => Trace uses imprecise timer in POSIX

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Alexander Peshkov [ alexpeshkoff ] => Dmitriy Starodubov [ dmitriy starodubov ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

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

No branches or pull requests

1 participant