summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 22:09:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 22:09:18 +0000
commit8677cf75e577ce98a3e72087dcbdda0c83a0330c (patch)
treeb74f7e170cd60b8172f85fdc5771dae647d18e60 /cpukit
parent2007-09-06 Daniel Hellstrom <daniel@gaisler.com> (diff)
downloadrtems-8677cf75e577ce98a3e72087dcbdda0c83a0330c.tar.bz2
2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/src/ratemonperiod.c: Clean up. * rtems/src/ratemonreportstatistics.c: Clarify period statistics output.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/rtems/src/ratemonperiod.c12
-rw-r--r--cpukit/rtems/src/ratemonreportstatistics.c26
3 files changed, 29 insertions, 14 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index f33232be6a..6b175832c9 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,10 @@
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>
+
* libmisc/monitor/mon-monitor.c: Fix warnings and typo.
2007-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 50a0a2d912..8d0dca13d2 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -66,8 +66,8 @@ void _Rate_monotonic_Update_statistics(
#ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
period_start = the_period->time_at_period;
- the_period->time_at_period = uptime;
_Timespec_Subtract( &period_start, &uptime, &since_last_period );
+ the_period->time_at_period = uptime;
#else
ticks_since_last_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 ) )
stats->max_cpu_time = executed;
-
#else
stats->total_cpu_time += ticks_executed_since_last_period;
@@ -148,10 +147,10 @@ void _Rate_monotonic_Update_statistics(
#else
_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;
- 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;
#endif
}
@@ -260,7 +259,10 @@ rtems_status_code rtems_rate_monotonic_period(
&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 );
}
#else
diff --git a/cpukit/rtems/src/ratemonreportstatistics.c b/cpukit/rtems/src/ratemonreportstatistics.c
index 35f3c6d30b..7e03105e1a 100644
--- a/cpukit/rtems/src/ratemonreportstatistics.c
+++ b/cpukit/rtems/src/ratemonreportstatistics.c
@@ -27,8 +27,9 @@
#include <rtems/score/timespec.h>
/* We print to 1/10's of milliseconds */
- #define NANOSECONDS_DIVIDER 100000
- #define PERCENT_FMT "%04" PRId32
+ #define NANOSECONDS_DIVIDER 1000
+ #define PERCENT_FMT "%04" PRId32
+ #define NANOSECONDS_FMT "%" PRId32
#endif
/*
@@ -48,6 +49,13 @@ void rtems_rate_monotonic_report_statistics( void )
char name[5];
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 :)
@@ -57,10 +65,10 @@ ididididid NNNN ccccc mmmmmm X
Uncomment the following if you are tinkering with the formatting.
Be sure to test the various cases.
+*/
printk("\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
-*/
printk( " ID OWNER COUNT MISSED CPU TIME "
#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
" "
@@ -119,9 +127,9 @@ ididididid NNNN ccccc mmmmmm X
&cpu_average
);
printk(
- "%" PRId32 "." PERCENT_FMT "/" /* min cpu time */
- "%" PRId32 "." PERCENT_FMT "/" /* max cpu time */
- "%" PRId32 "." PERCENT_FMT " ", /* avg cpu time */
+ "%" PRId32 ":" NANOSECONDS_FMT "/" /* min cpu time */
+ "%" PRId32 ":" NANOSECONDS_FMT "/" /* max cpu time */
+ "%" PRId32 ":" NANOSECONDS_FMT " ", /* avg cpu time */
the_stats.min_cpu_time.tv_sec,
the_stats.min_cpu_time.tv_nsec / NANOSECONDS_DIVIDER,
the_stats.max_cpu_time.tv_sec,
@@ -155,9 +163,9 @@ ididididid NNNN ccccc mmmmmm X
&wall_average
);
printk(
- "%" PRId32 "." PERCENT_FMT "/" /* min wall time */
- "%" PRId32 "." PERCENT_FMT "/" /* max wall time */
- "%" PRId32 "." PERCENT_FMT "\n", /* avg wall time */
+ "%" PRId32 ":" PERCENT_FMT "/" /* min wall time */
+ "%" PRId32 ":" PERCENT_FMT "/" /* max wall time */
+ "%" PRId32 ":" PERCENT_FMT "\n", /* avg wall time */
the_stats.min_wall_time.tv_sec,
the_stats.min_wall_time.tv_nsec / NANOSECONDS_DIVIDER,
the_stats.max_wall_time.tv_sec,