[rtems commit] rtems: Avoid __RTEMS_USE_TICKS_FOR_STATISTICS__
Sebastian Huber
sebh at rtems.org
Thu Feb 25 12:11:50 UTC 2016
Module: rtems
Branch: master
Commit: 67de5082a2fea0a834ef480dd951c4850d6d5695
Changeset: http://git.rtems.org/rtems/commit/?id=67de5082a2fea0a834ef480dd951c4850d6d5695
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Feb 25 13:08:45 2016 +0100
rtems: Avoid __RTEMS_USE_TICKS_FOR_STATISTICS__
Option was removed by e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4.
---
cpukit/rtems/src/ratemonperiod.c | 46 ++++++++++++++--------------------------
1 file changed, 16 insertions(+), 30 deletions(-)
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 6aefaba..144164e 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 );
}
More information about the vc
mailing list