Ignore:
Timestamp:
May 27, 2015, 3:13:58 PM (4 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
e0938c2
Parents:
80fca28
git-author:
Joel Sherrill <joel.sherrill@…> (05/27/15 15:13:58)
git-committer:
Joel Sherrill <joel.sherrill@…> (06/15/15 18:20:17)
Message:

Remove use ticks for statistics configure option.

This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the RTEMS_USE_TICKS_FOR_STATISTICS conditional.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/ratemonperiod.c

    r80fca28 re6b31b27  
    3131)
    3232{
    33   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    34     Timestamp_Control        uptime;
    35   #endif
    36     Thread_Control          *owning_thread = the_period->owner;
    37     Thread_CPU_usage_t       used;
     33  Timestamp_Control        uptime;
     34  Thread_Control          *owning_thread = the_period->owner;
     35  Thread_CPU_usage_t       used;
    3836
    3937  /*
    4038   *  Determine elapsed wall time since period initiated.
    4139   */
    42   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    43     _TOD_Get_uptime( &uptime );
     40  _TOD_Get_uptime( &uptime );
     41  _Timestamp_Subtract(
     42    &the_period->time_period_initiated, &uptime, wall_since_last_period
     43  );
     44
     45  /*
     46   *  Determine cpu usage since period initiated.
     47   */
     48  used = owning_thread->cpu_time_used;
     49
     50  if (owning_thread == _Thread_Executing) {
     51
     52    Thread_CPU_usage_t ran;
     53
     54    /* How much time time since last context switch */
    4455    _Timestamp_Subtract(
    45       &the_period->time_period_initiated, &uptime, wall_since_last_period
     56      &_Thread_Time_of_last_context_switch, &uptime, &ran
    4657    );
    47   #else
    48     *wall_since_last_period =
    49       _Watchdog_Ticks_since_boot - the_period->time_period_initiated;
    50   #endif
    51 
    52   /*
    53    *  Determine cpu usage since period initiated.
    54    */
    55   used = owning_thread->cpu_time_used;
    56 
    57   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    58     if (owning_thread == _Thread_Executing) {
    59 
    60       Thread_CPU_usage_t ran;
    61 
    62       /* How much time time since last context switch */
    63       _Timestamp_Subtract(
    64         &_Thread_Time_of_last_context_switch, &uptime, &ran
    65       );
    66 
    67       /* cpu usage += ran */
    68       _Timestamp_Add_to( &used, &ran );
    69 
    70       /*
    71        *  The cpu usage info was reset while executing.  Can't
    72        *  determine a status.
    73        */
    74       if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
    75         return false;
    76 
    77        /* used = current cpu usage - cpu usage at start of period */
    78       _Timestamp_Subtract(
    79          &the_period->cpu_usage_period_initiated,
    80          &used,
    81          cpu_since_last_period
    82       );
    83     }
    84   #else
    85       /*
    86        *  The cpu usage info was reset while executing.  Can't
    87        *  determine a status.
    88        */
    89       if (used < the_period->cpu_usage_period_initiated)
    90         return false;
    91 
    92       *cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
    93   #endif
     58
     59    /* cpu usage += ran */
     60    _Timestamp_Add_to( &used, &ran );
     61
     62    /*
     63     *  The cpu usage info was reset while executing.  Can't
     64     *  determine a status.
     65     */
     66    if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
     67      return false;
     68
     69     /* used = current cpu usage - cpu usage at start of period */
     70    _Timestamp_Subtract(
     71       &the_period->cpu_usage_period_initiated,
     72       &used,
     73       cpu_since_last_period
     74    );
     75  }
     76
    9477  return true;
    9578}
Note: See TracChangeset for help on using the changeset viewer.