summaryrefslogtreecommitdiff
path: root/sysutils/xosview/patches
diff options
context:
space:
mode:
authorveego <veego@pkgsrc.org>2007-04-09 21:22:11 +0000
committerveego <veego@pkgsrc.org>2007-04-09 21:22:11 +0000
commitcaadfe805d259325be7c8f3adcda2889297da53f (patch)
tree7f1da2c1ce78543e32eaefd591b0919d2febc9d8 /sysutils/xosview/patches
parentd4b643905a199a4aee2af55e638d5b7c326cf19e (diff)
downloadpkgsrc-caadfe805d259325be7c8f3adcda2889297da53f.tar.gz
- Make myself the MAINTAINER
- Fix the manpage path in the Makefile - Adapt the memmeter.cc changes to pagemeter so it doesn't use kmem to get uvmexp. - struct schedstate_percpu is no longer a public interface outside the kernel - Add netIface support for NetBSD. Now you can monitor only one network interface. See the manpage for more details. This change is allready present in the sourceforge tree. - PKGREVISION++
Diffstat (limited to 'sysutils/xosview/patches')
-rw-r--r--sysutils/xosview/patches/patch-aa87
-rw-r--r--sysutils/xosview/patches/patch-ac16
-rw-r--r--sysutils/xosview/patches/patch-ad20
-rw-r--r--sysutils/xosview/patches/patch-ae16
-rw-r--r--sysutils/xosview/patches/patch-af45
5 files changed, 178 insertions, 6 deletions
diff --git a/sysutils/xosview/patches/patch-aa b/sysutils/xosview/patches/patch-aa
index f3c615d82e6..d78c04d9129 100644
--- a/sysutils/xosview/patches/patch-aa
+++ b/sysutils/xosview/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.15 2006/10/28 02:15:12 christos Exp $
+$NetBSD: patch-aa,v 1.16 2007/04/09 21:22:11 veego Exp $
---- bsd/kernel.cc.orig 2006-02-18 02:36:06.000000000 -0500
-+++ bsd/kernel.cc 2006-10-27 22:12:37.000000000 -0400
-@@ -115,6 +115,13 @@
+--- bsd/kernel.cc.orig 2006-02-18 08:36:06.000000000 +0100
++++ bsd/kernel.cc 2007-04-09 15:27:42.000000000 +0200
+@@ -115,10 +115,18 @@
// in __NetBSD_Version__ for us if needed.
#if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106010000)
#define NETBSD_1_6A
@@ -16,7 +16,82 @@ $NetBSD: patch-aa,v 1.15 2006/10/28 02:15:12 christos Exp $
#endif
#include "general.h"
-@@ -773,13 +780,12 @@
+ #include "kernel.h" /* To grab CVSID stuff. */
++#include "netmeter.h" /* For netIface_ */
+
+ CVSID("$Id: patch-aa,v 1.16 2007/04/09 21:22:11 veego Exp $");
+ CVSID_DOT_H(KERNEL_H_CVSID);
+@@ -400,6 +408,8 @@
+ static int mib[] = { CTL_KERN, KERN_CPUSTATS };
+ #endif
+ #if defined(XOSVIEW_NETBSD) && (__NetBSD_Version__ >= 104260000)
++ uint64_t cp_time[CPUSTATES];
++ size_t size = sizeof(cp_time[0]) * CPUSTATES;
+ static int mib[] = { CTL_KERN, KERN_CP_TIME };
+ #endif
+
+@@ -407,14 +417,11 @@
+ if (CPUSTATES != 5)
+ errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n");
+ #if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */
+- struct schedstate_percpu ssp;
+- size_t size = sizeof(ssp.spc_cp_time);
+- if (sysctl(mib, 2, ssp.spc_cp_time, &size, NULL, 0) < 0) {
+- fprintf(stderr, "can't get schedstate_percpu: %s\n", strerror(errno));
+- memset(&ssp, 0, sizeof(ssp));
++ if (sysctl(mib, 2, cp_time, &size, NULL, 0) < 0) {
++ fprintf(stderr, "xosview: sysctl kern.cp_time failed: %s\n", strerror(errno));
++ bzero(&cp_time, size);
+ }
+- for (size = 0; size < CPUSTATES; size++)
+- timeArray[size] = (long) ssp.spc_cp_time[size];
++ bcopy (cp_time, timeArray, size);
+ #else
+ #ifdef XOSVIEW_BSDI
+ if (sysctl(mib, 2, &cpu, &size, NULL, 0) < 0) {
+@@ -441,7 +448,7 @@
+ }
+
+ void
+-BSDGetNetInOut (long long * inbytes, long long * outbytes) {
++NetMeter::BSDGetNetInOut (long long * inbytes, long long * outbytes) {
+
+
+ struct ifnet * ifnetp;
+@@ -466,7 +473,8 @@
+ while (ifnetp) {
+ // Now, dereference the pointer to get the ifnet struct.
+ safe_kvm_read ((u_long) ifnetp, &ifnet, sizeof(ifnet));
+-#ifdef NET_DEBUG
++#ifdef XOSVIEW_NETBSD
++ if (netIface_ != "False" ) {
+ char ifname[256];
+ #ifdef NETBSD_OLD_IFACE
+ // In pre-1.2A, getting the interface name was more complicated.
+@@ -476,15 +484,21 @@
+ safe_kvm_read ((u_long) (((char*)ifnetp) + (&ifnet.if_xname[0] - (char*)&ifnet)), ifname, 256);
+ snprintf (ifname, 256, "%s", ifname);
+ #endif
++#ifdef NET_DEBUG
+ printf ("Interface name is %s\n", ifname);
+ printf ("Ibytes: %8llu Obytes %8llu\n",
+ (unsigned long long) ifnet.if_ibytes,
+ (unsigned long long) ifnet.if_obytes);
+ printf ("Ipackets: %8llu\n", (unsigned long long) ifnet.if_ipackets);
+-#endif
++#endif /* NET_DEBUG */
++ if (ifname != netIface_)
++ goto skipif;
++ }
++#endif /* XOSVIEW_NETBSD */
+ *inbytes += ifnet.if_ibytes;
+ *outbytes += ifnet.if_obytes;
+
++ skipif:
+ // Linked-list step taken from if.c in netstat source, line 120.
+ #ifdef XOSVIEW_FREEBSD
+ #if (__FreeBSD_version >= 300000)
+@@ -773,13 +787,12 @@
#ifdef NETBSD_1_6A
// Do a sysctl with a NULL data pointer to get the size that would
// have been returned, and use that to figure out # drives.
@@ -32,7 +107,7 @@ $NetBSD: patch-aa,v 1.15 2006/10/28 02:15:12 christos Exp $
return 1;
#endif
return ValidSymbol(DISKLIST_SYM_INDEX);
-@@ -816,19 +822,29 @@
+@@ -816,19 +829,29 @@
#else
#if defined(NETBSD_1_6A)
// Use the new sysctl to do this for us.
diff --git a/sysutils/xosview/patches/patch-ac b/sysutils/xosview/patches/patch-ac
new file mode 100644
index 00000000000..30e5458d322
--- /dev/null
+++ b/sysutils/xosview/patches/patch-ac
@@ -0,0 +1,16 @@
+$NetBSD: patch-ac,v 1.8 2007/04/09 21:22:11 veego Exp $
+
+--- bsd/netmeter.h.orig 2003-10-09 06:23:10.000000000 +0200
++++ bsd/netmeter.h
+@@ -33,8 +33,11 @@ public:
+ void checkevent( void );
+
+ void checkResources( void );
++
++ void BSDGetNetInOut (long long * inbytes, long long * outbytes);
+ protected:
+ float netBandwidth_;
++ std::string netIface_;
+
+ private:
+ // NetBSD: Use long long, so we won't run into problems after 4 GB
diff --git a/sysutils/xosview/patches/patch-ad b/sysutils/xosview/patches/patch-ad
new file mode 100644
index 00000000000..11bc1e2a850
--- /dev/null
+++ b/sysutils/xosview/patches/patch-ad
@@ -0,0 +1,20 @@
+$NetBSD: patch-ad,v 1.8 2007/04/09 21:22:11 veego Exp $
+
+--- bsd/netmeter.cc.orig 2003-10-10 06:55:37.000000000 +0200
++++ bsd/netmeter.cc
+@@ -38,6 +38,7 @@ NetMeter::NetMeter( XOSView *parent, flo
+ netBandwidth_ = max;
+ total_ = netBandwidth_;
+ _lastBytesIn = _lastBytesOut = 0;
++ netIface_ = "False";
+ BSDGetNetInOut (&_lastBytesIn, &_lastBytesOut);
+ }
+ }
+@@ -56,6 +57,7 @@ void NetMeter::checkResources( void ){
+ dodecay_ = parent_->isResourceTrue("netDecay");
+ useGraph_ = parent_->isResourceTrue("netGraph");
+ SetUsedFormat (parent_->getResource("netUsedFormat"));
++ netIface_ = parent_->getResource( "netIface" );
+ }
+ }
+
diff --git a/sysutils/xosview/patches/patch-ae b/sysutils/xosview/patches/patch-ae
new file mode 100644
index 00000000000..c3ac8b96a1b
--- /dev/null
+++ b/sysutils/xosview/patches/patch-ae
@@ -0,0 +1,16 @@
+$NetBSD: patch-ae,v 1.11 2007/04/09 21:22:11 veego Exp $
+
+--- bsd/pagemeter.h.orig 2003-10-09 06:22:32.000000000 +0200
++++ bsd/pagemeter.h 2007-04-09 16:26:34.000000000 +0200
+@@ -48,7 +48,11 @@
+ void getpageinfo( void );
+ private:
+ #if defined(UVM)
++# ifdef VM_UVMEXP2
++ struct uvmexp_sysctl prev_;
++# else
+ struct uvmexp prev_;
++# endif
+ #else
+ struct vmmeter prev_;
+ #endif
diff --git a/sysutils/xosview/patches/patch-af b/sysutils/xosview/patches/patch-af
new file mode 100644
index 00000000000..660e497ae22
--- /dev/null
+++ b/sysutils/xosview/patches/patch-af
@@ -0,0 +1,45 @@
+$NetBSD: patch-af,v 1.3 2007/04/09 21:22:11 veego Exp $
+
+--- bsd/pagemeter.cc.orig 2002-03-22 04:23:41.000000000 +0100
++++ bsd/pagemeter.cc 2007-04-09 16:30:04.000000000 +0200
+@@ -20,6 +20,10 @@
+ #include "pagemeter.h"
+ #include "kernel.h" // For NetBSD Page functions.
+
++#if defined(UVM) && defined (VM_UVMEXP2)
++#include <sys/sysctl.h> /* Needed for uvmexp_sysctl. */
++#endif
++
+ CVSID("$Id: patch-af,v 1.3 2007/04/09 21:22:11 veego Exp $");
+ CVSID_DOT_H(PAGEMETER_H_CVSID);
+
+@@ -28,7 +32,13 @@
+ total_ = total;
+ BSDPageInit();
+ #ifdef UVM
++# ifdef VM_UVMEXP2
++ int params[] = {CTL_VM, VM_UVMEXP2};
++ size_t prev_size = sizeof (prev_);
++ sysctl (params, 2, &prev_, &prev_size, NULL, 0);
++# else
+ BSDGetUVMPageStats(&prev_);
++# endif
+ #else
+ BSDGetPageStats(&prev_);
+ #endif
+@@ -57,8 +67,15 @@
+ void PageMeter::getpageinfo (void) {
+ // Begin NetBSD-specific code...
+ #if defined(UVM)
++# ifdef VM_UVMEXP2
++ int params[] = {CTL_VM, VM_UVMEXP2};
++ struct uvmexp_sysctl uvm;
++ size_t uvm_size = sizeof (uvm);
++ sysctl (params, 2, &uvm, &uvm_size, NULL, 0);
++# else
+ struct uvmexp uvm;
+ BSDGetUVMPageStats(&uvm);
++# endif
+ #else
+ struct vmmeter vm;
+ BSDGetPageStats(&vm);