Changeset bdf5417e in rtems


Ignore:
Timestamp:
Nov 10, 2009, 11:27:01 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
c73cab2
Parents:
9fb27e3
Message:

2009-11-10 Jennifer Averett <jennifer.averett@…>

PR 1462/cpukit

  • rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemonperiod.c: Fine tune previous patch after analysis in application.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r9fb27e3 rbdf5417e  
     12009-11-10      Jennifer Averett <jennifer.averett@OARcorp.com>
     2
     3        PR 1462/cpukit
     4        * rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemonperiod.c: Fine
     5        tune previous patch after analysis in application.
     6
    172009-10-30      Glenn Humphrey <glenn.humphrey@oarcorp.com>
    28
  • cpukit/rtems/include/rtems/rtems/ratemon.h

    r9fb27e3 rbdf5417e  
    414414     } while (0)
    415415#else
    416   #define _Rate_monotonic_Reset_wall_time_statistics( _the_period )
     416  #define _Rate_monotonic_Reset_wall_time_statistics( _the_period ) \
     417     do { \
     418        /* set the minimum to a large value */ \
     419        (_the_period)->Statistics.min_wall_time = 0xffffffff; \
     420     } while (0)
    417421#endif
    418422
     
    430434     } while (0)
    431435#else
    432   #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period )
     436  #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period ) \
     437     do { \
     438        /* set the minimum to a large value */ \
     439        (_the_period)->Statistics.min_cpu_time = 0xffffffff; \
     440     } while (0)
    433441#endif
    434442
  • cpukit/rtems/src/ratemonperiod.c

    r9fb27e3 rbdf5417e  
    9191  rtems_thread_cpu_usage_t                executed;
    9292  rtems_rate_monotonic_period_time_t      since_last_period;
    93   #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
    94     rtems_rate_monotonic_period_time_t    period_start;
    95   #endif
    9693  #if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) || \
    9794      defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS)
     
    113110   *  Update the counts.
    114111   */
    115 
    116112  stats = &the_period->Statistics;
    117113  stats->count++;
     
    123119   *  Grab basic information for time statistics.
    124120   */
    125 
    126121  #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
    127     period_start               = the_period->time_at_period;
    128     _Timespec_Subtract( &period_start, &uptime, &since_last_period );
    129     the_period->time_at_period = uptime;
     122    _Timespec_Subtract(
     123     &the_period->time_at_period,
     124     &uptime,
     125     &since_last_period
     126   );
    130127  #else
    131128    since_last_period = _Watchdog_Ticks_since_boot - the_period->time_at_period;
    132     the_period->time_at_period = _Watchdog_Ticks_since_boot;
    133129  #endif
    134130
     
    156152    }
    157153  #else
     154      /* partial period, cpu usage info reset while executing.  Throw away */
     155      if (the_period->owner->cpu_time_used <
     156          the_period->owner_executed_at_period)
     157        return;
    158158      executed = the_period->owner->cpu_time_used -
    159159        the_period->owner_executed_at_period;
     
    187187
    188188  #ifndef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
     189
     190    /* Sanity check wall time */
     191    if ( since_last_period < executed)
     192      since_last_period = executed;
     193
    189194    stats->total_wall_time += since_last_period;
    190195
     
    330335           *  Update statistics from the concluding period
    331336           */
    332           _Rate_monotonic_Update_statistics( the_period );
     337          _Rate_monotonic_Initiate_statistics( the_period );
    333338
    334339          _ISR_Enable( level );
Note: See TracChangeset for help on using the changeset viewer.