Changeset 67de508 in rtems


Ignore:
Timestamp:
Feb 25, 2016, 12:08:45 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8c5c53f4
Parents:
9d1f3943
Message:

rtems: Avoid RTEMS_USE_TICKS_FOR_STATISTICS

Option was removed by e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4.

File:
1 edited

Legend:

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

    r9d1f3943 r67de508  
    8282)
    8383{
    84   Thread_Control *owning_thread = the_period->owner;
    85 
    86   /*
    87    *  If using nanosecond statistics, we need to obtain the uptime.
    88    */
    89   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    90     Timestamp_Control  uptime;
    91 
    92     _TOD_Get_uptime( &uptime );
    93   #endif
     84  Thread_Control    *owning_thread = the_period->owner;
     85  Timestamp_Control  uptime;
     86
     87  _TOD_Get_uptime( &uptime );
    9488
    9589  /*
    9690   *  Set the starting point and the CPU time used for the statistics.
    9791   */
    98   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    99     the_period->time_period_initiated = uptime;
    100   #else
    101     the_period->time_period_initiated = _Watchdog_Ticks_since_boot;
    102   #endif
    103 
     92  the_period->time_period_initiated = uptime;
    10493  the_period->cpu_usage_period_initiated = owning_thread->cpu_time_used;
    10594
    10695  /*
    107    *  If using nanosecond statistics and the period's thread is currently
    108    *  executing, then we need to take into account how much time the
     96   *  We need to take into account how much time the
    10997   *  executing thread has run since the last context switch.  When this
    11098   *  routine is invoked from rtems_rate_monotonic_period, the owner will
     
    112100   *  _Rate_monotonic_Timeout, it will not.
    113101   */
    114   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    115     if (owning_thread == _Thread_Executing) {
    116       Timestamp_Control ran;
    117 
    118       /*
    119        *  Adjust the CPU time used to account for the time since last
    120        *  context switch.
    121        */
    122       _Timestamp_Subtract(
    123         &_Thread_Time_of_last_context_switch, &uptime, &ran
    124       );
    125 
    126       _Timestamp_Add_to( &the_period->cpu_usage_period_initiated, &ran );
    127     }
    128   #endif
     102  if (owning_thread == _Thread_Executing) {
     103    Timestamp_Control ran;
     104
     105    /*
     106     *  Adjust the CPU time used to account for the time since last
     107     *  context switch.
     108     */
     109    _Timestamp_Subtract(
     110      &_Thread_Time_of_last_context_switch, &uptime, &ran
     111    );
     112
     113    _Timestamp_Add_to( &the_period->cpu_usage_period_initiated, &ran );
     114  }
    129115
    130116  _Scheduler_Release_job( the_period->owner, the_period->next_length );
Note: See TracChangeset for help on using the changeset viewer.