Add a command for showing the heap usage.

PR:		165025
Submitted by:	Gavin Mu
MFC after:	1 week
This commit is contained in:
Marius Strobl 2012-05-01 16:38:33 +00:00
parent 46684c91ec
commit e2a35695f8

View File

@ -800,6 +800,18 @@ main(int (*openfirm)(void *))
return (1);
}
COMMAND_SET(heap, "heap", "show heap usage", command_heap);
static int
command_heap(int argc, char *argv[])
{
mallocstats();
printf("heap base at %p, top at %p, upper limit at %p\n", heapva,
sbrk(0), heapva + HEAPSZ);
return(CMD_OK);
}
COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
static int