diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-07-18 08:44:55 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2011-07-18 08:44:55 +0000 |
commit | 3f3b773be17ab7a090c837e7cdd89459ca213473 (patch) | |
tree | d0c6f3858033cb3b525f92cde9482585e02f3801 /cpukit/libcsupport | |
parent | 2011-07-15 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-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.c | 30 |
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, |