From e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 27 May 2015 10:13:58 -0500 Subject: 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. --- cpukit/libcsupport/src/__times.c | 68 ++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 38 deletions(-) (limited to 'cpukit/libcsupport/src/__times.c') diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c index 895ee6b658..e5ec411543 100644 --- a/cpukit/libcsupport/src/__times.c +++ b/cpukit/libcsupport/src/__times.c @@ -31,9 +31,7 @@ #include #include #include -#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - #include -#endif +#include #include /** @@ -63,41 +61,35 @@ clock_t _times( * of ticks since boot and the number of ticks executed by this * this thread. */ - - #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ - { - Timestamp_Control per_tick; - uint32_t ticks_of_executing; - uint32_t fractional_ticks; - Per_CPU_Control *cpu_self; - - _Timestamp_Set( - &per_tick, - rtems_configuration_get_microseconds_per_tick() / - TOD_MICROSECONDS_PER_SECOND, - (rtems_configuration_get_nanoseconds_per_tick() % - TOD_NANOSECONDS_PER_SECOND) - ); - - cpu_self = _Thread_Dispatch_disable(); - executing = _Thread_Executing; - _Thread_Update_cpu_time_used( - executing, - &_Thread_Time_of_last_context_switch - ); - _Timestamp_Divide( - &executing->cpu_time_used, - &per_tick, - &ticks_of_executing, - &fractional_ticks - ); - _Thread_Dispatch_enable( cpu_self ); - ptms->tms_utime = ticks_of_executing * us_per_tick; - } - #else - executing = _Thread_Get_executing(); - ptms->tms_utime = executing->cpu_time_used * us_per_tick; - #endif + { + Timestamp_Control per_tick; + uint32_t ticks_of_executing; + uint32_t fractional_ticks; + Per_CPU_Control *cpu_self; + + _Timestamp_Set( + &per_tick, + rtems_configuration_get_microseconds_per_tick() / + TOD_MICROSECONDS_PER_SECOND, + (rtems_configuration_get_nanoseconds_per_tick() % + TOD_NANOSECONDS_PER_SECOND) + ); + + cpu_self = _Thread_Dispatch_disable(); + executing = _Thread_Executing; + _Thread_Update_cpu_time_used( + executing, + &_Thread_Time_of_last_context_switch + ); + _Timestamp_Divide( + &executing->cpu_time_used, + &per_tick, + &ticks_of_executing, + &fractional_ticks + ); + _Thread_Dispatch_enable( cpu_self ); + ptms->tms_utime = ticks_of_executing * us_per_tick; + } ptms->tms_stime = ticks * us_per_tick; ptms->tms_cutime = 0; ptms->tms_cstime = 0; -- cgit v1.2.3