summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-11-17 22:55:51 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-11-17 22:55:51 +0000
commitbf89c76217d64bcf6372486f111b2bd9174e732e (patch)
tree60a386985b40884abbf0730b5b712b215a8c8369
parent2006-11-17 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-bf89c76217d64bcf6372486f111b2bd9174e732e.tar.bz2
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* libmisc/rtmonuse/rtmonuse.c: Do not use float for calculations.
-rw-r--r--cpukit/ChangeLog4
-rw-r--r--cpukit/libmisc/rtmonuse/rtmonuse.c27
2 files changed, 25 insertions, 6 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 0d80208c13..795e7a2627 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,9 @@
2006-11-17 Joel Sherrill <joel@OARcorp.com>
+ * libmisc/rtmonuse/rtmonuse.c: Do not use float for calculations.
+
+2006-11-17 Joel Sherrill <joel@OARcorp.com>
+
* libcsupport/src/sync.c: Do not dereference NULL reent.
2006-11-17 Joel Sherrill <joel@OARcorp.com>
diff --git a/cpukit/libmisc/rtmonuse/rtmonuse.c b/cpukit/libmisc/rtmonuse/rtmonuse.c
index 4b8c2cbfe4..b954fae988 100644
--- a/cpukit/libmisc/rtmonuse/rtmonuse.c
+++ b/cpukit/libmisc/rtmonuse/rtmonuse.c
@@ -135,6 +135,8 @@ void Period_usage_Dump( void )
char *cname;
char name[5];
uint32_t api_index;
+ uint32_t ival_cpu, fval_cpu;
+ uint32_t ival_wall, fval_wall;
Objects_Information *information;
if ( !Period_usage_Information ) {
@@ -142,8 +144,10 @@ void Period_usage_Dump( void )
return;
}
- fprintf(stdout, "Period information by period\n" );
- fprintf(stdout, " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
+ fprintf(stdout,
+ "Period information by period\n"
+ " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n"
+ );
/*
* RTEMS does not use an index of zero for object ids.
@@ -192,19 +196,30 @@ void Period_usage_Dump( void )
if ( !isprint(name[3]) ) name[3] = '*';
+ ival_cpu = the_usage->total_cpu_time * 100 / the_usage->count;
+ fval_cpu = ival_cpu % 100;
+ ival_cpu /= 100;
+ ival_wall = the_usage->total_wall_time * 100 / the_usage->count;
+ fval_wall = ival_wall % 100;
+ ival_wall /= 100;
fprintf(stdout,
- "0x%08" PRIx32 " %4s %6" PRId32 " %3" PRId32 " %" PRId32
- "/%" PRId32 "/%5.2f %" PRId32 "/%" PRId32 "/%3.2f\n",
+ "0x%08" PRIx32 " %4s %6" PRId32 " %3" PRId32 " "
+ "%" PRId32 "/%" PRId32 "/%" PRId32 ".%02" PRId32 " "
+ "%" PRId32 "/%" PRId32 "/%" PRId32 ".%02" PRId32 "\n",
the_usage->id,
name,
the_usage->count,
the_usage->missed_count,
+
the_usage->min_cpu_time,
the_usage->max_cpu_time,
- (double) the_usage->total_cpu_time / (double) the_usage->count,
+ ival_cpu, fval_cpu,
+ /* (double) the_usage->total_cpu_time / (double) the_usage->count, */
+
the_usage->min_wall_time,
the_usage->max_wall_time,
- (double) the_usage->total_wall_time / (double) the_usage->count
+ ival_wall, fval_wall
+ /* (double) the_usage->total_wall_time / (double) the_usage->count */
);
}
}