#1914 closed defect (fixed)

Make timestamp implementation choice available for the CPU port

Reported by: Sebastian Huber Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

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

Attachments (1)

timestamp.patch (2.9 KB) - added by Sebastian Huber on 09/16/11 at 11:16:06.
Template for cpu.h

Download all attachments as: .zip

Change History (3)

Changed on 09/16/11 at 11:16:06 by Sebastian Huber

Attachment: timestamp.patch added

Template for cpu.h

comment:1 Changed on 09/28/11 at 13:53:04 by Sebastian Huber

Resolution: fixed
Status: newclosed

Committed to CVS head.

comment:2 Changed on 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.