Changeset a91e372 in rtems


Ignore:
Timestamp:
Nov 10, 2009, 11:27:34 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
48f3027
Parents:
b02f4cc1
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

    rb02f4cc1 ra91e372  
     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-11-09      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • cpukit/rtems/include/rtems/rtems/ratemon.h

    rb02f4cc1 ra91e372  
    447447     } while (0)
    448448#else
    449   #define _Rate_monotonic_Reset_wall_time_statistics( _the_period )
     449  #define _Rate_monotonic_Reset_wall_time_statistics( _the_period ) \
     450     do { \
     451        /* set the minimum to a large value */ \
     452        (_the_period)->Statistics.min_wall_time = 0xffffffff; \
     453     } while (0)
    450454#endif
    451455
     
    466470     } while (0)
    467471#else
    468   #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period )
     472  #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period ) \
     473     do { \
     474        /* set the minimum to a large value */ \
     475        (_the_period)->Statistics.min_cpu_time = 0xffffffff; \
     476     } while (0)
    469477#endif
    470478
  • cpukit/rtems/src/ratemonperiod.c

    rb02f4cc1 ra91e372  
    105105   *  Update the counts.
    106106   */
    107 
    108107  stats = &the_period->Statistics;
    109108  stats->count++;
     
    115114   *  Grab basic information for time statistics.
    116115   */
    117 
    118116  #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
    119     _Timestamp_Subtract(
    120       &the_period->time_at_period, &uptime, &since_last_period
     117    _Timespec_Subtract(
     118      &the_period->time_at_period,
     119      &uptime,
     120      &since_last_period
    121121    );
    122     the_period->time_at_period = uptime;
    123122  #else
    124123    since_last_period = _Watchdog_Ticks_since_boot - the_period->time_at_period;
    125     the_period->time_at_period = _Watchdog_Ticks_since_boot;
    126124  #endif
    127125
     
    151149    }
    152150  #else
     151      /* partial period, cpu usage info reset while executing.  Throw away */
     152      if (the_period->owner->cpu_time_used <
     153          the_period->owner_executed_at_period)
     154        return;
    153155      executed = the_period->owner->cpu_time_used -
    154156        the_period->owner_executed_at_period;
     
    182184
    183185  #ifndef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
     186
     187    /* Sanity check wall time */
     188    if ( since_last_period < executed )
     189      since_last_period = executed;
     190
    184191    stats->total_wall_time += since_last_period;
    185192
     
    324331           *  Update statistics from the concluding period
    325332           */
    326           _Rate_monotonic_Update_statistics( the_period );
     333          _Rate_monotonic_Initiate_statistics( the_period );
    327334
    328335          _ISR_Enable( level );
Note: See TracChangeset for help on using the changeset viewer.