FreeBSD Bugzilla – Attachment 162273 Details for
Bug 203917
[patch] systat -vm to display physical and kernel memory % usage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
systat -vm phys/kern mem usage
systat-vm-mem.diff (text/plain), 2.20 KB, created by
ota
on 2015-10-21 07:48:20 UTC
(
hide
)
Description:
systat -vm phys/kern mem usage
Filename:
MIME Type:
Creator:
ota
Created:
2015-10-21 07:48:20 UTC
Size:
2.20 KB
patch
obsolete
>Index: usr.bin/systat/vmstat.c >=================================================================== >--- usr.bin/systat/vmstat.c (revision 289605) >+++ usr.bin/systat/vmstat.c (working copy) >@@ -108,6 +107,7 @@ > u_int v_active_count; /* number of pages active */ > u_int v_inactive_count; /* number of pages inactive */ > u_int v_cache_count; /* number of pages on buffer cache queue */ >+ u_long v_kmem_map_size; /* Current kmem allocation size */ > struct vmtotal Total; > struct nchstats nchstats; > long nchcount; >@@ -118,8 +118,10 @@ > long freevnodes; > int numdirtybuffers; > } s, s1, s2, z; >+static u_long kmem_size; >+static u_int v_page_count; > > struct statinfo cur, last, run; > > #define total s.Total > #define nchtotal s.nchstats >@@ -278,6 +266,8 @@ > allocinfo(&s2); > allocinfo(&z); > } >+ GETSYSCTL("vm.kmem_size", kmem_size); >+ GETSYSCTL("vm.stats.vm.v_page_count", v_page_count); > getinfo(&s2); > copyinfo(&s2, &s1); > return(1); >@@ -307,8 +297,8 @@ > > clear(); > mvprintw(STATROW, STATCOL + 6, "users Load"); >- mvprintw(MEMROW, MEMCOL, "Mem:KB REAL VIRTUAL"); >- mvprintw(MEMROW + 1, MEMCOL, " Tot Share Tot Share"); >+ mvprintw(MEMROW, MEMCOL, "Phy: %% REAL VIRTUAL Kmem: %%"); >+ mvprintw(MEMROW + 1, MEMCOL, "Mem: Tot Share Tot Share"); > mvprintw(MEMROW + 2, MEMCOL, "Act"); > mvprintw(MEMROW + 3, MEMCOL, "All"); > >@@ -478,6 +449,10 @@ > putfloat(avenrun[2], STATROW, STATCOL + 32, 5, 2, 0); > mvaddstr(STATROW, STATCOL + 55, buf); > #define pgtokb(pg) ((pg) * (s.v_page_size / 1024)) >+ putfloat(100.0 * (v_page_count - total.t_free) / v_page_count, >+ MEMROW, MEMCOL + 4, 3, 0, 1); >+ putfloat(100.0 * s.v_kmem_map_size / kmem_size, >+ MEMROW, MEMCOL + 41, 3, 0, 1); > putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); > putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); > putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); >@@ -790,6 +762,7 @@ > GETSYSCTL("vfs.freevnodes", ls->freevnodes); > GETSYSCTL("vfs.cache.nchstats", ls->nchstats); > GETSYSCTL("vfs.numdirtybuffers", ls->numdirtybuffers); >+ GETSYSCTL("vm.kmem_map_size", ls->v_kmem_map_size); > getsysctl("hw.intrcnt", ls->intrcnt, nintr * sizeof(u_long)); > > size = sizeof(ls->Total);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203917
: 162273