shithub: riscv

Download patch

ref: 45b79036bed41e170dd4fca0bbec4425aee5033e
parent: 6c99d2f028a889602134f7117ff571991634dcf8
author: cinap_lenrek <[email protected]>
date: Tue Jun 16 04:05:33 EDT 2015

devcons: add current pool allocations to #c/swap

--- a/sys/man/3/cons
+++ b/sys/man/3/cons
@@ -253,8 +253,8 @@
 \fIn\fP kernel
 \fIn\fP/\fIm\fP user
 \fIn\fP/\fIm\fP swap
-\fIn\fP/\fIm\fP kernel malloc
-\fIn\fP/\fIm\fP kernel draw
+\fIa\fP/\fIn\fP/\fIm\fP kernel malloc
+\fIa\fP/\fIn\fP/\fIm\fP kernel draw
 .EE
 .PP
 These are total memory (bytes), system page size (bytes),
@@ -267,6 +267,9 @@
 used out of
 .I m
 available.
+For kernel malloc and kernel draw,
+.IR a
+indicates the current allocation in bytes.
 These numbers are not blank padded.
 .PP
 To turn on swapping, write to
--- a/sys/src/9/port/devcons.c
+++ b/sys/src/9/port/devcons.c
@@ -609,15 +609,17 @@
 			"%lud kernel\n"
 			"%lud/%lud user\n"
 			"%lud/%lud swap\n"
-			"%llud/%llud kernel malloc\n"
-			"%llud/%llud kernel draw\n",
+			"%llud/%llud/%llud kernel malloc\n"
+			"%llud/%llud/%llud kernel draw\n",
 			(uvlong)conf.npage*BY2PG,
 			(uvlong)BY2PG,
 			conf.npage-conf.upages,
 			palloc.user-palloc.freecount-fscache.pgref-swapimage.pgref, palloc.user,
 			conf.nswap-swapalloc.free, conf.nswap,
+			(uvlong)mainmem->curalloc,
 			(uvlong)mainmem->cursize,
 			(uvlong)mainmem->maxsize,
+			(uvlong)imagmem->curalloc,
 			(uvlong)imagmem->cursize,
 			(uvlong)imagmem->maxsize);