[Bug 1914] New: Make timestamp implementation choice available for the CPU port

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Wed Sep 14 15:25:26 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1914

           Summary: Make timestamp implementation choice available for the
                    CPU port
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: sebastian.huber at embedded-brains.de


In "score/include/rtems/score/timestamp.h" we have:

/*
 *  NOTE: Eventually each port should select what it should use!!!
 *
 *  These control which implementation of SuperCore Timestamp is used.
 *
 *  if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_STRUCT_SPEC)
 *     struct timespec is used
 *  else if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64)
 *     int64_t is used
 *
 *  When int64_t is used, then
 *     if defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE)
 *        the methods are inlined
 *     else
 *        the methods are NOT inlined
 *
 *  Performance of int64_t versus struct timespec
 *  =============================================
 *
 *  On PowerPC/psim, inlined int64_t saves ~50 instructions on each
 *    _Thread_Dispatch operation which results in a context switch.
 *    This works out to be about 10% faster dispatches and 7.5% faster
 *    blocking semaphore obtains.  The following numbers are in instructions
 *    and from tm02 and tm26.
 *
 *                         timespec  int64  inlined int64
 *    dispatch:              446      446      400
 *    blocking sem obtain:   627      626      581
 *
 *  On SPARC/sis, inlined int64_t shows the same percentage gains.
 *    The following numbers are in microseconds and from tm02 and tm26.
 *
 *                         timespec  int64  inlined int64
 *    dispatch:               59       61       53
 *    blocking sem obtain:    98      100       92
 *
 *  Inlining appears to have a tendency to increase the size of
 *    some executables.
 *  Not inlining reduces the execution improvement but does not seem to
 *    be an improvement on the PowerPC and SPARC. The struct timespec
 *    and the executables with int64 not inlined are about the same size.
 *
 *  Once there has some analysis of which algorithm and configuration
 *  is best suited to each target, these defines should be moved to
 *  the appropriate score/cpu cpu.h file.  In the meantime, it is
 *  appropriate to select an implementation here using CPU macros.
 */

#define CPU_RTEMS_SCORE_TIMESTAMP_IS_STRUCT_SPEC
/*
#define CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64
#define CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE
*/

I think it is time to delegate the implementation choice to the CPU port
(cpu.h).

I propose to change the defines a bit to be more in line with the other CPU
defines.  In cpu.h we have to define:

#define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC TRUE

    or

#define CPU_TIMESTAMP_USE_INT64 TRUE

    or

#define CPU_TIMESTAMP_USE_INT64_INLINE TRUE

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list