2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com>

* rtems/src/ratemonperiod.c: Clean up.
	* rtems/src/ratemonreportstatistics.c: Clarify period statistics output.
This commit is contained in:
Joel Sherrill
2007-09-06 22:09:18 +00:00
parent a7ff7e7f9d
commit 8677cf75e5
3 changed files with 29 additions and 14 deletions

View File

@@ -1,3 +1,8 @@
2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/src/ratemonperiod.c: Clean up.
* rtems/src/ratemonreportstatistics.c: Clarify period statistics output.
2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com> 2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/monitor/mon-monitor.c: Fix warnings and typo. * libmisc/monitor/mon-monitor.c: Fix warnings and typo.

View File

@@ -66,8 +66,8 @@ void _Rate_monotonic_Update_statistics(
#ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
period_start = the_period->time_at_period; period_start = the_period->time_at_period;
the_period->time_at_period = uptime;
_Timespec_Subtract( &period_start, &uptime, &since_last_period ); _Timespec_Subtract( &period_start, &uptime, &since_last_period );
the_period->time_at_period = uptime;
#else #else
ticks_since_last_period = ticks_since_last_period =
_Watchdog_Ticks_since_boot - the_period->time_at_period; _Watchdog_Ticks_since_boot - the_period->time_at_period;
@@ -122,7 +122,6 @@ void _Rate_monotonic_Update_statistics(
if ( _Timespec_Greater_than( &executed, &stats->max_cpu_time ) ) if ( _Timespec_Greater_than( &executed, &stats->max_cpu_time ) )
stats->max_cpu_time = executed; stats->max_cpu_time = executed;
#else #else
stats->total_cpu_time += ticks_executed_since_last_period; stats->total_cpu_time += ticks_executed_since_last_period;
@@ -148,10 +147,10 @@ void _Rate_monotonic_Update_statistics(
#else #else
_Timespec_Add_to( &stats->total_wall_time, &since_last_period ); _Timespec_Add_to( &stats->total_wall_time, &since_last_period );
if ( _Timespec_Less_than( &since_last_period, &stats->min_wall_time ) ) if ( _Timespec_Less_than( &since_last_period, &stats->min_wall_time ) )
stats->min_wall_time = since_last_period; stats->min_wall_time = since_last_period;
if ( _Timespec_Greater_than( &since_last_period, &stats->max_wall_time ) ) if ( _Timespec_Greater_than( &since_last_period, &stats->max_wall_time ) )
stats->max_wall_time = since_last_period; stats->max_wall_time = since_last_period;
#endif #endif
} }
@@ -260,7 +259,10 @@ rtems_status_code rtems_rate_monotonic_period(
&ran &ran
); );
/* thread had executed before the last context switch also */ /* The thread had executed before the last context switch also.
*
* the_period->owner_executed_at_period += ran
*/
_Timespec_Add_to( &the_period->owner_executed_at_period, &ran ); _Timespec_Add_to( &the_period->owner_executed_at_period, &ran );
} }
#else #else

View File

@@ -27,8 +27,9 @@
#include <rtems/score/timespec.h> #include <rtems/score/timespec.h>
/* We print to 1/10's of milliseconds */ /* We print to 1/10's of milliseconds */
#define NANOSECONDS_DIVIDER 100000 #define NANOSECONDS_DIVIDER 1000
#define PERCENT_FMT "%04" PRId32 #define PERCENT_FMT "%04" PRId32
#define NANOSECONDS_FMT "%" PRId32
#endif #endif
/* /*
@@ -48,6 +49,13 @@ void rtems_rate_monotonic_report_statistics( void )
char name[5]; char name[5];
printk( "Period information by period\n" ); printk( "Period information by period\n" );
#if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS)
printk( "--- Period times are seconds:microseconds ---\n" );
#endif
#if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS)
printk( "--- CPU Usage times are seconds:microseconds ---\n" );
#endif
/* /*
Layout by columns -- in memory of Hollerith :) Layout by columns -- in memory of Hollerith :)
@@ -57,10 +65,10 @@ ididididid NNNN ccccc mmmmmm X
Uncomment the following if you are tinkering with the formatting. Uncomment the following if you are tinkering with the formatting.
Be sure to test the various cases. Be sure to test the various cases.
*/
printk("\ printk("\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n"); \n");
*/
printk( " ID OWNER COUNT MISSED CPU TIME " printk( " ID OWNER COUNT MISSED CPU TIME "
#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
" " " "
@@ -119,9 +127,9 @@ ididididid NNNN ccccc mmmmmm X
&cpu_average &cpu_average
); );
printk( printk(
"%" PRId32 "." PERCENT_FMT "/" /* min cpu time */ "%" PRId32 ":" NANOSECONDS_FMT "/" /* min cpu time */
"%" PRId32 "." PERCENT_FMT "/" /* max cpu time */ "%" PRId32 ":" NANOSECONDS_FMT "/" /* max cpu time */
"%" PRId32 "." PERCENT_FMT " ", /* avg cpu time */ "%" PRId32 ":" NANOSECONDS_FMT " ", /* avg cpu time */
the_stats.min_cpu_time.tv_sec, the_stats.min_cpu_time.tv_sec,
the_stats.min_cpu_time.tv_nsec / NANOSECONDS_DIVIDER, the_stats.min_cpu_time.tv_nsec / NANOSECONDS_DIVIDER,
the_stats.max_cpu_time.tv_sec, the_stats.max_cpu_time.tv_sec,
@@ -155,9 +163,9 @@ ididididid NNNN ccccc mmmmmm X
&wall_average &wall_average
); );
printk( printk(
"%" PRId32 "." PERCENT_FMT "/" /* min wall time */ "%" PRId32 ":" PERCENT_FMT "/" /* min wall time */
"%" PRId32 "." PERCENT_FMT "/" /* max wall time */ "%" PRId32 ":" PERCENT_FMT "/" /* max wall time */
"%" PRId32 "." PERCENT_FMT "\n", /* avg wall time */ "%" PRId32 ":" PERCENT_FMT "\n", /* avg wall time */
the_stats.min_wall_time.tv_sec, the_stats.min_wall_time.tv_sec,
the_stats.min_wall_time.tv_nsec / NANOSECONDS_DIVIDER, the_stats.min_wall_time.tv_nsec / NANOSECONDS_DIVIDER,
the_stats.max_wall_time.tv_sec, the_stats.max_wall_time.tv_sec,