summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorGlenn Humphrey <glenn.humphrey@oarcorp.com>2007-10-26 21:30:59 +0000
committerGlenn Humphrey <glenn.humphrey@oarcorp.com>2007-10-26 21:30:59 +0000
commitb0ac06f8e9dc11c7aa3bfebc910fafd4018dbd9c (patch)
tree60ad5746b5e5ccad0a2971a64adb2f1a7af3266f /cpukit/libmisc
parent2007-10-26 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-b0ac06f8e9dc11c7aa3bfebc910fafd4018dbd9c.tar.bz2
2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* libmisc/cpuuse/cpuusagereport.c, rtems/src/ratemonreportstatistics.c: Cleaned up reports and fixed a bug related the printf format which resulted in lack of leading zeroes and misleading magnitude. * score/src/timespecdivide.c: Fixed bugs related to zero divide case.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r--cpukit/libmisc/cpuuse/cpuusagereport.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c
index 2a4c569e26..3fee85c269 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereport.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereport.c
@@ -86,15 +86,12 @@ void rtems_cpu_usage_report_with_plugin(
}
#endif
+ (*print)( context, "CPU Usage by thread\n"
#if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS)
- (*print)( context, "--- CPU Usage times are seconds:microseconds ---\n" );
+ " ID NAME SECONDS PERCENT\n"
+ #else
+ " ID NAME TICKS PERCENT\n"
#endif
- (*print)( context, "CPU Usage by thread\n"
- #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
- " ID NAME SECONDS PERCENT\n"
- #else
- " ID NAME TICKS PERCENT\n"
- #endif
);
for ( api_index = 1 ;
@@ -112,7 +109,7 @@ void rtems_cpu_usage_report_with_plugin(
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
- (*print)( context, "0x%08" PRIx32 " %4s ", the_thread->Object.id, name );
+ (*print)( context, "0x%08" PRIx32 " %4s ", the_thread->Object.id, name );
#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
/*
@@ -134,7 +131,7 @@ void rtems_cpu_usage_report_with_plugin(
*/
(*print)( context,
- "%2" PRId32 ":%06" PRId32 " %3" PRId32 ".%02" PRId32 "\n",
+ "%3" PRId32 ".%06" PRId32 " %3" PRId32 ".%03" PRId32 "\n",
ran.tv_sec, ran.tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND,
ival, fval
);
@@ -144,7 +141,7 @@ void rtems_cpu_usage_report_with_plugin(
fval = ival % 100;
ival /= 100;
(*print)( context,
- "%8" PRId32 " %3" PRId32 ".%02" PRId32"\n",
+ "%8" PRId32 " %3" PRId32 ".%02" PRId32"\n",
the_thread->ticks_executed,
ival,
fval
@@ -165,7 +162,7 @@ void rtems_cpu_usage_report_with_plugin(
"Ticks since last reset = %" PRId32 "\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
);
- (*print)( context, "Total Units = %" PRId32 "\n\n", total_units );
+ (*print)( context, "Total Units = %" PRId32 "\n", total_units );
#endif
}