diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/libmisc/shell/print_heapinfo.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/cpukit/libmisc/shell/print_heapinfo.c b/cpukit/libmisc/shell/print_heapinfo.c index 12bc363f71..4ac9c96f88 100644 --- a/cpukit/libmisc/shell/print_heapinfo.c +++ b/cpukit/libmisc/shell/print_heapinfo.c @@ -14,22 +14,47 @@ #endif #include <inttypes.h> +#include <stdio.h> -#include <rtems.h> -#include <rtems/shell.h> #include "internal.h" void rtems_shell_print_heap_info( - const char *c, - Heap_Information *h + const char *c, + const Heap_Information *h ) { printf( - "Number of %s blocks: %" PRId32 "\n" - "Largest %s block: %" PRId32 "\n" - "Total bytes %s: %" PRId32 "\n", + "Number of %s blocks: %12" PRId32 "\n" + "Largest %s block: %12" PRId32 "\n" + "Total bytes %s: %12" PRId32 "\n", c, h->number, c, h->largest, c, h->total ); } + +void rtems_shell_print_heap_stats( + const Heap_Statistics *s +) +{ + printf( + "Instance number: %12" PRIu32 "\n" + "Size of the allocatable area in bytes: %12" PRIuPTR "\n" + "Minimum free size ever in bytes: %12" PRIuPTR "\n" + "Maximum number of free blocks ever: %12" PRIu32 "\n" + "Maximum number of blocks searched ever: %12" PRIu32 "\n" + "Total number of successful allocations: %12" PRIu32 "\n" + "Total number of searches ever: %12" PRIu32 "\n" + "Total number of successful calls to free: %12" PRIu32 "\n" + "Total number of successful resizes: %12" PRIu32 "\n", + s->instance, + s->size, + s->min_free_size, + s->max_free_blocks, + s->max_search, + s->allocs, + s->searches, + s->frees, + s->resizes + ); +} |