devcons: add current pool allocations to #c/swap

This commit is contained in:
cinap_lenrek 2015-06-16 08:05:33 +02:00
parent 6c99d2f028
commit 45b79036be
2 changed files with 9 additions and 4 deletions

View file

@ -253,8 +253,8 @@ device holds a text block giving memory usage statistics:
\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 @@ indicates
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

View file

@ -609,15 +609,17 @@ consread(Chan *c, void *buf, long n, vlong off)
"%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);