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-issue-importer opened this issue Oct 30, 2012 · 7 comments
Closed

Trace uses imprecise timer in POSIX [CORE3970] #4303

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

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 30, 2012

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 6, 2012

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.3 [ 10461 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 6, 2012

Modified by: @asfernandes

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 23, 2013

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 6, 2015

Modified by: @dyemanov

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

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

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 21, 2016

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant