Trace uses impresice timer in POSIX
-----------------------------------

                 Key: CORE-3970
                 URL: http://tracker.firebirdsql.org/browse/CORE-3970
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.1, 2.5.0, 3.0 Initial
         Environment: POSIX OS
            Reporter: Dmitriy Starodubov
            Priority: Minor


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 
librt.so.

I suppose to add in 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]))

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to