Skip to content

Commit

Permalink
tlsf: Improve sizes when dumping debug data
Browse files Browse the repository at this point in the history
Include max possible available size (ie pool - overhead).
Include sizes - overhead.
Include size of some internal structures.
  • Loading branch information
Stephen Roderick authored and meyerj committed Apr 28, 2017
1 parent 2874eb9 commit dbdd514
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions rtt/os/tlsf/tlsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,15 @@ void print_all_blocks(FILE* ff, tlsf_t * tlsf)
area_info_t *ai;
bhdr_t *next;
FPRINT_MSG(ff, "\nTLSF at %p\nALL BLOCKS\n", tlsf);
FPRINT_MSG(ff, "Sizes pool=%u overhead=%u used=%u max-used=%u\n\n",
tlsf->pool_size, tlsf->overhead_size, tlsf->used_size, tlsf->max_size);
FPRINT_MSG(ff, "Sizes (bytes)\n");
FPRINT_MSG(ff, " pool=%lu initial overhead=%lu max-possible-available=%lu\n",
tlsf->pool_size, tlsf->overhead_size, (tlsf->pool_size - tlsf->overhead_size));
FPRINT_MSG(ff, " used=%lu max-used=%lu (both including initial overhead)\n",
tlsf->used_size, tlsf->max_size);
FPRINT_MSG(ff, " used=%lu max-used=%lu (both without initial overhead)\n",
(tlsf->used_size - tlsf->overhead_size), (tlsf->max_size - tlsf->overhead_size));
FPRINT_MSG(ff, " sizeof items bhdr_t=%lu area_info_t=%lu tlsf_t=%lu\n\n" ,
sizeof(bhdr_t), sizeof(area_info_t), sizeof(tlsf_t));
ai = tlsf->area_head;
while (ai) {
next = (bhdr_t *) ((char *) ai - BHDR_OVERHEAD);
Expand Down

0 comments on commit dbdd514

Please sign in to comment.