From 9f130719f5445043bc037dc3dd9dd3dbae95d23e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 29 Jun 2008 23:17:41 +0000 Subject: [PATCH] Fixed the layout of the "aspaces" command output and added the number of areas and the total area size. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26172 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/vm_address_space.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/vm/vm_address_space.cpp b/src/system/kernel/vm/vm_address_space.cpp index c01bb3fba2..984fa6db55 100644 --- a/src/system/kernel/vm/vm_address_space.cpp +++ b/src/system/kernel/vm/vm_address_space.cpp @@ -94,13 +94,24 @@ dump_aspace_list(int argc, char **argv) vm_address_space *space; struct hash_iterator iter; - dprintf("addr\tid\tbase\t\tsize\n"); + dprintf(" address id base size area count " + " area size\n"); hash_open(sAddressSpaceTable, &iter); while ((space = (vm_address_space *)hash_next(sAddressSpaceTable, &iter)) != NULL) { - dprintf("%p\t0x%lx\t0x%lx\t\t0x%lx\n", - space, space->id, space->base, space->size); + int32 areaCount = 0; + off_t areaSize = 0; + for (vm_area* area = space->areas; area != NULL; + area = area->address_space_next) { + if (area->id != RESERVED_AREA_ID + && area->cache->type != CACHE_TYPE_NULL) { + areaCount++; + areaSize += area->size; + } + } + dprintf("%p %6ld %#010lx %#10lx %10ld %10lld\n", + space, space->id, space->base, space->size, areaCount, areaSize); } hash_close(sAddressSpaceTable, &iter, false); return 0;