aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorGary Jennejohn <gj@FreeBSD.org>1999-02-04 05:10:54 +0000
committerGary Jennejohn <gj@FreeBSD.org>1999-02-04 05:10:54 +0000
commit091207b6c289c002c8b080d4b7dca1d23f5b4910 (patch)
treea29d408f2b3e62c62a85d7c5ecc2cfa49d574c52 /sysutils
parentf35a5950aba23c5ae1bf851343b7d1f446b06a64 (diff)
downloadports-091207b6c289c002c8b080d4b7dca1d23f5b4910.tar.gz
ports-091207b6c289c002c8b080d4b7dca1d23f5b4910.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xperfmon3/Makefile22
-rw-r--r--sysutils/xperfmon3/files/fbsd_vers.h22
-rw-r--r--sysutils/xperfmon3/files/freebsd_system.c1528
-rw-r--r--sysutils/xperfmon3/files/patch-aa1353
-rw-r--r--sysutils/xperfmon3/files/patch-ab400
-rw-r--r--sysutils/xperfmon3/files/patch-ac1696
-rw-r--r--sysutils/xperfmon3/files/patch-ad365
-rw-r--r--sysutils/xperfmon3/files/patch-ba146
-rw-r--r--sysutils/xperfmon3/files/patch-bb115
-rw-r--r--sysutils/xperfmon3/files/patch-bc371
-rw-r--r--sysutils/xperfmon3/files/patch-ca40
-rw-r--r--sysutils/xperfmon3/files/patch-cb71
-rw-r--r--sysutils/xperfmon3/files/patch-cc116
-rw-r--r--sysutils/xperfmon3/files/patch-cd631
-rw-r--r--sysutils/xperfmon3/pkg-comment2
-rw-r--r--sysutils/xperfmon3/pkg-descr44
-rw-r--r--sysutils/xperfmon3/scripts/configure1
17 files changed, 4761 insertions, 2162 deletions
diff --git a/sysutils/xperfmon3/Makefile b/sysutils/xperfmon3/Makefile
index 03b5677956a6..e1d7a1480699 100644
--- a/sysutils/xperfmon3/Makefile
+++ b/sysutils/xperfmon3/Makefile
@@ -1,31 +1,23 @@
-# New ports collection makefile for: xperfmon++ V1.40
+# New ports collection makefile for: xperfmon++ V3.0
+#
# Version required: 1.1
-# Date created: 14 March 97
+# Date created: 23. Oct 1998
# Whom: Lars Koeller <Lars.Koeller@Uni-Bielefeld.DE>
#
-# $Id: Makefile,v 1.21 1998/11/21 07:27:41 steve Exp $
+# $Id$
#
DISTNAME= xperfmon++
-PKGNAME= xperfmon++-2.0
+PKGNAME= xperfmon++-3.0
CATEGORIES= sysutils
-# In Germany try this
MASTER_SITES= ftp://ftp.uni-bielefeld.de/pub/systems/FreeBSD/lkoeller/ \
- ftp://ftp.u-aizu.ac.jp/pub/misc/tools/xperfmon/ \
+ ftp://ftp.u-aizu.ac.jp/pub/misc/tools/xperfmon/ \
ftp://ftp.ibank.ru/pub/unix_src/benchmarks/
-DISTFILES= xperfmon++v1.1.tar.Z
+EXTRACT_SUFX= v1.1.tar.Z
MAINTAINER= Lars.Koeller@Uni-Bielefeld.DE
USE_IMAKE= yes
MAN1= xperfmon++.1
-pre-configure:
- if [ -e /usr/lib/libdevstat.a -o -e /usr/lib/aout/libdevstat.a ]; then \
- cd ${WRKSRC} ; \
- ${MV} Imakefile Imakefile.in ; \
- ${SED} -e "s:EXTRA_DEFINES=:EXTRA_DEFINES= -DHAVE_DEVSTAT:" Imakefile.in > Imakefile.i1 ; \
- ${SED} -e "s:FreeBSDFLAGS=:FreeBSDFLAGS= -ldevstat:" Imakefile.i1 > Imakefile ; \
- fi
-
.include <bsd.port.mk>
diff --git a/sysutils/xperfmon3/files/fbsd_vers.h b/sysutils/xperfmon3/files/fbsd_vers.h
new file mode 100644
index 000000000000..4ca77bfb5b76
--- /dev/null
+++ b/sysutils/xperfmon3/files/fbsd_vers.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 1998 Lars Köller
+ * All rights reserved.
+ *
+ * Handel the FreeBSD Versions in a central file!
+ *
+ * $Id: fbsd_vers.h,v 3.1 1998/10/15 19:56:47 lkoeller Exp lkoeller $
+ */
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#if (defined(BSD) && (BSD >= 199506))
+# include <osreldate.h>
+#else
+# error You can compile this xperfmon++ V3.0 only on FreeBSD-3.X systems. xperfmon++ V1.31 up to V2.0 runs on FreeBSD 2.[12].X system!
+#endif
+
+#if __FreeBSD_version < 300000
+# error You can compile this xperfmon++ V3.0 only on FreeBSD-3.X systems. xperfmon++ V1.31 up to V2.0 runs on FreeBSD 2.[12].X system!
+#endif
diff --git a/sysutils/xperfmon3/files/freebsd_system.c b/sysutils/xperfmon3/files/freebsd_system.c
index d20ec2c08751..2e28cbfd3256 100644
--- a/sysutils/xperfmon3/files/freebsd_system.c
+++ b/sysutils/xperfmon3/files/freebsd_system.c
@@ -1,889 +1,911 @@
+
/*
- * Perfmon Performance Monitor
+ * freebsd_system.c für FreeBSD-3.X
+ * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+ *
+ * Work has started on 7th Sep 1998 on Northsea island Föhr.
*
- * Copyright 1985, Massachusetts Institute of Technology
- * Copyright 1989, PCS Computer Systeme GmbH, West Germany
- * Copyright 1994, Sterling Software @ NASA-Ames Research Center
- * Copyright 1995, Regents of the University of California,
- * Lars Köller <Lars.Koeller@Uni-Bielefeld.DE>
+ * $Id: freebsd_system.c,v 3.4 1998/11/15 16:50:04 lkoeller Exp lkoeller $
+ */
+
+/*
+ * Copyright (c) 1998 Lars Köller
+ * All rights reserved.
*
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, 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 PCS and Sterling Software not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. PCS and Sterling Software makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * PCS & STERLING SOFTWARE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL PCS & 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.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*
- * Original Author: Emanuel Jay Berkenbilt, MIT Project Athena
- * Author: Thomas A. Baghli, PCS Computer Systeme GmbH, West Germany
- * tom@meepmeep.pcs.com
- * 1994 Revision
- * Author: Roger Smith, Sterling Software @ NASA-Ames Research Center
- * Moffett Field, California, rsmith@proteus.arc.nasa.gov
- * 1995, ... FreeBSD 2.x, 3.x Version
- * Author: Lars Köller, Univerity of Bielefeld, Germany
- * Lars.Koeller@Uni-Bielefeld.DE
*/
-/* This file contains only system functions - that is the functions that
- * get the information the performance monitor is monitoring. No calls
- * to any X routines should be made here. The reason for doing this is
- * so that as the X toolkit becomes available and the X window system
- * improves no changes will have to be made to this file, and as this
- * program is made available for a new type of machine, only this file
- * will need to be changed.
+/*
+ *
+ * Parts of this program are derived from the iostat program:
+ *
+ * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
*/
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
+/*
+ * Parts of this program are derived from other original FreeBSD programs:
+ *
+ * Copyright (c) 1986, 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
-#if (defined(BSD) && (BSD >= 199506))
-# include <osreldate.h>
-#else
-# error You have to use at least a FreeBSD 2.2.X system
+#ifndef LINT
+static char rcsid[] = "$Id: freebsd_system.c,v 3.4 1998/11/15 16:50:04 lkoeller Exp lkoeller $";
#endif
+#include "fbsd_vers.h"
+
#include <X11/IntrinsicP.h>
#include "system.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <paths.h>
-#include <kvm.h>
-#include <nlist.h>
-#include <limits.h>
-#include <errno.h>
-#include <err.h>
+#include "is.h"
#include <sys/file.h>
#include <sys/param.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/dkstat.h>
-#ifdef HAVE_DEVSTAT
-#include <devstat.h>
-#endif
#include <sys/buf.h>
-#include <sys/vmmeter.h>
-#include <vm/vm.h>
#include <sys/time.h>
+#include <vm/vm.h>
#include <net/if.h>
-#if __FreeBSD_version >= 300000
#include <net/if_var.h>
-#endif
#include <netinet/in.h>
#include <sys/stat.h>
#include <sys/conf.h>
#include <sys/rlist.h>
#include <sys/mount.h>
#include <nfs/rpcv2.h>
-#include <nfs/nfsv2.h>
+#include <nfs/nfsproto.h>
#include <nfs/nfs.h>
-#ifndef CTL_FS
-#define CTL_FS CTL_VFS /* compatibility w/ Lite1 */
-#endif
-
-/*
- * It's a mess with all these version numbers:
- *
- * 2.0-RELEASE: 199411
- * 2.1-current's: 199501, 199503
- * 2.0.5-RELEASE: 199504
- * 2.2-current before 2.1: 199508
- * 2.1.0-RELEASE: 199511
- * 2.2-current before 2.1.5: 199512
- * 2.1.5-RELEASE: 199607
- * 2.2-current before 2.1.6: 199608
- * 2.1.6-RELEASE: 199612
- * 2.1.7-RELEASE: 199612
- * 2.2-RELEASE: 220000 (ahhhhh)
- * 3.0-current as of Feb 1997: 300000 (ohhhhh)
- */
-
-/*
- * FreeBSD version 2.2 and greater have NFSv3
- */
-#if __FreeBSD_version >= 220000
-# define HAS_NFS_V3
-#endif /* FreeBSD_version */
-
-#include "is.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <paths.h>
+#include <kvm.h>
+#include <nlist.h>
+#include <limits.h>
+#include <errno.h>
+#include <err.h>
+#include <devstat.h>
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-#define WANT_STAT(x) (poss_stats[(x)] != NO_STAT)
+struct nlist namelist[] = {
+#define X_HZ 0
+ { "_hz" },
+#define X_STATHZ 1
+ { "_stathz" },
+#define X_CP_TIME 2
+ { "_cp_time" },
+#define X_TK_NIN 3
+ { "_tk_nin" },
+#define X_TK_NOUT 4
+ { "_tk_nout" },
+#define N_IFNET 5
+ { "_ifnet" },
+#define X_INTRCNT 6
+ { "_intrcnt" },
+#define X_EINTRCNT 7
+ { "_eintrcnt" },
+#define X_BOOTTIME 8
+ { "_boottime" },
+#if __FreeBSD_version < 400000
+#define VM_NSWAP 9
+ { "_nswap" },
+#define VM_NSWDEV 10
+ { "_nswdev" },
+#define VM_DMMAX 11
+ { "_dmmax" },
+#define VM_SWAPLIST 12
+ { "_swaplist" },
+#define VM_SWDEVT 13
+ { "_swdevt" },
+#define X_END 13
+ { NULL },
+#else
+#define X_END 8
+ { NULL },
+#endif /* __FreeBSD_version < 400000 */
-#ifdef HAVE_DEVSTAT
-/* the old values */
-#define DK_NDRIVE 8
-#define DK_NAMELEN 8
-#endif
+};
-/*
- Function Prototypes
-*/
-static int get_namelist(const char *kernel_name, const char *memory_name);
-static void kread(int nlx, void *addr, size_t size);
-static void collect_stats(void);
-static int total_disk_transfers(void);
-static int get_swapspace(void);
-#ifdef HAVE_DEVSTAT
-void init_devstat(void);
-int get_devstat(void);
-#endif /* HAVE_DEVSTAT */
+extern Widget perfmon[NUM_GRAPHS];
+extern char *info1;
+double current_values[NUM_GRAPHS];
-/*
- Variables & Structs
-*/
-static unsigned long *intrcnt;
-static int nintr, hz;
static kvm_t *kd;
static char errbuf[_POSIX2_LINE_MAX];
-static char dr_name[DK_NDRIVE][DK_NAMELEN];
-static double etime;
-#ifdef HAVE_DEVSTAT
-long generation;
-devstat_select_mode select_mode;
-struct devstat_match *matches;
-int num_matches;
-int num_selected, num_selections;
-long select_generation;
-static struct statinfo cur, last;
-int num_devices;
-struct device_selection *dev_select;
-char nodisk;
-#endif /* HAVE_DEVSTAT */
-
-
-#if __FreeBSD_version >= 220000
-float current_values[NUM_GRAPHS];
-#else
-int current_values[NUM_GRAPHS];
-#endif
-stat_type stats;
-
-extern Widget perfmon[NUM_GRAPHS];
-
-static struct packet {
- int input, output, collisions;
-} packets, old_packets;
+static int has_nfs;
+static int hz, stathz;
+static double etime, pct;
+static long tmp;
+struct vfsconf vfc;
+/*
+ * Variables holding the statistic information
+ */
+static struct statinfo cur, last;
static struct nfsstats nfsstats;
static struct _nfsStats {
- int nfsServer, nfsClient;
+ int ServerCalls, ServerCacheHit, ServerCacheMis;
+ int ClientCalls, ClientCacheHit, ClientCacheMis;
} nfsStats, old_nfsStats;
+static struct _packets {
+ int input, output, collisions;
+} packets, old_packets;
+static int interrupts, old_interrupts;
-/* NB that we'll have to include machine/asname.h when the kernel goes ELF */
-struct nlist nl[] = {
-#define X_CPTIME 0
- { "_cp_time" },
-#define X_SUM 1
- { "_cnt" },
-#define X_BOOTTIME 2
- { "_boottime" },
-#define X_DKXFER 3
-#ifdef HAVE_DEVSTAT
- { "_hz" }, /* just a placeholder */
-#else
- { "_dk_xfer" },
-#endif
-#define X_HZ 4
- { "_hz" },
-#define N_IFNET 5
- { "_ifnet" },
-#define X_INTRCNT 6
- { "_intrcnt" },
-#define X_EINTRCNT 7
- { "_eintrcnt" },
-#if __FreeBSD_version < 400000
-#define VM_NSWAP 8
- { "_nswap" }, /* size of largest swap device */
-#define VM_NSWDEV 9
- { "_nswdev" }, /* number of swap devices */
-#define VM_DMMAX 10
- { "_dmmax" }, /* maximum size of a swap block */
-#define VM_SWAPLIST 11
- { "_swaplist" },/* list of free swap areas */
-#define VM_SWDEVT 12
- { "_swdevt" }, /* list of swap devices and sizes */
-#endif
- { "" },
-};
-
-struct {
- long time[CPUSTATES];
-#ifndef HAVE_DEVSTAT
- long xfer[DK_NDRIVE];
-#endif
- struct vmmeter Sum;
- struct vmmeter Rate;
- int interrupts;
-} s, s1;
-
-int first_time_getswap;
+/*
+ * Variables need for devstat to get diskio statistics
+ */
+static struct statinfo cur, last;
+static struct devstat_match *matches = NULL;
+static struct device_selection *dev_select = NULL;
+static devstat_select_mode select_mode;
+static int num_matches = 0, num_devices = 0;
+static int num_selected = 0, num_selections = 0;
+static int num_devices_specified = 0, maxshowdevs;
+static long generation, select_generation;
+static char **specified_devices = NULL;
+static struct _diskstat {
+ long double da_trsf, da_mb;
+ long double cd_trsf, cd_mb;
+ long double sa_trsf, sa_mb;
+} diskstat;
+
+void sys_setup(void);
+void update_stats(void);
+
+static void get_namelist(const char *kernel_name, const char *memory_name);
+static void kread(int nlx, void *addr, size_t size);
+static double get_load(void);
+static void get_cpustat(void);
+static void get_ttystat(void);
+static void get_interrupts(void);
+static void init_diskio(void);
+static void get_diskio(void);
+static double get_swapspace(void);
+static void get_netstat(void);
+static void get_nfsstat(void);
-#define rate s.Rate
-#define sum s.Sum
-/*
- This routine does all necessary setting up of structures
- that will handle system calls.
-*/
-void sys_setup()
+void
+sys_setup(void)
{
- get_namelist(getbootfile(), _PATH_KMEM);
- collect_stats();
-#ifdef HAVE_DEVSTAT
- init_devstat();
-#endif
- /* hack to enforce a resize of the 'Free Swap' graph
- without this the left border always displays the first drawn line
- cause this field isn't resized very often due to slow change of
- the free swapspace! */
- first_time_getswap = 1;
- etime = 1.0;
+ get_namelist(getbootfile(), _PATH_MEM);
+
+ get_cpustat();
+ get_load();
+ get_ttystat();
+ get_interrupts();
+ init_diskio();
+ get_diskio();
+
+ /*
+ * To force first scale of 'free swapspace' to 100%, we need this hack!
+ * Wee use a value < 0 cause it's not a valid value!
+ */
+ current_values[FREE_MEM] = -0.4 * SCALE_HACK;
+
+ get_netstat();
+
+ /*
+ * Check if we have NFS in the kernel
+ */
+ if (getvfsbyname("nfs", &vfc) < 0) {
+ fprintf(stderr, "xperfmon++: getvfsbyname: NFS not compiled into kernel\n");
+ has_nfs = FALSE;
+ } else {
+ has_nfs = TRUE;
+ get_nfsstat();
+ }
}
-/*
- Update the data structures
-*/
-void update_stats()
+void
+update_stats(void)
{
- int state;
- double pct, tot, loadavg[3];
+ static int firsttime = 1;
+ /*
+ * For any stat we need etime, so get it!
+ */
+ get_cpustat();
+ current_values[ USER_CPU_PERCENTAGE] = cur.cp_time[CP_USER] * pct * SCALE_HACK;
+ current_values[ NICE_CPU_PERCENTAGE] = cur.cp_time[CP_NICE] * pct * SCALE_HACK;
+ current_values[SYSTEM_CPU_PERCENTAGE] = cur.cp_time[CP_SYS] * pct * SCALE_HACK;
+ current_values[ INTER_CPU_PERCENTAGE] = cur.cp_time[CP_INTR] * pct * SCALE_HACK;
+ current_values[ IDLE_CPU_PERCENTAGE] = cur.cp_time[CP_IDLE] * pct * SCALE_HACK;
+
+ if (perfmon[LOAD])
+ current_values[LOAD] = get_load() * SCALE_HACK;
+
+ if (perfmon[TTY_CHARS_IN] || perfmon[TTY_CHARS_OUT]) {
+ get_ttystat();
+ current_values[TTY_IN] = cur.tk_nin/etime * SCALE_HACK;
+ current_values[TTY_OUT] = cur.tk_nout/etime * SCALE_HACK;
+ }
- collect_stats();
+ if (perfmon[INTERRUPTS]) {
+ get_interrupts();
+ current_values[INTERRUPTS] = (interrupts - old_interrupts)/etime * SCALE_HACK;
+ }
- tot = 0;
- for (state = 0; state < CPUSTATES; ++state)
- tot += s.time[state];
- if (tot)
- pct = 100 / tot;
+ /*
+ * The first time called, we want to get 100%
+ * for the full scale of the graph!
+ */
+ if (perfmon[FREE_MEM] && !firsttime)
+ current_values[FREE_MEM] =
+ (current_values[FREE_MEM] < 0 ? 100.0 * SCALE_HACK : get_swapspace() * SCALE_HACK);
else
- pct = 0;
+ --firsttime;
+
+ if (perfmon[DISK_TRANSFERS] || perfmon[DISK_MB] ||
+ perfmon[TAPE_TRANSFERS] || perfmon[TAPE_MB] ||
+ perfmon[CDROM_TRANSFERS] || perfmon[CDROM_MB] ) {
+ get_diskio();
+ current_values[DISK_TRANSFERS] = diskstat.da_trsf * SCALE_HACK;
+ current_values[DISK_MB] = diskstat.da_mb * SCALE_HACK;
+ current_values[TAPE_TRANSFERS] = diskstat.sa_trsf * SCALE_HACK;
+ current_values[TAPE_MB] = diskstat.sa_mb * SCALE_HACK;
+ current_values[CDROM_TRANSFERS] = diskstat.cd_trsf * SCALE_HACK;
+ current_values[CDROM_MB] = diskstat.cd_mb * SCALE_HACK;
+ }
-#if __FreeBSD_version >= 220000
- if (getloadavg(loadavg, sizeof(loadavg) / sizeof(loadavg[0])) == -1 ) {
- fprintf( stderr, "xperfmon++: getloadavg returned no values\n" );
- current_values[LOAD] = 0;
- } else {
- current_values[LOAD] = loadavg[0]*100;
- /* fprintf( stderr, "loadavg: %f %f %f\n", loadavg[0], loadavg[1], loadavg[2] ); */
+ if (perfmon[INPUT_PACKETS] || perfmon[OUTPUT_PACKETS] ||
+ perfmon[COLLISION_PACKETS]){
+ get_netstat();
+ current_values[ INPUT_PACKETS] =
+ (packets.input - old_packets.input)/etime * SCALE_HACK;
+ current_values[ OUTPUT_PACKETS] =
+ (packets.output - old_packets.output)/etime * SCALE_HACK;
+ current_values[COLLISION_PACKETS] =
+ (packets.collisions - old_packets.collisions)/etime * SCALE_HACK;
}
-#endif
-#if __FreeBSD_version >= 220000
- current_values[USER_CPU_PERCENTAGE] = s.time[CP_USER] * pct;
- current_values[NICE_CPU_PERCENTAGE] = s.time[CP_NICE] * pct;
- current_values[SYSTEM_CPU_PERCENTAGE] = s.time[CP_SYS] * pct;
- current_values[INTER_CPU_PERCENTAGE] = s.time[CP_INTR] * pct;
-#else
- current_values[USER_CPU_PERCENTAGE] = (s.time[CP_USER] + s.time[CP_NICE]) * pct;
- current_values[SYSTEM_CPU_PERCENTAGE] = (s.time[CP_SYS] + s.time[CP_INTR]) * pct;;
-#endif
- current_values[IDLE_CPU_PERCENTAGE] = s.time[CP_IDLE] * pct;
-
- if (perfmon[FREE_MEM]) {
- if(!first_time_getswap)
- current_values[FREE_MEM] = get_swapspace();
- else {
- current_values[FREE_MEM] = 100;
- first_time_getswap = 0;
- }
+ if (has_nfs && (perfmon[NFS_CLIENT_CALLS] ||
+ perfmon[NFS_CLIENT_HIT] ||
+ perfmon[NFS_CLIENT_MIS] ||
+ perfmon[NFS_SERVER_CALLS] ||
+ perfmon[NFS_SERVER_HIT] ||
+ perfmon[NFS_SERVER_MIS])) {
+ get_nfsstat();
+ current_values[NFS_CLIENT_CALLS] =
+ (nfsStats.ClientCalls - old_nfsStats.ClientCalls)/etime * SCALE_HACK;
+ current_values[NFS_SERVER_CALLS] =
+ (nfsStats.ServerCalls - old_nfsStats.ServerCalls)/etime * SCALE_HACK;
+ current_values[NFS_CLIENT_HIT] =
+ (nfsStats.ClientCacheHit - old_nfsStats.ClientCacheHit)/etime * SCALE_HACK;
+ current_values[NFS_CLIENT_MIS] =
+ (nfsStats.ClientCacheMis - old_nfsStats.ClientCacheMis)/etime * SCALE_HACK;
+ current_values[NFS_SERVER_HIT] =
+ (nfsStats.ServerCacheHit - old_nfsStats.ServerCacheHit)/etime * SCALE_HACK;
+ current_values[NFS_SERVER_MIS] =
+ (nfsStats.ServerCacheMis - old_nfsStats.ServerCacheMis)/etime * SCALE_HACK;
}
- if (perfmon[DISK_TRANSFERS])
- current_values[DISK_TRANSFERS] = total_disk_transfers();
- if (perfmon[INTERRUPTS])
- current_values[INTERRUPTS] = (s.interrupts - s1.interrupts)/etime;
- if (perfmon[INPUT_PACKETS])
- current_values[INPUT_PACKETS] = (packets.input - old_packets.input)/etime;
- if (perfmon[OUTPUT_PACKETS])
- current_values[OUTPUT_PACKETS] = (packets.output - old_packets.output)/etime;
- if (perfmon[COLLISION_PACKETS])
- current_values[COLLISION_PACKETS] = (packets.collisions - old_packets.collisions)/etime;
- if (perfmon[NFS_CLIENT_CALLS])
- current_values[NFS_CLIENT_CALLS] = (nfsStats.nfsClient - old_nfsStats.nfsClient)/etime;
- if (perfmon[NFS_SERVER_CALLS])
- current_values[NFS_SERVER_CALLS] = (nfsStats.nfsServer - old_nfsStats.nfsServer)/etime;
}
-/*
- Collect the overall disk transfer rates
-*/
-int
-total_disk_transfers()
+static void
+get_namelist(kernel_name, memory_name)
+ const char *kernel_name, *memory_name;
{
- register int i, total_xfers = 0;
+ register int i, ret;
+ time_t now, boottime;
+ int nintv;
-#ifdef HAVE_DEVSTAT
- total_xfers = get_devstat();
-#else
- for(i=0; i < DK_NDRIVE; i++)
- total_xfers += s.xfer[i];
-#endif
- return(total_xfers/etime);
+ kd = kvm_openfiles(kernel_name, memory_name, NULL, O_RDONLY, errbuf);
+ if (kd == 0)
+ errx(1, "xperfmon++: kvm_openfiles: %s", errbuf);
+
+ if ((ret = kvm_nlist(kd, namelist)) != 0) {
+ if (ret > 0) {
+ (void)fprintf(stderr, "xperfmon++: undefined symbols:");
+ for (i = 0; i < sizeof(namelist)/sizeof(namelist[0]); i++)
+ if (namelist[i].n_type == 0 || namelist[i].n_value == 0)
+ fprintf(stderr, "%s", namelist[i].n_name);
+ fprintf(stderr, "\n");
+ } else
+ errx(1, "xperfmon++: kvm_nlist: %s", kvm_geterr(kd));
+ exit(1);
+ }
+
+ kread(X_HZ, &hz, sizeof(hz));
+ kread(X_STATHZ, &stathz, sizeof(stathz));
+
+ if (stathz)
+ hz = stathz;
+
+ kread(X_BOOTTIME, &boottime, sizeof(boottime));
+ time(&now);
+ nintv = now - boottime;
+ if (nintv <= 0 || nintv > 60*60*24*365*10)
+ errx(1, "Time makes no sense ... namelist must be wrong", NULL);
}
-/*
- Collect all the data
-*/
-void
-collect_stats()
+static void
+kread(nlx, addr, size)
+ int nlx; void *addr; size_t size;
{
- off_t ifnetaddr;
- register int i, tmp;
- int mib[3], size;
-#if (__FreeBSD_version >= 300004)
- struct vfsconf vfc;
-#endif
+ char *sym;
- kread(X_CPTIME, s.time, sizeof(s.time));
-#ifndef HAVE_DEVSTAT
- kread(X_DKXFER, s.xfer, sizeof(s.xfer));
-#endif
- kread(X_SUM, &sum, sizeof(sum) );
+ if (kvm_read(kd, namelist[nlx].n_value, addr, size) != size) {
+ sym = namelist[nlx].n_name;
+ if (*sym == '_')
+ ++sym;
+ errx(1, "xperfmon++: %s: %s", sym, kvm_geterr(kd));
+ }
+}
- nintr = nl[X_EINTRCNT].n_value - nl[X_INTRCNT].n_value;
- if ((intrcnt = (unsigned long *) malloc((size_t) nintr)) == NULL)
- err(1, "xperfmon++ malloc in collect_stats");
- nintr /= sizeof(long);
- kread(X_INTRCNT, intrcnt, (size_t) nintr*sizeof(long));
- s1.interrupts = s.interrupts;
- s.interrupts = 0;
- for (i = 0; i < nintr; i++)
- s.interrupts += *(intrcnt + i);
- free(intrcnt);
- etime = 0;
-#ifndef HAVE_DEVSTAT
- for (i=0; i < DK_NDRIVE; i++) {
- tmp = s.xfer[i];
- s.xfer[i] -= s1.xfer[i];
- s1.xfer[i] = tmp;
- }
-#endif
- for (i=0; i < CPUSTATES; i++) {
- tmp = s.time[i];
- s.time[i] -= s1.time[i];
- s1.time[i] = tmp;
- etime += s.time[i];
+static void
+get_cpustat(void)
+{
+ register int i;
+ double tot;
+
+ kread(X_CP_TIME, cur.cp_time, sizeof(cur.cp_time));
+
+ etime = 0.0;
+ for (i = 0; i < CPUSTATES; i++) {
+ tmp = cur.cp_time[i];
+ cur.cp_time[i] -= last.cp_time[i];
+ last.cp_time[i] = tmp;
+ etime += cur.cp_time[i];
}
- if(etime == 0.)
- etime = 1.;
- etime /= hz;
+ tot = etime;
-/*
- Collect the Network-Traffic
-*/
+ if (etime == 0.0 )
+ etime = 1.0;
- if ((ifnetaddr = nl[N_IFNET].n_value) != 0) {
-#if __FreeBSD_version < 300000
- struct ifnet ifnet;
- kread(N_IFNET, &ifnetaddr, sizeof(ifnetaddr));
- old_packets = packets;
- packets.input = packets.output = packets.collisions = 0;
- while (ifnetaddr) {
- kvm_read(kd, ifnetaddr, &ifnet, sizeof ifnet );
- packets.input += ifnet.if_ipackets;
- packets.output += ifnet.if_opackets;
- packets.collisions += ifnet.if_collisions;
- ifnetaddr = (u_long) ifnet.if_next;
- }
-#else /* 3.0-current, Jan 1997 */
- /* Stolen from netstat/if.c */
- struct ifnet ifnet;
- struct ifnethead ifnethead;
- u_long ifaddraddr, ifnetfound;
- struct ifaddr ifa;
+ etime /= (float)hz;
- if(kvm_read(kd, ifnetaddr, (char *)&ifnethead, sizeof ifnethead) == -1)
- return;
- ifnetaddr = (u_long)ifnethead.tqh_first;
- if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
- return;
+ /*
+ * scale to percent
+ */
+ if(tot)
+ pct = 100.0 / tot;
+ else
+ pct = 0;
+}
- old_packets = packets;
- packets.input = packets.output = packets.collisions = 0;
- ifaddraddr = 0;
- while (ifnetaddr || ifaddraddr) {
- if (ifaddraddr == 0) {
- ifnetfound = ifnetaddr;
- if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
- return;
- ifnetaddr = (u_long)ifnet.if_link.tqe_next;
- ifaddraddr = (u_long)ifnet.if_addrhead.tqh_first;
- }
- if (kvm_read(kd, ifaddraddr, (char *)&ifa, sizeof ifa) == -1) {
- ifaddraddr = 0;
- continue;
- }
- ifaddraddr = (u_long)ifa.ifa_link.tqe_next;
- packets.input += ifnet.if_ipackets;
- packets.output += ifnet.if_opackets;
- packets.collisions += ifnet.if_collisions;
- }
-#endif
- }
+static double
+get_load(void)
+{
+ double loadavg[3];
-/*
- Collect the NFS and RPC Calls
-*/
-
- size = sizeof(nfsstats);
- mib[0] = CTL_FS;
-#if (__FreeBSD_version >= 300004)
- if (getvfsbyname("nfs", &vfc) < 0)
- /* no NFS in the kernel */
+ loadavg[0] = 0.0;
+ if (getloadavg(loadavg, sizeof(loadavg)/sizeof(loadavg[0])) == -1) {
+ fprintf(stderr, "xperfmon++: getloadavg() returned no values\n");
return;
- mib[1] = vfc.vfc_typenum;
-#else
- mib[1] = MOUNT_NFS;
-#endif
- mib[2] = NFS_NFSSTATS;
-
- if (sysctl( mib, 3, &nfsstats, &size, NULL, 0) < 0)
- return;
- else {
- old_nfsStats = nfsStats;
-
- nfsStats.nfsClient = nfsstats.rpccnt[NFSPROC_GETATTR] +
- nfsstats.rpccnt[NFSPROC_SETATTR] +
- nfsstats.rpccnt[NFSPROC_LOOKUP] +
- nfsstats.rpccnt[NFSPROC_READLINK] +
- nfsstats.rpccnt[NFSPROC_READ] +
- nfsstats.rpccnt[NFSPROC_WRITE] +
- nfsstats.rpccnt[NFSPROC_CREATE] +
- nfsstats.rpccnt[NFSPROC_REMOVE] +
- nfsstats.rpccnt[NFSPROC_RENAME] +
- nfsstats.rpccnt[NFSPROC_LINK] +
- nfsstats.rpccnt[NFSPROC_SYMLINK] +
- nfsstats.rpccnt[NFSPROC_MKDIR] +
- nfsstats.rpccnt[NFSPROC_RMDIR] +
- nfsstats.rpccnt[NFSPROC_READDIR] +
-#ifndef HAS_NFS_V3
- nfsstats.rpccnt[NFSPROC_STATFS] +
- nfsstats.rpccnt[NQNFSPROC_READDIRLOOK] +
-#else /* HAS_NFS_V3 */
- nfsstats.rpccnt[NFSPROC_READDIRPLUS] +
- nfsstats.rpccnt[NFSPROC_FSSTAT] +
- nfsstats.rpccnt[NFSPROC_FSINFO] +
- nfsstats.rpccnt[NFSPROC_PATHCONF] +
- nfsstats.rpccnt[NFSPROC_COMMIT] +
-#endif /* HAS_NFS_V3 */
- nfsstats.rpccnt[NQNFSPROC_GETLEASE] +
- nfsstats.rpccnt[NQNFSPROC_VACATED] +
- nfsstats.rpccnt[NQNFSPROC_EVICTED];
-
- nfsStats.nfsServer = nfsstats.srvrpccnt[NFSPROC_GETATTR] +
- nfsstats.srvrpccnt[NFSPROC_SETATTR] +
- nfsstats.srvrpccnt[NFSPROC_LOOKUP] +
- nfsstats.srvrpccnt[NFSPROC_READLINK] +
- nfsstats.srvrpccnt[NFSPROC_READ] +
- nfsstats.srvrpccnt[NFSPROC_WRITE] +
- nfsstats.srvrpccnt[NFSPROC_CREATE] +
- nfsstats.srvrpccnt[NFSPROC_REMOVE] +
- nfsstats.srvrpccnt[NFSPROC_RENAME] +
- nfsstats.srvrpccnt[NFSPROC_LINK] +
- nfsstats.srvrpccnt[NFSPROC_SYMLINK] +
- nfsstats.srvrpccnt[NFSPROC_MKDIR] +
- nfsstats.srvrpccnt[NFSPROC_RMDIR] +
- nfsstats.srvrpccnt[NFSPROC_READDIR] +
-#ifndef HAS_NFS_V3
- nfsstats.srvrpccnt[NFSPROC_STATFS] +
- nfsstats.srvrpccnt[NQNFSPROC_READDIRLOOK] +
-#else /* HAS_NFS_V3 */
- nfsstats.srvrpccnt[NFSPROC_READDIRPLUS] +
- nfsstats.srvrpccnt[NFSPROC_FSSTAT] +
- nfsstats.srvrpccnt[NFSPROC_FSINFO] +
- nfsstats.srvrpccnt[NFSPROC_PATHCONF] +
- nfsstats.srvrpccnt[NFSPROC_COMMIT] +
-#endif /* HAS_NFS_V3 */
- nfsstats.srvrpccnt[NQNFSPROC_GETLEASE] +
- nfsstats.srvrpccnt[NQNFSPROC_VACATED] +
- nfsstats.srvrpccnt[NQNFSPROC_EVICTED];
}
+ return(loadavg[0]);
}
-/*
- Reads the nlist from the kernel
-*/
-int
-get_namelist(kernel_name, memory_name)
- const char *kernel_name, *memory_name;
+static void
+get_ttystat(void)
{
- time_t now;
- time_t boottime;
- register int i, c;
- int nintv;
+ kread(X_TK_NIN, &cur.tk_nin, sizeof(cur.tk_nin));
+ kread(X_TK_NOUT, &cur.tk_nout, sizeof(cur.tk_nout));
- kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
- if (kd == 0) {
- (void)fprintf(stderr, "xperfmon++: kvm_openfiles: %s\n", errbuf);
- exit(1);
- }
+ tmp = cur.tk_nin;
+ cur.tk_nin -= last.tk_nin;
+ last.tk_nin = tmp;
- if ((c = kvm_nlist(kd, nl)) != 0) {
- if (c > 0) {
- (void)fprintf(stderr,"xperfmon++: undefined symbols:");
- for (c = 0; c < sizeof(nl)/sizeof(nl[0]); c++)
- if (nl[c].n_type == 0)
- fprintf(stderr, " %s", nl[c].n_name);
- (void)fputc('\n', stderr);
- } else
- (void)fprintf(stderr, "xperfmon++: kvm_nlist: %s\n", kvm_geterr(kd)); exit(1);
- }
+ tmp = cur.tk_nout;
+ cur.tk_nout -= last.tk_nout;
+ last.tk_nout = tmp;
+}
- kread(X_BOOTTIME, &boottime, sizeof(boottime));
- kread(X_HZ, &hz, sizeof(hz));
- for (i = 0; i < DK_NDRIVE; i++) {
- strcpy(dr_name[i], "xx");
- }
- time(&now);
- nintv = now - boottime;
- if (nintv <= 0 || nintv > 60*60*24*365*10) {
- fprintf(stderr,
- "Time makes no sense... namelist must be wrong.\n");
- exit(1);
- }
- return(nintv);
+
+static void
+get_interrupts(void)
+{
+ register int i;
+ unsigned long *intrcnt;
+ int nintr;
+
+ nintr = namelist[X_EINTRCNT].n_value - namelist[X_INTRCNT].n_value;
+ if ((intrcnt = (unsigned long *)malloc((size_t) nintr)) == NULL)
+ err(1, "xperfmon++: malloc failed in get_interrupts()");
+ nintr /= sizeof(long);
+ kread(X_INTRCNT, intrcnt, (size_t)nintr*sizeof(long));
+ old_interrupts = interrupts;
+ for (i = 0, interrupts = 0; i < nintr; i++)
+ interrupts += *(intrcnt + i);
+ free(intrcnt);
}
/*
- Kread reads something from the kernel, given its nlist index.
-*/
+ * Parts extracted from /usr/src/usr.bin/nfsstat/nfsstat.c
+ * pay attention Copyrights!
+ */
static void
-kread(nlx, addr, size)
- int nlx;
- void *addr;
- size_t size;
+get_nfsstat(void)
{
- char *sym;
-
- if (nl[nlx].n_type == 0 || nl[nlx].n_value == 0) {
- sym = nl[nlx].n_name;
- if (*sym == '_')
- ++sym;
- (void)fprintf(stderr,
- "xpermon++: symbol %s not defined\n", sym);
- exit(1);
- }
- if (kvm_read(kd, nl[nlx].n_value, addr, size) != size) {
- sym = nl[nlx].n_name;
- if (*sym == '_')
- ++sym;
- (void)fprintf(stderr, "xperfmon++: %s: %s\n", sym, kvm_geterr(kd));
- exit(1);
- }
+ int name[3];
+ size_t size = sizeof(nfsstats);
+
+ name[0] = CTL_VFS;
+ name[1] = vfc.vfc_typenum;
+ name[2] = NFS_NFSSTATS;
+ if (sysctl(name, 3, &nfsstats, &size, (void *)0, (size_t)0) < 0) {
+ fprintf(stderr, "xperfmon++: get_nfsstat(): Can?%t get NFS statistics with sysctl()\n");
+ return;
+ }
+
+ old_nfsStats = nfsStats;
+
+ nfsStats.ClientCalls = nfsstats.rpccnt[NFSPROC_GETATTR] +
+ nfsstats.rpccnt[NFSPROC_SETATTR] +
+ nfsstats.rpccnt[NFSPROC_LOOKUP] +
+ nfsstats.rpccnt[NFSPROC_READLINK] +
+ nfsstats.rpccnt[NFSPROC_READ] +
+ nfsstats.rpccnt[NFSPROC_WRITE] +
+ nfsstats.rpccnt[NFSPROC_CREATE] +
+ nfsstats.rpccnt[NFSPROC_REMOVE] +
+ nfsstats.rpccnt[NFSPROC_RENAME] +
+ nfsstats.rpccnt[NFSPROC_LINK] +
+ nfsstats.rpccnt[NFSPROC_SYMLINK] +
+ nfsstats.rpccnt[NFSPROC_MKDIR] +
+ nfsstats.rpccnt[NFSPROC_RMDIR] +
+ nfsstats.rpccnt[NFSPROC_READDIR] +
+ nfsstats.rpccnt[NFSPROC_READDIRPLUS]+
+ nfsstats.rpccnt[NFSPROC_ACCESS] +
+ nfsstats.rpccnt[NFSPROC_MKNOD] +
+ nfsstats.rpccnt[NFSPROC_FSSTAT] +
+ nfsstats.rpccnt[NFSPROC_FSINFO] +
+ nfsstats.rpccnt[NFSPROC_PATHCONF] +
+ nfsstats.rpccnt[NFSPROC_COMMIT] +
+ nfsstats.rpccnt[NQNFSPROC_GETLEASE] +
+ nfsstats.rpccnt[NQNFSPROC_VACATED] +
+ nfsstats.rpccnt[NQNFSPROC_EVICTED];
+
+ nfsStats.ClientCacheHit = nfsstats.attrcache_hits +
+ nfsstats.lookupcache_hits +
+ nfsstats.biocache_reads -
+ nfsstats.read_bios +
+ nfsstats.biocache_writes -
+ nfsstats.write_bios +
+ nfsstats.biocache_readlinks -
+ nfsstats.readlink_bios +
+ nfsstats.biocache_readdirs -
+ nfsstats.readdir_bios +
+ nfsstats.direofcache_hits;
+
+ nfsStats.ClientCacheMis = nfsstats.attrcache_misses +
+ nfsstats.lookupcache_misses +
+ nfsstats.read_bios +
+ nfsstats.write_bios +
+ nfsstats.readlink_bios +
+ nfsstats.readdir_bios +
+ nfsstats.direofcache_misses;
+
+ nfsStats.ServerCalls = nfsstats.srvrpccnt[NFSPROC_GETATTR] +
+ nfsstats.srvrpccnt[NFSPROC_SETATTR] +
+ nfsstats.srvrpccnt[NFSPROC_LOOKUP] +
+ nfsstats.srvrpccnt[NFSPROC_READLINK] +
+ nfsstats.srvrpccnt[NFSPROC_READ] +
+ nfsstats.srvrpccnt[NFSPROC_WRITE] +
+ nfsstats.srvrpccnt[NFSPROC_CREATE] +
+ nfsstats.srvrpccnt[NFSPROC_REMOVE] +
+ nfsstats.srvrpccnt[NFSPROC_RENAME] +
+ nfsstats.srvrpccnt[NFSPROC_LINK] +
+ nfsstats.srvrpccnt[NFSPROC_SYMLINK] +
+ nfsstats.srvrpccnt[NFSPROC_MKDIR] +
+ nfsstats.srvrpccnt[NFSPROC_RMDIR] +
+ nfsstats.srvrpccnt[NFSPROC_READDIR] +
+ nfsstats.srvrpccnt[NFSPROC_READDIRPLUS]+
+ nfsstats.srvrpccnt[NFSPROC_ACCESS] +
+ nfsstats.srvrpccnt[NFSPROC_MKNOD] +
+ nfsstats.srvrpccnt[NFSPROC_FSSTAT] +
+ nfsstats.srvrpccnt[NFSPROC_FSINFO] +
+ nfsstats.srvrpccnt[NFSPROC_PATHCONF] +
+ nfsstats.srvrpccnt[NFSPROC_COMMIT] +
+ nfsstats.srvrpccnt[NQNFSPROC_GETLEASE] +
+ nfsstats.srvrpccnt[NQNFSPROC_VACATED] +
+ nfsstats.srvrpccnt[NQNFSPROC_EVICTED];
+
+ nfsStats.ServerCacheHit = nfsstats.srvcache_inproghits +
+ nfsstats.srvcache_idemdonehits +
+ nfsstats.srvcache_nonidemdonehits;
+
+ nfsStats.ServerCacheMis = nfsstats.srvcache_misses;
}
+
/*
- * get_swapspace is based on a program called swapinfo written
- * by Kevin Lahey <kml@rokkaku.atl.ga.us>.
+ * Stolen from /usr/src/usr.sbin/pstat/pstat.c and
+ * /usr/src/usr.bin/top/machine.c (pay attention Copyrights!)
*/
-int
-get_swapspace()
+static double
+get_swapspace(void)
{
#if __FreeBSD_version >= 400000
- /* based on swapmode from /usr/src/usr.bin/top/machine.c */
- int n;
- int percentfree;
- struct kvm_swap swapary[1];
-
- n = kvm_getswapinfo(kd, swapary, 1, 0);
- if (n < 0)
- return(0);
-
- percentfree = (int)((((double)swapary[0].ksw_total -
- (double)swapary[0].ksw_used) * 100.0) /
- (double)swapary[0].ksw_total);
- return(percentfree);
-#else
- char *header;
- int hlen, nswap, nswdev, dmmax;
- int i, div, avail, nfree, npfree, used;
- struct swdevt *sw;
- long blocksize, *perdev;
- struct rlist head;
-#if __FreeBSD_version >= 220000
- struct rlisthdr swaplist;
- struct rlist *swapptr;
-#else
- struct rlist *swaplist;
-#endif
- u_long ptr;
- kread(VM_NSWAP, &nswap, sizeof(nswap));
- kread(VM_NSWDEV, &nswdev, sizeof(nswdev));
- kread(VM_DMMAX, &dmmax, sizeof(dmmax));
- kread(VM_SWAPLIST, &swaplist, sizeof(swaplist));
- if ((sw = malloc(nswdev * sizeof(*sw))) == NULL ||
- (perdev = malloc(nswdev * sizeof(*perdev))) == NULL)
- err(1, "xperfmon++ malloc in get_swapspace");
- kread(VM_SWDEVT, &ptr, sizeof(ptr));
- kvm_read(kd, ptr, sw, nswdev * sizeof(*sw));
- /* Count up swap space. */
- nfree = 0;
- memset(perdev, 0, nswdev * sizeof(*perdev));
-#if __FreeBSD_version >= 220000
- swapptr = swaplist.rlh_list;
- while (swapptr) {
-#else
- while (swaplist) {
-#endif
- int top, bottom, next_block;
-#if __FreeBSD_version >= 220000
- kvm_read(kd, (u_long)swapptr, &head, sizeof(struct rlist));
-#else
- kvm_read(kd, (u_long)swaplist, &head, sizeof(struct rlist));
-#endif
- top = head.rl_end;
- bottom = head.rl_start;
-
- nfree += top - bottom + 1;
-
- /*
- * Swap space is split up among the configured disks.
- *
- * For interleaved swap devices, the first dmmax blocks
- * of swap space some from the first disk, the next dmmax
- * blocks from the next, and so on up to nswap blocks.
- *
- * The list of free space joins adjacent free blocks,
- * ignoring device boundries. If we want to keep track
- * of this information per device, we'll just have to
- * extract it ourselves.
- */
- while (top / dmmax != bottom / dmmax) {
- next_block = ((bottom + dmmax) / dmmax);
- perdev[(bottom / dmmax) % nswdev] +=
- next_block * dmmax - bottom;
- bottom = next_block * dmmax;
- }
- perdev[(bottom / dmmax) % nswdev] +=
- top - bottom + 1;
-#if __FreeBSD_version >= 220000
- swapptr = head.rl_next;
+ /* based on swapmode from /usr/src/usr.bin/top/machine.c */
+ int n;
+ int percentfree;
+ struct kvm_swap swapary[1];
+
+ n = kvm_getswapinfo(kd, swapary, 1, 0);
+ if (n < 0)
+ return(0);
+
+ percentfree = ((((double)swapary[0].ksw_total -
+ (double)swapary[0].ksw_used) * 100.0) /
+ (double)swapary[0].ksw_total);
+ return(percentfree);
+
#else
- swaplist = head.rl_next;
-#endif
- }
-
- header = getbsize(&hlen, &blocksize);
- div = blocksize / 512;
- avail = npfree = 0;
- for (i = 0; i < nswdev; i++) {
- int xsize, xfree;
-
- /*
- * Don't report statistics for partitions which have not
- * yet been activated via swapon(8).
- */
- if (!(sw[i].sw_flags & SW_FREED))
- continue;
-
- /* The first dmmax is never allocated to avoid trashing of
- * disklabels
- */
- xsize = sw[i].sw_nblks - dmmax;
- xfree = perdev[i];
- used = xsize - xfree;
- npfree++;
- avail += xsize;
+ /* based on /usr/src/usr.sbin/pstat/pstat.c */
+ char *header;
+ int hlen, nswap, nswdev, dmmax;
+ int i, div, avail, nfree, npfree, used;
+ struct swdevt *sw;
+ long blocksize, *perdev;
+ struct rlist head;
+ struct rlisthdr swaplist;
+ struct rlist *swapptr;
+ u_long ptr;
+
+ kread(VM_NSWAP, &nswap, sizeof(nswap));
+ kread(VM_NSWDEV, &nswdev, sizeof(nswdev));
+ kread(VM_DMMAX, &dmmax, sizeof(dmmax));
+ kread(VM_SWAPLIST, &swaplist, sizeof(swaplist));
+ if ((sw = malloc(nswdev * sizeof(*sw))) == NULL ||
+ (perdev = malloc(nswdev * sizeof(*perdev))) == NULL)
+ err(1, "xperfmon++ malloc in get_swapspace");
+ kread(VM_SWDEVT, &ptr, sizeof(ptr));
+ kvm_read(kd, ptr, sw, nswdev * sizeof(*sw));
+
+ /* Count up swap space. */
+ nfree = 0;
+ memset(perdev, 0, nswdev * sizeof(*perdev));
+ swapptr = swaplist.rlh_list;
+ while (swapptr) {
+ int top, bottom, next_block;
+ kvm_read(kd, (u_long)swapptr, &head, sizeof(struct rlist));
+ top = head.rl_end;
+ bottom = head.rl_start;
+
+ nfree += top - bottom + 1;
+
+ /*
+ * Swap space is split up among the configured disks.
+ *
+ * For interleaved swap devices, the first dmmax blocks
+ * of swap space some from the first disk, the next dmmax
+ * blocks from the next, and so on up to nswap blocks.
+ *
+ * The list of free space joins adjacent free blocks,
+ * ignoring device boundries. If we want to keep track
+ * of this information per device, we'll just have to
+ * extract it ourselves.
+ */
+ while (top / dmmax != bottom / dmmax) {
+ next_block = ((bottom + dmmax) / dmmax);
+ perdev[(bottom / dmmax) % nswdev] +=
+ next_block * dmmax - bottom;
+ bottom = next_block * dmmax;
}
+ perdev[(bottom / dmmax) % nswdev] +=
+ top - bottom + 1;
+ swapptr = head.rl_next;
+ }
+ header = getbsize(&hlen, &blocksize);
+ div = blocksize / 512;
+ avail = npfree = 0;
+ for (i = 0; i < nswdev; i++) {
+ int xsize, xfree;
/*
- * If only one partition has been set up via swapon(8), we don't
- * need to bother with totals.
+ * Don't report statistics for partitions which have not
+ * yet been activated via swapon(8).
*/
- used = avail - nfree;
+ if (!(sw[i].sw_flags & SW_FREED))
+ continue;
+
+ /* The first dmmax is never allocated to avoid trashing of
+ * disklabels
+ */
+ xsize = sw[i].sw_nblks - dmmax;
+ xfree = perdev[i];
+ used = xsize - xfree;
+ npfree++;
+ avail += xsize;
+ }
+
+ /*
+ * If only one partition has been set up via swapon(8), we don't
+ * need to bother with totals.
+ */
+ used = avail - nfree;
+ free(sw);
+ free(perdev);
+
+ return((100.0*nfree)/avail);
- free(perdev);
- free(sw);
- return((100*nfree)/avail); /* return free swap in percent */
#endif /* __FreeBSD_version >= 400000 */
}
-#ifdef HAVE_DEVSTAT
-/* routines which use libdevstat */
-/* this is partly taken from FreeBSD - /usr/src/usr.sbin/iostat */
-void
-init_devstat(void)
-{
- /*
- * Make sure that the userland devstat version matches the kernel
- * devstat version.
- */
- if (checkversion() < 0) {
- nodisk++;
- return;
- }
- /* find out how many devices we have */
- if ((num_devices = getnumdevs()) < 0) {
- nodisk++;
- return;
- }
- cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
- last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo));
- bzero(cur.dinfo, sizeof(struct devinfo));
- bzero(last.dinfo, sizeof(struct devinfo));
+/*
+ * Stolen from /usr/src/usr.bin/netstat/if.c
+ * pay attention Copyrights!
+ */
+static void
+get_netstat(void)
+{
+ off_t ifnetaddr;
- /*
- * Grab all the devices. We don't look to see if the list has
- * changed here, since it almost certainly has. We only look for
- * errors.
- */
- if (getdevs(&cur) == -1) {
- nodisk++;
- return;
- }
+ if ((ifnetaddr = namelist[N_IFNET].n_value) != 0) {
+ struct ifnet ifnet;
+ struct ifnethead ifnethead;
+ u_long ifaddraddr, ifnetfound;
+ struct ifaddr ifa;
- num_devices = cur.dinfo->numdevs;
- generation = cur.dinfo->generation;
+ if(kvm_read(kd, ifnetaddr, (char *)&ifnethead, sizeof(ifnethead)) == -1)
+ return;
+ ifnetaddr = (u_long)ifnethead.tqh_first;
+ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof(ifnet)) == -1)
+ return;
- dev_select = NULL;
+ old_packets = packets;
+ packets.input = packets.output = packets.collisions = 0;
+ ifaddraddr = 0;
+ while (ifnetaddr || ifaddraddr) {
+ if (ifaddraddr == 0) {
+ ifnetfound = ifnetaddr;
+ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
+ return;
+ ifnetaddr = (u_long)ifnet.if_link.tqe_next;
+ ifaddraddr = (u_long)ifnet.if_addrhead.tqh_first;
+ }
+ if (kvm_read(kd, ifaddraddr, (char *)&ifa, sizeof ifa) == -1) {
+ ifaddraddr = 0;
+ continue;
+ }
+ ifaddraddr = (u_long)ifa.ifa_link.tqe_next;
- /* only interested in disks */
- matches = NULL;
- if (buildmatch("da", &matches, &num_matches) != 0) {
- nodisk++;
- return;
+ packets.input += ifnet.if_ipackets;
+ packets.output += ifnet.if_opackets;
+ packets.collisions += ifnet.if_collisions;
}
+ }
+}
- if (num_matches == 0)
- select_mode = DS_SELECT_ADD;
- else
- select_mode = DS_SELECT_ONLY;
-
- /*
- * At this point, selectdevs will almost surely indicate that the
- * device list has changed, so we don't look for return values of 0
- * or 1. If we get back -1, though, there is an error.
- */
- if (selectdevs(&dev_select, &num_selected,
- &num_selections, &select_generation,
- generation, cur.dinfo->devices, num_devices,
- matches, num_matches,
- NULL, 0,
- select_mode, DK_NDRIVE, 0) == -1)
- nodisk++;
+/*
+ * Many thanks to Kenneth Merry <ken@plutotech.com> who helped to code
+ * the initial disk statistic routines
+ */
+static void
+init_diskio(void)
+{
+ int retval, i;
+
+ cur.dinfo = (struct devinfo *) malloc(sizeof(struct devinfo));
+ last.dinfo = (struct devinfo *) malloc(sizeof(struct devinfo));
+ bzero(cur.dinfo, sizeof(struct devinfo));
+ bzero(last.dinfo, sizeof(struct devinfo));
+
+ if (checkversion() < 0)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+
+ /*
+ * man muß über specified devices gehen, um da1,... zu
+ * selektieren, siehe /usr/src/usr.sbin/iostat/iostat.c
+ */
+
+/* printf("%s\n", info1); LK!!! */
+ if (buildmatch("da", &matches, &num_matches) != 0)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+ if (buildmatch("sa", &matches, &num_matches) != 0)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+ if (buildmatch("cd", &matches, &num_matches) != 0)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+
+ if (getdevs(&cur) == -1)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+
+ maxshowdevs = 50;
+
+ num_devices = cur.dinfo->numdevs;
+ generation = cur.dinfo->generation;
+
+ retval = selectdevs(&dev_select, &num_selected,
+ &num_selections, &select_generation,
+ generation, cur.dinfo->devices,
+ num_devices, matches, num_matches,
+ specified_devices, num_devices_specified,
+ DS_SELECT_ONLY, maxshowdevs, 0);
+ switch (retval) {
+ case -1:
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+ break;
+ default:
+ break;
+ }
}
-int
-get_devstat(void)
+
+static void
+get_diskio(void)
{
- register int dn;
- long double busy_seconds;
- u_int64_t total_transfers;
- struct devinfo *tmp_dinfo;
- int total_xfers = 0;
-
- if (nodisk == 0) {
- /*
- * Here what we want to do is refresh our device stats.
- * getdevs() returns 1 when the device list has changed.
- * If the device list has changed, we want to go through
- * the selection process again, in case a device that we
- * were previously displaying has gone away.
- */
- switch (getdevs(&cur)) {
+ register int i, dn;
+ long double busy_seconds;
+ long double transfers_per_second, mb_per_second;
+ struct devinfo *tmp_dinfo;
+ int retval;
+
+ tmp_dinfo = last.dinfo;
+ last.dinfo = cur.dinfo;
+ cur.dinfo = tmp_dinfo;
+ last.busy_time = cur.busy_time;
+
+ switch (getdevs(&cur)) {
+ case -1:
+ errx(1, "xperfmon++: %s", devstat_errbuf);
+ break;
+ case 1: {
+ int retval;
+
+ num_devices = cur.dinfo->numdevs;
+ generation = cur.dinfo->generation;
+ retval = selectdevs(&dev_select, &num_selected,
+ &num_selections, &select_generation,
+ generation, cur.dinfo->devices,
+ num_devices, matches, num_matches,
+ specified_devices, num_devices_specified,
+ DS_SELECT_ONLY, maxshowdevs, 0);
+ switch (retval) {
case -1:
- return (0);
- case 1: {
- int retval;
-
- num_devices = cur.dinfo->numdevs;
- generation = cur.dinfo->generation;
- retval = selectdevs(&dev_select, &num_selected,
- &num_selections, &select_generation,
- generation, cur.dinfo->devices,
- num_devices, matches, num_matches,
- NULL, 0,
- select_mode, DK_NDRIVE, 0);
- switch(retval) {
- case -1:
- return (0);
- case 1:
- break;
- default:
- break;
- }
+ errx(1, "xperfmon++: %s", devstat_errbuf);
break;
- }
default:
break;
}
-
- /*
- * Calculate elapsed time up front, since it's the same for all
- * devices.
- */
- busy_seconds = compute_etime(cur.busy_time, last.busy_time);
-
- /* this is the first time thru so just copy cur to last */
- if (last.dinfo->numdevs == 0) {
- tmp_dinfo = last.dinfo;
- last.dinfo = cur.dinfo;
- cur.dinfo = tmp_dinfo;
- last.busy_time = cur.busy_time;
- return (0);
+ break;
}
+ default:
+ break;
+ }
+ /*
+ * Calculate elapsed time up front, since it's the same for all
+ * devices.
+ */
- for (dn = 0; dn < num_devices; dn++) {
- int di;
+ diskstat.da_trsf = diskstat.da_mb = 0.0;
+ diskstat.sa_trsf = diskstat.sa_mb = 0.0;
+ diskstat.cd_trsf = diskstat.cd_mb = 0.0;
- if ((dev_select[dn].selected == 0)
- || (dev_select[dn].selected > DK_NDRIVE))
- continue;
+ busy_seconds = compute_etime(cur.busy_time, last.busy_time);
- di = dev_select[dn].position;
+ for (dn = 0; dn < num_devices; dn++) {
+ int di;
- if (compute_stats(&cur.dinfo->devices[di],
- &last.dinfo->devices[di], busy_seconds,
- NULL, &total_transfers,
- NULL, NULL,
- NULL, NULL,
- NULL, NULL)!= 0)
- break;
- total_xfers += (int)total_transfers;
- }
+ if (dev_select[dn].selected == 0)
+ continue;
- tmp_dinfo = last.dinfo;
- last.dinfo = cur.dinfo;
- cur.dinfo = tmp_dinfo;
+ di = dev_select[dn].position;
- last.busy_time = cur.busy_time;
+ if (compute_stats(&cur.dinfo->devices[di],
+ &last.dinfo->devices[di], busy_seconds,
+ NULL, NULL,
+ NULL, NULL,
+ &transfers_per_second, &mb_per_second,
+ NULL, NULL) != 0)
+ errx(1, "xperfmon++: %s", devstat_errbuf);
- } else
- /* no disks found ? */
- total_xfers = 0;
+ if (strcmp(cur.dinfo->devices[di].device_name, "da") == 0 ||
+ strcmp(cur.dinfo->devices[di].device_name, "wd") == 0) {
+#ifdef DEBUG
+ printf( "da%d: %Lf %Lf\n", cur.dinfo->devices[di].unit_number, transfers_per_second, mb_per_second);
+#endif
+ diskstat.da_trsf += transfers_per_second;
+ diskstat.da_mb += mb_per_second;
+ }
+ if (strcmp(cur.dinfo->devices[di].device_name, "sa") == 0) {
+#ifdef DEBUG
+ printf( "sa%d: %Lf %Lf\n", cur.dinfo->devices[di].unit_number, transfers_per_second, mb_per_second);
+#endif
+ diskstat.sa_trsf += transfers_per_second;
+ diskstat.sa_mb += mb_per_second;
+ }
+ if (strcmp(cur.dinfo->devices[di].device_name, "cd") == 0 ||
+ strcmp(cur.dinfo->devices[di].device_name, "acd") == 0) {
+#ifdef DEBUG
+ printf( "cd%d: %Lf %Lf\n", cur.dinfo->devices[di].unit_number, transfers_per_second, mb_per_second);
+#endif
+ diskstat.cd_trsf += transfers_per_second;
+ diskstat.cd_mb += mb_per_second;
+ }
+
+ }
- return (total_xfers);
}
-#endif /* HAVE_DEVSTAT */
diff --git a/sysutils/xperfmon3/files/patch-aa b/sysutils/xperfmon3/files/patch-aa
index c53c1fc383c6..d39791572c8c 100644
--- a/sysutils/xperfmon3/files/patch-aa
+++ b/sysutils/xperfmon3/files/patch-aa
@@ -1,50 +1,142 @@
*** ../xperfmon++/StripChart.c Wed Jul 27 22:29:30 1994
---- ./StripChart.c Thu Apr 30 15:03:27 1998
+--- ./StripChart.c Sun Jan 10 21:14:40 1999
+***************
+*** 1,4 ****
+! /* $XConsortium: StripChart.c,v 1.20 91/05/24 17:20:42 converse Exp $ */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+--- 1,9 ----
+! /*
+! * Enhancement and error correction for FreeBSD-3.X
+! * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+! *
+! * $Id: StripChart.c,v 3.8 1999/01/10 20:14:30 lkoeller Exp lkoeller $
+! */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+***************
+*** 6,18 ****
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+--- 11,23 ----
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+***************
+*** 28,34 ****
+ * 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
+--- 33,39 ----
+ * 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 ****
+ * 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
+--- 44,50 ----
+ * 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
***************
-*** 53,58 ****
---- 53,70 ----
+*** 48,58 ****
+--- 53,71 ----
+
+ ******************************************************************/
+
++ #ifndef LINT
++ static char rcsid[] = "$Id: StripChart.c,v 3.8 1999/01/10 20:14:30 lkoeller Exp lkoeller $";
++ #endif
++
++ #include "fbsd_vers.h"
++
+ #include <stdio.h>
+ #include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/XawInit.h>
#include "StripCharP.h"
+
-+ #ifdef HAVE_SYS_PARAM_H
-+ #include <sys/param.h>
-+ #endif
-+
-+ #if (defined(BSD) && (BSD >= 199506))
-+ # include <osreldate.h>
-+ #else
-+ # error You have to use at least a FreeBSD 2.2.X system
-+ #endif
-+
-+ # include "system.h"
++ #include "system.h"
#include <X11/Xfuncs.h>
#define MS_PER_SEC 100
***************
-*** 108,114 ****
- };
+*** 109,114 ****
+--- 122,128 ----
#undef offset
-! #define LABEL_ROOM 100
+ #define LABEL_ROOM 100
++
static void Initialize(), Destroy(), Redisplay(), MoveChart(), SetPoints();
static Boolean SetValues();
static int repaint_window();
---- 120,130 ----
- };
+***************
+*** 204,213 ****
+ PerfChartWidget w;
+ unsigned int which;
+ {
+! if (which & FOREGROUND)
+ XtReleaseGC((Widget) w, w->strip_chart.fgGC);
+
+! if (which & HIGHLIGHT)
+ XtReleaseGC((Widget) w, w->strip_chart.hiGC);
+ }
+
+--- 218,227 ----
+ PerfChartWidget w;
+ unsigned int which;
+ {
+! if (which & FOREGROUND)
+ XtReleaseGC((Widget) w, w->strip_chart.fgGC);
+
+! if (which & HIGHLIGHT)
+ XtReleaseGC((Widget) w, w->strip_chart.hiGC);
+ }
- #undef offset
-! #if (defined(BSD) && (BSD >= 199306))
-! # define LABEL_ROOM 80
-! #else
-! # define LABEL_ROOM 100
-! #endif
- static void Initialize(), Destroy(), Redisplay(), MoveChart(), SetPoints();
- static Boolean SetValues();
- static int repaint_window();
***************
*** 215,222 ****
---- 231,253 ----
+--- 229,251 ----
static void Initialize (greq, gnew)
Widget greq, gnew;
{
@@ -69,7 +161,121 @@
if ( mono_screen ) {
***************
-*** 343,361 ****
+*** 247,257 ****
+ w->strip_chart.currentBG = w->core.background_pixel;
+ w->strip_chart.interval = LABEL_ROOM;
+ w->strip_chart.max_value = 0.0;
+! w->strip_chart.min_value = 99999.99;
+ w->strip_chart.points = NULL;
+ SetPoints(w);
+ }
+!
+ static void Destroy (gw)
+ Widget gw;
+ {
+--- 276,286 ----
+ w->strip_chart.currentBG = w->core.background_pixel;
+ w->strip_chart.interval = LABEL_ROOM;
+ w->strip_chart.max_value = 0.0;
+! w->strip_chart.min_value = 99999;
+ w->strip_chart.points = NULL;
+ SetPoints(w);
+ }
+!
+ static void Destroy (gw)
+ Widget gw;
+ {
+***************
+*** 265,271 ****
+ }
+
+ /*
+! * NOTE: This function really needs to recieve graphics exposure
+ * events, but since this is not easily supported until R4 I am
+ * going to hold off until then.
+ */
+--- 294,300 ----
+ }
+
+ /*
+! * NOTE: This function really needs to recieve graphics exposure
+ * events, but since this is not easily supported until R4 I am
+ * going to hold off until then.
+ */
+***************
+*** 295,301 ****
+ double value, checkValue;
+ Display *dpy = XtDisplay(w);
+ Window win = XtWindow(w);
+!
+ /* if (w->strip_chart.update > 0)
+ w->strip_chart.interval_id =
+ XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) w),
+--- 324,330 ----
+ double value, checkValue;
+ Display *dpy = XtDisplay(w);
+ Window win = XtWindow(w);
+!
+ /* if (w->strip_chart.update > 0)
+ w->strip_chart.interval_id =
+ XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) w),
+***************
+*** 311,321 ****
+
+ XtCallCallbacks( (Widget)w, XtNgetValue, (XtPointer)&value );
+
+! /*
+! * Keep w->strip_chart.max_value up to date, and if this data
+! * point is off the graph, change the scale to make it fit.
+ */
+!
+ if (value > w->strip_chart.max_value) {
+ w->strip_chart.max_value = value;
+ if (w->strip_chart.max_value > w->strip_chart.scale) {
+--- 340,350 ----
+
+ XtCallCallbacks( (Widget)w, XtNgetValue, (XtPointer)&value );
+
+! /*
+! * Keep w->strip_chart.max_value up to date, and if this data
+! * point is off the graph, change the scale to make it fit.
+ */
+!
+ if (value > w->strip_chart.max_value) {
+ w->strip_chart.max_value = value;
+ if (w->strip_chart.max_value > w->strip_chart.scale) {
+***************
+*** 323,330 ****
+ w->strip_chart.interval = repaint_window(w, 0, (int) w->core.width);
+ }
+ }
+! if (value < w->strip_chart.min_value)
+! w->strip_chart.min_value = value;
+
+ w->strip_chart.valuedata[w->strip_chart.interval] = value;
+ if (XtIsRealized((Widget)w)) {
+--- 352,359 ----
+ w->strip_chart.interval = repaint_window(w, 0, (int) w->core.width);
+ }
+ }
+! if (value < w->strip_chart.min_value)
+! w->strip_chart.min_value = value;
+
+ w->strip_chart.valuedata[w->strip_chart.interval] = value;
+ if (XtIsRealized((Widget)w)) {
+***************
+*** 332,391 ****
+ (int)(w->core.height * value) / w->strip_chart.scale);
+
+ /* Check for high warnings and alarms */
+!
+ if ( w->strip_chart.highWarn != 99999 ||
+ w->strip_chart.highAlarm != 99999 ) {
+
+ if ( w->strip_chart.immediate )
+! checkValue = value;
+ else
+! checkValue = w->strip_chart.max_value;
if ( checkValue >= w->strip_chart.highAlarm ) { /* check for high alarm */
if ( w->strip_chart.currentBG != w->strip_chart.alarmColor ) {
@@ -89,48 +295,78 @@
w->strip_chart.currentBG = w->strip_chart.okColor;
}
}
---- 374,392 ----
+ }
+!
+ /* Check for low warnings and alarms */
+!
+ else if ( w->strip_chart.lowWarn != 0 ||
+ w->strip_chart.lowAlarm != 0 ) {
+
+ if ( w->strip_chart.immediate )
+! checkValue = value;
+ else
+! checkValue = w->strip_chart.min_value;
- if ( checkValue >= w->strip_chart.highAlarm ) { /* check for high alarm */
+ if ( checkValue <= w->strip_chart.lowAlarm ) { /* check for low alarm */
if ( w->strip_chart.currentBG != w->strip_chart.alarmColor ) {
-! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.alarmColor, NULL );
+! XtVaSetValues(w, XtNbackground, w->strip_chart.alarmColor, NULL );
w->strip_chart.currentBG = w->strip_chart.alarmColor;
}
}
- else if ( checkValue >= w->strip_chart.highWarn ) { /* check for high warning */
+ else if ( checkValue <= w->strip_chart.lowWarn ) { /* check for low warning */
if ( w->strip_chart.currentBG != w->strip_chart.warnColor ) {
-! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.warnColor, NULL );
+! XtVaSetValues(w, XtNbackground, w->strip_chart.warnColor, NULL );
w->strip_chart.currentBG = w->strip_chart.warnColor;
}
}
else {
if ( w->strip_chart.currentBG != w->strip_chart.okColor ) { /* reset to okColor? */
-! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.okColor, NULL );
+! XtVaSetValues(w, XtNbackground, w->strip_chart.okColor, NULL );
w->strip_chart.currentBG = w->strip_chart.okColor;
}
}
-***************
-*** 373,391 ****
+--- 361,420 ----
+ (int)(w->core.height * value) / w->strip_chart.scale);
- if ( checkValue <= w->strip_chart.lowAlarm ) { /* check for low alarm */
+ /* Check for high warnings and alarms */
+!
+ if ( w->strip_chart.highWarn != 99999 ||
+ w->strip_chart.highAlarm != 99999 ) {
+
+ if ( w->strip_chart.immediate )
+! checkValue = value / SCALE_HACK;
+ else
+! checkValue = w->strip_chart.max_value / SCALE_HACK;
+
+ if ( checkValue >= w->strip_chart.highAlarm ) { /* check for high alarm */
if ( w->strip_chart.currentBG != w->strip_chart.alarmColor ) {
-! XtVaSetValues(w, XtNbackground, w->strip_chart.alarmColor, NULL );
+! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.alarmColor, NULL );
w->strip_chart.currentBG = w->strip_chart.alarmColor;
}
}
- else if ( checkValue <= w->strip_chart.lowWarn ) { /* check for low warning */
+ else if ( checkValue >= w->strip_chart.highWarn ) { /* check for high warning */
if ( w->strip_chart.currentBG != w->strip_chart.warnColor ) {
-! XtVaSetValues(w, XtNbackground, w->strip_chart.warnColor, NULL );
+! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.warnColor, NULL );
w->strip_chart.currentBG = w->strip_chart.warnColor;
}
}
else {
if ( w->strip_chart.currentBG != w->strip_chart.okColor ) { /* reset to okColor? */
-! XtVaSetValues(w, XtNbackground, w->strip_chart.okColor, NULL );
+! XtVaSetValues((Widget)w, XtNbackground, w->strip_chart.okColor, NULL );
w->strip_chart.currentBG = w->strip_chart.okColor;
}
}
---- 404,422 ----
+ }
+!
+ /* Check for low warnings and alarms */
+!
+ else if ( w->strip_chart.lowWarn != 0 ||
+ w->strip_chart.lowAlarm != 0 ) {
+
+ if ( w->strip_chart.immediate )
+! checkValue = value / SCALE_HACK;
+ else
+! checkValue = w->strip_chart.min_value / SCALE_HACK;
if ( checkValue <= w->strip_chart.lowAlarm ) { /* check for low alarm */
if ( w->strip_chart.currentBG != w->strip_chart.alarmColor ) {
@@ -151,6 +387,68 @@
}
}
***************
+*** 393,413 ****
+
+ if ( !w->strip_chart.fillRect ) { /* draw line graph */
+ int y = (int) (w->core.height -
+! (int)(w->core.height *
+! w->strip_chart.valuedata[w->strip_chart.interval-1] ) /
+ w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.fgGC,
+! w->strip_chart.interval-1, y,
+ w->strip_chart.interval, y1);
+ }
+ else /* draw filled graph */
+ XFillRectangle(dpy, win, w->strip_chart.fgGC,
+! w->strip_chart.interval, y1,
+ (unsigned int) 1, w->core.height - y1);
+
+ /*
+ * Fill in the graph lines we just painted over.
+!
+
+ if (w->strip_chart.points != NULL) {
+ w->strip_chart.points[0].x = w->strip_chart.interval;
+--- 422,442 ----
+
+ if ( !w->strip_chart.fillRect ) { /* draw line graph */
+ int y = (int) (w->core.height -
+! (int)(w->core.height *
+! w->strip_chart.valuedata[w->strip_chart.interval-1] ) /
+ w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.fgGC,
+! w->strip_chart.interval-1, y,
+ w->strip_chart.interval, y1);
+ }
+ else /* draw filled graph */
+ XFillRectangle(dpy, win, w->strip_chart.fgGC,
+! w->strip_chart.interval, y1,
+ (unsigned int) 1, w->core.height - y1);
+
+ /*
+ * Fill in the graph lines we just painted over.
+!
+
+ if (w->strip_chart.points != NULL) {
+ w->strip_chart.points[0].x = w->strip_chart.interval;
+***************
+*** 434,440 ****
+ #define XDS(s) XDrawString(XtDisplay(w), XtWindow(w), \
+ w->strip_chart.hiGC, x, y, s, strlen(s))
+
+! static int
+ repaint_window(w, left, width)
+ PerfChartWidget w;
+ int left, width;
+--- 463,469 ----
+ #define XDS(s) XDrawString(XtDisplay(w), XtWindow(w), \
+ w->strip_chart.hiGC, x, y, s, strlen(s))
+
+! static int
+ repaint_window(w, left, width)
+ PerfChartWidget w;
+ int left, width;
+***************
*** 448,455 ****
/* Compute the minimum scale required to graph the data, but don't go
@@ -160,24 +458,36 @@
if (scale < w->strip_chart.min_scale)
scale = w->strip_chart.min_scale;
---- 479,493 ----
+--- 477,486 ----
/* Compute the minimum scale required to graph the data, but don't go
lower than min_scale. */
!
! if (w->strip_chart.interval != 0 || scale <= (int)w->strip_chart.max_value) {
-! #if (defined(BSD) && (BSD >= 199306))
-! if (strcmp(w->strip_chart.botLabel, botNames[FREE_MEM]) != 0 || w->strip_chart.max_value == 100)
- scale = ((int) (w->strip_chart.max_value)) + 1;
-+ #else
-+ scale = ((int) (w->strip_chart.max_value)) + 1;
-+ #endif
+ scale = ((int) (w->strip_chart.max_value)) + 1;
+ }
if (scale < w->strip_chart.min_scale)
scale = w->strip_chart.min_scale;
***************
-*** 479,490 ****
+*** 461,467 ****
+
+ SetPoints(w);
+
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ }
+--- 492,498 ----
+
+ SetPoints(w);
+
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ }
+***************
+*** 479,502 ****
/* draw titles */
if ( w->strip_chart.topLabel ) {
@@ -190,7 +500,19 @@
x = 4;
XDS(w->strip_chart.botLabel);
}
---- 517,528 ----
+
+ /* draw scale labels */
+!
+ (void) sprintf(numstring, "%d ", 0);
+ x = LABEL_ROOM - XTW(numstring);
+ y = w->core.height - 1;
+ XDS(numstring); /* draw min value */
+
+ (void) sprintf(numstring, "%d ", (int)w->strip_chart.max_value );
+ x = LABEL_ROOM - XTW(numstring);
+ y = w->strip_chart.font_height - 4;
+ XDS(numstring); /* draw max value */
+--- 510,540 ----
/* draw titles */
if ( w->strip_chart.topLabel ) {
@@ -203,748 +525,243 @@
x = 4;
XDS(w->strip_chart.botLabel);
}
-*** ../xperfmon++/TimeChart.c Wed Jul 27 22:29:31 1994
---- ./TimeChart.c Thu Apr 30 15:03:27 1998
-***************
-*** 47,52 ****
---- 47,62 ----
- * Moffett Field, California, rsmith@proteus.arc.nasa.gov
- ******************************************************************/
-+ #ifdef HAVE_SYS_PARAM_H
-+ #include <sys/param.h>
-+ #endif
-+
-+ #if (defined(BSD) && (BSD >= 199506))
-+ # include <osreldate.h>
-+ #else
-+ # error You have to use at least a FreeBSD 2.2.X system
-+ #endif
-+
- #include <stdio.h>
- #include <X11/IntrinsicP.h>
- #include <X11/StringDefs.h>
-*** ../xperfmon++/misc.c Wed Jul 27 22:29:33 1994
---- ./misc.c Thu Apr 30 15:03:27 1998
-***************
-*** 22,27 ****
---- 22,38 ----
- * Author: Roger Smith, Sterling Software @ NASA-Ames Research Center
- * Moffett Field, California, rsmith@proteus.arc.nasa.gov
- */
-+
-+ #ifdef HAVE_SYS_PARAM_H
-+ #include <sys/param.h>
+ /* draw scale labels */
+! #ifdef __FreeBSD__
+! (void) sprintf(numstring, "%1.1f ", 0.0);
+! #else
+ (void) sprintf(numstring, "%d ", 0);
+ #endif
-+
-+ #if (defined(BSD) && (BSD >= 199506))
-+ # include <osreldate.h>
+ x = LABEL_ROOM - XTW(numstring);
+ y = w->core.height - 1;
+ XDS(numstring); /* draw min value */
+
++ #ifdef __FreeBSD__
++ (void) sprintf(numstring, "%01.1f ", w->strip_chart.max_value / SCALE_HACK );
+ #else
-+ # error You have to use at least a FreeBSD 2.2.X system
+ (void) sprintf(numstring, "%d ", (int)w->strip_chart.max_value );
+ #endif
-+
- #include <stdio.h>
+ x = LABEL_ROOM - XTW(numstring);
+ y = w->strip_chart.font_height - 4;
+ XDS(numstring); /* draw max value */
+***************
+*** 511,525 ****
+
+ if ( i == left && left + 1 == width && width != next ) {
+ y1 = (int) (w->core.height -
+! (int)(w->core.height * w->strip_chart.valuedata[i-1]) /
+! w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.fgGC,
+ i-1, y1, i, y);
+ }
+ else if ( i == left ) { /* If this is the leftmost point, then just plot it. */
+!
+ XDrawPoint(dpy, win, w->strip_chart.fgGC, i, y);
+! }
+ else {
+ /* If this is not the left most point, then draw a line
+ * connecting this point with the one to its left.
+--- 549,562 ----
+
+ if ( i == left && left + 1 == width && width != next ) {
+ y1 = (int) (w->core.height -
+! (int)(w->core.height * w->strip_chart.valuedata[i-1]) / w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.fgGC,
+ i-1, y1, i, y);
+ }
+ else if ( i == left ) { /* If this is the leftmost point, then just plot it. */
+!
+ XDrawPoint(dpy, win, w->strip_chart.fgGC, i, y);
+! }
+ else {
+ /* If this is not the left most point, then draw a line
+ * connecting this point with the one to its left.
+***************
+*** 536,542 ****
+ int y = (int) (w->core.height -
+ (int)(w->core.height * w->strip_chart.valuedata[i]) /
+ w->strip_chart.scale);
+! XFillRectangle(dpy, win, w->strip_chart.fgGC,
+ i, /* x */
+ y, /* y */
+ (unsigned int) 1, /* width */
+--- 573,579 ----
+ int y = (int) (w->core.height -
+ (int)(w->core.height * w->strip_chart.valuedata[i]) /
+ w->strip_chart.scale);
+! XFillRectangle(dpy, win, w->strip_chart.fgGC,
+ i, /* x */
+ y, /* y */
+ (unsigned int) 1, /* width */
+***************
+*** 545,551 ****
- #include <X11/IntrinsicP.h>
-***************
-*** 58,64 ****
- int i, keycode, length = 0;
- /* PerfmonWidget pw = (PerfmonWidget) w;*/
-
-! length = XLookupString(event, strbuf, STRBUFSIZE, &keycode, NULL);
- switch (keycode) {
- case 'Q':
- case 'q':
---- 69,75 ----
- int i, keycode, length = 0;
- /* PerfmonWidget pw = (PerfmonWidget) w;*/
-
-! length = XLookupString((XKeyEvent *)event, strbuf, STRBUFSIZE, (KeySym *)&keycode, NULL);
- switch (keycode) {
- case 'Q':
- case 'q':
-*** ../xperfmon++/xperfmon.c Wed Jul 27 22:29:39 1994
---- ./xperfmon.c Thu Aug 13 18:59:02 1998
-***************
-*** 58,63 ****
---- 58,73 ----
- *
- */
+ }
-+ #ifdef HAVE_SYS_PARAM_H
-+ #include <sys/param.h>
-+ #endif
-+
-+ #if (defined(BSD) && (BSD >= 199506))
-+ # include <osreldate.h>
-+ #else
-+ # error You have to use at least a FreeBSD 2.2.X system
-+ #endif
-+
- #include <stdio.h>
- #include <X11/IntrinsicP.h>
- #include <X11/StringDefs.h>
-***************
-*** 76,82 ****
---- 86,97 ----
- extern void start_graphs();
- extern time_t timeStamp;
- extern Dimension oldHeight, oldWidth;
-+
-+ #if __FreeBSD_version >= 220000
-+ extern float current_values[NUM_GRAPHS];
-+ #else
- extern int current_values[NUM_GRAPHS];
-+ #endif
+! /************** Draw graph reference lines
+ for (i = 1; i < w->strip_chart.scale; i++) {
+ j = i * ((int)w->core.height / w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.hiGC, left , j, scalewidth, j);
+--- 582,588 ----
- char *gprogname;
- double testValue;
-***************
-*** 94,99 ****
---- 109,119 ----
- { NULL, NULL },
- };
-
-+ /* LK!!! */
-+ int MIN_HEIGHT=420;
-+ #define MIN_WIDTH 185
-+ #define GRAPH_MIN_HEIGHT 28
-+
- #define XtNinterval "interval"
- #define XtNcount "count"
- #define XtCCount "Count"
-***************
-*** 101,120 ****
- #define XtCFill "Fill"
- #define XtNfast "fast"
- #define XtCFast "Fast"
-- #define XtNstufAdd "stufAdd"
-- #define XtCStufAdd "StufAdd"
-- #define XtNstufSub "stufSub"
-- #define XtCStufSub "StufSub"
- #define XtNdebug "debug"
- #define XtCDebug "Debug"
- #define XtNusercpuAdd "usercpuAdd"
- #define XtCUsercpuAdd "UsercpuAdd"
- #define XtNusercpuSub "usercpuSub"
- #define XtCUsercpuSub "UsercpuSub"
- #define XtNsystemcpuAdd "systemcpuAdd"
- #define XtCSystemcpuAdd "SystemcpuAdd"
- #define XtNsystemcpuSub "systemcpuSub"
- #define XtCSystemcpuSub "SystemcpuSub"
- #define XtNidlecpuAdd "idlecpuAdd"
- #define XtCIdlecpuAdd "IdlecpuAdd"
- #define XtNidlecpuSub "idlecpuSub"
---- 121,154 ----
- #define XtCFill "Fill"
- #define XtNfast "fast"
- #define XtCFast "Fast"
- #define XtNdebug "debug"
- #define XtCDebug "Debug"
-+ #if __FreeBSD_version >= 220000
-+ #define XtNsysloadAdd "sysloadAdd"
-+ #define XtCSysloadAdd "SysloadAdd"
-+ #define XtNsysloadSub "sysloadSub"
-+ #define XtCSysloadSub "SysloadSub"
-+ #endif
- #define XtNusercpuAdd "usercpuAdd"
- #define XtCUsercpuAdd "UsercpuAdd"
- #define XtNusercpuSub "usercpuSub"
- #define XtCUsercpuSub "UsercpuSub"
-+ #if __FreeBSD_version >= 220000
-+ #define XtNnicecpuAdd "nicecpuAdd"
-+ #define XtCNicecpuAdd "NicecpuAdd"
-+ #define XtNnicecpuSub "nicecpuSub"
-+ #define XtCNicecpuSub "NicecpuSub"
-+ #endif
- #define XtNsystemcpuAdd "systemcpuAdd"
- #define XtCSystemcpuAdd "SystemcpuAdd"
- #define XtNsystemcpuSub "systemcpuSub"
- #define XtCSystemcpuSub "SystemcpuSub"
-+ #if __FreeBSD_version >= 220000
-+ #define XtNintercpuAdd "intercpuAdd"
-+ #define XtCIntercpuAdd "IntercpuAdd"
-+ #define XtNintercpuSub "intercpuSub"
-+ #define XtCIntercpuSub "IntercpuSub"
-+ #endif
- #define XtNidlecpuAdd "idlecpuAdd"
- #define XtCIdlecpuAdd "IdlecpuAdd"
- #define XtNidlecpuSub "idlecpuSub"
-***************
-*** 171,192 ****
- static XrmOptionDescRec optionDescList[] = {
- { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL},
- { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" },
-!
- { "-lowmemAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL },
- { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL },
- { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL },
-!
- { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL },
- { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL },
- { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL },
-
- { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL },
- { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL },
- { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL },
-
- { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL },
- { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL },
---- 205,250 ----
- static XrmOptionDescRec optionDescList[] = {
- { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL},
- { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" },
-! #if __FreeBSD_version >= 220000
-! { "-lowloadAlarm", "*perfChartLoad.lowAlarm", XrmoptionSepArg, NULL },
-! { "-lowloadWarn", "*perfChartLoad.lowWarn", XrmoptionSepArg, NULL },
-! { "-highloadAlarm", "*perfChartLoad.highAlarm", XrmoptionSepArg, NULL },
-! { "-highloadWarn", "*perfChartLoad.highWarn", XrmoptionSepArg, NULL },
+ }
+
+! /************** Draw graph reference lines
+ for (i = 1; i < w->strip_chart.scale; i++) {
+ j = i * ((int)w->core.height / w->strip_chart.scale);
+ XDrawLine(dpy, win, w->strip_chart.hiGC, left , j, scalewidth, j);
+***************
+*** 582,598 ****
+ bcopy((char *)(w->strip_chart.valuedata + next - j),
+ (char *)(w->strip_chart.valuedata), j * sizeof(double));
+ next = w->strip_chart.interval = j;
+!
+ /*
+! * Since we just lost some data, recompute the
+! * w->strip_chart.max_value, and min_value.
+ */
+
+ old_max = w->strip_chart.max_value;
+ w->strip_chart.max_value = 0.0;
+! w->strip_chart.min_value = 99999.99;
+ for (i = LABEL_ROOM; i < next; i++) {
+! if (w->strip_chart.valuedata[i] > w->strip_chart.max_value)
+ w->strip_chart.max_value = w->strip_chart.valuedata[i];
+ if ( w->strip_chart.valuedata[i] < w->strip_chart.min_value )
+ w->strip_chart.min_value = w->strip_chart.valuedata[i];
+--- 619,645 ----
+ bcopy((char *)(w->strip_chart.valuedata + next - j),
+ (char *)(w->strip_chart.valuedata), j * sizeof(double));
+ next = w->strip_chart.interval = j;
!
-! { "-lowswapAlarm", "*perfChartSwap.lowAlarm", XrmoptionSepArg, NULL },
-! { "-lowswapWarn", "*perfChartSwap.lowWarn", XrmoptionSepArg, NULL },
-! { "-highswapAlarm", "*perfChartSwap.highAlarm", XrmoptionSepArg, NULL },
-! { "-highswapWarn", "*perfChartSwap.highWarn", XrmoptionSepArg, NULL },
-! #else
- { "-lowmemAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL },
- { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL },
- { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL },
-! #endif
- { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL },
- { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL },
- { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL },
-
-+ #if __FreeBSD_version >= 220000
-+ { "-lowniceAlarm", "*perfChartNice.lowAlarm", XrmoptionSepArg, NULL },
-+ { "-lowniceWarn", "*perfChartNice.lowWarn", XrmoptionSepArg, NULL },
-+ { "-highniceAlarm", "*perfChartNice.highAlarm", XrmoptionSepArg, NULL },
-+ { "-highniceWarn", "*perfChartNice.highWarn", XrmoptionSepArg, NULL },
-+ #endif
-+
- { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL },
- { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL },
- { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL },
-
-+ #if __FreeBSD_version >= 220000
-+ { "-lowinterAlarm", "*perfChartInter.lowAlarm", XrmoptionSepArg, NULL },
-+ { "-lowinterWarn", "*perfChartInter.lowWarn", XrmoptionSepArg, NULL },
-+ { "-highinterAlarm", "*perfChartInter.highAlarm", XrmoptionSepArg, NULL },
-+ { "-highinterWarn", "*perfChartInter.highWarn", XrmoptionSepArg, NULL },
-+ #endif
-+
- { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL },
- { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL },
- { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL },
-***************
-*** 231,244 ****
---- 289,319 ----
- { "-fill", "*fill", XrmoptionNoArg, "True" },
- { "-debug", "*debug", XrmoptionNoArg, "True" },
- { "-fast", "*fast", XrmoptionNoArg, (XtPointer)"True" },
-+ #if __FreeBSD_version >= 220000
-+ { "-sysload", XtNsysloadSub, XrmoptionNoArg, "True" },
-+ { "+sysload", XtNsysloadAdd, XrmoptionNoArg, "TRUE" },
-+ #endif
- { "-usercpu", XtNusercpuSub, XrmoptionNoArg, "True" },
- { "+usercpu", XtNusercpuAdd, XrmoptionNoArg, "TRUE" },
-+ #if __FreeBSD_version >= 220000
-+ { "-nicecpu", XtNnicecpuSub, XrmoptionNoArg, "True" },
-+ { "+nicecpu", XtNnicecpuAdd, XrmoptionNoArg, "TRUE" },
-+ #endif
- { "-systemcpu", XtNsystemcpuSub, XrmoptionNoArg, "True" },
- { "+systemcpu", XtNsystemcpuAdd, XrmoptionNoArg, "TRUE" },
-+ #if __FreeBSD_version >= 220000
-+ { "-intercpu", XtNintercpuSub, XrmoptionNoArg, "True" },
-+ { "+intercpu", XtNintercpuAdd, XrmoptionNoArg, "TRUE" },
-+ #endif
- { "-idlecpu", XtNidlecpuSub, XrmoptionNoArg, "True" },
- { "+idlecpu", XtNidlecpuAdd, XrmoptionNoArg, "TRUE" },
-+ #if __FreeBSD_version >= 220000
-+ { "-freeswap", XtNfreememSub, XrmoptionNoArg, "True" },
-+ { "+freeswap", XtNfreememAdd, XrmoptionNoArg, "TRUE" },
+ /*
+! * Since we just lost some data, recompute the
+! * w->strip_chart.max_value, and min_value.
+ */
+
+ old_max = w->strip_chart.max_value;
++ /*
++ * To avoid scaling of Free Swap cause it changes so slow, it's
++ * better to not change the max value of 100%
++ */
++ #ifdef __FreeBSD__
++ if ( strcmp(w->strip_chart.botLabel, botNames[FRE_MEM]) != 0 )
++ w->strip_chart.max_value = 0.0;
+ #else
- { "-freemem", XtNfreememSub, XrmoptionNoArg, "True" },
- { "+freemem", XtNfreememAdd, XrmoptionNoArg, "TRUE" },
-+ #endif
- { "-diskxfr", XtNdiskxfrSub, XrmoptionNoArg, "True" },
- { "+diskxfr", XtNdiskxfrAdd, XrmoptionNoArg, "TRUE" },
- { "-interrupts", XtNinterruptsSub , XrmoptionNoArg, "True" },
-***************
-*** 253,269 ****
- { "+nfsclient", XtNnfsclientAdd, XrmoptionNoArg, "TRUE" },
- { "-nfsserver", XtNnfsserverSub, XrmoptionNoArg, "True" },
- { "+nfsserver", XtNnfsserverAdd, XrmoptionNoArg, "TRUE" },
-- { "-stuf", XtNstufAdd, XrmoptionNoArg, (XtPointer)"True" },
-- { "+stuf", XtNstufSub, XrmoptionNoArg, (XtPointer)"True" },
- };
-
- /* Application Resource List - no particular widget */
-
- static XtResource resources[] = {
-- { XtNstufAdd, XtCStufAdd, XtRBool, sizeof(Bool),
-- XtOffsetOf(AppData, addG[1]), XtRImmediate, (XtPointer) NULL },
-- { XtNstufSub, XtCStufSub, XtRBool, sizeof(Bool),
-- XtOffsetOf(AppData, subG[0]), XtRImmediate, (XtPointer) NULL },
- { XtNinterval, XtCInterval, XtRInt, sizeof(int),
- XtOffsetOf(AppData, interval), XtRImmediate, (caddr_t) DEF_INTERVAL },
- { XtNcount, XtCCount, XtRInt, sizeof(int),
---- 328,338 ----
-***************
-*** 274,288 ****
- XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL },
- { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean),
- XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL },
-!
- { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool),
---- 343,374 ----
- XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL },
- { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean),
- XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL },
-! #if __FreeBSD_version >= 220000
-! { XtNsysloadAdd, XtCSysloadAdd, XtRBool, sizeof(Bool),
-! XtOffsetOf(AppData, addG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL },
-! { XtNsysloadSub, XtCSysloadSub, XtRBool, sizeof(Bool),
-! XtOffsetOf(AppData, subG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL },
+ w->strip_chart.max_value = 0.0;
! #endif
- { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
-+ #if __FreeBSD_version >= 220000
-+ { XtNnicecpuAdd, XtCNicecpuAdd, XtRBool, sizeof(Bool),
-+ XtOffsetOf(AppData, addG[NICE_CPU]), XtRImmediate, (XtPointer) NULL },
-+ { XtNnicecpuSub, XtCNicecpuSub, XtRBool, sizeof(Bool),
-+ XtOffsetOf(AppData, subG[NICE_CPU]), XtRImmediate, (XtPointer) NULL },
-+ #endif
- { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
-+ #if __FreeBSD_version >= 220000
-+ { XtNintercpuAdd, XtCIntercpuAdd, XtRBool, sizeof(Bool),
-+ XtOffsetOf(AppData, addG[INT_CPU]), XtRImmediate, (XtPointer) NULL },
-+ { XtNintercpuSub, XtCIntercpuSub, XtRBool, sizeof(Bool),
-+ XtOffsetOf(AppData, subG[INT_CPU]), XtRImmediate, (XtPointer) NULL },
-+ #endif
- { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool),
- XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
- { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool),
-***************
-*** 324,329 ****
---- 410,418 ----
- void
- usage()
- {
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, "\nxperfmon++ V2.0 for FreeBSD-2.2.X and 3.X\n");
-+ #endif
- fprintf(stderr, "\nusage: xperfmon++ option option option .....\n");
- fprintf(stderr, "options:\n");
- fprintf(stderr, " [-display [{host}]:[{vs}]]\n");
-***************
-*** 340,350 ****
- fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n");
- fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n");
- fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n");
!
- fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n");
- fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n");
- fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n");
- fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n");
- fprintf(stderr, " [{-+}diskxfr] ({remove|add} disk transfers to list of graphs\n");
- fprintf(stderr, " [{-+}interrupts] ({remove|add} interrupts to list of graphs\n");
- fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n");
---- 429,451 ----
- fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n");
- fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n");
- fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n");
-! #if __FreeBSD_version >= 220000
-! fprintf(stderr, " [{-+}sysload] ({remove|add} sysload to list of graphs\n");
-! #endif
- fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n");
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, " [{-+}nicecpu] ({remove|add} nicecpu to list of graphs\n");
-+ #endif
- fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n");
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, " [{-+}intercpu] ({remove|add} intercpu to list of graphs\n");
-+ #endif
- fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n");
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, " [{-+}freeswap] ({remove|add} freeswap to list of graphs\n");
-+ #else
- fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n");
-+ #endif
- fprintf(stderr, " [{-+}diskxfr] ({remove|add} disk transfers to list of graphs\n");
- fprintf(stderr, " [{-+}interrupts] ({remove|add} interrupts to list of graphs\n");
- fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n");
-***************
-*** 361,370 ****
- fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n");
- fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n");
- fprintf(stderr, " Where \"*\" is one of the following:\n");
- fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n");
-! fprintf(stderr, " input | output | collision | nfsclient | nfsserver]\n");
- fprintf(stderr, " For Example:\n");
- fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n");
- fprintf(stderr, "WARNING: It is an error condition to set both a high, and a low, limit warning or alarm.\n");
- exit(1);
- }
---- 462,479 ----
- fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n");
- fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n");
- fprintf(stderr, " Where \"*\" is one of the following:\n");
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, " [load | user | nice | sys | inter | idle | swap | disk |\n");
-+ #else
- fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n");
-! #endif
-! fprintf(stderr, " intrpts | input | output | collision | nfsclient | nfsserver]\n");
- fprintf(stderr, " For Example:\n");
-+ #if __FreeBSD_version >= 220000
-+ fprintf(stderr, " [-lowswapAlarm {value}] ( Set low Free Swap Alarm Value)\n");
-+ #else
- fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n");
-+ #endif
- fprintf(stderr, "WARNING: It is an error condition to set both a high, and a low, limit warning or alarm.\n");
- exit(1);
- }
-***************
-*** 386,391 ****
---- 495,501 ----
- time(&timeStamp);
- return;
- }
-+
- /*ARGSUSED*/
- void handleResize( w, unused, event, contin2disp )
- Widget w;
-***************
-*** 394,400 ****
- Boolean *contin2disp;
- {
- Dimension neww, newh;
-! int i;
- char eventString[60];
- switch (event->type) {
- case Expose:
---- 504,511 ----
- Boolean *contin2disp;
- {
- Dimension neww, newh;
-! Dimension hOverHead, boxH, timeH, newWidgetH;
-! int i, window_size_changed;
- char eventString[60];
- switch (event->type) {
- case Expose:
-***************
-*** 403,415 ****
- strcpy(eventString,"expose");
- break;
- case MapNotify:
-! neww=0;
-! newh=0;
- strcpy(eventString,"map notify");
- break;
- case ReparentNotify:
-! neww=0;
-! newh=0;
- strcpy(eventString,"reparent");
- break;
- case ConfigureNotify:
---- 514,531 ----
- strcpy(eventString,"expose");
- break;
- case MapNotify:
-! neww=w->core.width;
-! newh=oldHeight;
- strcpy(eventString,"map notify");
- break;
-+ case UnmapNotify:
-+ neww=w->core.width;
-+ newh=oldHeight;
-+ strcpy(eventString,"unmap notify");
-+ break;
- case ReparentNotify:
-! neww=w->core.width;
-! newh=oldHeight;
- strcpy(eventString,"reparent");
- break;
- case ConfigureNotify:
-***************
-*** 417,429 ****
- newh=event->xconfigure.height;
- strcpy(eventString,"configure");
- break;
-
+! w->strip_chart.min_value = 99999;
+ for (i = LABEL_ROOM; i < next; i++) {
+! if (w->strip_chart.valuedata[i] > w->strip_chart.max_value)
+ w->strip_chart.max_value = w->strip_chart.valuedata[i];
+ if ( w->strip_chart.valuedata[i] < w->strip_chart.min_value )
+ w->strip_chart.min_value = w->strip_chart.valuedata[i];
+***************
+*** 611,622 ****
+ (unsigned int) j-LABEL_ROOM, (unsigned int) w->core.height,
+ LABEL_ROOM, 0);
+
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! (int) j, 0,
+ (unsigned int) w->core.width - j, (unsigned int)w->core.height,
+ FALSE);
+
+! /* Draw graph reference lines
+ left = j;
+ for (i = 1; i < w->strip_chart.scale; i++) {
+ j = i * ((int)w->core.height / w->strip_chart.scale);
+--- 658,669 ----
+ (unsigned int) j-LABEL_ROOM, (unsigned int) w->core.height,
+ LABEL_ROOM, 0);
+
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! (int) j, 0,
+ (unsigned int) w->core.width - j, (unsigned int)w->core.height,
+ FALSE);
+
+! /* Draw graph reference lines
+ left = j;
+ for (i = 1; i < w->strip_chart.scale; i++) {
+ j = i * ((int)w->core.height / w->strip_chart.scale);
+***************
+*** 645,663 ****
+ draw_graph, (XtPointer)w);
}
-! if ( neww < 250 + 10 ) {
-! neww = 250 + 10;
-! w->core.width = 250 + 10;
- XtResizeWindow(w);
-! }
- if ( appData.debug )
- printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n",
- (int)event->type, eventString,
---- 533,567 ----
- newh=event->xconfigure.height;
- strcpy(eventString,"configure");
- break;
-+ }
+ */
+ if ( w->strip_chart.min_scale > (int) ((w->strip_chart.max_value) + 1) )
+ ret_val = TRUE;
+!
+ if ( w->strip_chart.fgpixel != old->strip_chart.fgpixel ) {
+ new_gc |= FOREGROUND;
+ ret_val = True;
+ }
+!
+ if ( w->strip_chart.hipixel != old->strip_chart.hipixel ) {
+ new_gc |= HIGHLIGHT;
+ ret_val = True;
+ }
+!
+ DestroyGC(old, new_gc);
+ CreateGC(w, new_gc);
-+ if ( neww < MIN_WIDTH ) {
-+ neww = MIN_WIDTH;
-+ w->core.width = MIN_WIDTH;
-+ window_size_changed = TRUE;
-+ } else {
-+ w->core.width = neww;
-+ }
-+
-+ if ( newh < MIN_HEIGHT ) {
-+ newh = MIN_HEIGHT;
-+ w->core.height = MIN_HEIGHT;
-+ window_size_changed = TRUE;
-+ }
-+
-+ /* Now the graphs fit perfect into the window! */
-+ hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn);
-+ boxH = labelBox->core.height;
-+ timeH = timechart->core.height;
-+ newWidgetH = (newh - (boxH+7) - (timeH+10) - hOverHead) / appData.numGraphsOn;
-+ w->core.height = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+10);
-+ if(w->core.height != newh) {
-+ newh = w->core.height;
+--- 692,714 ----
+ draw_graph, (XtPointer)w);
}
+ */
++ #ifdef __FreeBSD__
++ if ( w->strip_chart.min_scale > ((w->strip_chart.max_value)) )
++ #else
+ if ( w->strip_chart.min_scale > (int) ((w->strip_chart.max_value) + 1) )
++ #endif
+ ret_val = TRUE;
!
-! if( neww != oldWidth || newh != oldHeight || window_size_changed == TRUE )
- XtResizeWindow(w);
-!
- if ( appData.debug )
- printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n",
- (int)event->type, eventString,
-***************
-*** 431,441 ****
- neww, newh);
-
- if ( event->type == ConfigureNotify ) {
-! /* Dimension h = perfmon[0]->core.height;*/
-! Dimension hOverHead = 5 * appData.numGraphsOn;
-! Dimension boxH = labelBox->core.height;
-! Dimension timeH = timechart->core.height;
-! Dimension newWidgetH = (newh - (boxH+8) - (timeH+10) - hOverHead) / appData.numGraphsOn;
- if ( oldWidth == neww && oldHeight == newh ) return;
-
- if ( appData.debug )
---- 569,575 ----
- neww, newh);
-
- if ( event->type == ConfigureNotify ) {
+ if ( w->strip_chart.fgpixel != old->strip_chart.fgpixel ) {
+ new_gc |= FOREGROUND;
+ ret_val = True;
+ }
!
- if ( oldWidth == neww && oldHeight == newh ) return;
-
- if ( appData.debug )
-***************
-*** 455,460 ****
---- 589,595 ----
- XFlush(XtDisplay(w));
-
+ if ( w->strip_chart.hipixel != old->strip_chart.hipixel ) {
+ new_gc |= HIGHLIGHT;
+ ret_val = True;
}
-+
- oldWidth = neww+=10, oldHeight = newh;
- return;
- }
-***************
-*** 464,472 ****
- int argc;
- char **argv;
- {
- Arg arg;
- Pixmap icon_pixmap = None;
-! Widget loadParent, pappaBox;
-
- char *progname = argv[0];
- Bool foundAnAdd = FALSE;
---- 599,611 ----
- int argc;
- char **argv;
- {
-+ /* LK!!! */
-+ Dimension timeH, newWidgetW, newWidgetH, hOverHead, boxH;
-+ unsigned int w, h;
-+
- Arg arg;
- Pixmap icon_pixmap = None;
-! Widget pappaBox;
-
- char *progname = argv[0];
- Bool foundAnAdd = FALSE;
-***************
-*** 478,483 ****
---- 617,626 ----
- optionDescList, XtNumber(optionDescList),
- &argc, argv,
- NULL, NULL);
-+
-+ appData.toplevel->core.width=MIN_WIDTH;
-+ appData.toplevel->core.height=MIN_HEIGHT;
-+
- if (argc != 1) usage();
+!
+ DestroyGC(old, new_gc);
+ CreateGC(w, new_gc);
- if ( appData.toplevel->core.depth == 1 )
***************
-*** 540,561 ****
- xperfmon_width, xperfmon_height));
- XtSetValues(appData.toplevel, &arg, 1);
- }
--
- /* create windows */
-
- pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel,
- XtNborderWidth, 0,
- NULL);
--
- XtOverrideTranslations(pappaBox, XtParseTranslationTable(defaultTranslations));
-
- (void)gethostname(hostname, sizeof(hostname));
- c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
- sprintf(c, "\nUpdate Interval = %5.1f secs", (float)(appData.interval*appData.ms_per_sec)/1000.0);
-
- labelBox = XtVaCreateManagedWidget("LabelBox", labelWidgetClass, pappaBox,
-! XtNwidth, 250,
-! /* XtNheight, 16,*/
- XtNjustify, XtJustifyLeft,
- XtNinternalHeight, 0,
- XtNtop, XtChainTop,
---- 683,734 ----
- xperfmon_width, xperfmon_height));
- XtSetValues(appData.toplevel, &arg, 1);
+*** 686,701 ****
+ w->strip_chart.points = NULL;
+ return;
}
- /* create windows */
+!
+! size = sizeof(XPoint) * (w->strip_chart.scale - 1);
- pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel,
- XtNborderWidth, 0,
- NULL);
- XtOverrideTranslations(pappaBox, XtParseTranslationTable(defaultTranslations));
+ points = (XPoint *) XtRealloc( (XtPointer) w->strip_chart.points, size);
+ w->strip_chart.points = points;
- (void)gethostname(hostname, sizeof(hostname));
- c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
- sprintf(c, "\nUpdate Interval = %5.1f secs", (float)(appData.interval*appData.ms_per_sec)/1000.0);
+ /* Draw graph reference lines into clip mask */
-+ { /* LK!!! handle -geometry option correct, also small changes in handleResize */
-+ Window rwin;
-+ int x,y,px,py;
-+ unsigned int pw,ph,bw,d;
-+
-+ XtRealizeWidget(appData.toplevel);
-+
-+ XGetGeometry(XtDisplay(appData.toplevel),XtWindow(appData.toplevel),
-+ &rwin,&x,&y,&w,&h,&bw,&d);
-+
-+ if ( w > MIN_WIDTH) {
-+ newWidgetW = w - 10;
-+ appData.toplevel->core.width = w;
-+ } else {
-+ appData.toplevel->core.width = MIN_WIDTH;
-+ newWidgetW = MIN_WIDTH - 10;
-+ }
-+
-+ hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn);
-+ boxH = 22;
-+ timeH = 12;
-+ if (h > GRAPH_MIN_HEIGHT * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+10))
-+ newWidgetH = (h - hOverHead - (boxH+7) - (timeH+10)) / appData.numGraphsOn;
-+ else
-+ newWidgetH = GRAPH_MIN_HEIGHT;
-+
-+ MIN_HEIGHT = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+10);
-+ appData.toplevel->core.height = MIN_HEIGHT;
-+
-+ XtResizeWindow(appData.toplevel);
-+ }
-+
- labelBox = XtVaCreateManagedWidget("LabelBox", labelWidgetClass, pappaBox,
-! XtNwidth, newWidgetW,
-! XtNheight, boxH,
- XtNjustify, XtJustifyLeft,
- XtNinternalHeight, 0,
- XtNtop, XtChainTop,
-***************
-*** 570,577 ****
- perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox,
- XtNtopLabel, topNames[i],
- XtNbotLabel, botNames[i],
-! XtNwidth, 250,
-! XtNheight, 36,
- XtNupdate, appData.interval*appData.ms_per_sec,
- XtNfillRect, (int)appData.fill,
- XtNjumpScroll, 1,
---- 743,750 ----
- perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox,
- XtNtopLabel, topNames[i],
- XtNbotLabel, botNames[i],
-! XtNwidth, newWidgetW,
-! XtNheight, newWidgetH,
- XtNupdate, appData.interval*appData.ms_per_sec,
- XtNfillRect, (int)appData.fill,
- XtNjumpScroll, 1,
-***************
-*** 580,600 ****
+! for (i = 1; i < w->strip_chart.scale; i++) {
+ points[i - 1].x = 0;
+ points[i - 1].y = HEIGHT / w->strip_chart.scale;
}
- timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox,
- XtNfromVert, perfmon[1],
-! XtNwidth, 250,
-! XtNheight, 18,
- XtNupdate, appData.interval*appData.ms_per_sec,
- XtNjumpScroll, 1,
- NULL);
- sys_setup();
- XtAddCallback(timechart, XtNgetValue, update_time_stat, NULL);
-
- for ( i=0; i<NUM_GRAPHS; i++ )
- if ( appData.graphOn[i] )
-! XtAddCallback(perfmon[i], XtNgetValue, update_stat, i);
-
- appData.interval_id = XtAppAddTimeOut(appData.app_context,
- appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
-
-- XtRealizeWidget(appData.toplevel);
- XtAppMainLoop(appData.app_context);
}
---- 753,773 ----
+--- 737,753 ----
+ w->strip_chart.points = NULL;
+ return;
}
- timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox,
- XtNfromVert, perfmon[1],
-! XtNwidth, newWidgetW,
-! XtNheight, timeH,
- XtNupdate, appData.interval*appData.ms_per_sec,
- XtNjumpScroll, 1,
- NULL);
-+
- sys_setup();
- XtAddCallback(timechart, XtNgetValue, update_time_stat, NULL);
+!
+! size = sizeof(XPoint) * (w->strip_chart.scale - 1) / SCALE_HACK;
- for ( i=0; i<NUM_GRAPHS; i++ )
- if ( appData.graphOn[i] )
-! XtAddCallback(perfmon[i], XtNgetValue, update_stat, (XtPointer)i);
+ points = (XPoint *) XtRealloc( (XtPointer) w->strip_chart.points, size);
+ w->strip_chart.points = points;
- appData.interval_id = XtAppAddTimeOut(appData.app_context,
- appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
+ /* Draw graph reference lines into clip mask */
- XtAppMainLoop(appData.app_context);
+! for (i = 1; i < w->strip_chart.scale / SCALE_HACK; i++) {
+ points[i - 1].x = 0;
+ points[i - 1].y = HEIGHT / w->strip_chart.scale;
+ }
++
}
diff --git a/sysutils/xperfmon3/files/patch-ab b/sysutils/xperfmon3/files/patch-ab
index a3d29f3b6d85..7ed45a98894f 100644
--- a/sysutils/xperfmon3/files/patch-ab
+++ b/sysutils/xperfmon3/files/patch-ab
@@ -1,80 +1,10 @@
-*** ../xperfmon++/StripCharP.h Wed Jul 27 22:29:30 1994
---- ./StripCharP.h Thu Apr 30 15:03:13 1998
+*** ../xperfmon++/misc.c Wed Jul 27 22:29:33 1994
+--- ./misc.c Sun Jan 10 21:14:22 1999
***************
-*** 62,71 ****
- #define HIGHLIGHT 1 << 1
- #define ALL_GCS (FOREGROUND | HIGHLIGHT)
-
- /* New fields for the PerfChart widget instance record */
-
- typedef struct {
-! double valuedata[2048]; /* record of data points */
- Pixel fgpixel; /* color index for graph */
- Pixel hipixel; /* color index for lines */
- Pixel warnColor;
---- 62,73 ----
- #define HIGHLIGHT 1 << 1
- #define ALL_GCS (FOREGROUND | HIGHLIGHT)
-
-+ #define NUM_VALUES 2048
-+
- /* New fields for the PerfChart widget instance record */
-
- typedef struct {
-! double valuedata[NUM_VALUES]; /* record of data points */
- Pixel fgpixel; /* color index for graph */
- Pixel hipixel; /* color index for lines */
- Pixel warnColor;
-*** ../xperfmon++/TimeChart.h Wed Jul 27 22:29:31 1994
---- ./TimeChart.h Thu Apr 30 15:03:14 1998
-***************
-*** 88,99 ****
- #define XtCFillRect "FillRect"
-
- #define XtNgetValue "getValue"
-! #define XtNhighlight "highlight"
- #define XtNjumpScroll "jumpScroll"
- #define XtNminScale "minScale"
- #define XtNscale "scale"
- #define XtNfillRect "fillRect"
-! #define XtNupdate "update"
- #define XtNvmunix "vmunix"
-
- typedef struct _TimeChartRec *TimeChartWidget;
---- 88,99 ----
- #define XtCFillRect "FillRect"
-
- #define XtNgetValue "getValue"
-! /* #define XtNhighlight "highlight" */
- #define XtNjumpScroll "jumpScroll"
- #define XtNminScale "minScale"
- #define XtNscale "scale"
- #define XtNfillRect "fillRect"
-! /* #define XtNupdate "update" */
- #define XtNvmunix "vmunix"
-
- typedef struct _TimeChartRec *TimeChartWidget;
-*** ../xperfmon++/system.h Wed Jul 27 22:29:34 1994
---- ./system.h Thu Apr 30 22:41:43 1998
-***************
-*** 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.
+*** 1,10 ****
+ /* Copyright 1994, Roger Smith for Sterling Software and NASA-Ames Research Center
*
- * Original Author: Emanuel Jay Berkenbilt, MIT Project Athena
---- 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
-***************
-*** 32,38 ****
+ * Permission to use, copy, modify, and distribute this software and its
* 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
@@ -82,7 +12,17 @@
* 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
---- 32,38 ----
+--- 1,17 ----
++ /*
++ * Enhancement and error correction for FreeBSD-3.X
++ * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
++ *
++ * $Id: misc.c,v 3.3 1999/01/10 20:13:27 lkoeller Exp lkoeller $
++ */
++
+ /* Copyright 1994, Roger Smith for Sterling Software and NASA-Ames Research Center
+ *
+ * Permission to use, copy, modify, and distribute this software and its
* 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
@@ -91,7 +31,7 @@
* publicity pertaining to distribution of the software without specific,
* written prior permission. NASA and Sterling Software makes no representations about the
***************
-*** 43,49 ****
+*** 15,27 ****
* 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
@@ -99,7 +39,13 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* 1994 Revision
---- 43,49 ----
+ * Author: Roger Smith, Sterling Software @ NASA-Ames Research Center
+ * Moffett Field, California, rsmith@proteus.arc.nasa.gov
+ */
+ #include <stdio.h>
+
+ #include <X11/IntrinsicP.h>
+--- 22,40 ----
* 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
@@ -107,206 +53,118 @@
* 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
---- 55,65 ----
-
- /* This file information needed by both system.c and Perfmon.c */
-
-! #if __FreeBSD_version >= 220000
-! # define NUM_POSSIBLE_STATS 14
-! #else
-! # define NUM_POSSIBLE_STATS 11
-! #endif
- #define MAX_STATS NUM_POSSIBLE_STATS + 1
+ * Author: Roger Smith, Sterling Software @ NASA-Ames Research Center
+ * Moffett Field, California, rsmith@proteus.arc.nasa.gov
+ */
++
++ #ifndef LINT
++ static char rcsid[] = "$Id: misc.c,v 3.3 1999/01/10 20:13:27 lkoeller Exp lkoeller $";
++ #endif
++
++ #include "fbsd_vers.h"
+ #include <stdio.h>
- #define LINES_PER_LABEL 2
+ #include <X11/IntrinsicP.h>
***************
-*** 77,93 ****
- for (stat = 0; stat < num_stats; stat++)
+*** 42,48 ****
- #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
+ static void adjust_timeout();
- struct statistic {
- int min_val, max_val;
---- 81,114 ----
- for (stat = 0; stat < num_stats; stat++)
+! /* This routine interprets the key that was pressed on top of the window.
+ * It returns TRUE if Quit has been selected, signaling that the program
+ * is done.
+ */
+--- 55,61 ----
- #define NO_STAT -1
-! #if __FreeBSD_version >= 220000
-! #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 FREE_MEM 6
-! #define DISK_TRANSFERS 7
-! #define INTERRUPTS 8
-! #define INPUT_PACKETS 9
-! #define OUTPUT_PACKETS 10
-! #define COLLISION_PACKETS 11
-! #define NFS_CLIENT_CALLS 12
-! #define NFS_SERVER_CALLS 13
-! #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 ****
---- 134,155 ----
+ static void adjust_timeout();
- #define VALID_UPDATE(x) ((x <= MAX_TIME) && (x > 0))
-
-+ #if __FreeBSD_version >= 220000
-+ #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 FRE_MEM 6
-+ #define DSK_XFR 7
-+ #define INTRPTS 8
-+ #define INP_PKT 9
-+ #define OUT_PKT 10
-+ #define COL_PKT 11
-+ #define NFS_CLT 12
-+ #define NFS_SRV 13
-+ #else
- #define USR_CPU 0
- #define SYS_CPU 1
- #define IDL_CPU 2
+! /* This routine interprets the key that was pressed on top of the window.
+ * It returns TRUE if Quit has been selected, signaling that the program
+ * is done.
+ */
***************
-*** 124,129 ****
---- 161,167 ----
- #define COL_PKT 8
- #define NFS_CLT 9
- #define NFS_SRV 10
-+ #endif
- #define LAST_ITEM NFS_SRV /* must equal last item above */
- #define NUM_GRAPHS LAST_ITEM+1
-
+*** 58,64 ****
+ int i, keycode, length = 0;
+ /* PerfmonWidget pw = (PerfmonWidget) w;*/
+
+! length = XLookupString(event, strbuf, STRBUFSIZE, &keycode, NULL);
+ switch (keycode) {
+ case 'Q':
+ case 'q':
+--- 71,77 ----
+ int i, keycode, length = 0;
+ /* PerfmonWidget pw = (PerfmonWidget) w;*/
+
+! length = XLookupString((XKeyEvent *)event, strbuf, STRBUFSIZE, (KeySym *)&keycode, NULL);
+ switch (keycode) {
+ case 'Q':
+ case 'q':
***************
-*** 146,168 ****
---- 184,238 ----
- }AppData, *AppDataPtr;
-
- static char *topNames[] = {
-+ #if __FreeBSD_version >= 220000
-+ "Load",
-+ #endif
- "User",
-+ #if __FreeBSD_version >= 220000
-+ "Nice",
-+ #endif
- "System",
-+ #if __FreeBSD_version >= 220000
-+ "Interrpt",
-+ #endif
- "Idle",
- "Free",
- "Disk",
-+ #if __FreeBSD_version >= 220000
-+ "Inter-",
-+ #else
- "Interrupts",
-+ #endif
- "Input",
- "Output",
-+ #if __FreeBSD_version >= 220000
-+ "Collis",
-+ "NFS Clt",
-+ "NFS Srv",
-+ #else
- "Collision",
- "NFS Client",
- "NFS Server",
-+ #endif
- };
- static char *widgetLabels[] = {
-+ #if __FreeBSD_version >= 220000
-+ "Load",
-+ #endif
- "User",
-+ #if __FreeBSD_version >= 220000
-+ "Nice",
-+ #endif
- "System",
-+ #if __FreeBSD_version >= 220000
-+ "Inter",
-+ #endif
- "Idle",
-+ #if __FreeBSD_version >= 220000
-+ "Swap",
-+ #else
- "Free",
-+ #endif
- "Disk",
- "Intrpts",
- "Input",
+*** 88,103 ****
+ break;
+ case 'L':
+ case 'l': /* print out a chart of current limit settings */
+! printf("\n%10s %5s %5s %5s %5s\n",
+! "Widget", "Hi ", "Hi ", "Low", "Low ");
+! printf("%10s %5s %5s %5s %5s\n",
+! "Name ", "Warn", "Alarm", "Warn", "Alarm");
+! printf("%10s %5s %5s %5s %5s\n",
+! "------", "-----","-----","-----","-----");
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ if ( perfmon[i] ) {
+ PerfChartWidget pw = (PerfChartWidget)perfmon[i];
+! printf("%10s %5d %5d %5d %5d\n",
+ widgetLabels[i],
+ pw->strip_chart.highWarn,
+ pw->strip_chart.highAlarm,
+--- 101,116 ----
+ break;
+ case 'L':
+ case 'l': /* print out a chart of current limit settings */
+! printf("\n%16s %6s %6s %6s %6s\n",
+! " Widget ", " Hi ", " Hi ", " Low", " Low ");
+! printf("%16s %6s %6s %6s %6s\n",
+! " Name ", " Warn", " Alarm", " Warn", " Alarm");
+! printf("%16s %6s %6s %6s %6s\n",
+! "--------", "------","------","------","------");
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ if ( perfmon[i] ) {
+ PerfChartWidget pw = (PerfChartWidget)perfmon[i];
+! printf("%16s %6d %6d %6d %6d\n",
+ widgetLabels[i],
+ pw->strip_chart.highWarn,
+ pw->strip_chart.highAlarm,
***************
-*** 171,177 ****
---- 241,264 ----
- "NFSClient",
- "NFSServer",
- };
-+
- static char *botNames[] = {
-+ #if __FreeBSD_version >= 220000
-+ "(* 100)",
-+ "CPU (%)",
-+ "CPU (%)",
-+ "CPU (%)",
-+ "CPU (%)",
-+ "CPU (%)",
-+ "Swap (%)",
-+ "Trsf/s",
-+ "rupts/s",
-+ "Pkts/s",
-+ "Pkts/s",
-+ "Pkts/s",
-+ "Calls/s",
-+ "Calls/s",
-+ #else
- "CPU",
- "CPU",
- "CPU",
+*** 152,158 ****
+ appData.interval += delta;
+
+ XtRemoveTimeOut(appData.interval_id);
+!
+ appData.interval_id =
+ XtAppAddTimeOut(appData.app_context,
+ appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
+--- 165,171 ----
+ appData.interval += delta;
+
+ XtRemoveTimeOut(appData.interval_id);
+!
+ appData.interval_id =
+ XtAppAddTimeOut(appData.app_context,
+ appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
***************
-*** 183,186 ****
---- 270,274 ----
- "Packets",
- "Calls",
- "Calls",
-+ #endif
- };
+*** 160,166 ****
+
+ (void)gethostname(hostname, sizeof(hostname));
+ c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
+! sprintf(c, "\nUpdate Interval = %5.1f secs",
+ (float)(appData.interval*appData.ms_per_sec)/1000.0);
+ XtVaSetValues(labelBox, XtNlabel, hostname, NULL);
+ }
+--- 173,179 ----
+
+ (void)gethostname(hostname, sizeof(hostname));
+ c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
+! sprintf(c, "\nUpdate Interval = %5.1f secs",
+ (float)(appData.interval*appData.ms_per_sec)/1000.0);
+ XtVaSetValues(labelBox, XtNlabel, hostname, NULL);
+ }
diff --git a/sysutils/xperfmon3/files/patch-ac b/sysutils/xperfmon3/files/patch-ac
index d7f24ea9bc31..079f583cc6e5 100644
--- a/sysutils/xperfmon3/files/patch-ac
+++ b/sysutils/xperfmon3/files/patch-ac
@@ -1,336 +1,1384 @@
-*** ../xperfmon++/Imakefile Wed Jul 27 22:29:29 1994
---- ./Imakefile Thu Apr 30 15:03:39 1998
+*** ../xperfmon++/xperfmon.c Wed Jul 27 22:29:39 1994
+--- ./xperfmon.c Tue Jan 26 22:17:32 1999
***************
-*** 17,31 ****
- SYS_MODULE= sgi_system
- #endif
-
-! EXTRA_LIBRARIES = $(SUNFLAGS) $(MIPSFLAGS) $(SGIFLAGS)
-
- INSTPGMFLAGS = $(INSTKMEMFLAGS)
-! LOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB)
- INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11
-! # INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11 -I/usr/include/bsd
-! CDEBUGFLAGS = -O
-! SRCS = TimeChart.c StripChart.c misc.c $(SYS_MODULE).c xperfmon.c nfs.c
-! OBJS = TimeChart.o StripChart.o misc.o $(SYS_MODULE).o xperfmon.o nfs.o
-
- ComplexProgramTarget(xperfmon++)
-
---- 17,38 ----
- SYS_MODULE= sgi_system
- #endif
-
-! #if defined (FreeBSDArchitecture)
-! FreeBSDFLAGS= -lkvm
-! SYS_MODULE= freebsd_system
-! CC= gcc
-! EXTRA_DEFINES= -DHAVE_SYS_PARAM_H
+*** 1,6 ****
+ /*
+! * $XConsortium: xperfmon.c,v 1.6 89/09/19 14:44:02 jim Exp $
+! *
+ * xperfmon
+ * X Window System -based Unix Performance Monitor.
+ * Simple graphical performance monitor for system-wide data.
+--- 1,11 ----
+ /*
+! * Enhancement and error correction for FreeBSD-3.X
+! * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+! *
+! * $Id: xperfmon.c,v 3.5 1999/01/10 17:04:06 lkoeller Exp lkoeller $
+! */
+!
+! /*
+ * xperfmon
+ * X Window System -based Unix Performance Monitor.
+ * Simple graphical performance monitor for system-wide data.
+***************
+*** 22,28 ****
+ * 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.
+ *
+ * This original version was completed by Emanuel Jay Berkenbilt,
+--- 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.
+ *
+ * This original version was completed by Emanuel Jay Berkenbilt,
+***************
+*** 38,44 ****
+ * 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 ----
+ * 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
+***************
+*** 49,55 ****
+ * 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
+--- 54,60 ----
+ * 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
+***************
+*** 58,63 ****
+--- 63,74 ----
+ *
+ */
+
++ #ifndef LINT
++ static char rcsid[] = "$Id: xperfmon.c,v 3.5 1999/01/10 17:04:06 lkoeller Exp lkoeller $";
++ #endif
++
++ #include "fbsd_vers.h"
++
+ #include <stdio.h>
+ #include <X11/IntrinsicP.h>
+ #include <X11/StringDefs.h>
+***************
+*** 76,82 ****
+--- 87,98 ----
+ extern void start_graphs();
+ extern time_t timeStamp;
+ extern Dimension oldHeight, oldWidth;
++
++ #if __FreeBSD_version >= 300000
++ extern double current_values[NUM_GRAPHS];
++ #else
+ extern int current_values[NUM_GRAPHS];
++ #endif
+
+ char *gprogname;
+ double testValue;
+***************
+*** 94,99 ****
+--- 110,122 ----
+ { NULL, NULL },
+ };
+
++ /* LK!!! */
++ char *info1 = "da1";
++ int MIN_HEIGHT=78;
++ #define MIN_WIDTH 185
++ #define ADD_TO_TIMEH (11+(int)(appData.numGraphsOn*0.2))
++ #define GRAPH_MIN_HEIGHT 25
++
+ #define XtNinterval "interval"
+ #define XtNcount "count"
+ #define XtCCount "Count"
+***************
+*** 101,156 ****
+ #define XtCFill "Fill"
+ #define XtNfast "fast"
+ #define XtCFast "Fast"
+- #define XtNstufAdd "stufAdd"
+- #define XtCStufAdd "StufAdd"
+- #define XtNstufSub "stufSub"
+- #define XtCStufSub "StufSub"
+ #define XtNdebug "debug"
+ #define XtCDebug "Debug"
+ #define XtNusercpuAdd "usercpuAdd"
+ #define XtCUsercpuAdd "UsercpuAdd"
+ #define XtNusercpuSub "usercpuSub"
+ #define XtCUsercpuSub "UsercpuSub"
+ #define XtNsystemcpuAdd "systemcpuAdd"
+ #define XtCSystemcpuAdd "SystemcpuAdd"
+ #define XtNsystemcpuSub "systemcpuSub"
+ #define XtCSystemcpuSub "SystemcpuSub"
+ #define XtNidlecpuAdd "idlecpuAdd"
+ #define XtCIdlecpuAdd "IdlecpuAdd"
+ #define XtNidlecpuSub "idlecpuSub"
+ #define XtCIdlecpuSub "IdlecpuSub"
+ #define XtNfreememAdd "freememAdd"
+ #define XtCFreememAdd "FreememAdd"
+ #define XtNfreememSub "freememSub"
+ #define XtCFreememSub "FreememSub"
+ #define XtNdiskxfrAdd "diskxfrAdd"
+ #define XtCDiskxfrAdd "DiskxfrAdd"
+ #define XtNdiskxfrSub "diskxfrSub"
+ #define XtCDiskxfrSub "DiskxfrSub"
+! #define XtNinterruptsAdd "interruptsAdd"
+! #define XtCInterrputsAdd "InterrputsAdd"
+! #define XtNinterruptsSub "interruptsSub"
+! #define XtCInterrputsSub "InterrputsSub"
+ #define XtNinputpktsAdd "inputpktsAdd"
+ #define XtCInputpktsAdd "InputpktsAdd"
+ #define XtNinputpktsSub "inputpktsSub"
+ #define XtCInputpktsSub "InputpktsSub"
+ #define XtNoutputpktsAdd "outputpktsAdd"
+ #define XtCOutputpktsAdd "OutputpktsAdd"
+ #define XtNoutputpktsSub "outputpktsSub"
+ #define XtCOutputpktsSub "OutputpktsSub"
+ #define XtNcollpktsAdd "collpktsAdd"
+ #define XtCCollpktsAdd "CollpktsAdd"
+ #define XtNcollpktsSub "collpktsSub"
+ #define XtCCollpktsSub "CollpktsSub"
+ #define XtNnfsclientAdd "nfsclientAdd"
+ #define XtCNfsclientAdd "NfsclientAdd"
+ #define XtNnfsclientSub "nfsclientSub"
+ #define XtCNfsclientSub "NfsclientSub"
+ #define XtNnfsserverAdd "nfsserverAdd"
+ #define XtCNfsserverAdd "NfsserverAdd"
+ #define XtNnfsserverSub "nfsserverSub"
+ #define XtCNfsserverSub "NfsserverSub"
+
+ #define DEF_INTERVAL 1
+ #define DEF_COUNT -1
+--- 124,280 ----
+ #define XtCFill "Fill"
+ #define XtNfast "fast"
+ #define XtCFast "Fast"
+ #define XtNdebug "debug"
+ #define XtCDebug "Debug"
++
++ #if __FreeBSD_version >= 300000
++ # define XtNsysloadAdd "sysloadAdd"
++ # define XtCSysloadAdd "SysloadAdd"
++ # define XtNsysloadSub "sysloadSub"
++ # define XtCSysloadSub "SysloadSub"
++ #endif
++
+ #define XtNusercpuAdd "usercpuAdd"
+ #define XtCUsercpuAdd "UsercpuAdd"
+ #define XtNusercpuSub "usercpuSub"
+ #define XtCUsercpuSub "UsercpuSub"
++
++ #if __FreeBSD_version >= 300000
++ # define XtNnicecpuAdd "nicecpuAdd"
++ # define XtCNicecpuAdd "NicecpuAdd"
++ # define XtNnicecpuSub "nicecpuSub"
++ # define XtCNicecpuSub "NicecpuSub"
++ #endif
++
+ #define XtNsystemcpuAdd "systemcpuAdd"
+ #define XtCSystemcpuAdd "SystemcpuAdd"
+ #define XtNsystemcpuSub "systemcpuSub"
+ #define XtCSystemcpuSub "SystemcpuSub"
++
++ #if __FreeBSD_version >= 300000
++ # define XtNintercpuAdd "intercpuAdd"
++ # define XtCIntercpuAdd "IntercpuAdd"
++ # define XtNintercpuSub "intercpuSub"
++ # define XtCIntercpuSub "IntercpuSub"
++ #endif
++
+ #define XtNidlecpuAdd "idlecpuAdd"
+ #define XtCIdlecpuAdd "IdlecpuAdd"
+ #define XtNidlecpuSub "idlecpuSub"
+ #define XtCIdlecpuSub "IdlecpuSub"
++
++ #if __FreeBSD_version >= 300000
++ # define XtNttyinAdd "ttyinAdd"
++ # define XtCTtyinAdd "TtyinAdd"
++ # define XtNttyinSub "ttyinSub"
++ # define XtCTtyinSub "TtyinSub"
++
++ # define XtNttyoutAdd "ttyoutAdd"
++ # define XtCTtyoutAdd "TtyoutAdd"
++ # define XtNttyoutSub "ttyoutSub"
++ # define XtCTtyoutSub "TtyoutSub"
++ #endif
++
++ #define XtNinterruptsAdd "interruptsAdd"
++ #define XtCInterrputsAdd "InterrputsAdd"
++ #define XtNinterruptsSub "interruptsSub"
++ #define XtCInterrputsSub "InterrputsSub"
++
+ #define XtNfreememAdd "freememAdd"
+ #define XtCFreememAdd "FreememAdd"
+ #define XtNfreememSub "freememSub"
+ #define XtCFreememSub "FreememSub"
++
+ #define XtNdiskxfrAdd "diskxfrAdd"
+ #define XtCDiskxfrAdd "DiskxfrAdd"
+ #define XtNdiskxfrSub "diskxfrSub"
+ #define XtCDiskxfrSub "DiskxfrSub"
+!
+! #if __FreeBSD_version >= 300000
+! # define XtNdiskmbAdd "diskmbAdd"
+! # define XtCDiskmbAdd "DiskmbAdd"
+! # define XtNdiskmbSub "diskmbSub"
+! # define XtCDiskmbSub "DiskmbSub"
+!
+! # define XtNtapexfrAdd "tapexfrAdd"
+! # define XtCTapexfrAdd "TapexfrAdd"
+! # define XtNtapexfrSub "tapexfrSub"
+! # define XtCTapexfrSub "TapexfrSub"
+!
+! # define XtNtapembAdd "tapembAdd"
+! # define XtCTapembAdd "TapembAdd"
+! # define XtNtapembSub "tapembSub"
+! # define XtCTapembSub "TapembSub"
+!
+! # define XtNcdromxfrAdd "cdromxfrAdd"
+! # define XtCCdromxfrAdd "CdromxfrAdd"
+! # define XtNcdromxfrSub "cdromxfrSub"
+! # define XtCCdromxfrSub "CdromxfrSub"
+!
+! # define XtNcdrommbAdd "cdrommbAdd"
+! # define XtCCdrommbAdd "CdrommbAdd"
+! # define XtNcdrommbSub "cdrommbSub"
+! # define XtCCdrommbSub "CdrommbSub"
+! #endif
+!
+ #define XtNinputpktsAdd "inputpktsAdd"
+ #define XtCInputpktsAdd "InputpktsAdd"
+ #define XtNinputpktsSub "inputpktsSub"
+ #define XtCInputpktsSub "InputpktsSub"
++
+ #define XtNoutputpktsAdd "outputpktsAdd"
+ #define XtCOutputpktsAdd "OutputpktsAdd"
+ #define XtNoutputpktsSub "outputpktsSub"
+ #define XtCOutputpktsSub "OutputpktsSub"
++
+ #define XtNcollpktsAdd "collpktsAdd"
+ #define XtCCollpktsAdd "CollpktsAdd"
+ #define XtNcollpktsSub "collpktsSub"
+ #define XtCCollpktsSub "CollpktsSub"
++
++ #if __FreeBSD_version >= 300000
++ # define XtNnfsservercAdd "nfsservercAdd"
++ # define XtCNfsservercAdd "NfsservercAdd"
++ # define XtNnfsservercSub "nfsservercSub"
++ # define XtCNfsservercSub "NfsservercSub"
++
++ # define XtNnfsserverhAdd "nfsserverhAdd"
++ # define XtCNfsserverhAdd "NfsserverhAdd"
++ # define XtNnfsserverhSub "nfsserverhSub"
++ # define XtCNfsserverhSub "NfsserverhSub"
++
++ # define XtNnfsservermAdd "nfsservermAdd"
++ # define XtCNfsservermAdd "NfsservermAdd"
++ # define XtNnfsservermSub "nfsservermSub"
++ # define XtCNfsservermSub "NfsservermSub"
++
++ # define XtNnfsclientcAdd "nfsclientcAdd"
++ # define XtCNfsclientcAdd "NfsclientcAdd"
++ # define XtNnfsclientcSub "nfsclientcSub"
++ # define XtCNfsclientcSub "NfsclientcSub"
++
++ # define XtNnfsclienthAdd "nfsclienthAdd"
++ # define XtCNfsclienthAdd "NfsclienthAdd"
++ # define XtNnfsclienthSub "nfsclienthSub"
++ # define XtCNfsclienthSub "NfsclienthSub"
++
++ # define XtNnfsclientmAdd "nfsclientmAdd"
++ # define XtCNfsclientmAdd "NfsclientmAdd"
++ # define XtNnfsclientmSub "nfsclientmSub"
++ # define XtCNfsclientmSub "NfsclientmSub"
++
++ #else
++
+ #define XtNnfsclientAdd "nfsclientAdd"
+ #define XtCNfsclientAdd "NfsclientAdd"
+ #define XtNnfsclientSub "nfsclientSub"
+ #define XtCNfsclientSub "NfsclientSub"
++
+ #define XtNnfsserverAdd "nfsserverAdd"
+ #define XtCNfsserverAdd "NfsserverAdd"
+ #define XtNnfsserverSub "nfsserverSub"
+ #define XtCNfsserverSub "NfsserverSub"
++ #endif
+
+ #define DEF_INTERVAL 1
+ #define DEF_COUNT -1
+***************
+*** 171,207 ****
+ static XrmOptionDescRec optionDescList[] = {
+ { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL},
+ { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" },
+!
+! { "-lowmemAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL },
+! { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL },
+! { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL },
+!
+ { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL },
+ { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL },
+ { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL },
+!
+ { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL },
+ { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL },
+ { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL },
+!
+ { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL },
+ { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL },
+ { "-highidleWarn", "*perfChartIdle.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowdiskAlarm", "*perfChartDisk.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowdiskWarn", "*perfChartDisk.lowWarn", XrmoptionSepArg, NULL },
+! { "-highdiskAlarm", "*perfChartDisk.highAlarm", XrmoptionSepArg, NULL },
+! { "-highdiskWarn", "*perfChartDisk.highWarn", XrmoptionSepArg, NULL },
+!
+ { "-lowintrptsAlarm", "*perfChartIntrpts.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowintrptsWarn", "*perfChartIntrpts.lowWarn", XrmoptionSepArg, NULL },
+ { "-highintrptsAlarm", "*perfChartIntrpts.highAlarm", XrmoptionSepArg, NULL },
+ { "-highintrptsWarn", "*perfChartIntrpts.highWarn", XrmoptionSepArg, NULL },
+!
+ { "-lowinputAlarm", "*perfChartInput.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowinputWarn", "*perfChartInput.lowWarn", XrmoptionSepArg, NULL },
+ { "-highinputAlarm", "*perfChartInput.highAlarm", XrmoptionSepArg, NULL },
+--- 295,392 ----
+ static XrmOptionDescRec optionDescList[] = {
+ { "-interval", ".interval", XrmoptionSepArg, (caddr_t) NULL},
+ { "-immediate", "*PerfChart.immediate", XrmoptionNoArg, "True" },
+! #if __FreeBSD_version >= 300000
+! { "-lowloadAlarm", "*perfChartLoad.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowloadWarn", "*perfChartLoad.lowWarn", XrmoptionSepArg, NULL },
+! { "-highloadAlarm", "*perfChartLoad.highAlarm", XrmoptionSepArg, NULL },
+! { "-highloadWarn", "*perfChartLoad.highWarn", XrmoptionSepArg, NULL },
+! #endif
+ { "-lowuserAlarm", "*perfChartUser.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowuserWarn", "*perfChartUser.lowWarn", XrmoptionSepArg, NULL },
+ { "-highuserAlarm", "*perfChartUser.highAlarm", XrmoptionSepArg, NULL },
+ { "-highuserWarn", "*perfChartUser.highWarn", XrmoptionSepArg, NULL },
+! #if __FreeBSD_version >= 300000
+! { "-lowniceAlarm", "*perfChartNice.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowniceWarn", "*perfChartNice.lowWarn", XrmoptionSepArg, NULL },
+! { "-highniceAlarm", "*perfChartNice.highAlarm", XrmoptionSepArg, NULL },
+! { "-highniceWarn", "*perfChartNice.highWarn", XrmoptionSepArg, NULL },
! #endif
+ { "-lowsysAlarm", "*perfChartSystem.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowsysWarn", "*perfChartSystem.lowWarn", XrmoptionSepArg, NULL },
+ { "-highsysAlarm", "*perfChartSystem.highAlarm", XrmoptionSepArg, NULL },
+ { "-highsysWarn", "*perfChartSystem.highWarn", XrmoptionSepArg, NULL },
+! #if __FreeBSD_version >= 300000
+! { "-lowinterAlarm", "*perfChartInter.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowinterWarn", "*perfChartInter.lowWarn", XrmoptionSepArg, NULL },
+! { "-highinterAlarm", "*perfChartInter.highAlarm", XrmoptionSepArg, NULL },
+! { "-highinterWarn", "*perfChartInter.highWarn", XrmoptionSepArg, NULL },
+! #endif
+ { "-lowidleAlarm", "*perfChartIdle.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowidleWarn", "*perfChartIdle.lowWarn", XrmoptionSepArg, NULL },
+ { "-highidleAlarm", "*perfChartIdle.highAlarm", XrmoptionSepArg, NULL },
+ { "-highidleWarn", "*perfChartIdle.highWarn", XrmoptionSepArg, NULL },
+! #if __FreeBSD_version >= 300000
+! { "-lowttyinAlarm", "*perfChartTtyin.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowttyinWarn", "*perfChartTtyin.lowWarn", XrmoptionSepArg, NULL },
+! { "-highttyinAlarm", "*perfChartTtyin.highAlarm", XrmoptionSepArg, NULL },
+! { "-highttyinWarn", "*perfChartTtyin.highWarn", XrmoptionSepArg, NULL },
!
-! EXTRA_LIBRARIES = $(SUNFLAGS) $(MIPSFLAGS) $(SGIFLAGS) $(FreeBSDFLAGS)
+! { "-lowttyoutAlarm", "*perfChartTtyout.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowttyoutWarn", "*perfChartTtyout.lowWarn", XrmoptionSepArg, NULL },
+! { "-highttyoutAlarm", "*perfChartTtyout.highAlarm", XrmoptionSepArg, NULL },
+! { "-highttyoutWarn", "*perfChartTtyout.highWarn", XrmoptionSepArg, NULL },
+! #endif
+ { "-lowintrptsAlarm", "*perfChartIntrpts.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowintrptsWarn", "*perfChartIntrpts.lowWarn", XrmoptionSepArg, NULL },
+ { "-highintrptsAlarm", "*perfChartIntrpts.highAlarm", XrmoptionSepArg, NULL },
+ { "-highintrptsWarn", "*perfChartIntrpts.highWarn", XrmoptionSepArg, NULL },
+! #if __FreeBSD_version >= 300000
+! { "-lowswapAlarm", "*perfChartSwap.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowswapWarn", "*perfChartSwap.lowWarn", XrmoptionSepArg, NULL },
+! { "-highswapAlarm", "*perfChartSwap.highAlarm", XrmoptionSepArg, NULL },
+! { "-highswapWarn", "*perfChartSwap.highWarn", XrmoptionSepArg, NULL },
+! #else
+! { "-lowmemAlarm", "*perfChartFree.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowmemWarn", "*perfChartFree.lowWarn", XrmoptionSepArg, NULL },
+! { "-highmemAlarm", "*perfChartFree.highAlarm", XrmoptionSepArg, NULL },
+! { "-highmemWarn", "*perfChartFree.highWarn", XrmoptionSepArg, NULL },
+! #endif
+! #if __FreeBSD_version >= 300000
+! { "-lowdiskxfrfAlarm", "*perfChartDiskXfr.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowdiskxfrWarn", "*perfChartDiskXfr.lowWarn", XrmoptionSepArg, NULL },
+! { "-highdiskxfrAlarm", "*perfChartDiskXfr.highAlarm", XrmoptionSepArg, NULL },
+! { "-highdiskxfrWarn", "*perfChartDiskXfr.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowdiskmbAlarm", "*perfChartDiskMB.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowdiskmbWarn", "*perfChartDiskMB.lowWarn", XrmoptionSepArg, NULL },
+! { "-highdiskmbAlarm", "*perfChartDiskMB.highAlarm", XrmoptionSepArg, NULL },
+! { "-highdiskmbWarn", "*perfChartDiskMB.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowtapexfrAlarm", "*perfChartTapeXfr.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowtapexfrWarn", "*perfChartTapeXfr.lowWarn", XrmoptionSepArg, NULL },
+! { "-hightapexfrAlarm", "*perfChartTapeXfr.highAlarm", XrmoptionSepArg, NULL },
+! { "-hightapexfrWarn", "*perfChartTapeXfr.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowtapembAlarm", "*perfChartTapeMB.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowtapembWarn", "*perfChartTapeMB.lowWarn", XrmoptionSepArg, NULL },
+! { "-hightapembAlarm", "*perfChartTapeMB.highAlarm", XrmoptionSepArg, NULL },
+! { "-hightapembWarn", "*perfChartTapeMB.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowcdromxfrAlarm", "*perfChartCDRomXfr.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowcdromxfrWarn", "*perfChartCDRomXfr.lowWarn", XrmoptionSepArg, NULL },
+! { "-highcdromxfrAlarm", "*perfChartCDRomXfr.highAlarm", XrmoptionSepArg, NULL },
+! { "-highcdromxfrWarn", "*perfChartCDRomXfr.highWarn", XrmoptionSepArg, NULL },
+!
+! { "-lowcdrommbAlarm", "*perfChartCDRomMB.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowcdrommbWarn", "*perfChartCDRomMB.lowWarn", XrmoptionSepArg, NULL },
+! { "-highcdrommbAlarm", "*perfChartCDRomMB.highAlarm", XrmoptionSepArg, NULL },
+! { "-highcdrommbWarn", "*perfChartCDRomMB.highWarn", XrmoptionSepArg, NULL },
+! #else
+! { "-lowdiskAlarm", "*perfChartDisk.lowAlarm", XrmoptionSepArg, NULL },
+! { "-lowdiskWarn", "*perfChartDisk.lowWarn", XrmoptionSepArg, NULL },
+! { "-highdiskAlarm", "*perfChartDisk.highAlarm", XrmoptionSepArg, NULL },
+! { "-highdiskWarn", "*perfChartDisk.highWarn", XrmoptionSepArg, NULL },
+! #endif
+ { "-lowinputAlarm", "*perfChartInput.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lowinputWarn", "*perfChartInput.lowWarn", XrmoptionSepArg, NULL },
+ { "-highinputAlarm", "*perfChartInput.highAlarm", XrmoptionSepArg, NULL },
+***************
+*** 217,222 ****
+--- 402,438 ----
+ { "-highcollisionAlarm", "*perfChartCollision.highAlarm", XrmoptionSepArg, NULL },
+ { "-highcollisionWarn", "*perfChartCollision.highWarn", XrmoptionSepArg, NULL },
+
++ #if __FreeBSD_version >= 300000
++ { "-lownfsservercallsAlarm", "*perfChartNFSServerCalls.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsservercallsWarn", "*perfChartNFSServerCalls.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsservercallsAlarm", "*perfChartNFSServerCalls.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsservercallsWarn", "*perfChartNFSServerCalls.highWarn", XrmoptionSepArg, NULL },
++
++ { "-lownfsserverhitsAlarm", "*perfChartNFSServerHits.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsserverhitsWarn", "*perfChartNFSServerHits.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsserverhitsAlarm", "*perfChartNFSServerHits.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsserverhitsWarn", "*perfChartNFSServerHits.highWarn", XrmoptionSepArg, NULL },
++
++ { "-lownfsservermissesAlarm", "*perfChartNFSServerMisses.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsservermissesWarn", "*perfChartNFSServerMisses.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsservermissesAlarm", "*perfChartNFSServerMisses.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsservermissesWarn", "*perfChartNFSServerMisses.highWarn", XrmoptionSepArg, NULL },
++
++ { "-lownfsclientcallsAlarm", "*perfChartNFSClientCalls.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsclientcallsWarn", "*perfChartNFSClientCalls.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsclientcallsAlarm", "*perfChartNFSClientCalls.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsclientcallsWarn", "*perfChartNFSClientCalls.highWarn", XrmoptionSepArg, NULL },
++
++ { "-lownfsclienthitsAlarm", "*perfChartNFSClientHits.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsclienthitsWarn", "*perfChartNFSClientHits.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsclienthitsAlarm", "*perfChartNFSClientHits.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsclienthitsWarn", "*perfChartNFSClientHits.highWarn", XrmoptionSepArg, NULL },
++
++ { "-lownfsclientmissesAlarm", "*perfChartNFSClientMisses.lowAlarm", XrmoptionSepArg, NULL },
++ { "-lownfsclientmissesWarn", "*perfChartNFSClientMisses.lowWarn", XrmoptionSepArg, NULL },
++ { "-highnfsclientmissesAlarm", "*perfChartNFSClientMisses.highAlarm", XrmoptionSepArg, NULL },
++ { "-highnfsclientmissesWarn", "*perfChartNFSClientMisses.highWarn", XrmoptionSepArg, NULL },
++ #else
+ { "-lownfsclientAlarm", "*perfChartNFSClient.lowAlarm", XrmoptionSepArg, NULL },
+ { "-lownfsclientWarn", "*perfChartNFSClient.lowWarn", XrmoptionSepArg, NULL },
+ { "-highnfsclientAlarm", "*perfChartNFSClient.highAlarm", XrmoptionSepArg, NULL },
+***************
+*** 226,269 ****
+ { "-lownfsserverWarn", "*perfChartNFSServer.lowWarn", XrmoptionSepArg, NULL },
+ { "-highnfsserverAlarm", "*perfChartNFSServer.highAlarm", XrmoptionSepArg, NULL },
+ { "-highnfsserverWarn", "*perfChartNFSServer.highWarn", XrmoptionSepArg, NULL },
+
+ { "-count", ".count", XrmoptionSepArg, (caddr_t) NULL},
+ { "-fill", "*fill", XrmoptionNoArg, "True" },
+ { "-debug", "*debug", XrmoptionNoArg, "True" },
+ { "-fast", "*fast", XrmoptionNoArg, (XtPointer)"True" },
+ { "-usercpu", XtNusercpuSub, XrmoptionNoArg, "True" },
+ { "+usercpu", XtNusercpuAdd, XrmoptionNoArg, "TRUE" },
+! { "-systemcpu", XtNsystemcpuSub, XrmoptionNoArg, "True" },
+! { "+systemcpu", XtNsystemcpuAdd, XrmoptionNoArg, "TRUE" },
+ { "-idlecpu", XtNidlecpuSub, XrmoptionNoArg, "True" },
+ { "+idlecpu", XtNidlecpuAdd, XrmoptionNoArg, "TRUE" },
+ { "-freemem", XtNfreememSub, XrmoptionNoArg, "True" },
+ { "+freemem", XtNfreememAdd, XrmoptionNoArg, "TRUE" },
+ { "-diskxfr", XtNdiskxfrSub, XrmoptionNoArg, "True" },
+ { "+diskxfr", XtNdiskxfrAdd, XrmoptionNoArg, "TRUE" },
+! { "-interrupts", XtNinterruptsSub , XrmoptionNoArg, "True" },
+! { "+interrupts", XtNinterruptsAdd, XrmoptionNoArg, "TRUE" },
+ { "-inputpkts", XtNinputpktsSub, XrmoptionNoArg, "True" },
+ { "+inputpkts", XtNinputpktsAdd, XrmoptionNoArg, "TRUE" },
+ { "-outputpkts", XtNoutputpktsSub, XrmoptionNoArg, "True" },
+ { "+outputpkts", XtNoutputpktsAdd, XrmoptionNoArg, "TRUE" },
+ { "-collpkts", XtNcollpktsSub, XrmoptionNoArg, "True" },
+ { "+collpkts", XtNcollpktsAdd, XrmoptionNoArg, "TRUE" },
+ { "-nfsclient", XtNnfsclientSub, XrmoptionNoArg, "True" },
+ { "+nfsclient", XtNnfsclientAdd, XrmoptionNoArg, "TRUE" },
+ { "-nfsserver", XtNnfsserverSub, XrmoptionNoArg, "True" },
+ { "+nfsserver", XtNnfsserverAdd, XrmoptionNoArg, "TRUE" },
+! { "-stuf", XtNstufAdd, XrmoptionNoArg, (XtPointer)"True" },
+! { "+stuf", XtNstufSub, XrmoptionNoArg, (XtPointer)"True" },
+ };
+
+ /* Application Resource List - no particular widget */
+
+ static XtResource resources[] = {
+- { XtNstufAdd, XtCStufAdd, XtRBool, sizeof(Bool),
+- XtOffsetOf(AppData, addG[1]), XtRImmediate, (XtPointer) NULL },
+- { XtNstufSub, XtCStufSub, XtRBool, sizeof(Bool),
+- XtOffsetOf(AppData, subG[0]), XtRImmediate, (XtPointer) NULL },
+ { XtNinterval, XtCInterval, XtRInt, sizeof(int),
+ XtOffsetOf(AppData, interval), XtRImmediate, (caddr_t) DEF_INTERVAL },
+ { XtNcount, XtCCount, XtRInt, sizeof(int),
+--- 442,543 ----
+ { "-lownfsserverWarn", "*perfChartNFSServer.lowWarn", XrmoptionSepArg, NULL },
+ { "-highnfsserverAlarm", "*perfChartNFSServer.highAlarm", XrmoptionSepArg, NULL },
+ { "-highnfsserverWarn", "*perfChartNFSServer.highWarn", XrmoptionSepArg, NULL },
++ #endif
- INSTPGMFLAGS = $(INSTKMEMFLAGS)
-! LOCAL_LIBRARIES = -lXaw -lXt -lXmu -lX11
- INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11
-! # SRCS = TimeChart.c StripChart.c misc.c $(SYS_MODULE).c xperfmon.c nfs.c
-! # OBJS = TimeChart.o StripChart.o misc.o $(SYS_MODULE).o xperfmon.o nfs.o
-! SRCS = TimeChart.c StripChart.c misc.c $(SYS_MODULE).c xperfmon.c
-! OBJS = TimeChart.o StripChart.o misc.o $(SYS_MODULE).o xperfmon.o
+ { "-count", ".count", XrmoptionSepArg, (caddr_t) NULL},
+ { "-fill", "*fill", XrmoptionNoArg, "True" },
+ { "-debug", "*debug", XrmoptionNoArg, "True" },
+ { "-fast", "*fast", XrmoptionNoArg, (XtPointer)"True" },
++ #if __FreeBSD_version >= 300000
++ { "-sysload", XtNsysloadSub, XrmoptionNoArg, "True" },
++ { "+sysload", XtNsysloadAdd, XrmoptionNoArg, "TRUE" },
++ #endif
+ { "-usercpu", XtNusercpuSub, XrmoptionNoArg, "True" },
+ { "+usercpu", XtNusercpuAdd, XrmoptionNoArg, "TRUE" },
+! #if __FreeBSD_version >= 300000
+! { "-nicecpu", XtNnicecpuSub, XrmoptionNoArg, "True" },
+! { "+nicecpu", XtNnicecpuAdd, XrmoptionNoArg, "TRUE" },
+! #endif
+! { "-systemcpu", XtNsystemcpuSub, XrmoptionNoArg, "True" },
+! { "+systemcpu", XtNsystemcpuAdd, XrmoptionNoArg, "TRUE" },
+! #if __FreeBSD_version >= 300000
+! { "-intercpu", XtNintercpuSub, XrmoptionNoArg, "True" },
+! { "+intercpu", XtNintercpuAdd, XrmoptionNoArg, "TRUE" },
+! #endif
+ { "-idlecpu", XtNidlecpuSub, XrmoptionNoArg, "True" },
+ { "+idlecpu", XtNidlecpuAdd, XrmoptionNoArg, "TRUE" },
++ #if __FreeBSD_version >= 300000
++ { "-ttyin", XtNttyinSub, XrmoptionNoArg, "True" },
++ { "+ttyin", XtNttyinAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-ttyout", XtNttyoutSub, XrmoptionNoArg, "True" },
++ { "+ttyout", XtNttyoutAdd, XrmoptionNoArg, "TRUE" },
++ #endif
++ { "-interrupts", XtNinterruptsSub , XrmoptionNoArg, "True" },
++ { "+interrupts", XtNinterruptsAdd, XrmoptionNoArg, "TRUE" },
++ #if __FreeBSD_version >= 300000
++ { "-freeswap", XtNfreememSub, XrmoptionNoArg, "True" },
++ { "+freeswap", XtNfreememAdd, XrmoptionNoArg, "TRUE" },
++ #else
+ { "-freemem", XtNfreememSub, XrmoptionNoArg, "True" },
+ { "+freemem", XtNfreememAdd, XrmoptionNoArg, "TRUE" },
++ #endif
+ { "-diskxfr", XtNdiskxfrSub, XrmoptionNoArg, "True" },
+ { "+diskxfr", XtNdiskxfrAdd, XrmoptionNoArg, "TRUE" },
+! #if __FreeBSD_version >= 300000
+! { "-diskmb", XtNdiskmbSub, XrmoptionNoArg, "True" },
+! { "+diskmb", XtNdiskmbAdd, XrmoptionNoArg, "TRUE" },
+!
+! { "-tapexfr", XtNtapexfrSub, XrmoptionNoArg, "True" },
+! { "+tapexfr", XtNtapexfrAdd, XrmoptionNoArg, "TRUE" },
+!
+! { "-tapemb", XtNtapembSub, XrmoptionNoArg, "True" },
+! { "+tapemb", XtNtapembAdd, XrmoptionNoArg, "TRUE" },
+!
+! { "-cdromxfr", XtNcdromxfrSub, XrmoptionNoArg, "True" },
+! { "+cdromxfr", XtNcdromxfrAdd, XrmoptionNoArg, "TRUE" },
+!
+! { "-cdrommb", XtNcdrommbSub, XrmoptionNoArg, "True" },
+! { "+cdrommb", XtNcdrommbAdd, XrmoptionNoArg, "TRUE" },
+! #endif
+ { "-inputpkts", XtNinputpktsSub, XrmoptionNoArg, "True" },
+ { "+inputpkts", XtNinputpktsAdd, XrmoptionNoArg, "TRUE" },
++
+ { "-outputpkts", XtNoutputpktsSub, XrmoptionNoArg, "True" },
+ { "+outputpkts", XtNoutputpktsAdd, XrmoptionNoArg, "TRUE" },
++
+ { "-collpkts", XtNcollpktsSub, XrmoptionNoArg, "True" },
+ { "+collpkts", XtNcollpktsAdd, XrmoptionNoArg, "TRUE" },
++ #if __FreeBSD_version >= 300000
++ { "-nfsservercalls", XtNnfsservercSub, XrmoptionNoArg, "True" },
++ { "+nfsservercalls", XtNnfsservercAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-nfsserverhits", XtNnfsserverhSub, XrmoptionNoArg, "True" },
++ { "+nfsserverhits", XtNnfsserverhAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-nfsservermisses", XtNnfsservermSub, XrmoptionNoArg, "True" },
++ { "+nfsservermisses", XtNnfsservermAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-nfsclientcalls", XtNnfsclientcSub, XrmoptionNoArg, "True" },
++ { "+nfsclientcalls", XtNnfsclientcAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-nfsclienthits", XtNnfsclienthSub, XrmoptionNoArg, "True" },
++ { "+nfsclienthits", XtNnfsclienthAdd, XrmoptionNoArg, "TRUE" },
++
++ { "-nfsclientmisses", XtNnfsclientmSub, XrmoptionNoArg, "True" },
++ { "+nfsclientmisses", XtNnfsclientmAdd, XrmoptionNoArg, "TRUE" },
++ #else
+ { "-nfsclient", XtNnfsclientSub, XrmoptionNoArg, "True" },
+ { "+nfsclient", XtNnfsclientAdd, XrmoptionNoArg, "TRUE" },
++
+ { "-nfsserver", XtNnfsserverSub, XrmoptionNoArg, "True" },
+ { "+nfsserver", XtNnfsserverAdd, XrmoptionNoArg, "TRUE" },
+! #endif
+ };
- ComplexProgramTarget(xperfmon++)
+ /* Application Resource List - no particular widget */
-*** ../xperfmon++/README Wed Jul 27 22:29:30 1994
---- ./README Thu Apr 30 15:03:39 1998
+ static XtResource resources[] = {
+ { XtNinterval, XtCInterval, XtRInt, sizeof(int),
+ XtOffsetOf(AppData, interval), XtRImmediate, (caddr_t) DEF_INTERVAL },
+ { XtNcount, XtCCount, XtRInt, sizeof(int),
***************
-*** 18,20 ****
---- 18,58 ----
- Research Center, rsmith@proteus.arc.nasa.gov. Imake will build for correct
- O/S if x11r5 is fully installed in all the right places.
-
-+
-+ 3-15-95 Completely new port of systemdependent file (bsd_system.c) for FreeBSD-2.X
-+ by Lars Köller @University of Rostock, Germany.
-+ E-Mail: <lars.koeller@odie.physik2.uni-rostock.de>
-+
-+ 8-16-95 Quick and dirty workaround of -geometry option bug.
-+ But there are still some side effects when changing the geometry.
-+ Fix memory leak in bsd_system.c
-+ by Lars Köller @University of Rostock, Germany.
-+ E-Mail: <lars.koeller@odie.physik2.uni-rostock.de>
-+
-+ 30-10-95 Change 'Free Mem' graph to 'Free Swap' cause the FreeBSD memory system
-+ tries to minimize the free unused amount of memory.
-+ Include basic support for FreeBSD > 2.1.
-+ Number of interrupts now independent from 'Update Intervall'
-+ by Lars Köller @University of Rostock, Germany.
-+ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
-+
-+ 11-12-95 Fix -geometry bug! Now there is only a MIN_WIDTH of 185 pixels, and the
-+ MIN_HEIGTH is calculates dynamically depending on the number of active
-+ graphs. FreeBSD-2.X only:
-+ Change 'Free Swap' graph from absolut into percent values.
-+ All graphs shoud be independent of the 'Update Intervall'.
-+ Modify graph labels and add unit of each graph.
-+ by Lars Köller @University of Rostock, Germany.
-+ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
-+
-+ 5-4-96 Fix some event problems that consumes a lot of cpu power after resizing
-+ (mwm) or restart of an window manager. Make xperfmon compile with
-+ FreeBSD-current (2.2, changes in get_swapspace)
-+ by Lars Köller @University of Rostock, Germany.
-+ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
-+
-+ 4-30-98 Add System Load graph
-+ Add CPU Nice and Interrupt graph
-+ Compiles on FreeBSD-2.2.X and 3.X
-+ by Lars Köller @University of Bielefeld, Germany.
-+ E-Mail: Lars.Koeller@Uni-Bielefeld.DE
-*** ../xperfmon++/XPerfmon++.ad Wed Jul 27 22:29:32 1994
---- ./XPerfmon++.ad Thu Aug 13 18:58:32 1998
+*** 274,316 ****
+ XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL },
+ { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean),
+ XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL },
+!
+ { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNfreememAdd, XtCFreememAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[FRE_MEM]), XtRImmediate, (XtPointer) NULL },
+ { XtNfreememSub, XtCFreememSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[FRE_MEM]), XtRImmediate, (XtPointer) NULL },
+ { XtNdiskxfrAdd, XtCDiskxfrAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[DSK_XFR]), XtRImmediate, (XtPointer) NULL },
+ { XtNdiskxfrSub, XtCDiskxfrSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[DSK_XFR]), XtRImmediate, (XtPointer) NULL },
+! { XtNinterruptsAdd, XtCInterrputsAdd, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, addG[INTRPTS]), XtRImmediate, (XtPointer) NULL },
+! { XtNinterruptsSub, XtCInterrputsSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[INTRPTS]), XtRImmediate, (XtPointer) NULL },
+ { XtNinputpktsAdd, XtCInputpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[INP_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNinputpktsSub, XtCInputpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[INP_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNoutputpktsAdd, XtCOutputpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[OUT_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNoutputpktsSub, XtCOutputpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[OUT_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNcollpktsAdd, XtCCollpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[COL_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNcollpktsSub, XtCCollpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[COL_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNnfsclientAdd, XtCNfsclientAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[NFS_CLT]), XtRImmediate, (XtPointer) NULL },
+ { XtNnfsclientSub, XtCNfsclientSub, XtRBool, sizeof(Bool),
+--- 548,684 ----
+ XtOffsetOf(AppData, debug), XtRImmediate, (caddr_t)NULL },
+ { XtNfast, XtCFast, XtRBoolean, sizeof(Boolean),
+ XtOffsetOf(AppData, fast), XtRImmediate, (XtPointer) NULL },
+! #if __FreeBSD_version >= 300000
+! { XtNsysloadAdd, XtCSysloadAdd, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, addG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL },
+! { XtNsysloadSub, XtCSysloadSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[SYS_LOAD]), XtRImmediate, (XtPointer) NULL },
+! #endif
+ { XtNusercpuAdd, XtCUsercpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNusercpuSub, XtCUsercpuSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[USR_CPU]), XtRImmediate, (XtPointer) NULL },
+! #if __FreeBSD_version >= 300000
+! { XtNnicecpuAdd, XtCNicecpuAdd, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, addG[NICE_CPU]), XtRImmediate, (XtPointer) NULL },
+! { XtNnicecpuSub, XtCNicecpuSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[NICE_CPU]), XtRImmediate, (XtPointer) NULL },
+! #endif
+ { XtNsystemcpuAdd, XtCSystemcpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNsystemcpuSub, XtCSystemcpuSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[SYS_CPU]), XtRImmediate, (XtPointer) NULL },
++ #if __FreeBSD_version >= 300000
++ { XtNintercpuAdd, XtCIntercpuAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[INT_CPU]), XtRImmediate, (XtPointer) NULL },
++ { XtNintercpuSub, XtCIntercpuSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[INT_CPU]), XtRImmediate, (XtPointer) NULL },
++ #endif
+ { XtNidlecpuAdd, XtCIdlecpuAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
+ { XtNidlecpuSub, XtCIdlecpuSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[IDL_CPU]), XtRImmediate, (XtPointer) NULL },
++ #if __FreeBSD_version >= 300000
++ { XtNttyinAdd, XtCTtyinAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[TTY_IN]), XtRImmediate, (XtPointer) NULL },
++ { XtNttyinSub, XtCTtyinSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[TTY_IN]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNttyoutAdd, XtCTtyoutAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[TTY_OUT]), XtRImmediate, (XtPointer) NULL },
++ { XtNttyoutSub, XtCTtyoutSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[TTY_OUT]), XtRImmediate, (XtPointer) NULL },
++ #endif
++ { XtNinterruptsAdd, XtCInterrputsAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[INTRPTS]), XtRImmediate, (XtPointer) NULL },
++ { XtNinterruptsSub, XtCInterrputsSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[INTRPTS]), XtRImmediate, (XtPointer) NULL },
++
+ { XtNfreememAdd, XtCFreememAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[FRE_MEM]), XtRImmediate, (XtPointer) NULL },
+ { XtNfreememSub, XtCFreememSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[FRE_MEM]), XtRImmediate, (XtPointer) NULL },
++ #if __FreeBSD_version >= 300000
++ { XtNdiskxfrAdd, XtCDiskxfrAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[DA_XFR]), XtRImmediate, (XtPointer) NULL },
++ { XtNdiskxfrSub, XtCDiskxfrSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[DA_XFR]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNdiskmbAdd, XtCDiskmbAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[DA_MB]), XtRImmediate, (XtPointer) NULL },
++ { XtNdiskmbSub, XtCDiskmbSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[DA_MB]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNtapexfrAdd, XtCTapexfrAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[SA_XFR]), XtRImmediate, (XtPointer) NULL },
++ { XtNtapexfrSub, XtCTapexfrSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[SA_XFR]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNtapembAdd, XtCTapembAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[SA_MB]), XtRImmediate, (XtPointer) NULL },
++ { XtNtapembSub, XtCTapembSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[SA_MB]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNcdromxfrAdd, XtCCdromxfrAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[CD_XFR]), XtRImmediate, (XtPointer) NULL },
++ { XtNcdromxfrSub, XtCCdromxfrSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[CD_XFR]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNcdrommbAdd, XtCCdrommbAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[CD_MB]), XtRImmediate, (XtPointer) NULL },
++ { XtNcdrommbSub, XtCCdrommbSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[CD_MB]), XtRImmediate, (XtPointer) NULL },
++ #else
+ { XtNdiskxfrAdd, XtCDiskxfrAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[DSK_XFR]), XtRImmediate, (XtPointer) NULL },
+ { XtNdiskxfrSub, XtCDiskxfrSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[DSK_XFR]), XtRImmediate, (XtPointer) NULL },
+! #endif
+ { XtNinputpktsAdd, XtCInputpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[INP_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNinputpktsSub, XtCInputpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[INP_PKT]), XtRImmediate, (XtPointer) NULL },
++
+ { XtNoutputpktsAdd, XtCOutputpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[OUT_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNoutputpktsSub, XtCOutputpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[OUT_PKT]), XtRImmediate, (XtPointer) NULL },
++
+ { XtNcollpktsAdd, XtCCollpktsAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[COL_PKT]), XtRImmediate, (XtPointer) NULL },
+ { XtNcollpktsSub, XtCCollpktsSub, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, subG[COL_PKT]), XtRImmediate, (XtPointer) NULL },
++ #if __FreeBSD_version >= 300000
++ { XtNnfsservercAdd, XtCNfsservercAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsservercSub, XtCNfsservercSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNnfsserverhAdd, XtCNfsserverhAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_SRV_HIT]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsserverhSub, XtCNfsserverhSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_SRV_HIT]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNnfsservermAdd, XtCNfsservermAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_SRV_MIS]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsservermSub, XtCNfsservermSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_SRV_MIS]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNnfsclientcAdd, XtCNfsclientcAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_CLT]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsclientcSub, XtCNfsclientcSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_CLT]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNnfsclienthAdd, XtCNfsclienthAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_CLT_HIT]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsclienthSub, XtCNfsclienthSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_CLT_HIT]), XtRImmediate, (XtPointer) NULL },
++
++ { XtNnfsclientmAdd, XtCNfsclientmAdd, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, addG[NFS_CLT_MIS]), XtRImmediate, (XtPointer) NULL },
++ { XtNnfsclientmSub, XtCNfsclientmSub, XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, subG[NFS_CLT_MIS]), XtRImmediate, (XtPointer) NULL },
++ #else
+ { XtNnfsclientAdd, XtCNfsclientAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[NFS_CLT]), XtRImmediate, (XtPointer) NULL },
+ { XtNnfsclientSub, XtCNfsclientSub, XtRBool, sizeof(Bool),
+***************
+*** 318,329 ****
+ { XtNnfsserverAdd, XtCNfsserverAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
+ { XtNnfsserverSub, XtCNfsserverSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
+ };
+
+ void
+ usage()
+ {
+ fprintf(stderr, "\nusage: xperfmon++ option option option .....\n");
+ fprintf(stderr, "options:\n");
+ fprintf(stderr, " [-display [{host}]:[{vs}]]\n");
+--- 686,701 ----
+ { XtNnfsserverAdd, XtCNfsserverAdd, XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, addG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
+ { XtNnfsserverSub, XtCNfsserverSub, XtRBool, sizeof(Bool),
+! XtOffsetOf(AppData, subG[NFS_SRV]), XtRImmediate, (XtPointer) NULL },
+! #endif
+ };
+
+ void
+ usage()
+ {
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, "\nxperfmon++ V3.0 for FreeBSD-3.X\n");
++ #endif
+ fprintf(stderr, "\nusage: xperfmon++ option option option .....\n");
+ fprintf(stderr, "options:\n");
+ fprintf(stderr, " [-display [{host}]:[{vs}]]\n");
+***************
+*** 340,357 ****
+ fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n");
+ fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n");
+ fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n");
+!
+ fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n");
+ fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n");
+ fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n");
+ fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n");
+ fprintf(stderr, " [{-+}diskxfr] ({remove|add} disk transfers to list of graphs\n");
+! fprintf(stderr, " [{-+}interrupts] ({remove|add} interrupts to list of graphs\n");
+ fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n");
+ fprintf(stderr, " [{-+}outputpkts] ({remove|add} output packets to list of graphs\n");
+ fprintf(stderr, " [{-+}collpkts] ({remove|add} collision packets to list of graphs\n");
+ fprintf(stderr, " [{-+}nfsclient] ({remove|add} NFS client transactions count to list of graphs\n");
+ fprintf(stderr, " [{-+}nfsserver] ({remove|add} NFS server transactions count to list of graphs\n\n");
+ fprintf(stderr, "NOTE: The default is ALL graphs! A \"-\" option takes away from the default list.\n");
+ fprintf(stderr, " Any \"+\" option resets the default list to empty and then adds the option.\n\n");
+ fprintf(stderr, "ALARMS:\n");
+--- 712,761 ----
+ fprintf(stderr, " [-fast] (changes interval from seconds to milliseconds)\n");
+ fprintf(stderr, " [-immediate] (background limit alarm color is based on current sample)\n");
+ fprintf(stderr, " [-fill] (output filled graph instead of line graph)\n\n");
+! #if __FreeBSD_version >= 300000
+! fprintf(stderr, " [{-+}sysload] ({remove|add} sysload to list of graphs\n");
+! #endif
+ fprintf(stderr, " [{-+}usercpu] ({remove|add} usercpu to list of graphs\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [{-+}nicecpu] ({remove|add} nicecpu to list of graphs\n");
++ #endif
+ fprintf(stderr, " [{-+}systemcpu] ({remove|add} systemcpu to list of graphs\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [{-+}intercpu] ({remove|add} intercpu to list of graphs\n");
++ #endif
+ fprintf(stderr, " [{-+}idlecpu] ({remove|add} idlecpu to list of graphs\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [{-+}ttyin] ({remove|add} input tty characters to list of graphs\n");
++ fprintf(stderr, " [{-+}ttyout] ({remove|add} output tty characters to list of graphs\n");
++ #endif
++ fprintf(stderr, " [{-+}interrupts] ({remove|add} interrupts to list of graphs\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [{-+}freeswap] ({remove|add} freeswap to list of graphs\n");
++ #else
+ fprintf(stderr, " [{-+}freemem] ({remove|add} freemem to list of graphs\n");
++ #endif
+ fprintf(stderr, " [{-+}diskxfr] ({remove|add} disk transfers to list of graphs\n");
+! #if __FreeBSD_version >= 300000
+! fprintf(stderr, " [{-+}diskmb] ({remove|add} MB to/from disks to list of graphs\n");
+! fprintf(stderr, " [{-+}tapexfr] ({remove|add} tape transfers to list of graphs\n");
+! fprintf(stderr, " [{-+}tapemb] ({remove|add} MB to/from tapes to list of graphs\n");
+! fprintf(stderr, " [{-+}cdromxfr] ({remove|add} cdrom transfers to list of graphs\n");
+! fprintf(stderr, " [{-+}cdrommb] ({remove|add} MB from cdroms to list of graphs\n");
+! #endif
+ fprintf(stderr, " [{-+}inputpkts] ({remove|add} input packets to list of graphs\n");
+ fprintf(stderr, " [{-+}outputpkts] ({remove|add} output packets to list of graphs\n");
+ fprintf(stderr, " [{-+}collpkts] ({remove|add} collision packets to list of graphs\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [{-+}nfsservercalls] ({remove|add} NFS server transactions count to list of graphs\n\n");
++ fprintf(stderr, " [{-+}nfsserverhits] ({remove|add} NFS server cache hit count to list of graphs\n\n");
++ fprintf(stderr, " [{-+}nfsservermisses] ({remove|add} NFS server cache miss count to list of graphs\n\n");
++ fprintf(stderr, " [{-+}nfsclientcalls] ({remove|add} NFS client transactions count to list of graphs\n\n");
++ fprintf(stderr, " [{-+}nfsclienthits] ({remove|add} NFS client cache hit count to list of graphs\n\n");
++ fprintf(stderr, " [{-+}nfsclientmisses] ({remove|add} NFS client cache miss count to list of graphs\n\n");
++ #else
+ fprintf(stderr, " [{-+}nfsclient] ({remove|add} NFS client transactions count to list of graphs\n");
+ fprintf(stderr, " [{-+}nfsserver] ({remove|add} NFS server transactions count to list of graphs\n\n");
++ #endif
+ fprintf(stderr, "NOTE: The default is ALL graphs! A \"-\" option takes away from the default list.\n");
+ fprintf(stderr, " Any \"+\" option resets the default list to empty and then adds the option.\n\n");
+ fprintf(stderr, "ALARMS:\n");
***************
-*** 4,27 ****
- ! commented out, the "NFS Server" graph background will be the application
- ! default color, unless some other resource file has specified it.
- ! *PerfChart.highAlarm: 99998
- *perfChartIdle.lowWarn: 10
- *perfChartIdle.lowAlarm: 5
-! *perfChartUser.highAlarm: 90
-! *perfChartUser.highWarn: 75
-! *perfChartSystem.highAlarm: 90
-! *perfChartSystem.highWarn: 75
-! *perfChartFree.lowWarn: 2000
-! *perfChartFree.lowAlarm: 1000
-! *perfChartDisk.highWarn: 25
-! *perfChartDisk.highAlarm: 50
-! *perfChartIntrpts.highWarn: 500
-! *perfChartIntrpts.highAlarm: 750
-! *perfChartInput.highWarn: 300
-! *perfChartInput.highAlarm: 500
-! *perfChartOutput.highWarn: 300
-! *perfChartOutput.highAlarm: 500
- *perfChartCollision.highWarn: 20
- *perfChartCollision.highAlarm: 50
-! *perfChartNFSClient.highWarn: 200
-! *perfChartNFSClient.highAlarm: 400
- *font: 6x13
---- 4,50 ----
- ! commented out, the "NFS Server" graph background will be the application
- ! default color, unless some other resource file has specified it.
- ! *PerfChart.highAlarm: 99998
-+
-+ ! Remember Load*100 is shown in the graph!
-+ *perfChartLoad.highAlarm: 800
-+ *perfChartLoad.highWarn: 400
-+
-+ *perfChartUser.highAlarm: 95
-+ *perfChartUser.highWarn: 75
-+
-+ *perfChartNice.highAlarm: 75
-+ *perfChartNice.highWarn: 55
-+
-+ *perfChartSystem.highAlarm: 40
-+ *perfChartSystem.highWarn: 25
-+
-+ *perfChartInter.highAlarm: 40
-+ *perfChartInter.highWarn: 25
-+
- *perfChartIdle.lowWarn: 10
- *perfChartIdle.lowAlarm: 5
-!
-! *perfChartSwap.lowWarn: 20
-! *perfChartSwap.lowAlarm: 10
-!
-! *perfChartDisk.highWarn: 50
-! *perfChartDisk.highAlarm: 100
-!
-! *perfChartIntrpts.highWarn: 400
-! *perfChartIntrpts.highAlarm: 600
-!
-! *perfChartInput.highWarn: 500
-! *perfChartInput.highAlarm: 1000
-!
-! *perfChartOutput.highWarn: 500
-! *perfChartOutput.highAlarm: 1000
-!
- *perfChartCollision.highWarn: 20
- *perfChartCollision.highAlarm: 50
-!
-! *perfChartNFSClient.highWarn: 100
-! *perfChartNFSClient.highAlarm: 200
-!
-! *perfChartNFSServer.highWarn: 100
-! *perfChartNFSServer.highAlarm: 200
- *font: 6x13
-*** ../xperfmon++/xperfmon++.man Wed Jul 27 22:29:39 1994
---- ./xperfmon++.man Thu Apr 30 15:03:39 1998
+*** 361,370 ****
+ fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n");
+ fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n");
+ fprintf(stderr, " Where \"*\" is one of the following:\n");
+ fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n");
+! fprintf(stderr, " input | output | collision | nfsclient | nfsserver]\n");
+ fprintf(stderr, " For Example:\n");
+ fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n");
+ fprintf(stderr, "WARNING: It is an error condition to set both a high, and a low, limit warning or alarm.\n");
+ exit(1);
+ }
+--- 765,785 ----
+ fprintf(stderr, " [-high*Alarm {value}] ( Set High Alarm value for *)\n");
+ fprintf(stderr, " [-high*Warn {value}] ( Set High Warning value for *)\n");
+ fprintf(stderr, " Where \"*\" is one of the following:\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [load | user | nice | sys | inter | idle | ttyin | ttyout | intrps | swap |\n");
++ fprintf(stderr, " diskxfr | diskmb | tapexfr | tapemb | cdromxfr | cdrommb | input | output |\n");
++ fprintf(stderr, " collision | nfsservercalls | nfsserverhits | nfsservermisses |\n");
++ fprintf(stderr, " nfsclientcalls | nfsclienthits | nfsclientmisses]\n");
++ #else
+ fprintf(stderr, " [mem | user | sys | idle | disk | intrpts |\n");
+! fprintf(stderr, " intrpts | input | output | collision | nfsclient | nfsserver]\n");
+! #endif
+ fprintf(stderr, " For Example:\n");
++ #if __FreeBSD_version >= 300000
++ fprintf(stderr, " [-lowswapAlarm {value}] ( Set low Free Swap Alarm Value)\n");
++ #else
+ fprintf(stderr, " [-lowmemAlarm {value}] ( Set low Free Memory Alarm Value)\n");
++ #endif
+ fprintf(stderr, "WARNING: It is an error condition to set both a high, and a low, limit warning or alarm.\n");
+ exit(1);
+ }
+***************
+*** 386,391 ****
+--- 801,807 ----
+ time(&timeStamp);
+ return;
+ }
++
+ /*ARGSUSED*/
+ void handleResize( w, unused, event, contin2disp )
+ Widget w;
***************
-*** 85,101 ****
- default list. Specifying both "-" and "+" options will produce unpredictable
- results.
- .TP 26
- .B \-usercpu | \+usercpu
- Graph percentage of \fIUser CPU Time\fP.
- .TP 26
- .B \-systemcpu | \+systemcpu
-! Graph \fISystem\fP CPU Percentage.
- .TP 26
- .B \-idlecpu | \+idlecpu
-! Graph \fIIdle\fP CPU Percentage.
- .TP 26
-! .B \-freemem | \+freemem
-! Graph \fIFree Memory\fP.
- .TP 26
- .B \-diskxfr | \+diskxfr
- Graph \fIDisk Transfers\fP per interval period.
---- 85,110 ----
- default list. Specifying both "-" and "+" options will produce unpredictable
- results.
- .TP 26
-+ .B \-sysload | \+sysload
-+ Graph percentage of \fISystem Load\fP (avaraged over 1 minute).
-+ .TP 26
- .B \-usercpu | \+usercpu
- Graph percentage of \fIUser CPU Time\fP.
- .TP 26
-+ .B \-nicecpu | \+nicecpu
-+ Graph percentage of \fINice CPU Time\fP.
-+ .TP 26
- .B \-systemcpu | \+systemcpu
-! Graph percentage of \fISystem CPU Time\fP.
-! .TP 26
-! .B \-intercpu | \+intercpu
-! Graph percentage of \fIInterrupt CPU Time\fP.
- .TP 26
- .B \-idlecpu | \+idlecpu
-! Graph percentage of \fIIdle CPU Time\fP.
- .TP 26
-! .B \-free{mem/swap} | \+free{mem/swap}
-! Graph \fIFree Memory/Swap (Operating system dependent, swap for FreeBSD in %)\fP.
- .TP 26
- .B \-diskxfr | \+diskxfr
- Graph \fIDisk Transfers\fP per interval period.
+*** 394,400 ****
+ Boolean *contin2disp;
+ {
+ Dimension neww, newh;
+! int i;
+ char eventString[60];
+ switch (event->type) {
+ case Expose:
+--- 810,817 ----
+ Boolean *contin2disp;
+ {
+ Dimension neww, newh;
+! Dimension hOverHead, boxH, timeH, newWidgetH;
+! int i, window_size_changed;
+ char eventString[60];
+ switch (event->type) {
+ case Expose:
***************
-*** 167,183 ****
- .PP
- Where "*" is one of the following:
- .TP 12
- .B user
- Set \fIlimit\fP value for User CPU Percentage.
- .TP 12
- .B sys
- Set \fIlimit\fP value for System CPU Percentage.
- .TP 12
- .B idle
- Set \fIlimit\fP value for Idle CPU Percentage.
- .TP 12
-! .B mem
-! Set \fIlimit\fP value for Free Memory.
- .TP 12
- .B disk
- Set \fIlimit\fP value for Disk Transfers.
---- 176,201 ----
- .PP
- Where "*" is one of the following:
- .TP 12
-+ .B load
-+ Set \fIlimit\fP value for Load Average (multiplied by 100!!!).
-+ .TP 12
- .B user
- Set \fIlimit\fP value for User CPU Percentage.
- .TP 12
-+ .B nice
-+ Set \fIlimit\fP value for Nice CPU Percentage.
-+ .TP 12
- .B sys
- Set \fIlimit\fP value for System CPU Percentage.
- .TP 12
-+ .B inter
-+ Set \fIlimit\fP value for Interrupt CPU Percentage.
-+ .TP 12
- .B idle
- Set \fIlimit\fP value for Idle CPU Percentage.
- .TP 12
-! .B mem/swap
-! Set \fIlimit\fP value for Free Memory/Swap (OS dependent, swap for FreeBSD).
- .TP 12
- .B disk
- Set \fIlimit\fP value for Disk Transfers.
+*** 403,415 ****
+ strcpy(eventString,"expose");
+ break;
+ case MapNotify:
+! neww=0;
+! newh=0;
+ strcpy(eventString,"map notify");
+ break;
+ case ReparentNotify:
+! neww=0;
+! newh=0;
+ strcpy(eventString,"reparent");
+ break;
+ case ConfigureNotify:
+--- 820,837 ----
+ strcpy(eventString,"expose");
+ break;
+ case MapNotify:
+! neww=w->core.width;
+! newh=oldHeight;
+ strcpy(eventString,"map notify");
+ break;
++ case UnmapNotify:
++ neww=w->core.width;
++ newh=oldHeight;
++ strcpy(eventString,"unmap notify");
++ break;
+ case ReparentNotify:
+! neww=w->core.width;
+! newh=oldHeight;
+ strcpy(eventString,"reparent");
+ break;
+ case ConfigureNotify:
***************
-*** 304,320 ****
- .PP
- Where "&" is one of the following (Note: \fICase\fP IS important):
- .TP 16
-! .B Idle
-! Set Idle CPU Percentage resource.
- .TP 16
- .B User
- Set User CPU Percentage resource.
- .TP 16
- .B System
- Set System CPU Percentage resource.
- .TP 16
-! .B Free
-! Set Free Memory resource.
- .TP 16
- .B Disk
- Set Disk Transfer count resource.
---- 322,347 ----
- .PP
- Where "&" is one of the following (Note: \fICase\fP IS important):
- .TP 16
-! .B Load
-! Set System Load resource.
- .TP 16
- .B User
- Set User CPU Percentage resource.
- .TP 16
-+ .B Nice
-+ Set Nice CPU Percentage resource.
-+ .TP 16
- .B System
- Set System CPU Percentage resource.
- .TP 16
-! .B Inter
-! Set Interrupt CPU Percentage resource.
-! .TP 16
-! .B Idle
-! Set Idle CPU Percentage resource.
-! .TP 16
-! .B Free/Swap
-! Set Free Memory/Swap resource.
- .TP 16
- .B Disk
- Set Disk Transfer count resource.
+*** 417,429 ****
+ newh=event->xconfigure.height;
+ strcpy(eventString,"configure");
+ break;
+
+ }
+! if ( neww < 250 + 10 ) {
+! neww = 250 + 10;
+! w->core.width = 250 + 10;
+! XtResizeWindow(w);
+ }
+ if ( appData.debug )
+ printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n",
+ (int)event->type, eventString,
+--- 839,872 ----
+ newh=event->xconfigure.height;
+ strcpy(eventString,"configure");
+ break;
++ }
+
++ if ( neww < MIN_WIDTH ) {
++ neww = MIN_WIDTH;
++ w->core.width = MIN_WIDTH;
++ window_size_changed = TRUE;
++ } else {
++ w->core.width = neww;
+ }
+!
+! hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn);
+! boxH = labelBox->core.height;
+! timeH = timechart->core.height;
+! if (newh > GRAPH_MIN_HEIGHT * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+ADD_TO_TIMEH))
+! newWidgetH = (newh - hOverHead - (boxH+7) - (timeH+ADD_TO_TIMEH)) / appData.numGraphsOn;
+! else
+! newWidgetH = GRAPH_MIN_HEIGHT;
+!
+! MIN_HEIGHT = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+ADD_TO_TIMEH);
+! w->core.height = MIN_HEIGHT;
+! if(w->core.height != newh) {
+! newh = w->core.height;
+! window_size_changed = TRUE;
+ }
++
++ if( neww != oldWidth || newh != oldHeight || window_size_changed == TRUE )
++ XtResizeWindow(w);
++
+ if ( appData.debug )
+ printf("Resize Request: type=%d %s, oldw=%hu, oldh=%hu, neww=%hu, newh=%hu\n",
+ (int)event->type, eventString,
***************
-*** 394,398 ****
---- 421,449 ----
- out there would like to port this program to any other operating system or architecture I would be
- glad to incorporate the modifications into this master copy. Send me your changes via E-Mail at the
- above address.
-+ .PP
-+ .I xperfmon++ V1.2 for FreeBSD
-+ was written by Lars Köller with a lot of helpful notes by Jörg Wunsch.
-+ .PP
-+ .I xperfmon++ V1.31 for FreeBSD
-+ close some memory leaks, fix geometry (resize) bug, display free swap
-+ without resizing of graph in percent.
-+ .PP
-+ .I xperfmon++ V1.33 for FreeBSD
-+ contains some fixes due to event problems and compiles fine under
-+ FreeBSD 2.2 (changes in get_swapspace).
-+ Now the -geometry switch works well!
-+ .PP
-+ .I xperfmon++ V1.40 for FreeBSD
-+ contains some fixes due to changes in the networking structs and
-+ cleans up the FreeBSD version number #if's. Now it should compile fine
-+ from FreeBSD 2.0 up to FreeBSD-3.0-current.
-+ .PP
-+ .I xperfmon++ V2.0 for FreeBSD 2.2.X and 3.0
-+ added System Load, Nice and Interrupt CPU graphs.
-+ Should compile fine from FreeBSD 2.2 up to FreeBSD-3.0-current.
-+ .PP
-+ Please E-Mail any bugs or comments with the subject
-+ "xperfmon++: ..." to Lars.Koeller@Uni-Bielefeld.DE.
- .PP
- Enjoy!
+*** 431,441 ****
+ neww, newh);
+
+ if ( event->type == ConfigureNotify ) {
+! /* Dimension h = perfmon[0]->core.height;*/
+! Dimension hOverHead = 5 * appData.numGraphsOn;
+! Dimension boxH = labelBox->core.height;
+! Dimension timeH = timechart->core.height;
+! Dimension newWidgetH = (newh - (boxH+8) - (timeH+10) - hOverHead) / appData.numGraphsOn;
+ if ( oldWidth == neww && oldHeight == newh ) return;
+
+ if ( appData.debug )
+--- 874,880 ----
+ neww, newh);
+
+ if ( event->type == ConfigureNotify ) {
+!
+ if ( oldWidth == neww && oldHeight == newh ) return;
+
+ if ( appData.debug )
+***************
+*** 455,472 ****
+ XFlush(XtDisplay(w));
+
+ }
+ oldWidth = neww+=10, oldHeight = newh;
+ return;
+ }
+
+! void
+ main(argc, argv)
+ int argc;
+ char **argv;
+ {
+ Arg arg;
+ Pixmap icon_pixmap = None;
+! Widget loadParent, pappaBox;
+
+ char *progname = argv[0];
+ Bool foundAnAdd = FALSE;
+--- 894,917 ----
+ XFlush(XtDisplay(w));
+
+ }
++
+ oldWidth = neww+=10, oldHeight = newh;
+ return;
+ }
+
+! int
+ main(argc, argv)
+ int argc;
+ char **argv;
+ {
++ /* LK!!! */
++ Dimension timeH, newWidgetW, newWidgetH, hOverHead, boxH;
++ unsigned int w, h;
++ static char *da_str[] = {"da1 da2"};
++
+ Arg arg;
+ Pixmap icon_pixmap = None;
+! Widget pappaBox;
+
+ char *progname = argv[0];
+ Bool foundAnAdd = FALSE;
+***************
+*** 474,483 ****
+ int i;
+ gprogname = progname;
+
+! appData.toplevel = XtVaAppInitialize(&appData.app_context, "XPerfmon++",
+! optionDescList, XtNumber(optionDescList),
+ &argc, argv,
+ NULL, NULL);
+ if (argc != 1) usage();
+
+ if ( appData.toplevel->core.depth == 1 )
+--- 919,936 ----
+ int i;
+ gprogname = progname;
+
+!
+! /* topNames[DA_MB] = da_str[0]; LK!!! */
+!
+!
+! appData.toplevel = XtVaAppInitialize(&appData.app_context, "XPerfmon++",
+! optionDescList, XtNumber(optionDescList),
+ &argc, argv,
+ NULL, NULL);
++
++ appData.toplevel->core.width=MIN_WIDTH;
++ appData.toplevel->core.height=MIN_HEIGHT;
++
+ if (argc != 1) usage();
+
+ if ( appData.toplevel->core.depth == 1 )
+***************
+*** 488,493 ****
+--- 941,949 ----
+ XtGetApplicationResources(appData.toplevel, &appData, resources,
+ XtNumber(resources), NULL, 0 );
+
++ /* LK!!! Moved to here, cause calling it in TimeChart.c is too late! */
++ XtInsertEventHandler(appData.toplevel, StructureNotifyMask, FALSE, handleResize, (Opaque)NULL, XtListHead);
++
+ /*check resources to make sure they are in range */
+
+ if ( (int)appData.fast ) {
+***************
+*** 512,518 ****
+
+ /* build graphOn table */
+
+! for ( i=0; i<NUM_GRAPHS; i++ )
+ if ( appData.addG[i] ) {
+ foundAnAdd = appData.graphOn[i] = TRUE;
+ appData.numGraphsOn++;
+--- 968,974 ----
+
+ /* build graphOn table */
+
+! for ( i=0; i<NUM_GRAPHS; i++ )
+ if ( appData.addG[i] ) {
+ foundAnAdd = appData.graphOn[i] = TRUE;
+ appData.numGraphsOn++;
+***************
+*** 520,526 ****
+ if ( !foundAnAdd ) {
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ appData.graphOn[i] = TRUE;
+! if ( appData.subG[i] )
+ appData.graphOn[i] = FALSE;
+ else
+ appData.numGraphsOn++;
+--- 976,982 ----
+ if ( !foundAnAdd ) {
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ appData.graphOn[i] = TRUE;
+! if ( appData.subG[i] )
+ appData.graphOn[i] = FALSE;
+ else
+ appData.numGraphsOn++;
+***************
+*** 540,561 ****
+ xperfmon_width, xperfmon_height));
+ XtSetValues(appData.toplevel, &arg, 1);
+ }
+-
+ /* create windows */
+
+! pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel,
+ XtNborderWidth, 0,
+ NULL);
+-
+ XtOverrideTranslations(pappaBox, XtParseTranslationTable(defaultTranslations));
+
+ (void)gethostname(hostname, sizeof(hostname));
+ c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
+ sprintf(c, "\nUpdate Interval = %5.1f secs", (float)(appData.interval*appData.ms_per_sec)/1000.0);
+
+ labelBox = XtVaCreateManagedWidget("LabelBox", labelWidgetClass, pappaBox,
+! XtNwidth, 250,
+! /* XtNheight, 16,*/
+ XtNjustify, XtJustifyLeft,
+ XtNinternalHeight, 0,
+ XtNtop, XtChainTop,
+--- 996,1047 ----
+ xperfmon_width, xperfmon_height));
+ XtSetValues(appData.toplevel, &arg, 1);
+ }
+ /* create windows */
+
+! pappaBox = XtVaCreateManagedWidget("PappaBox", boxWidgetClass, appData.toplevel,
+ XtNborderWidth, 0,
+ NULL);
+ XtOverrideTranslations(pappaBox, XtParseTranslationTable(defaultTranslations));
+
+ (void)gethostname(hostname, sizeof(hostname));
+ c = (char *) ((long) &hostname[0] + (int) strlen(hostname));
+ sprintf(c, "\nUpdate Interval = %5.1f secs", (float)(appData.interval*appData.ms_per_sec)/1000.0);
+
++ { /* LK!!! handle -geometry option correct, also small changes in handleResize */
++ Window rwin;
++ int x,y,px,py;
++ unsigned int pw,ph,bw,d;
++
++ XtRealizeWidget(appData.toplevel);
++
++ XGetGeometry(XtDisplay(appData.toplevel),XtWindow(appData.toplevel),
++ &rwin,&x,&y,&w,&h,&bw,&d);
++
++ if ( w > MIN_WIDTH) {
++ newWidgetW = w - 10;
++ appData.toplevel->core.width = w;
++ } else {
++ appData.toplevel->core.width = MIN_WIDTH;
++ newWidgetW = MIN_WIDTH - 10;
++ }
++
++ hOverHead = (5.6 * appData.numGraphsOn) - (6 / appData.numGraphsOn);
++ boxH = 22;
++ timeH = 12;
++ if (h > GRAPH_MIN_HEIGHT * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+ADD_TO_TIMEH))
++ newWidgetH = (h - hOverHead - (boxH+7) - (timeH+ADD_TO_TIMEH) ) / appData.numGraphsOn;
++ else
++ newWidgetH = GRAPH_MIN_HEIGHT;
++
++ MIN_HEIGHT = newWidgetH * appData.numGraphsOn + hOverHead + (boxH+7) + (timeH+ADD_TO_TIMEH);
++ appData.toplevel->core.height = MIN_HEIGHT;
++
++ XtResizeWindow(appData.toplevel);
++ }
++
+ labelBox = XtVaCreateManagedWidget("LabelBox", labelWidgetClass, pappaBox,
+! XtNwidth, newWidgetW,
+! XtNheight, boxH,
+ XtNjustify, XtJustifyLeft,
+ XtNinternalHeight, 0,
+ XtNtop, XtChainTop,
+***************
+*** 567,600 ****
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ if ( appData.graphOn[i] ) {
+ sprintf(hostname, "perfChart%s", widgetLabels[i]);
+! perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox,
+ XtNtopLabel, topNames[i],
+ XtNbotLabel, botNames[i],
+! XtNwidth, 250,
+! XtNheight, 36,
+ XtNupdate, appData.interval*appData.ms_per_sec,
+ XtNfillRect, (int)appData.fill,
+ XtNjumpScroll, 1,
+ NULL);
+ }
+ }
+! timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox,
+! XtNfromVert, perfmon[1],
+! XtNwidth, 250,
+! XtNheight, 18,
+ XtNupdate, appData.interval*appData.ms_per_sec,
+ XtNjumpScroll, 1,
+ NULL);
+ sys_setup();
+ XtAddCallback(timechart, XtNgetValue, update_time_stat, NULL);
+
+! for ( i=0; i<NUM_GRAPHS; i++ )
+! if ( appData.graphOn[i] )
+! XtAddCallback(perfmon[i], XtNgetValue, update_stat, i);
+
+ appData.interval_id = XtAppAddTimeOut(appData.app_context,
+ appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
+
+- XtRealizeWidget(appData.toplevel);
+ XtAppMainLoop(appData.app_context);
+ }
+--- 1053,1086 ----
+ for ( i=0; i<NUM_GRAPHS; i++ ) {
+ if ( appData.graphOn[i] ) {
+ sprintf(hostname, "perfChart%s", widgetLabels[i]);
+! perfmon[i] = XtVaCreateManagedWidget(hostname, perfChartWidgetClass, pappaBox,
+ XtNtopLabel, topNames[i],
+ XtNbotLabel, botNames[i],
+! XtNwidth, newWidgetW,
+! XtNheight, newWidgetH,
+ XtNupdate, appData.interval*appData.ms_per_sec,
+ XtNfillRect, (int)appData.fill,
+ XtNjumpScroll, 1,
+ NULL);
+ }
+ }
+! timechart = XtVaCreateManagedWidget("timeChart", timeChartWidgetClass, pappaBox,
+! XtNfromVert, perfmon[1],
+! XtNwidth, newWidgetW,
+! XtNheight, timeH,
+ XtNupdate, appData.interval*appData.ms_per_sec,
+ XtNjumpScroll, 1,
+ NULL);
++
+ sys_setup();
+ XtAddCallback(timechart, XtNgetValue, update_time_stat, NULL);
+
+! for ( i=0; i<NUM_GRAPHS; i++ )
+! if ( appData.graphOn[i] )
+! XtAddCallback(perfmon[i], XtNgetValue, update_stat, (XtPointer)i);
+
+ appData.interval_id = XtAppAddTimeOut(appData.app_context,
+ appData.interval*appData.ms_per_sec, start_graphs, (caddr_t) appData.toplevel);
+
+ XtAppMainLoop(appData.app_context);
+ }
diff --git a/sysutils/xperfmon3/files/patch-ad b/sysutils/xperfmon3/files/patch-ad
new file mode 100644
index 000000000000..012a9929b214
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-ad
@@ -0,0 +1,365 @@
+*** ../xperfmon++/TimeChart.c Wed Jul 27 22:29:31 1994
+--- ./TimeChart.c Sun Jan 10 18:08:06 1999
+***************
+*** 1,4 ****
+! /* $XConsortium: TimeChart.c,v 1.20 91/05/24 17:20:42 converse Exp $ */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+--- 1,9 ----
+! /*
+! * Enhancement and error correction for FreeBSD-3.X
+! * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+! *
+! * $Id: TimeChart.c,v 1.4 1999/01/10 17:07:57 lkoeller Exp lkoeller $
+! */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+***************
+*** 6,18 ****
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+--- 11,23 ----
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+***************
+*** 28,34 ****
+ * 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
+--- 33,39 ----
+ * 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 ****
+ * 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
+--- 44,50 ----
+ * 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
+***************
+*** 47,52 ****
+--- 52,61 ----
+ * Moffett Field, California, rsmith@proteus.arc.nasa.gov
+ ******************************************************************/
+
++ #ifndef LINT
++ static char rcsid[] = "$Id: TimeChart.c,v 1.4 1999/01/10 17:07:57 lkoeller Exp lkoeller $";
++ #endif
++
+ #include <stdio.h>
+ #include <X11/IntrinsicP.h>
+ #include <X11/StringDefs.h>
+***************
+*** 97,103 ****
+ extern void handleResize();
+ static Boolean SetValues();
+ static int repaint_window();
+- static int firstTime=TRUE;
+ Dimension oldHeight, oldWidth;
+ time_t timeStamp;
+ char numstring[32];
+--- 106,111 ----
+***************
+*** 190,199 ****
+ TimeChartWidget w;
+ unsigned int which;
+ {
+! if (which & FOREGROUND)
+ XtReleaseGC((Widget) w, w->time_chart.fgGC);
+
+! if (which & HIGHLIGHT)
+ XtReleaseGC((Widget) w, w->time_chart.hiGC);
+ }
+
+--- 198,207 ----
+ TimeChartWidget w;
+ unsigned int which;
+ {
+! if (which & FOREGROUND)
+ XtReleaseGC((Widget) w, w->time_chart.fgGC);
+
+! if (which & HIGHLIGHT)
+ XtReleaseGC((Widget) w, w->time_chart.hiGC);
+ }
+
+***************
+*** 239,245 ****
+ }
+
+ /*
+! * NOTE: This function really needs to recieve graphics exposure
+ * events, but since this is not easily supported until R4 I am
+ * going to hold off until then.
+ */
+--- 247,253 ----
+ }
+
+ /*
+! * NOTE: This function really needs to recieve graphics exposure
+ * events, but since this is not easily supported until R4 I am
+ * going to hold off until then.
+ */
+***************
+*** 251,263 ****
+ Region region;
+ {
+ TimeChartWidget ww = (TimeChartWidget)w;
+! if ( firstTime ) {
+! XtInsertEventHandler(appData.toplevel, StructureNotifyMask, FALSE, handleResize, (Opaque)NULL, XtListHead);
+! firstTime = FALSE;
+! oldHeight = (int)ww->core.parent->core.parent->core.height;
+! oldWidth = (int)ww->core.parent->core.parent->core.width;
+! /* printf("oldHeight=%d, oldWidth=%d\n", oldHeight, oldWidth);*/
+! }
+ if (event->type == GraphicsExpose)
+ (void) repaint_window ((TimeChartWidget)w, event->xgraphicsexpose.x,
+ event->xgraphicsexpose.width);
+--- 259,268 ----
+ Region region;
+ {
+ TimeChartWidget ww = (TimeChartWidget)w;
+!
+! oldHeight = (int)ww->core.parent->core.parent->core.height;
+! oldWidth = (int)ww->core.parent->core.parent->core.width;
+!
+ if (event->type == GraphicsExpose)
+ (void) repaint_window ((TimeChartWidget)w, event->xgraphicsexpose.x,
+ event->xgraphicsexpose.width);
+***************
+*** 364,388 ****
+
+ SetPoints(w);
+
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ }
+ #endif
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ if ( left == 0 || left < LABEL_ROOM ) left = LABEL_ROOM;
+!
+ if (XtIsRealized((Widget)w)) {
+ Display *dpy = XtDisplay(w);
+ Window win = XtWindow(w);
+!
+ width += left - 1;
+ if (!scalewidth) scalewidth = width;
+!
+ if (next < ++width) width = next;
+!
+ w->time_chart.next_x = 0;
+ w->time_chart.last_end = 0;
+ w->time_chart.num_timestamps = 0;
+--- 369,393 ----
+
+ SetPoints(w);
+
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ }
+ #endif
+! if (XtIsRealized ((Widget) w))
+ XClearWindow (XtDisplay (w), XtWindow (w));
+
+ if ( left == 0 || left < LABEL_ROOM ) left = LABEL_ROOM;
+!
+ if (XtIsRealized((Widget)w)) {
+ Display *dpy = XtDisplay(w);
+ Window win = XtWindow(w);
+!
+ width += left - 1;
+ if (!scalewidth) scalewidth = width;
+!
+ if (next < ++width) width = next;
+!
+ w->time_chart.next_x = 0;
+ w->time_chart.last_end = 0;
+ w->time_chart.num_timestamps = 0;
+***************
+*** 425,431 ****
+ }
+ }
+ }
+! if ( oldInterval )
+ w->time_chart.interval = oldInterval;
+ }
+ return(next);
+--- 430,436 ----
+ }
+ }
+ }
+! if ( oldInterval )
+ w->time_chart.interval = oldInterval;
+ }
+ return(next);
+***************
+*** 461,474 ****
+ next = w->time_chart.interval = j;
+
+ XCopyArea(XtDisplay((Widget)w), XtWindow((Widget)w), XtWindow((Widget)w),
+! w->time_chart.hiGC,
+ (int) (w->core.width - j), 0, /* source x, y */
+ (unsigned int) j, (unsigned int) w->core.height, /* width, height */
+ 0, 0); /* dest x, y */
+
+
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! (int) j, 0,
+ (unsigned int) w->core.width - j, (unsigned int)w->core.height,
+ FALSE);
+
+--- 466,479 ----
+ next = w->time_chart.interval = j;
+
+ XCopyArea(XtDisplay((Widget)w), XtWindow((Widget)w), XtWindow((Widget)w),
+! w->time_chart.hiGC,
+ (int) (w->core.width - j), 0, /* source x, y */
+ (unsigned int) j, (unsigned int) w->core.height, /* width, height */
+ 0, 0); /* dest x, y */
+
+
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! (int) j, 0,
+ (unsigned int) w->core.width - j, (unsigned int)w->core.height,
+ FALSE);
+
+***************
+*** 480,489 ****
+ if ( j > 31 ) break;
+ w->time_chart.timestamp_end[j]--;
+ }
+!
+ if (w->time_chart.timestamp_end[0] <= LABEL_ROOM ) {
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! 0, 0,
+ LABEL_ROOM, (unsigned int)w->core.height,
+ FALSE);
+ for ( j=1; j < w->time_chart.num_timestamps; j++ ) {
+--- 485,494 ----
+ if ( j > 31 ) break;
+ w->time_chart.timestamp_end[j]--;
+ }
+!
+ if (w->time_chart.timestamp_end[0] <= LABEL_ROOM ) {
+! XClearArea(XtDisplay((Widget)w), XtWindow((Widget)w),
+! 0, 0,
+ LABEL_ROOM, (unsigned int)w->core.height,
+ FALSE);
+ for ( j=1; j < w->time_chart.num_timestamps; j++ ) {
+***************
+*** 491,497 ****
+ }
+ w->time_chart.num_timestamps--;
+ }
+!
+ return;
+ }
+
+--- 496,502 ----
+ }
+ w->time_chart.num_timestamps--;
+ }
+!
+ return;
+ }
+
+***************
+*** 516,532 ****
+ */
+ if ( w->time_chart.min_scale > (int) ((w->time_chart.max_value) + 1) )
+ ret_val = TRUE;
+!
+ if ( w->time_chart.fgpixel != old->time_chart.fgpixel ) {
+ new_gc |= FOREGROUND;
+ ret_val = True;
+ }
+!
+ if ( w->time_chart.hipixel != old->time_chart.hipixel ) {
+ new_gc |= HIGHLIGHT;
+ ret_val = True;
+ }
+!
+ DestroyGC(old, new_gc);
+ CreateGC(w, new_gc);
+
+--- 521,537 ----
+ */
+ if ( w->time_chart.min_scale > (int) ((w->time_chart.max_value) + 1) )
+ ret_val = TRUE;
+!
+ if ( w->time_chart.fgpixel != old->time_chart.fgpixel ) {
+ new_gc |= FOREGROUND;
+ ret_val = True;
+ }
+!
+ if ( w->time_chart.hipixel != old->time_chart.hipixel ) {
+ new_gc |= HIGHLIGHT;
+ ret_val = True;
+ }
+!
+ DestroyGC(old, new_gc);
+ CreateGC(w, new_gc);
+
+***************
+*** 554,560 ****
+ w->time_chart.points = NULL;
+ return;
+ }
+!
+ size = sizeof(XPoint) * (w->time_chart.scale - 1);
+
+ points = (XPoint *) XtRealloc( (XtPointer) w->time_chart.points, size);
+--- 559,565 ----
+ w->time_chart.points = NULL;
+ return;
+ }
+!
+ size = sizeof(XPoint) * (w->time_chart.scale - 1);
+
+ points = (XPoint *) XtRealloc( (XtPointer) w->time_chart.points, size);
diff --git a/sysutils/xperfmon3/files/patch-ba b/sysutils/xperfmon3/files/patch-ba
new file mode 100644
index 000000000000..3d9da29b31e4
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-ba
@@ -0,0 +1,146 @@
+*** ../xperfmon++/StripCharP.h Wed Jul 27 22:29:30 1994
+--- ./StripCharP.h Sun Jan 10 18:07:37 1999
+***************
+*** 1,7 ****
+ /*
+! * $XConsortium: StripCharP.h,v 1.3 89/11/11 14:53:47 kit Exp $
+! */
+!
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+--- 1,9 ----
+ /*
+! * Enhancement and error correction for FreeBSD-3.X
+! * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+! *
+! * $Id: StripCharP.h,v 3.2 1999/01/10 17:07:24 lkoeller Exp lkoeller $
+! */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+***************
+*** 9,21 ****
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+--- 11,23 ----
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+***************
+*** 31,37 ****
+ * 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
+--- 33,39 ----
+ * 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
+***************
+*** 42,48 ****
+ * 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
+--- 44,50 ----
+ * 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
+***************
+*** 62,71 ****
+ #define HIGHLIGHT 1 << 1
+ #define ALL_GCS (FOREGROUND | HIGHLIGHT)
+
+ /* New fields for the PerfChart widget instance record */
+
+ typedef struct {
+! double valuedata[2048]; /* record of data points */
+ Pixel fgpixel; /* color index for graph */
+ Pixel hipixel; /* color index for lines */
+ Pixel warnColor;
+--- 64,75 ----
+ #define HIGHLIGHT 1 << 1
+ #define ALL_GCS (FOREGROUND | HIGHLIGHT)
+
++ #define NUM_VALUES 2048
++
+ /* New fields for the PerfChart widget instance record */
+
+ typedef struct {
+! double valuedata[NUM_VALUES]; /* record of data points */
+ Pixel fgpixel; /* color index for graph */
+ Pixel hipixel; /* color index for lines */
+ Pixel warnColor;
+***************
+*** 74,90 ****
+ Pixel currentBG;
+ GC fgGC; /* graphics context for fgpixel */
+ GC hiGC; /* graphics context for hipixel */
+!
+ /* start of graph stuff */
+!
+ int highWarn; /* warning alert occurrs above this limit */
+ int highAlarm; /* alarm alert occurrs above this limit */
+ int lowWarn; /* low warning alert occurrs below this limit */
+ int lowAlarm; /* low alarm alert occurrs below this limit */
+ Boolean immediate; /* background is current point */
+ int update; /* update frequence */
+! int scale; /* scale factor */
+! int min_scale; /* smallest scale factor */
+ int interval; /* data point interval */
+ XPoint * points ; /* Poly point for repairing graph lines. */
+ Boolean reverse_video; /* display in reverse video */
+--- 78,94 ----
+ Pixel currentBG;
+ GC fgGC; /* graphics context for fgpixel */
+ GC hiGC; /* graphics context for hipixel */
+!
+ /* start of graph stuff */
+!
+ int highWarn; /* warning alert occurrs above this limit */
+ int highAlarm; /* alarm alert occurrs above this limit */
+ int lowWarn; /* low warning alert occurrs below this limit */
+ int lowAlarm; /* low alarm alert occurrs below this limit */
+ Boolean immediate; /* background is current point */
+ int update; /* update frequence */
+! int scale; /* scale factor */
+! int min_scale; /* smallest scale factor */
+ int interval; /* data point interval */
+ XPoint * points ; /* Poly point for repairing graph lines. */
+ Boolean reverse_video; /* display in reverse video */
diff --git a/sysutils/xperfmon3/files/patch-bb b/sysutils/xperfmon3/files/patch-bb
new file mode 100644
index 000000000000..43e610e72685
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-bb
@@ -0,0 +1,115 @@
+*** ../xperfmon++/TimeChart.h Wed Jul 27 22:29:31 1994
+--- ./TimeChart.h Sun Jan 10 18:07:14 1999
+***************
+*** 1,7 ****
+ /*
+! * $XConsortium: TimeChart.h,v 1.2 89/08/24 11:52:00 kit Exp $
+! */
+!
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+--- 1,9 ----
+ /*
+! * Enhancement and error correction for FreeBSD-3.X
+! * COPYRIGHT 1998 by Lars Köller <Lars.Koeller@Uni-Bielefeld.de>
+! *
+! * $Id: TimeChart.h,v 3.2 1999/01/10 17:07:04 lkoeller Exp lkoeller $
+! */
+
+ /***********************************************************
+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
+***************
+*** 9,21 ****
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+--- 11,23 ----
+
+ All Rights Reserved
+
+! Permission to use, copy, modify, and distribute this software and its
+! 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 names of Digital or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+! software without specific, written prior permission.
+
+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+***************
+*** 31,37 ****
+ * 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
+--- 33,39 ----
+ * 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
+***************
+*** 42,48 ****
+ * 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
+--- 44,50 ----
+ * 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
+***************
+*** 88,101 ****
+ #define XtCFillRect "FillRect"
+
+ #define XtNgetValue "getValue"
+! #define XtNhighlight "highlight"
+ #define XtNjumpScroll "jumpScroll"
+ #define XtNminScale "minScale"
+ #define XtNscale "scale"
+ #define XtNfillRect "fillRect"
+! #define XtNupdate "update"
+ #define XtNvmunix "vmunix"
+!
+ typedef struct _TimeChartRec *TimeChartWidget;
+ typedef struct _TimeChartClassRec *TimeChartWidgetClass;
+
+--- 90,103 ----
+ #define XtCFillRect "FillRect"
+
+ #define XtNgetValue "getValue"
+! /* #define XtNhighlight "highlight" in /usr/X11/include/X11/StringDefs.h */
+ #define XtNjumpScroll "jumpScroll"
+ #define XtNminScale "minScale"
+ #define XtNscale "scale"
+ #define XtNfillRect "fillRect"
+! /* #define XtNupdate "update" in /usr/X11/include/X11/StringDefs.h */
+ #define XtNvmunix "vmunix"
+!
+ typedef struct _TimeChartRec *TimeChartWidget;
+ typedef struct _TimeChartClassRec *TimeChartWidgetClass;
+
diff --git a/sysutils/xperfmon3/files/patch-bc b/sysutils/xperfmon3/files/patch-bc
new file mode 100644
index 000000000000..c91bbd75d3d8
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-bc
@@ -0,0 +1,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
+ };
diff --git a/sysutils/xperfmon3/files/patch-ca b/sysutils/xperfmon3/files/patch-ca
new file mode 100644
index 000000000000..8cd86efae204
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-ca
@@ -0,0 +1,40 @@
+*** ../xperfmon++/Imakefile Wed Jul 27 22:29:29 1994
+--- ./Imakefile Wed Dec 2 23:33:54 1998
+***************
+*** 17,31 ****
+ SYS_MODULE= sgi_system
+ #endif
+
+! EXTRA_LIBRARIES = $(SUNFLAGS) $(MIPSFLAGS) $(SGIFLAGS)
+
+ INSTPGMFLAGS = $(INSTKMEMFLAGS)
+! LOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XMULIB) $(XLIB)
+ INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11
+! # INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11 -I/usr/include/bsd
+! CDEBUGFLAGS = -O
+! SRCS = TimeChart.c StripChart.c misc.c $(SYS_MODULE).c xperfmon.c nfs.c
+! OBJS = TimeChart.o StripChart.o misc.o $(SYS_MODULE).o xperfmon.o nfs.o
+
+ ComplexProgramTarget(xperfmon++)
+
+--- 17,36 ----
+ SYS_MODULE= sgi_system
+ #endif
+
+! #if defined (FreeBSDArchitecture)
+! FreeBSDFLAGS= -lkvm -ldevstat
+! SYS_MODULE= freebsd_system
+! CC= gcc
+! EXTRA_DEFINES= -DHAVE_SYS_PARAM_H
+! #endif
+!
+! EXTRA_LIBRARIES = $(SUNFLAGS) $(MIPSFLAGS) $(SGIFLAGS) $(FreeBSDFLAGS)
+
+ INSTPGMFLAGS = $(INSTKMEMFLAGS)
+! LOCAL_LIBRARIES = -lXaw -lXt -lXmu -lX11
+ INCLUDES = -I. -I$(TOOLKITSRC) -I$(TOP) -I$(TOP)/X11
+! SRCS = TimeChart.c StripChart.c misc.c $(SYS_MODULE).c xperfmon.c
+! OBJS = TimeChart.o StripChart.o misc.o $(SYS_MODULE).o xperfmon.o
+
+ ComplexProgramTarget(xperfmon++)
+
diff --git a/sysutils/xperfmon3/files/patch-cb b/sysutils/xperfmon3/files/patch-cb
new file mode 100644
index 000000000000..21562c5a347c
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-cb
@@ -0,0 +1,71 @@
+*** ../xperfmon++/README Wed Jul 27 22:29:30 1994
+--- ./README Thu Oct 15 21:25:22 1998
+***************
+*** 6,12 ****
+ program will compile correctly under X11R5 and/or Motif.
+
+ 1-11-94 Revised by Roger Smith, Sterling Software @NASA-Ames Research Center,
+! rsmith@proteus.arc.nasa.gov.
+ Changed name to "xperfmon++".
+ Replaced Perfmon widget with a highly modified StripChart widget. Charts
+ now smooth scroll, scales update immediately, and there is a scrolling timestamp
+--- 6,12 ----
+ program will compile correctly under X11R5 and/or Motif.
+
+ 1-11-94 Revised by Roger Smith, Sterling Software @NASA-Ames Research Center,
+! rsmith@proteus.arc.nasa.gov.
+ Changed name to "xperfmon++".
+ Replaced Perfmon widget with a highly modified StripChart widget. Charts
+ now smooth scroll, scales update immediately, and there is a scrolling timestamp
+***************
+*** 18,20 ****
+--- 18,66 ----
+ Research Center, rsmith@proteus.arc.nasa.gov. Imake will build for correct
+ O/S if x11r5 is fully installed in all the right places.
+
++
++ 3-15-95 Completely new port of systemdependent file (bsd_system.c) for FreeBSD-2.X
++ by Lars Köller @University of Rostock, Germany.
++ E-Mail: <lars.koeller@odie.physik2.uni-rostock.de>
++
++ 8-16-95 Quick and dirty workaround of -geometry option bug.
++ But there are still some side effects when changing the geometry.
++ Fix memory leak in bsd_system.c
++ by Lars Köller @University of Rostock, Germany.
++ E-Mail: <lars.koeller@odie.physik2.uni-rostock.de>
++
++ 30-10-95 Change 'Free Mem' graph to 'Free Swap' cause the FreeBSD memory system
++ tries to minimize the free unused amount of memory.
++ Include basic support for FreeBSD > 2.1.
++ Number of interrupts now independent from 'Update Intervall'
++ by Lars Köller @University of Rostock, Germany.
++ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
++
++ 11-12-95 Fix -geometry bug! Now there is only a MIN_WIDTH of 185 pixels, and the
++ MIN_HEIGTH is calculates dynamically depending on the number of active
++ graphs. FreeBSD-2.X only:
++ Change 'Free Swap' graph from absolut into percent values.
++ All graphs shoud be independent of the 'Update Intervall'.
++ Modify graph labels and add unit of each graph.
++ by Lars Köller @University of Rostock, Germany.
++ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
++
++ 5-4-96 Fix some event problems that consumes a lot of cpu power after resizing
++ (mwm) or restart of an window manager. Make xperfmon compile with
++ FreeBSD-current (2.2, changes in get_swapspace)
++ by Lars Köller @University of Rostock, Germany.
++ E-Mail: <Lars_Koeller@odie.physik2.uni-rostock.de>
++
++ 4-30-98 Add System Load graph
++ Add CPU Nice and Interrupt graph
++ Compiles on FreeBSD-2.2.X and 3.X
++ by Lars Köller @University of Bielefeld, Germany.
++ E-Mail: Lars.Koeller@Uni-Bielefeld.DE
++
++ 10-10-98 Add graphs for: disk/tape/cdrom transfers, disktape/cdrom io in MB/s,
++ NFS client and server cache hits/misses
++ Complete rewrite of freebsd_system.c!
++ Graphs now scales and displays floating point values correctly
++ Compiles on FreeBSD-3.X
++ by Lars Köller @University of Bielefeld, Germany.
++ E-Mail: Lars.Koeller@Uni-Bielefeld.DE
diff --git a/sysutils/xperfmon3/files/patch-cc b/sysutils/xperfmon3/files/patch-cc
new file mode 100644
index 000000000000..c0a989563dde
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-cc
@@ -0,0 +1,116 @@
+*** ../xperfmon++/XPerfmon++.ad Wed Jul 27 22:29:32 1994
+--- ./XPerfmon++.ad Sun Oct 25 11:49:15 1998
+***************
+*** 1,27 ****
+ ! the following specification would set all highAlarm values to 99998.
+ ! this will turn on a green color background for all graphs, even if no other
+! ! resources are set for that graph. Note that if this specification is
+ ! commented out, the "NFS Server" graph background will be the application
+ ! default color, unless some other resource file has specified it.
+ ! *PerfChart.highAlarm: 99998
+! *perfChartIdle.lowWarn: 10
+! *perfChartIdle.lowAlarm: 5
+! *perfChartUser.highAlarm: 90
+! *perfChartUser.highWarn: 75
+! *perfChartSystem.highAlarm: 90
+! *perfChartSystem.highWarn: 75
+! *perfChartFree.lowWarn: 2000
+! *perfChartFree.lowAlarm: 1000
+! *perfChartDisk.highWarn: 25
+! *perfChartDisk.highAlarm: 50
+! *perfChartIntrpts.highWarn: 500
+! *perfChartIntrpts.highAlarm: 750
+! *perfChartInput.highWarn: 300
+! *perfChartInput.highAlarm: 500
+! *perfChartOutput.highWarn: 300
+! *perfChartOutput.highAlarm: 500
+! *perfChartCollision.highWarn: 20
+! *perfChartCollision.highAlarm: 50
+! *perfChartNFSClient.highWarn: 200
+! *perfChartNFSClient.highAlarm: 400
+ *font: 6x13
+--- 1,84 ----
+ ! the following specification would set all highAlarm values to 99998.
+ ! this will turn on a green color background for all graphs, even if no other
+! ! resources are set for that graph. Note that if this specification is
+ ! commented out, the "NFS Server" graph background will be the application
+ ! default color, unless some other resource file has specified it.
+ ! *PerfChart.highAlarm: 99998
+!
+ *font: 6x13
++
++ ! Remember Load*100 is shown in the graph!
++ *perfChartLoad.highAlarm: 800
++ *perfChartLoad.highWarn: 400
++
++ *perfChartUser.highAlarm: 95
++ *perfChartUser.highWarn: 75
++
++ *perfChartNice.highAlarm: 75
++ *perfChartNice.highWarn: 55
++
++ *perfChartSystem.highAlarm: 40
++ *perfChartSystem.highWarn: 25
++
++ *perfChartInter.highAlarm: 40
++ *perfChartInter.highWarn: 25
++
++ *perfChartIdle.lowWarn: 10
++ *perfChartIdle.lowAlarm: 5
++
++ *perfChartTtyin.highWarn: 2000
++ *perfChartTtyin.highAlarm: 5000
++
++ *perfChartTtyout.highWarn: 20000
++ *perfChartTtyout.highAlarm: 30000
++
++ *perfChartIntrpts.highWarn: 400
++ *perfChartIntrpts.highAlarm: 600
++
++ *perfChartSwap.lowWarn: 20
++ *perfChartSwap.lowAlarm: 10
++
++ *perfChartDiskXfr.highWarn: 500
++ *perfChartDiskXfr.highAlarm: 1000
++
++ *perfChartDiskMB.highWarn: 10
++ *perfChartDiskMB.highAlarm: 20
++
++ *perfChartTapeXfr.highWarn: 500
++ *perfChartTapeXfr.highAlarm: 1000
++
++ *perfChartTapeMB.highWarn: 10
++ *perfChartTapeMB.highAlarm: 20
++
++ *perfChartCDRomXfr.highWarn: 500
++ *perfChartCDRomXfr.highAlarm: 1000
++
++ *perfChartCDRomMB.highWarn: 10
++ *perfChartCDRomMB.highAlarm: 20
++
++ *perfChartInput.highWarn: 2000
++ *perfChartInput.highAlarm: 5000
++
++ *perfChartOutput.highWarn: 2000
++ *perfChartOutput.highAlarm: 5000
++
++ *perfChartCollision.highWarn: 50
++ *perfChartCollision.highAlarm: 100
++
++ *perfChartNFSServerCalls.highWarn: 500
++ *perfChartNFSServerCalls.highAlarm: 1000
++
++ *perfChartNFSServerHits.lowWarn: -1
++ *perfChartNFSServerHits.lowAlarm: -1
++
++ *perfChartNFSServerMisses.highWarn: 400
++ *perfChartNFSServerMisses.highAlarm: 600
++
++ *perfChartNFSClientCalls.highWarn: 500
++ *perfChartNFSClientCalls.highAlarm: 1000
++
++ *perfChartNFSClientHits.lowWarn: -1
++ *perfChartNFSClientHits.lowAlarm: -1
++
++ *perfChartNFSClientMisses.highWarn: 400
++ *perfChartNFSClientMisses.highAlarm: 600
diff --git a/sysutils/xperfmon3/files/patch-cd b/sysutils/xperfmon3/files/patch-cd
new file mode 100644
index 000000000000..043f5df02764
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-cd
@@ -0,0 +1,631 @@
+*** ../xperfmon++/xperfmon++.man Wed Jul 27 22:29:39 1994
+--- ./xperfmon++.man Sun Jan 10 21:28:14 1999
+***************
+*** 1,5 ****
+! ./" .TH XPERFMON++ 1 "19 January 1988" "X Version 11"
+! .TH XPERFMON++ 1 "January 1994" "X Version 11"
+ .SH NAME
+ xperfmon++ - X Window System-based performance monitor
+ .SH SYNOPSIS
+--- 1,4 ----
+! .TH XPERFMON++ 1 "10 Oct 1998" "V3.0 for FreeBSD-3.X"
+ .SH NAME
+ xperfmon++ - X Window System-based performance monitor
+ .SH SYNOPSIS
+***************
+*** 20,51 ****
+ The program can produce a filled graph or a line graph and the update interval can be set in
+ seconds or 100-millisecond intervals.
+ .PP
+! While
+ .I xperfmon++
+ is running, it is possible to perform certain tasks by pressing keys over
+ the window:
+ .PP
+ .br
+! .B Q/q:
+ Quit... Exit gracefully
+ .br
+! .B l | L:
+ Print out a chart of all current limit settings. This chart will appear in the
+ window from which xperfmon++ was invoked.
+ .br
+! .B s:
+ Decrease update interval (slower) by a small amount
+ .br
+! .B S:
+ Decrease update interval (slower) by a large amount
+ .br
+! .B f:
+ Increase update interval (faster) by a small amount
+ .br
+! .B F:
+ Increase update interval (faster) by a large amount
+ .br
+! .B ?:
+ Help
+ .SH OPTIONS
+ .PP
+--- 19,50 ----
+ The program can produce a filled graph or a line graph and the update interval can be set in
+ seconds or 100-millisecond intervals.
+ .PP
+! While
+ .I xperfmon++
+ is running, it is possible to perform certain tasks by pressing keys over
+ the window:
+ .PP
+ .br
+! .B Q/q:
+ Quit... Exit gracefully
+ .br
+! .B l | L:
+ Print out a chart of all current limit settings. This chart will appear in the
+ window from which xperfmon++ was invoked.
+ .br
+! .B s:
+ Decrease update interval (slower) by a small amount
+ .br
+! .B S:
+ Decrease update interval (slower) by a large amount
+ .br
+! .B f:
+ Increase update interval (faster) by a small amount
+ .br
+! .B F:
+ Increase update interval (faster) by a large amount
+ .br
+! .B ?:
+ Help
+ .SH OPTIONS
+ .PP
+***************
+*** 79,108 ****
+ .PP
+ The following options specify the list of statistics to be displayed.
+ If none are present on the command line, then all statistics are displayed.
+! If any "+" options are listed the default list is cleared and only those
+ listed as "+" options are displayed.
+ If any "-" options are listed, then they are taken away from the
+ default list. Specifying both "-" and "+" options will produce unpredictable
+ results.
+ .TP 26
+ .B \-usercpu | \+usercpu
+ Graph percentage of \fIUser CPU Time\fP.
+ .TP 26
+ .B \-systemcpu | \+systemcpu
+! Graph \fISystem\fP CPU Percentage.
+ .TP 26
+ .B \-idlecpu | \+idlecpu
+! Graph \fIIdle\fP CPU Percentage.
+ .TP 26
+! .B \-freemem | \+freemem
+! Graph \fIFree Memory\fP.
+ .TP 26
+! .B \-diskxfr | \+diskxfr
+! Graph \fIDisk Transfers\fP per interval period.
+ .TP 26
+ .B \-interrputs | \+interrupts
+ Graph \fISystem Interrupts\fP.
+ .TP 26
+ .B \-inputpkts | \+inputpkts
+ Graph number of network \fIInput Packets\fP.
+ .TP 26
+--- 78,137 ----
+ .PP
+ The following options specify the list of statistics to be displayed.
+ If none are present on the command line, then all statistics are displayed.
+! If any "+" options are listed the default list is cleared and only those
+ listed as "+" options are displayed.
+ If any "-" options are listed, then they are taken away from the
+ default list. Specifying both "-" and "+" options will produce unpredictable
+ results.
+ .TP 26
++ .B \-sysload | \+sysload
++ Graph percentage of \fISystem Load\fP (avaraged over 1 minute).
++ .TP 26
+ .B \-usercpu | \+usercpu
+ Graph percentage of \fIUser CPU Time\fP.
+ .TP 26
++ .B \-nicecpu | \+nicecpu
++ Graph percentage of \fINice CPU Time\fP.
++ .TP 26
+ .B \-systemcpu | \+systemcpu
+! Graph percentage of \fISystem CPU Time\fP.
+! .TP 26
+! .B \-intercpu | \+intercpu
+! Graph percentage of \fIInterrupt CPU Time\fP.
+ .TP 26
+ .B \-idlecpu | \+idlecpu
+! Graph percentage of \fIIdle CPU Time\fP.
+ .TP 26
+! .B \-ttyin | \+ttyin
+! Graph \fItty input characters\fP per second of.
+ .TP 26
+! .B \-ttyout | \+ttyout
+! Graph \fItty output characters\fP per second of.
+ .TP 26
+ .B \-interrputs | \+interrupts
+ Graph \fISystem Interrupts\fP.
+ .TP 26
++ .B \-freeswap | \+freeswap
++ Graph \fIFree Swap in %\fP.
++ .TP 26
++ .B \-diskxfr | \+diskxfr
++ Graph \fIDisk Transfers\fP per second.
++ .TP 26
++ .B \-diskmb | \+diskmb
++ Graph \fIamount of Data tranfered from/to Disk\fP in MByte per second.
++ .TP 26
++ .B \-tapexfr | \+tapexfr
++ Graph \fITape Transfers\fP per second.
++ .TP 26
++ .B \-tapemb | \+tapemb
++ Graph \fIamount of Data tranfered from/to Tape\fP in MByte per second.
++ .TP 26
++ .B \-cdromxfr | \+cdromxfr
++ Graph \fICDRom Transfers\fP per second.
++ .TP 26
++ .B \-cdrommb | \+cdrommb
++ Graph \fIamount of Data tranfered from CDRom\fP in MByte per second.
++ .TP 26
+ .B \-inputpkts | \+inputpkts
+ Graph number of network \fIInput Packets\fP.
+ .TP 26
+***************
+*** 112,132 ****
+ .B \-collpkts | \+collpkts
+ Graph number of network \fICollision Packets\fP.
+ .TP 26
+! .B \-nfsclient | \+nfsclient
+! Graph Number of \fINFS Client\fP transactions.
+ .TP 26
+! .B \-nfsserver | \+nfsserver
+! Graph number of \fINFS Server\fP transactions.
+ .SH LIMIT OPTIONS
+ .PP
+ .sp
+ \fIxperfmon++\fP will accept a number of \fIlimit\fP options. When a data point
+ exceeds a high or low limit the background of that graph changes color to visually reflect
+! the condition. The background color is an indication of the min (low limit) or max (high limit)
+ value currently contained
+ in the graph. When no limit has been exceeded the background color is set to green. If no limits have
+! been set for that graph its background color remains the same as the applications default color,
+! which is usually white.
+ .PP
+ WARNING: High and Low limits are mutually exclusive, i.e., you can set high limits or low limits, but
+ not both. If both are inadvertently set, the high limits are checked first, and the low limit will be
+--- 141,173 ----
+ .B \-collpkts | \+collpkts
+ Graph number of network \fICollision Packets\fP.
+ .TP 26
+! .B \-nfsservercalls | \+nfsservercalls
+! Graph Number of \fINFS Server transactions\fP.
+! .TP 26
+! .B \-nfsserverhits | \+nfsserverhits
+! Graph Number of \fINFS Server Cache Hits\fP.
+! .TP 26
+! .B \-nfsservermisses | \+nfsservermisses
+! Graph Number of \fINFS Server Cache Misses\fP.
+! .TP 26
+! .B \-nfsclientcalls | \+nfsclientcalls
+! Graph Number of \fINFS Client transactions\fP.
+! .TP 26
+! .B \-nfsclienthits | \+nfsclienthits
+! Graph Number of \fINFS Client Cache Hits\fP.
+ .TP 26
+! .B \-nfsclientmisses | \+nfsclientmisses
+! Graph Number of \fINFS Client Cache Misses\fP.
+ .SH LIMIT OPTIONS
+ .PP
+ .sp
+ \fIxperfmon++\fP will accept a number of \fIlimit\fP options. When a data point
+ exceeds a high or low limit the background of that graph changes color to visually reflect
+! the condition. The background color is an indication of the min (low limit) or max (high limit)
+ value currently contained
+ in the graph. When no limit has been exceeded the background color is set to green. If no limits have
+! been set for that graph its background color remains the same as the applications default color,
+! which is usually white.
+ .PP
+ WARNING: High and Low limits are mutually exclusive, i.e., you can set high limits or low limits, but
+ not both. If both are inadvertently set, the high limits are checked first, and the low limit will be
+***************
+*** 135,141 ****
+ There are four possible \fIlimit\fP conditions:
+ .TP 16
+ .B High Warning
+! When any value in the current graph exceeds the \fIhigh warning\fP limit
+ the background color of that graph is changed to \fIyellow\fP.
+ .TP 16
+ .B Low Warning
+--- 176,182 ----
+ There are four possible \fIlimit\fP conditions:
+ .TP 16
+ .B High Warning
+! When any value in the current graph exceeds the \fIhigh warning\fP limit
+ the background color of that graph is changed to \fIyellow\fP.
+ .TP 16
+ .B Low Warning
+***************
+*** 164,190 ****
+ .TP 26
+ .B \-high*Warn \fIvalue\fP
+ Set high Warning value for *.
+! .PP
+ Where "*" is one of the following:
+ .TP 12
+ .B user
+ Set \fIlimit\fP value for User CPU Percentage.
+ .TP 12
+ .B sys
+ Set \fIlimit\fP value for System CPU Percentage.
+ .TP 12
+ .B idle
+ Set \fIlimit\fP value for Idle CPU Percentage.
+ .TP 12
+! .B mem
+! Set \fIlimit\fP value for Free Memory.
+ .TP 12
+! .B disk
+! Set \fIlimit\fP value for Disk Transfers.
+ .TP 12
+ .B intrpts
+ Set \fIlimit\fP value for System Interrupts.
+ .TP 12
+ .B input
+ Set \fIlimit\fP value for network Input Packets.
+ .TP 12
+--- 205,261 ----
+ .TP 26
+ .B \-high*Warn \fIvalue\fP
+ Set high Warning value for *.
+! .PP
+ Where "*" is one of the following:
+ .TP 12
++ .B load
++ Set \fIlimit\fP value for Load Average.
++ .TP 12
+ .B user
+ Set \fIlimit\fP value for User CPU Percentage.
+ .TP 12
++ .B nice
++ Set \fIlimit\fP value for Nice CPU Percentage.
++ .TP 12
+ .B sys
+ Set \fIlimit\fP value for System CPU Percentage.
+ .TP 12
++ .B inter
++ Set \fIlimit\fP value for Interrupt CPU Percentage.
++ .TP 12
+ .B idle
+ Set \fIlimit\fP value for Idle CPU Percentage.
+ .TP 12
+! .B ttyin
+! Set \fIlimit\fP value for TTY input characters per second.
+ .TP 12
+! .B ttyout
+! Set \fIlimit\fP value for TTY output characters per second.
+ .TP 12
+ .B intrpts
+ Set \fIlimit\fP value for System Interrupts.
+ .TP 12
++ .B swap
++ Set \fIlimit\fP value for Free Swap.
++ .TP 12
++ .B diskxfr
++ Set \fIlimit\fP value for Disk Transfers.
++ .TP 12
++ .B diskmb
++ Set \fIlimit\fP value for Disk Transfers.
++ .TP 12
++ .B tapexfr
++ Set \fIlimit\fP value for Tape Transfers.
++ .TP 12
++ .B tapemb
++ Set \fIlimit\fP value for Tape Transfers.
++ .TP 12
++ .B cdromxfr
++ Set \fIlimit\fP value for CDRom Transfers.
++ .TP 12
++ .B cdrommb
++ Set \fIlimit\fP value for CDRom Transfers.
++ .TP 12
+ .B input
+ Set \fIlimit\fP value for network Input Packets.
+ .TP 12
+***************
+*** 194,204 ****
+ .B collision
+ Set \fIlimit\fP value for network Collision Packets.
+ .TP 12
+! .B nfsclient
+ Set \fIlimit\fP value for NFS Client Transactions.
+ .TP 12
+! .B nfsserver
+! Set \fIlimit\fP value for NFS Server Transactions.
+ .PP
+ For example:
+ .TP 16
+--- 265,287 ----
+ .B collision
+ Set \fIlimit\fP value for network Collision Packets.
+ .TP 12
+! .B nfsservercalls
+! Set \fIlimit\fP value for NFS Server Transactions.
+! .TP 12
+! .B nfssserverhits
+! Set \fIlimit\fP value for NFS Server Cache Hits.
+! .TP 12
+! .B nfsservermisses
+! Set \fIlimit\fP value for NFS Server Cache Misses.
+! .TP 12
+! .B nfsclientcalls
+ Set \fIlimit\fP value for NFS Client Transactions.
+ .TP 12
+! .B nfsclienthits
+! Set \fIlimit\fP value for NFS Client Cache Hits.
+! .TP 12
+! .B nfsclientmisses
+! Set \fIlimit\fP value for NFS Client Cache Misses.
+ .PP
+ For example:
+ .TP 16
+***************
+*** 206,212 ****
+ Set \fIlow user Alarm\fP value to 25.
+ .PP
+ As with any X-based command line specification you only need specify the minimum number of
+! characters required to make the string unique.
+ See below for a description of setting \fIlimit\fP values using application resource specifications.
+ .SH TOOLKIT OPTIONS
+ .PP
+--- 289,295 ----
+ Set \fIlow user Alarm\fP value to 25.
+ .PP
+ As with any X-based command line specification you only need specify the minimum number of
+! characters required to make the string unique.
+ See below for a description of setting \fIlimit\fP values using application resource specifications.
+ .SH TOOLKIT OPTIONS
+ .PP
+***************
+*** 304,327 ****
+ .PP
+ Where "&" is one of the following (Note: \fICase\fP IS important):
+ .TP 16
+! .B Idle
+! Set Idle CPU Percentage resource.
+ .TP 16
+ .B User
+ Set User CPU Percentage resource.
+ .TP 16
+ .B System
+ Set System CPU Percentage resource.
+ .TP 16
+! .B Free
+! Set Free Memory resource.
+ .TP 16
+! .B Disk
+! Set Disk Transfer count resource.
+ .TP 16
+ .B Intrpts
+ Set System Interrupts resource.
+ .TP 16
+ .B Input
+ Set network Input Packets resource.
+ .TP 16
+--- 387,440 ----
+ .PP
+ Where "&" is one of the following (Note: \fICase\fP IS important):
+ .TP 16
+! .B Load
+! Set System Load resource.
+ .TP 16
+ .B User
+ Set User CPU Percentage resource.
+ .TP 16
++ .B Nice
++ Set Nice CPU Percentage resource.
++ .TP 16
+ .B System
+ Set System CPU Percentage resource.
+ .TP 16
+! .B Inter
+! Set Interrupt CPU Percentage resource.
+ .TP 16
+! .B Idle
+! Set Idle CPU Percentage resource.
+! .TP 16
+! .B Ttyin
+! Set TTY characters input resource.
+! .TP 16
+! .B Ttyout
+! Set TTY output characters resource.
+ .TP 16
+ .B Intrpts
+ Set System Interrupts resource.
+ .TP 16
++ .B Swap
++ Set Free Swap resource.
++ .TP 16
++ .B DiskXfr
++ Set Disk Transfer count resource.
++ .TP 16
++ .B DiskMB
++ Set Disk Transfer MByte/s resource.
++ .TP 16
++ .B TapeXfr
++ Set Tape Transfer count resource.
++ .TP 16
++ .B TapeMB
++ Set Tape Transfer MByte/s resource.
++ .TP 16
++ .B CDRomXfr
++ Set CDRom Transfer count resource.
++ .TP 16
++ .B CDRomMB
++ Set CDRom Transfer MByte/s resource.
++ .TP 16
+ .B Input
+ Set network Input Packets resource.
+ .TP 16
+***************
+*** 331,341 ****
+ .B Collision
+ Set network Collision Packets resource.
+ .TP 16
+! .B NFSClient
+ Set NFS Client Transactions resource.
+ .TP 16
+! .B NFSServer
+! Set NFS Server Transactions resource.
+ .PP
+ For example:
+ .TP 29
+--- 444,466 ----
+ .B Collision
+ Set network Collision Packets resource.
+ .TP 16
+! .B NFSServerCalls
+! Set NFS Server Transactions resource.
+! .TP 16
+! .B NFSServerHits
+! Set NFS Server Cache Hits resource.
+! .TP 16
+! .B NFSServerMisses
+! Set NFS Server Cache Misses resource.
+! .TP 16
+! .B NFSClientCalls
+ Set NFS Client Transactions resource.
+ .TP 16
+! .B NFSClientHits
+! Set NFS Client Cache Hits resource.
+! .TP 16
+! .B NFSClientMisses
+! Set NFS Client Cache Misses resource.
+ .PP
+ For example:
+ .TP 29
+***************
+*** 354,366 ****
+ .SH BUGS
+ .I xperfmon++
+ requires the ability to open and read the special system file
+! .I /dev/kmem.
+ On most systems, this requires the
+ .I suid
+ (set user id) bit to be set with root ownership, or the
+ .I sgid
+! (set group id) bit to be set and membership in the same group as
+! .I /dev/kmem.
+ .PP
+ Reading /dev/kmem is inherently non-portable. Therefore, the widget upon
+ which this application is based must be ported to each new operating system.
+--- 479,491 ----
+ .SH BUGS
+ .I xperfmon++
+ requires the ability to open and read the special system file
+! .I /dev/kmem.
+ On most systems, this requires the
+ .I suid
+ (set user id) bit to be set with root ownership, or the
+ .I sgid
+! (set group id) bit to be set and membership in the same group as
+! .I /dev/kmem.
+ .PP
+ Reading /dev/kmem is inherently non-portable. Therefore, the widget upon
+ which this application is based must be ported to each new operating system.
+***************
+*** 371,377 ****
+ by fully covering the xperfmon++ window and then exposing it, or by iconifying the
+ xperfmon++ window and then de-iconifying it.
+ .SH AUTHORS
+! The X11 version of
+ .I xperfmon
+ was written by Emanuel Jay Berkenbilt, Project Athena on
+ 1/21/1988.
+--- 496,502 ----
+ by fully covering the xperfmon++ window and then exposing it, or by iconifying the
+ xperfmon++ window and then de-iconifying it.
+ .SH AUTHORS
+! The X11 version of
+ .I xperfmon
+ was written by Emanuel Jay Berkenbilt, Project Athena on
+ 1/21/1988.
+***************
+*** 381,387 ****
+ was modified by Thomas Bagli, PCS Computer Systeme GmbH, West Germany, to
+ be a toolkit-based client.
+ .PP
+! .I xperfmon++
+ was created from \fIxperfmon\fP, and the Athena StripChart Widget,
+ by Roger Smith, Sterling Software @ NASA-Ames Research Center, Moffett Field, California. Version 1.0
+ was released in January, 1994.
+--- 506,512 ----
+ was modified by Thomas Bagli, PCS Computer Systeme GmbH, West Germany, to
+ be a toolkit-based client.
+ .PP
+! .I xperfmon++
+ was created from \fIxperfmon\fP, and the Athena StripChart Widget,
+ by Roger Smith, Sterling Software @ NASA-Ames Research Center, Moffett Field, California. Version 1.0
+ was released in January, 1994.
+***************
+*** 389,398 ****
+ If you like this program, or if you have difficulties, I would like to hear your comments.
+ E-Mail me at rsmith@proteus.arc.nasa.gov.
+ .PP
+! .I xperfmon++
+ was written for Suns running SunOs and X11R5 Windows software. If some energetic soul
+ out there would like to port this program to any other operating system or architecture I would be
+ glad to incorporate the modifications into this master copy. Send me your changes via E-Mail at the
+ above address.
+ .PP
+ Enjoy!
+--- 514,561 ----
+ If you like this program, or if you have difficulties, I would like to hear your comments.
+ E-Mail me at rsmith@proteus.arc.nasa.gov.
+ .PP
+! .I xperfmon++
+ was written for Suns running SunOs and X11R5 Windows software. If some energetic soul
+ out there would like to port this program to any other operating system or architecture I would be
+ glad to incorporate the modifications into this master copy. Send me your changes via E-Mail at the
+ above address.
++ .PP
++ .I xperfmon++ V1.2 for FreeBSD
++ was written by Lars Köller with a lot of helpful notes by Jörg Wunsch.
++ .PP
++ .I xperfmon++ V1.31 for FreeBSD
++ closes some memory leaks, fix geometry (resize) bug, display free swap
++ in percent and avoids resizing of the graph.
++ .PP
++ .I xperfmon++ V1.33 for FreeBSD
++ contains some fixes due to event problems and compiles fine under
++ FreeBSD 2.2 (changes in get_swapspace).
++ Now the -geometry switch works well!
++ .PP
++ .I xperfmon++ V1.40 for FreeBSD
++ contains some fixes due to changes in the networking structs and
++ cleans up the FreeBSD version number #if's. Now it should compile fine
++ from FreeBSD 2.0 up to FreeBSD-3.0-current.
++ .PP
++ .I xperfmon++ V2.0 for FreeBSD 2.2.X and 3.X
++ added System Load, Nice and Interrupt CPU graphs.
++ Should compile fine from FreeBSD 2.2 up to FreeBSD-3.X with CAM and devstat
++ library (Many thanks to Gary Jennejohn <garyj@muc.de> and
++ Simon Shapiro <shimon@simon-shapiro.org> for integrating the devstat
++ changes into xperfmon++.
++ .PP
++ .I xperfmon++ V3.0 for FreeBSD 3.X
++ added graphs for terminal IO, disk/tape/cdrom transfers and IO in MByte/s.
++ Further NFS server/client cache hits and misses. Rewriting of freebsd_system.c
++ and migration to the devstat library (Many thanks to Kenneth D. Merry
++ <ken@plutotech.com>). Scaling of the graphs changed from integer to floating
++ point values (-> system load is now displayed as is, and not mutliplied with
++ 100!, this improvement was also necessary to display useful tranfer rates in
++ MBytes/s). Further bugs in autocalculating the window size dependent on the
++ number of graphs and rescaling the window fixed (hope this was the last time).
++ Output of Warn/Alarm values (press L|l in xperfmon++ window) corrected.
++ .PP
++ Please E-Mail any bugs or comments with the subject
++ "xperfmon++ V3: ..." to Lars.Koeller@Uni-Bielefeld.DE or lkoeller@cc.FH-Lippe.DE.
+ .PP
+ Enjoy!
diff --git a/sysutils/xperfmon3/pkg-comment b/sysutils/xperfmon3/pkg-comment
index a97c188996ad..c8a72a071674 100644
--- a/sysutils/xperfmon3/pkg-comment
+++ b/sysutils/xperfmon3/pkg-comment
@@ -1 +1 @@
-A graphical X11 system performance monitor.
+xperfmon++ : A graphical X11 system performance monitor.
diff --git a/sysutils/xperfmon3/pkg-descr b/sysutils/xperfmon3/pkg-descr
index 34dcd3d4a811..1acad540cf1b 100644
--- a/sysutils/xperfmon3/pkg-descr
+++ b/sysutils/xperfmon3/pkg-descr
@@ -1,38 +1,22 @@
-This package contains the binary release of xperfmon++ V2.0 a X based
-system performance meter for several systems, ported to FreeBSD 2.2.X
-and FreeBSD-3.X.
+This package contains the binary release of xperfmon++ V3.0 a X based
+system performance meter for several systems, ported to FreeBSD-3.X
+with addition of many new features.
The program monitors:
system load, user-, nice-, system-, interrupt-, idle-cputime,
- free swap, disk io, number of interrupts,
- network-input, -output, -collision packets and
- NFS client and server activity.
+ free swap, disk/tape/cdrom transfers, disktape/cdrom io in MB/s,
+ number of interrupts, network-input, -output, -collision packets and
+ NFS client and server activity and cache hits/misses.
Please send BUGS and annotations to: Lars.Koeller@Uni-Bielefeld.DE
-Major changes in xperfmon++ V1.3 due to xperfmon++ V1.1:
+Changes from xperfmon++ V2.0 to xperfmon++ V3.0:
- - Clean fix of the -geometry option bug, now there is only
- a MIN_WIDTH of 185 pixels. The MIN_HEIGTH is calculated
- dynamically out of the number of active graphs.
- - Display 'Free Swap' in percent without resizing of the graph
- - Close some memory leaks
- - Display unit of graph in label field.
+ - Complete rewirte of freebsd_system.c (now it has a clear structure,
+ separate procedures for each different type of statistic gathered)
+ - Integration of devstat library first appeared in FreeBSD-3.X
+ - Add many graphs, now there are a total of 25 graphs
+ - Change scaling of graphs from integer to float.
+ - Problems during first resize of the window are fixed
-Changes from xperfmon++ V1.3 to xperfmon++ V1.33:
-
- - Fix event bug when resizing or moving the window.
- (High cpu consumption when running xperfmon++ with mwm)
- - Changes in get_swapspace to compile with FreeBSD 2.2 (-current)
-
-Changes from xperfmon++ V1.33 to xperfmon++ V1.40:
-
- - Fix -geometry option. Changing the size of the window now wokes
- well. The start frame of the window has the correct size.
- - Changes in freebsd_system.c to compile with FreeBSD 30-current.
- - Clean the FreeBSD version number #if's
-
-Changes from xperfmon++ V1.40 to xperfmon++ V2.0:
-
- - Add System Load graph
- - Add Nice and Interrupt CPU percentage graph
+See also /usr/ports/sysutils/xperfmon/pkg/DESCR for older change information.
diff --git a/sysutils/xperfmon3/scripts/configure b/sysutils/xperfmon3/scripts/configure
index 9604303fdd20..b071e9827690 100644
--- a/sysutils/xperfmon3/scripts/configure
+++ b/sysutils/xperfmon3/scripts/configure
@@ -1,3 +1,4 @@
#! /bin/sh
cp ${FILESDIR}/freebsd_system.c ${WRKSRC}/freebsd_system.c
+cp ${FILESDIR}/fbsd_vers.h ${WRKSRC}/fbsd_vers.h