summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-18 08:44:55 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-07-18 08:44:55 +0000
commit3f3b773be17ab7a090c837e7cdd89459ca213473 (patch)
treed0c6f3858033cb3b525f92cde9482585e02f3801 /cpukit/libcsupport
parent2011-07-15 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-3f3b773be17ab7a090c837e7cdd89459ca213473.tar.bz2
2011-07-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/malloc_report_statistics_plugin.c: Fixed format specifiers.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/malloc_report_statistics_plugin.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/cpukit/libcsupport/src/malloc_report_statistics_plugin.c b/cpukit/libcsupport/src/malloc_report_statistics_plugin.c
index 637587190a..48fd048123 100644
--- a/cpukit/libcsupport/src/malloc_report_statistics_plugin.c
+++ b/cpukit/libcsupport/src/malloc_report_statistics_plugin.c
@@ -24,27 +24,27 @@ void malloc_report_statistics_with_plugin(
rtems_printk_plugin_t print
)
{
- rtems_malloc_statistics_t *s;
- uintmax_t allocated;
-
- s = &rtems_malloc_statistics;
-
- allocated = s->lifetime_allocated - s->lifetime_freed;
+ rtems_malloc_statistics_t *s = &rtems_malloc_statistics;
+ uint32_t space_available = s->space_available;
+ uint32_t allocated = (uint32_t) (s->lifetime_allocated - s->lifetime_freed);
+ uint32_t max_depth = s->max_depth;
+ /* avoid float! */
+ uint32_t allocated_per_cent = (allocated * 100) / space_available;
+ uint32_t max_depth_per_cent = (max_depth * 100) / space_available;
(*print)(
context,
"Malloc statistics\n"
- " avail:%"PRIu32"k allocated:%"PRIu32"k (%"PRId32"%%) "
+ " avail:%"PRIu32"k allocated:%"PRIu32"k (%"PRIu32"%%) "
"max:%"PRIu32"k (%"PRIu32"%%)"
- " lifetime:%"PRIu32"k freed:%"PRIu32"k\n",
- s->space_available / 1024,
+ " lifetime:%"PRIuMAX"k freed:%"PRIuMAX"k\n",
+ space_available / 1024,
allocated / 1024,
- /* avoid float! */
- (allocated * 100) / s->space_available,
- s->max_depth / 1024,
- (s->max_depth * 100) / s->space_available,
- (uint32_t) (s->lifetime_allocated / 1024),
- (uint32_t) (s->lifetime_freed / 1024)
+ allocated_per_cent,
+ max_depth / 1024,
+ max_depth_per_cent,
+ s->lifetime_allocated / 1024,
+ s->lifetime_freed / 1024
);
(*print)(
context,