diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-25 13:08:45 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-25 13:08:45 +0100 |
commit | 67de5082a2fea0a834ef480dd951c4850d6d5695 (patch) | |
tree | 925ca3ea24766baa95d34ef890c4f8d60d0b6858 /cpukit/rtems/src/ratemonperiod.c | |
parent | malloc: Add _Malloc_System_state() (diff) | |
download | rtems-67de5082a2fea0a834ef480dd951c4850d6d5695.tar.bz2 |
rtems: Avoid __RTEMS_USE_TICKS_FOR_STATISTICS__
Option was removed by e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/src/ratemonperiod.c | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c index 6aefaba09b..144164e79a 100644 --- a/cpukit/rtems/src/ratemonperiod.c +++ b/cpukit/rtems/src/ratemonperiod.c @@ -81,51 +81,37 @@ void _Rate_monotonic_Initiate_statistics( Rate_monotonic_Control *the_period ) { - Thread_Control *owning_thread = the_period->owner; + Thread_Control *owning_thread = the_period->owner; + Timestamp_Control uptime; - /* - * If using nanosecond statistics, we need to obtain the uptime. - */ - #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - Timestamp_Control uptime; - - _TOD_Get_uptime( &uptime ); - #endif + _TOD_Get_uptime( &uptime ); /* * Set the starting point and the CPU time used for the statistics. */ - #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - the_period->time_period_initiated = uptime; - #else - the_period->time_period_initiated = _Watchdog_Ticks_since_boot; - #endif - + the_period->time_period_initiated = uptime; the_period->cpu_usage_period_initiated = owning_thread->cpu_time_used; /* - * If using nanosecond statistics and the period's thread is currently - * executing, then we need to take into account how much time the + * We need to take into account how much time the * executing thread has run since the last context switch. When this * routine is invoked from rtems_rate_monotonic_period, the owner will * be the executing thread. When this routine is invoked from * _Rate_monotonic_Timeout, it will not. */ - #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - if (owning_thread == _Thread_Executing) { - Timestamp_Control ran; + if (owning_thread == _Thread_Executing) { + Timestamp_Control ran; - /* - * Adjust the CPU time used to account for the time since last - * context switch. - */ - _Timestamp_Subtract( - &_Thread_Time_of_last_context_switch, &uptime, &ran - ); + /* + * Adjust the CPU time used to account for the time since last + * context switch. + */ + _Timestamp_Subtract( + &_Thread_Time_of_last_context_switch, &uptime, &ran + ); - _Timestamp_Add_to( &the_period->cpu_usage_period_initiated, &ran ); - } - #endif + _Timestamp_Add_to( &the_period->cpu_usage_period_initiated, &ran ); + } _Scheduler_Release_job( the_period->owner, the_period->next_length ); } |