summaryrefslogtreecommitdiff
path: root/sysutils/xuvmstat/patches/patch-aa
blob: 44e63e90442e75d3007d337f7250f2cc10fc5ddf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
$NetBSD: patch-aa,v 1.8 2006/11/10 10:07:20 martin Exp $

--- xuvmstat.c.orig	2005-09-09 15:38:48.000000000 +0200
+++ xuvmstat.c	2006-11-10 10:52:11.000000000 +0100
@@ -40,13 +40,13 @@
 
 #include "libcdcx.h"
 
-void get_uvmexp __P((struct uvmexp *));
+void get_uvmexp __P((struct uvmexp_sysctl *));
 void redraw __P((struct xdpy *, Window, GC, int));
 
 
 u_long black, white, red, green, blue, magenta, orange, purple;
 XFontStruct *fnt_fixed, *fnt_8x13bold;
-struct uvmexp cexp, oexp;	/* current, old */
+struct uvmexp_sysctl curexp, oexp;	/* current, old */
 struct timeval tv, otv;
 struct graph *gp_faults, *gp_traps, *gp_intrs, *gp_ctx;
 
@@ -100,7 +100,7 @@
   XMapRaised(xdpy.dpy, win);
   XFlush(xdpy.dpy);
 
-  get_uvmexp(&cexp);
+  get_uvmexp(&curexp);
   gettimeofday(&tv, NULL);
   get_uvmexp(&oexp);
   gettimeofday(&otv, NULL);
@@ -135,8 +135,8 @@
       if (retval == 0) {
         timeradd(&now, &incr, &ping);
         otv = tv;
-        oexp = cexp;
-        get_uvmexp(&cexp);
+        oexp = curexp;
+        get_uvmexp(&curexp);
         gettimeofday(&tv, NULL);
         /* NEW GRAPH DATA HERE */
 
@@ -186,7 +186,7 @@
 
   XSetFont(xdpy->dpy, gc, fnt_fixed->fid); 
   snprintf(buf, sizeof(buf),"The UVM system manages %d %d-byte pages",
-	   cexp.npages, cexp.pagesize);
+	   curexp.npages, curexp.pagesize);
   XDrawImageString(xdpy->dpy, win, gc, 5, get_fontheight(fnt_fixed) + y,
 		   buf, strlen(buf)); 
   y += get_fontheight(fnt_fixed) + 5;
@@ -205,12 +205,12 @@
       colors[4] = purple;
     }
  
-    vals[0] = cexp.active;
-    vals[1] = cexp.inactive;
-    vals[2] = cexp.free;
-    vals[3] = cexp.wired;
-    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[0] = curexp.active;
+    vals[1] = curexp.inactive;
+    vals[2] = curexp.free;
+    vals[3] = curexp.wired;
+    vals[4] = curexp.npages - (vals[0]+vals[1]+vals[2]+vals[3]);
+    y = draw_barbox(xdpy, win, gc, fnt_fixed, 5, 295, y, 5, curexp.npages, names,
 		  vals, colors, white);
   }
 
@@ -229,12 +229,12 @@
       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[0] = curexp.filepages;
+    vals[1] = curexp.anonpages;
+    vals[2] = curexp.execpages;
+    vals[3] = curexp.free;
+    vals[4] = curexp.npages - (vals[0]+vals[1]+vals[2]+vals[3]);
+    y = draw_barbox(xdpy, win, gc, fnt_fixed, 5, 295, y, 5, curexp.npages, names,
                   vals, colors, white);
   }
 
@@ -245,11 +245,11 @@
     u_long vals[3];
     u_long colors[3];
 
-    vals[0] = cexp.freemin;  colors[0] = black;
-    vals[1] = cexp.freetarg; colors[1] = black;
-    vals[2] = cexp.free;     colors[2] = green;
+    vals[0] = curexp.freemin;  colors[0] = black;
+    vals[1] = curexp.freetarg; colors[1] = black;
+    vals[2] = curexp.free;     colors[2] = green;
 
-    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 3, cexp.npages, names,
+    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 3, curexp.npages, names,
 		vals, colors, white);
   }
 
@@ -260,10 +260,10 @@
     u_long vals[2];
     u_long colors[2];
 
-    vals[0] = cexp.inactarg;  colors[0] = black;
-    vals[1] = cexp.inactive;  colors[1] = blue;
+    vals[0] = curexp.inactarg;  colors[0] = black;
+    vals[1] = curexp.inactive;  colors[1] = blue;
 
-    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 2, cexp.npages, names,
+    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 2, curexp.npages, names,
 		vals, colors, white);
   }
 
@@ -274,10 +274,10 @@
     u_long vals[2];
     u_long colors[2];
 
-    vals[0] = cexp.wiredmax;  colors[0] = black;
-    vals[1] = cexp.wired;     colors[1] = orange;
+    vals[0] = curexp.wiredmax;  colors[0] = black;
+    vals[1] = curexp.wired;     colors[1] = orange;
 
-    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 2, cexp.npages, names,
+    y = draw_barlvl(xdpy, win, gc, fnt_fixed, 5, 295, y, 2, curexp.npages, names,
 		vals, colors, white);
   }
 
@@ -289,15 +289,15 @@
     if (init == 0) {
       static char *names[] = { "faults", "anon", "ancow", "obj", 
 	"copy", "zero" };
-      static int *before[6], *after[6];
+      static int64_t *before[6], *after[6];
       static u_long color[6];
       init = 1;
-      before[0] = &oexp.faults; after[0] = &cexp.faults; color[0] = black;
-      before[1] = &oexp.flt_anon; after[1] = &cexp.flt_anon; color[1] = red;
-      before[2] = &oexp.flt_acow; after[2] = &cexp.flt_acow; color[2] = blue;
-      before[3] = &oexp.flt_obj; after[3] = &cexp.flt_obj; color[3] = green;
-      before[4] = &oexp.flt_prcopy; after[4] = &cexp.flt_prcopy; color[4] = orange;
-      before[5] = &oexp.flt_przero; after[5] = &cexp.flt_przero; color[5] = purple;
+      before[0] = &oexp.faults; after[0] = &curexp.faults; color[0] = black;
+      before[1] = &oexp.flt_anon; after[1] = &curexp.flt_anon; color[1] = red;
+      before[2] = &oexp.flt_acow; after[2] = &curexp.flt_acow; color[2] = blue;
+      before[3] = &oexp.flt_obj; after[3] = &curexp.flt_obj; color[3] = green;
+      before[4] = &oexp.flt_prcopy; after[4] = &curexp.flt_prcopy; color[4] = orange;
+      before[5] = &oexp.flt_przero; after[5] = &curexp.flt_przero; color[5] = purple;
       gp_faults = create_graph(6, "FAULTS", names, before, after, color, white);
     }  
 
@@ -311,10 +311,10 @@
 
     if (init == 0) {
       static char *names[] = { "traps" };
-      static int *before[1], *after[1];
+      static int64_t *before[1], *after[1];
       static u_long color[1];
       init = 1;
-      before[0] = &oexp.traps; after[0] = &cexp.traps; color[0] = black;
+      before[0] = &oexp.traps; after[0] = &curexp.traps; color[0] = black;
       gp_traps = create_graph(1, "TRAPS", names, before, after, color, white);
     }  
 
@@ -330,12 +330,12 @@
 
     if (init == 0) {
       static char *names[] = { "intrs", "soft", "syscall" };
-      static int *before[3], *after[3];
+      static int64_t *before[3], *after[3];
       static u_long color[3];
       init = 1;
-      before[0] = &oexp.intrs; after[0] = &cexp.intrs; color[0] = black;
-      before[1] = &oexp.softs; after[1] = &cexp.softs; color[1] = blue;
-      before[2] = &oexp.syscalls; after[2] = &cexp.syscalls; color[2] = red;
+      before[0] = &oexp.intrs; after[0] = &curexp.intrs; color[0] = black;
+      before[1] = &oexp.softs; after[1] = &curexp.softs; color[1] = blue;
+      before[2] = &oexp.syscalls; after[2] = &curexp.syscalls; color[2] = red;
       gp_intrs = create_graph(3, "INTRS", names, before, after, color, white);
     }  
 
@@ -349,12 +349,12 @@
 
     if (init == 0) {
       static char *names[] = { "cswtch", "swin", "swout" };
-      static int *before[3], *after[3];
+      static int64_t *before[3], *after[3];
       static u_long color[3];
       init = 1;
-      before[0] = &oexp.swtch; after[0] = &cexp.swtch; color[0] = black;
-      before[1] = &oexp.swapins; after[1] = &cexp.swapins; color[1] = green;
-      before[2] = &oexp.swapouts; after[2] = &cexp.swapouts; color[2] = red;
+      before[0] = &oexp.swtch; after[0] = &curexp.swtch; color[0] = black;
+      before[1] = &oexp.swapins; after[1] = &curexp.swapins; color[1] = green;
+      before[2] = &oexp.swapouts; after[2] = &curexp.swapouts; color[2] = red;
       gp_ctx = create_graph(3, "SWITCH/SWAP", names, before, after, color, white);
     }  
 
@@ -373,25 +373,25 @@
     y += get_fontheight(fnt_fixed) + 5;
 
     snprintf(buf, sizeof(buf), " woke=%d, revs=%d, swout=%d",
-	cexp.pdwoke, cexp.pdrevs, cexp.pdswout);
+	curexp.pdwoke, curexp.pdrevs, curexp.pdswout);
     XDrawImageString(xdpy->dpy, win, gc, 5, get_fontheight(fnt_fixed) + y,
 		   buf, strlen(buf)); 
     y += get_fontheight(fnt_fixed) + 1;
 
     snprintf(buf, sizeof(buf), " scans=%d, anon_scans=%d, obj_scans=%d",
-	cexp.pdscans, cexp.pdanscan, cexp.pdobscan);
+	curexp.pdscans, curexp.pdanscan, curexp.pdobscan);
     XDrawImageString(xdpy->dpy, win, gc, 5, get_fontheight(fnt_fixed) + y,
 		   buf, strlen(buf)); 
     y += get_fontheight(fnt_fixed) + 1;
 
     snprintf(buf, sizeof(buf), " busy=%d, freed=%d, pending=%d",
-	cexp.pdbusy, cexp.pdfreed, cexp.pdpending);
+	curexp.pdbusy, curexp.pdfreed, curexp.pdpending);
     XDrawImageString(xdpy->dpy, win, gc, 5, get_fontheight(fnt_fixed) + y,
 		   buf, strlen(buf)); 
     y += get_fontheight(fnt_fixed) + 1;
 
     snprintf(buf, sizeof(buf), " reactivate=%d, deactivate=%d, pageouts=%d",
-	cexp.pdreact, cexp.pddeact, cexp.pdpageouts);
+	curexp.pdreact, curexp.pddeact, curexp.pdpageouts);
     XDrawImageString(xdpy->dpy, win, gc, 5, get_fontheight(fnt_fixed) + y,
 		   buf, strlen(buf)); 
     y += get_fontheight(fnt_fixed) + 1;