summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/__times.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2015-05-27 10:13:58 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-06-15 13:20:17 -0500
commite6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4 (patch)
treee833cd29335dedfba764815c61a92c0a4cab1347 /cpukit/libcsupport/src/__times.c
parentscore: Add _Watchdog_Preinitialize() (diff)
downloadrtems-e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4.tar.bz2
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.
Diffstat (limited to 'cpukit/libcsupport/src/__times.c')
-rw-r--r--cpukit/libcsupport/src/__times.c68
1 files changed, 30 insertions, 38 deletions
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 <errno.h>
#include <rtems/seterr.h>
#include <rtems/score/todimpl.h>
-#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
- #include <rtems/score/timestamp.h>
-#endif
+#include <rtems/score/timestamp.h>
#include <rtems/score/threadimpl.h>
/**
@@ -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;