Subject: Re: vm tuning/monitoring
To: None <hubert@feyrer.de>
From: Havard Eidnes <he@NetBSD.org>
List: tech-kern
Date: 09/09/2004 09:42:08
----Next_Part(Thu_Sep__9_09:42:08_2004_512)--
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

following up with uvm information collection, find below a patch to
xuvmstat from pkgsrc which adds a bar graph showing how many pages are
allocated to file, anon and exec, plus free and the "rest".  I'm not
entirely clear on what's included in the latter.  To build with this,
create pkgsrc/xuvmstat/patches, stick the patch in patches/patch-aa,
do "make mps" and either "make install" or "make update".

I've sent the patch to Chuck for inclusion in later versions, either
as is or a modified version.

Regards,

- H=E5vard

----Next_Part(Thu_Sep__9_09:42:08_2004_512)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

$NetBSD$

--- xuvmstat.c.orig	Mon Aug 11 02:14:36 2003
+++ xuvmstat.c
@@ -74,7 +74,7 @@ char **argv;
 
   x = y = 10;
   w = WIDTH;
-  h = 650;
+  h = 680;
   win = open_window(&xdpy, xdpy.rootwin, x, y, w, h,
 		    xdpy.black, xdpy.white, ExposureMask, visual);
 
@@ -212,6 +212,30 @@ int was_timeout;
     vals[4] = cexp.npages - (vals[0]+vals[1]+vals[2]+vals[3]);
     y = draw_barbox(xdpy, win, gc, fnt_fixed, 5, 295, y, 5, cexp.npages, names,
 		  vals, colors, white);
+  }
+
+  y += 8;
+  {
+    static char *names[] = { "file", "anon", "exec", "free", "rest" };
+    u_long vals[5];
+    static u_long colors[5], init = 0;
+    
+    if (init == 0) { 
+      init = 1;
+      colors[0] = red;
+      colors[1] = blue;
+      colors[2] = green;
+      colors[3] = orange; 
+      colors[4] = purple;
+    } 
+  
+    vals[0] = cexp.filepages;
+    vals[1] = cexp.anonpages;
+    vals[2] = cexp.execpages;
+    vals[3] = cexp.free;
+    vals[4] = cexp.npages - (vals[0]+vals[1]+vals[2]+vals[3]);
+    y = draw_barbox(xdpy, win, gc, fnt_fixed, 5, 295, y, 5, cexp.npages, names,
+                  vals, colors, white);
   }
 
   y += 8;

----Next_Part(Thu_Sep__9_09:42:08_2004_512)----