svn commit: r235998 - stable/8/sys/boot/sparc64/loader

Marius Strobl marius at FreeBSD.org
Fri May 25 14:57:03 UTC 2012


Author: marius
Date: Fri May 25 14:57:02 2012
New Revision: 235998
URL: http://svn.freebsd.org/changeset/base/235998

Log:
  MFC: r234897
  
  Add a command for showing the heap usage.
  
  PR:		165025
  Submitted by:	Gavin Mu

Modified:
  stable/8/sys/boot/sparc64/loader/main.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/boot/sparc64/loader/main.c
==============================================================================
--- stable/8/sys/boot/sparc64/loader/main.c	Fri May 25 14:57:01 2012	(r235997)
+++ stable/8/sys/boot/sparc64/loader/main.c	Fri May 25 14:57:02 2012	(r235998)
@@ -915,6 +915,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


More information about the svn-src-stable mailing list