diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-10 22:13:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-12-10 22:13:28 +0000 |
commit | 9dc2c8d16e3d54daeb394d71b2455da114bbd5c9 (patch) | |
tree | 7e70e439c02af44198c2c9d3f1d490e865ae2ab9 /cpukit/rtems/src/ratemongetstatistics.c | |
parent | 2008-12-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-9dc2c8d16e3d54daeb394d71b2455da114bbd5c9.tar.bz2 |
2008-12-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/include/rtems/rtems/ratemon.h,
rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
rtems/src/ratemonreportstatistics.c,
score/include/rtems/score/thread.h, score/src/coretodgetuptime.c:
Make all Thread and Period Statistics use publicly defined types. Do
not leak the SuperCore Timestamp type through the APIs.
Diffstat (limited to 'cpukit/rtems/src/ratemongetstatistics.c')
-rw-r--r-- | cpukit/rtems/src/ratemongetstatistics.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/cpukit/rtems/src/ratemongetstatistics.c b/cpukit/rtems/src/ratemongetstatistics.c index 1738c9c9b9..9b6eb4b173 100644 --- a/cpukit/rtems/src/ratemongetstatistics.c +++ b/cpukit/rtems/src/ratemongetstatistics.c @@ -45,8 +45,10 @@ rtems_status_code rtems_rate_monotonic_get_statistics( rtems_rate_monotonic_period_statistics *statistics ) { - Objects_Locations location; - Rate_monotonic_Control *the_period; + Objects_Locations location; + Rate_monotonic_Control *the_period; + rtems_rate_monotonic_period_statistics *dst; + Rate_monotonic_Statistics *src; if ( !statistics ) return RTEMS_INVALID_ADDRESS; @@ -55,7 +57,30 @@ rtems_status_code rtems_rate_monotonic_get_statistics( switch ( location ) { case OBJECTS_LOCAL: - *statistics = the_period->Statistics; + dst = statistics; + src = &the_period->Statistics; + dst->count = src->count; + dst->missed_count = src->missed_count; + #if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) + _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); + _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); + _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); + #else + statistics->min_wall_time = src->min_wall_time; + statistics->max_wall_time = src->max_wall_time; + statistics->total_wall_time = src->total_wall_time; + #endif + + #if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) + _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); + _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); + _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); + #else + dst->min_wall_time = src->min_wall_time; + dst->max_wall_time = src->max_wall_time; + dst->total_wall_time = src->total_wall_time; + #endif + _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; |