summaryrefslogtreecommitdiff
path: root/sysutils/xperfmon3/files/patch-bc
blob: c91bbd75d3d817755c425f073f845fb405e5c9d4 (plain) (blame)
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
*** ../xperfmon++/system.h	Wed Jul 27 22:29:34 1994
--- ./system.h	Sun Jan 10 18:08:49 1999
***************
*** 1,4 ****
--- 1,11 ----
  /*
+  * Enhancement and error correction for FreeBSD-3.X
+  * COPYRIGHT 1998 by Lars K�ller <Lars.Koeller@Uni-Bielefeld.de>
+  *
+  *      $Id: system.h,v 3.4 1999/01/10 17:08:28 lkoeller Exp lkoeller $
+  */
+ 
+ /*
   * $XConsortium: system.h,v 1.4 89/09/19 14:43:58 jim Exp $
   *
   * Perfmon Performance Monitor
***************
*** 20,26 ****
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL PCS
   * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
!  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   *
   * Original Author:  Emanuel Jay Berkenbilt, MIT Project Athena
--- 27,33 ----
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL PCS
   * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
!  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   *
   * Original Author:  Emanuel Jay Berkenbilt, MIT Project Athena
***************
*** 32,38 ****
   * documentation for any purpose and without fee is hereby granted, provided that
   * the above copyright notice appear in all copies and that both that
   * copyright notice and this permission notice appear in supporting
!  * documentation, and that the name of NASA and Sterling Software (collectively 
   * or individually) are not be used in advertising or
   * publicity pertaining to distribution of the software without specific,
   * written prior permission.  NASA and Sterling Software makes no representations about the
--- 39,45 ----
   * documentation for any purpose and without fee is hereby granted, provided that
   * the above copyright notice appear in all copies and that both that
   * copyright notice and this permission notice appear in supporting
!  * documentation, and that the name of NASA and Sterling Software (collectively
   * or individually) are not be used in advertising or
   * publicity pertaining to distribution of the software without specific,
   * written prior permission.  NASA and Sterling Software makes no representations about the
***************
*** 43,49 ****
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NASA & STERLING SOFTWARE
   * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
!  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   *
   * 1994 Revision
--- 50,56 ----
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NASA & STERLING SOFTWARE
   * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
!  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   *
   * 1994 Revision
***************
*** 55,61 ****
  
  /* This file information needed by both system.c and Perfmon.c */
  
! #define NUM_POSSIBLE_STATS     11
  #define MAX_STATS NUM_POSSIBLE_STATS + 1
  
  #define LINES_PER_LABEL 2
--- 62,72 ----
  
  /* This file information needed by both system.c and Perfmon.c */
  
! #if __FreeBSD_version >= 300000
! # define NUM_POSSIBLE_STATS     25
! #else
! # define NUM_POSSIBLE_STATS     11
! #endif
  #define MAX_STATS NUM_POSSIBLE_STATS + 1
  
  #define LINES_PER_LABEL 2
***************
*** 77,93 ****
      for (stat = 0; stat < num_stats; stat++)
  
  #define	NO_STAT			-1
! #define USER_CPU_PERCENTAGE	0
! #define SYSTEM_CPU_PERCENTAGE	1
! #define IDLE_CPU_PERCENTAGE	2
! #define FREE_MEM		3
! #define DISK_TRANSFERS		4
! #define INTERRUPTS		5
! #define INPUT_PACKETS		6
! #define OUTPUT_PACKETS		7
! #define COLLISION_PACKETS	8
  #define NFS_CLIENT_CALLS        9
  #define NFS_SERVER_CALLS       10
  
  struct statistic {
      int min_val, max_val;
--- 88,132 ----
      for (stat = 0; stat < num_stats; stat++)
  
  #define	NO_STAT			-1
! #if __FreeBSD_version >= 300000
! #define LOAD                    0
! #define USER_CPU_PERCENTAGE	1
! #define NICE_CPU_PERCENTAGE     2
! #define SYSTEM_CPU_PERCENTAGE	3
! #define INTER_CPU_PERCENTAGE    4
! #define IDLE_CPU_PERCENTAGE	5
! #define TTY_CHARS_IN            6
! #define TTY_CHARS_OUT           7
! #define INTERRUPTS	        8
! #define FREE_MEM		9
! #define DISK_TRANSFERS	       10
! #define DISK_MB	               11
! #define TAPE_TRANSFERS	       12
! #define TAPE_MB	               13
! #define CDROM_TRANSFERS	       14
! #define CDROM_MB               15
! #define INPUT_PACKETS	       16
! #define OUTPUT_PACKETS	       17
! #define COLLISION_PACKETS      18
! #define NFS_SERVER_CALLS       19
! #define NFS_SERVER_HIT         20
! #define NFS_SERVER_MIS         21
! #define NFS_CLIENT_CALLS       22
! #define NFS_CLIENT_HIT         23
! #define NFS_CLIENT_MIS         24
! #else
! #define USER_CPU_PERCENTAGE     0
! #define SYSTEM_CPU_PERCENTAGE   1
! #define IDLE_CPU_PERCENTAGE     2
! #define FREE_MEM                3
! #define DISK_TRANSFERS          4
! #define INTERRUPTS              5
! #define INPUT_PACKETS           6
! #define OUTPUT_PACKETS          7
! #define COLLISION_PACKETS       8
  #define NFS_CLIENT_CALLS        9
  #define NFS_SERVER_CALLS       10
+ #endif
  
  struct statistic {
      int min_val, max_val;
***************
*** 113,118 ****
--- 152,197 ----
  
  #define VALID_UPDATE(x) ((x <= MAX_TIME) && (x > 0))
  
+ #if __FreeBSD_version >= 300000
+ 
+ /*
+  * This is a dirty but easy hack to display and scale floating point numbers
+  * in the graphs. The original version of xperfmon++ can only scale integers
+  * above 1.
+  */
+ #define SCALE_HACK 100.0
+ 
+ #define SYS_LOAD     0
+ #define USR_CPU      1
+ #define NICE_CPU     2
+ #define SYS_CPU      3
+ #define INT_CPU      4
+ #define IDL_CPU      5
+ #define TTY_IN       6
+ #define TTY_OUT      7
+ #define INTRPTS      8
+ #define FRE_MEM      9
+ #define DA_XFR      10
+ #define DA_MB       11
+ #define SA_XFR      12
+ #define SA_MB       13
+ #define CD_XFR      14
+ #define CD_MB       15
+ #define INP_PKT     16
+ #define OUT_PKT     17
+ #define COL_PKT     18
+ #define NFS_SRV     19
+ #define NFS_SRV_HIT 20
+ #define NFS_SRV_MIS 21
+ #define NFS_CLT     22
+ #define NFS_CLT_HIT 23
+ #define NFS_CLT_MIS 24
+ #define LAST_ITEM NFS_CLT_MIS	/* must equal last item above */
+ 
+ #else
+ 
+ #define SCALE_HACK 1
+ 
  #define USR_CPU 0
  #define SYS_CPU 1
  #define IDL_CPU 2
***************
*** 125,130 ****
--- 204,210 ----
  #define NFS_CLT 9
  #define NFS_SRV 10
  #define LAST_ITEM NFS_SRV	/* must equal last item above */
+ #endif
  #define NUM_GRAPHS LAST_ITEM+1
  
  /* data structure for custom application resources */
***************
*** 146,177 ****
  }AppData, *AppDataPtr;
  
  static char *topNames[] = {
      "User",
      "System",
      "Idle",
      "Free",
      "Disk",
!     "Interrupts",
      "Input",
      "Output",
!     "Collision",
!     "NFS Client",
!     "NFS Server",
! };
! static char *widgetLabels[] = {
      "User",
      "System",
      "Idle",
      "Free",
      "Disk",
!     "Intrpts",
      "Input",
      "Output",
      "Collision",
!     "NFSClient",
!     "NFSServer",
  };
  static char *botNames[] = {
      "CPU",
      "CPU",
      "CPU",
--- 226,299 ----
  }AppData, *AppDataPtr;
  
  static char *topNames[] = {
+ #if __FreeBSD_version >= 300000
+     "System",
      "User",
+     "Nice",
      "System",
+     "Intrpt",
      "Idle",
+     "TTY",
+     "TTY",
+     "Inter-",
      "Free",
      "Disk",
!     "Disk IO",
!     "Tape",
!     "Tape IO",
!     "CDRom",
!     "CDRom IO",
      "Input",
      "Output",
!     "Collis",
!     "NFS Srv",
!     "NFS Srv",
!     "NFS Srv",
!     "NFS Clt",
!     "NFS Clt",
!     "NFS Clt",
! #else
      "User",
      "System",
      "Idle",
      "Free",
      "Disk",
!     "Interrupts",
      "Input",
      "Output",
      "Collision",
!     "NFS Client",
!     "NFS Server",
! #endif
  };
  static char *botNames[] = {
+ #if __FreeBSD_version >= 300000
+     "Load",
+     "CPU (%)",
+     "CPU (%)",
+     "CPU (%)",
+     "CPU (%)",
+     "CPU (%)",
+     "in (Char/s)",
+     "out (Char/s)",
+     "rupts/s",
+     "Swap (%)",
+     "Trsf/s",
+     "(MByte/s)",
+     "Trsf/s",
+     "(MByte/s)",
+     "Trsf/s",
+     "(MByte/s)",
+     "Packets/s",
+     "Packets/s",
+     "Packets/s",
+     "Calls/s",
+     "Cache-Hits",
+     "Cache-Miss",
+     "Calls/s",
+     "Cache-Hits",
+     "Cache-Miss",
+ #else
      "CPU",
      "CPU",
      "CPU",
***************
*** 183,186 ****
--- 305,351 ----
      "Packets",
      "Calls",
      "Calls",
+ #endif
+ };
+ 
+ static char *widgetLabels[] = {
+ #if __FreeBSD_version >= 300000
+     "Load",
+     "User",
+     "Nice",
+     "System",
+     "Inter",
+     "Idle",
+     "Ttyin",
+     "Ttyout",
+     "Intrpts",
+     "Swap",
+     "DiskXfr",
+     "DiskMB",
+     "TapeXfr",
+     "TapeMB",
+     "CDRomXfr",
+     "CDRomMB",
+     "Input",
+     "Output",
+     "Collision",
+     "NFSServerCalls",
+     "NFSServerHits",
+     "NFSServerMisses",
+     "NFSClientCalls",
+     "NFSClientHits",
+     "NFSClientMisses",
+ #else
+     "User",
+     "System",
+     "Idle",
+     "Free",
+     "Disk",
+     "Intrpts",
+     "Input",
+     "Output",
+     "Collision",
+     "NFSClient",
+     "NFSServer",
+ #endif
  };