aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xperfmon
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1997-01-19 18:36:51 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1997-01-19 18:36:51 +0000
commit9f5eba44198a6279463eda6fe2bde54931f3b89f (patch)
treef5032820116d91ee547853c00f06bdabf277bb59 /sysutils/xperfmon
parent3bff7781cbdc667223cf7dc5510ece3c6a887cb8 (diff)
downloadports-9f5eba44198a6279463eda6fe2bde54931f3b89f.tar.gz
ports-9f5eba44198a6279463eda6fe2bde54931f3b89f.zip
Notes
Diffstat (limited to 'sysutils/xperfmon')
-rw-r--r--sysutils/xperfmon/files/patch-aa2
-rw-r--r--sysutils/xperfmon/files/patch-ac62
2 files changed, 63 insertions, 1 deletions
diff --git a/sysutils/xperfmon/files/patch-aa b/sysutils/xperfmon/files/patch-aa
index 34596e00688b..5a44adbca135 100644
--- a/sysutils/xperfmon/files/patch-aa
+++ b/sysutils/xperfmon/files/patch-aa
@@ -11,7 +11,7 @@ diff -c -N ../xperfmon++/freebsd_system.c ./freebsd_system.c
+ * 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 ler <Lars_Koeller@odie.physik2.uni-rostock.de
++ * Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
diff --git a/sysutils/xperfmon/files/patch-ac b/sysutils/xperfmon/files/patch-ac
new file mode 100644
index 000000000000..1b74333552d9
--- /dev/null
+++ b/sysutils/xperfmon/files/patch-ac
@@ -0,0 +1,62 @@
+--- freebsd_system.c.orig Sun Jan 19 18:43:41 1997
++++ freebsd_system.c Sun Jan 19 18:42:59 1997
+@@ -75,6 +75,7 @@
+ #include <sys/sysctl.h>
+ #include <sys/dkstat.h>
+ #include <sys/buf.h>
++#include <sys/time.h>
+ #include <sys/vmmeter.h>
+ #include <vm/vm.h>
+ #include <net/if.h>
+@@ -310,7 +311,8 @@
+ Collect the Network-Traffic
+ */
+
+- if (nl[N_IFNET].n_value != 0) {
++ if ((ifnetaddr = nl[N_IFNET].n_value) != 0) {
++#if __FreeBSD_version <= 199701
+ struct ifnet ifnet;
+ kread(N_IFNET, &ifnetaddr, sizeof(ifnetaddr));
+ old_packets = packets;
+@@ -322,6 +324,41 @@
+ 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;
++
++ 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;
++
++ 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
+ }
+
+ /*