summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-11-22 15:21:14 -0500
committerZack Rusin <[email protected]>2009-11-25 10:20:08 -0500
commitd228e3cc8e7b6a3d4c6d554c5d9aed5e26be7ff0 (patch)
tree18b1779b6c79e57f01944b91529b66db923d515a /src/gallium
parent55b0157860af0eb957262cb0d22ab47eccd85940 (diff)
util: also print out memory statistics
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_mm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_mm.c b/src/gallium/auxiliary/util/u_mm.c
index 4b75d4ba1d0..82f83702d1e 100644
--- a/src/gallium/auxiliary/util/u_mm.c
+++ b/src/gallium/auxiliary/util/u_mm.c
@@ -39,13 +39,20 @@ u_mmDumpMemInfo(const struct mem_block *heap)
}
else {
const struct mem_block *p;
+ int total_used = 0, total_free = 0;
for (p = heap->next; p != heap; p = p->next) {
debug_printf(" Offset:%08x, Size:%08x, %c%c\n", p->ofs, p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
+ if (p->free)
+ total_free += p->size;
+ else
+ total_used += p->size;
}
+ debug_printf("'\nMemory stats: total = %d, used = %d, free = %d\n",
+ total_used + total_free, total_used, total_free);
debug_printf("\nFree list:\n");
for (p = heap->next_free; p != heap; p = p->next_free) {