diff options
author | christos <christos@pkgsrc.org> | 2000-08-18 22:43:53 +0000 |
---|---|---|
committer | christos <christos@pkgsrc.org> | 2000-08-18 22:43:53 +0000 |
commit | 7001b0d29790e58891d1f5c989b5a396a9ec277d (patch) | |
tree | 926fa23e7ce12b6df2729fbcdc2fc9ee5a22a9cf /sysutils/xosview | |
parent | f7bc41cb9f8ddaa11169e4a43221302794b5853c (diff) | |
download | pkgsrc-7001b0d29790e58891d1f5c989b5a396a9ec277d.tar.gz |
Fix cp_time shit that broke post 1.4Z
Fix uvm -> vm conversion lossage that broke post 1.5B
Works with 1.5E and earlier.
Diffstat (limited to 'sysutils/xosview')
-rw-r--r-- | sysutils/xosview/patches/patch-ad | 53 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-af | 16 |
2 files changed, 65 insertions, 4 deletions
diff --git a/sysutils/xosview/patches/patch-ad b/sysutils/xosview/patches/patch-ad index eadda40b4b8..b3c1f256b17 100644 --- a/sysutils/xosview/patches/patch-ad +++ b/sysutils/xosview/patches/patch-ad @@ -1,7 +1,7 @@ -$NetBSD: patch-ad,v 1.4 2000/06/27 08:15:51 tron Exp $ +$NetBSD: patch-ad,v 1.5 2000/08/18 22:43:53 christos Exp $ ---- bsd/kernel.cc.orig Tue Feb 16 15:09:21 1999 -+++ bsd/kernel.cc Tue Jun 27 10:13:23 2000 +--- bsd/kernel.cc.orig Tue Feb 16 09:09:21 1999 ++++ bsd/kernel.cc Fri Aug 18 18:36:14 2000 @@ -30,6 +30,10 @@ #include <errno.h> #include <sys/dkstat.h> /* For CPUSTATES, which tells us how @@ -13,7 +13,18 @@ $NetBSD: patch-ad,v 1.4 2000/06/27 08:15:51 tron Exp $ #ifndef XOSVIEW_FREEBSD #include <sys/disk.h> /* For disk statistics. */ #endif -@@ -67,7 +71,11 @@ +@@ -60,14 +64,22 @@ + #include <sys/malloc.h> + #include <sys/sysctl.h> + #include <sys/device.h> ++#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 105010000 /* > 1.5A */ ++#include <uvm/uvm.h> ++#else + #include <vm/vm.h> /* XXX Is this needed? */ ++#endif + #else + #include <sys/vmmeter.h> /* For struct vmmeter. */ + #endif #ifdef HAVE_SWAPCTL #include <unistd.h> /* For swapctl proto. */ @@ -26,3 +37,37 @@ $NetBSD: patch-ad,v 1.4 2000/06/27 08:15:51 tron Exp $ #include <stdlib.h> /* For malloc(), free(). */ #endif +@@ -85,7 +97,11 @@ + // This struct has the list of all the symbols we want from the kernel. + static struct nlist nlst[] = + { ++#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */ ++{ "_ifnet" }, /* XXX: LZ! Don't renumber */ ++#else + { "_cp_time" }, ++#endif + #define CP_TIME_SYM_INDEX 0 + { "_ifnet" }, + #define IFNET_SYM_INDEX 1 +@@ -293,7 +309,21 @@ + if (!timeArray) errx (-1, "BSDGetCPUTimes(): passed pointer was null!\n"); + if (CPUSTATES != 5) + errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n"); ++#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */ ++ int mib[2]; ++ struct schedstate_percpu ssp; ++ size_t size = sizeof(ssp.spc_cp_time); ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_CP_TIME; ++ if (sysctl(mib, 2, ssp.spc_cp_time, &size, NULL, 0) < 0) { ++ printf("can't get schedstate_percpu: %s\n", strerror(errno)); ++ memset(&ssp, 0, sizeof(ssp)); ++ } ++ for (size = 0; size < CPUSTATES; size++) ++ timeArray[size] = (long) ssp.spc_cp_time[size]; ++#else + safe_kvm_read_symbol (CP_TIME_SYM_INDEX, timeArray, sizeof (long) * CPUSTATES); ++#endif + } + + diff --git a/sysutils/xosview/patches/patch-af b/sysutils/xosview/patches/patch-af new file mode 100644 index 00000000000..c21efde10d1 --- /dev/null +++ b/sysutils/xosview/patches/patch-af @@ -0,0 +1,16 @@ +$NetBSD: patch-af,v 1.1 2000/08/18 22:43:53 christos Exp $ + +--- bsd/pagemeter.h.orig Fri Aug 18 18:40:08 2000 ++++ bsd/pagemeter.h Fri Aug 18 18:22:28 2000 +@@ -22,7 +22,11 @@ + #include "fieldmetergraph.h" + #if defined(UVM) + #include <sys/param.h> ++#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 105010000 /* > 1.5A */ ++#include <uvm/uvm.h> ++#else + #include <vm/vm.h> ++#endif + #include <uvm/uvm_extern.h> + #else + #include <sys/vmmeter.h> |