[rtems commit] rtems: Avoid __RTEMS_USE_TICKS_FOR_STATISTICS__

Sebastian Huber sebh at rtems.org
Mon Mar 21 09:46:44 UTC 2016


Module:    rtems
Branch:    master
Commit:    875c26db0f5a6c548b6fb92c478511f2c8ef919b
Changeset: http://git.rtems.org/rtems/commit/?id=875c26db0f5a6c548b6fb92c478511f2c8ef919b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 21 10:45:44 2016 +0100

rtems: Avoid __RTEMS_USE_TICKS_FOR_STATISTICS__

Option was removed by e6b31b27fbe3cd76534db2d4fc4ef5dcdf0d33b4.

---

 cpukit/rtems/src/ratemonperiod.c | 45 +++++++++-------------------------------
 1 file changed, 10 insertions(+), 35 deletions(-)

diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 11968ad..e03d8cf 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -123,49 +123,24 @@ static void _Rate_monotonic_Update_statistics(
   /*
    *  Update CPU time
    */
-  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
-    _Timestamp_Add_to( &stats->total_cpu_time, &executed );
+  _Timestamp_Add_to( &stats->total_cpu_time, &executed );
 
-    if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
-      stats->min_cpu_time = executed;
+  if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
+    stats->min_cpu_time = executed;
 
-    if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
-      stats->max_cpu_time = executed;
-  #else
-    stats->total_cpu_time  += executed;
-
-    if ( executed < stats->min_cpu_time )
-      stats->min_cpu_time = executed;
-
-    if ( executed > stats->max_cpu_time )
-      stats->max_cpu_time = executed;
-  #endif
+  if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
+    stats->max_cpu_time = executed;
 
   /*
    *  Update Wall time
    */
-  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
-    _Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
-
-    if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
-      stats->min_wall_time = since_last_period;
-
-    if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
-      stats->max_wall_time = since_last_period;
-  #else
-
-    /* Sanity check wall time */
-    if ( since_last_period < executed )
-      since_last_period = executed;
-
-    stats->total_wall_time += since_last_period;
+  _Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
 
-    if ( since_last_period < stats->min_wall_time )
-      stats->min_wall_time = since_last_period;
+  if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
+    stats->min_wall_time = since_last_period;
 
-    if ( since_last_period > stats->max_wall_time )
-      stats->max_wall_time = since_last_period;
-  #endif
+  if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
+    stats->max_wall_time = since_last_period;
 }
 
 rtems_status_code rtems_rate_monotonic_period(




More information about the vc mailing list