View | Details | Raw Unified | Return to bug 204447
Collapse All | Expand All

(-)sysutils/xosview/Makefile (-10 / +19 lines)
Lines 2-29 Link Here
2
# $FreeBSD: head/sysutils/xosview/Makefile 397897 2015-09-25 21:55:36Z linimon $
2
# $FreeBSD: head/sysutils/xosview/Makefile 397897 2015-09-25 21:55:36Z linimon $
3
3
4
PORTNAME=	xosview
4
PORTNAME=	xosview
5
PORTVERSION=	1.16
5
PORTVERSION=	1.17
6
PORTREVISION=	2
7
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
8
MASTER_SITES=	http://www.pogo.org.uk/~mark/xosview/releases/
7
MASTER_SITES=	GH
9
8
10
MAINTAINER=	ports@FreeBSD.org
9
MAINTAINER=	ports@FreeBSD.org
11
COMMENT=	Graphical performance meter
10
COMMENT=	Graphical performance meter
12
11
12
LICENSE=	BSD4CLAUSE GPLv2
13
LICENSE_COMB=	multi
14
13
ONLY_FOR_ARCHS=	amd64 i386 ia64
15
ONLY_FOR_ARCHS=	amd64 i386 ia64
14
ONLY_FOR_ARCHS_REASON=	used i386-specific hardware resources
16
ONLY_FOR_ARCHS_REASON=	used i386-specific hardware resources
15
17
16
USE_XORG=	xpm
18
USE_GITHUB=	yes
19
GH_ACCOUNT=	hills
20
17
USES=		gmake
21
USES=		gmake
18
MAKE_ENV+=	PLATFORM=bsd MANDIR=${LOCALBASE}/man
22
USE_XORG=	xpm
19
ALL_TARGET=	# empty
23
MAKE_ENV=	OPTFLAGS="" PLATFORM=bsd MANDIR=${MANPREFIX}/man
24
ALL_TARGET=	xosview
25
26
DESKTOP_ENTRIES="XOsview" "" "" "xosview" "" ""
20
27
21
do-configure:
28
do-configure:
22
	@${CP} ${WRKSRC}/targets/freebsd-9.0 ${WRKSRC}/.config
29
	@${CAT} ${WRKSRC}/targets/freebsd | ${SED} -e \
23
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/.config
30
		'/CXX/s|^|#| ; \
31
		 s|/usr/local|${LOCALBASE}|' > ${WRKSRC}/.config
24
32
25
post-install:
33
post-install:
26
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
34
	(cd ${WRKSRC} && ${INSTALL_DATA} Xdefaults \
27
	@${CP} ${WRKSRC}/Xdefaults ${STAGEDIR}${PREFIX}/lib/X11/app-defaults/XOsview
35
		${STAGEDIR}${PREFIX}/lib/X11/app-defaults/XOsview)
36
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xosview
28
37
29
.include <bsd.port.mk>
38
.include <bsd.port.mk>
(-)sysutils/xosview/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (xosview-1.16.tar.gz) = 8e9e130d1bbb30b68419d12f0d74609c10eeed4d6c6a85f35d9941ea3c7b23a0
1
SHA256 (hills-xosview-1.17_GH0.tar.gz) = a5a84cbcee21805922781d3532cf5c4436331f031fa39e741a699f83ad5ddda9
2
SIZE (xosview-1.16.tar.gz) = 137097
2
SIZE (hills-xosview-1.17_GH0.tar.gz) = 144327
(-)sysutils/xosview/files/patch-bsd-kernel.cc (-18 / +17 lines)
Lines 1-5 Link Here
1
--- bsd/kernel.cc.orig	2013-08-23 13:40:35.000000000 +0400
1
--- bsd/kernel.cc.orig	2015-09-23 13:28:14 UTC
2
+++ bsd/kernel.cc	2014-10-03 00:35:05.000000000 +0400
2
+++ bsd/kernel.cc
3
@@ -28,6 +28,7 @@
3
@@ -28,6 +28,7 @@
4
 #include <string.h>
4
 #include <string.h>
5
 #include <err.h>
5
 #include <err.h>
Lines 8-22 Link Here
8
 #include <sysexits.h>
8
 #include <sysexits.h>
9
 #include <sys/types.h>
9
 #include <sys/types.h>
10
 #include <sys/queue.h>
10
 #include <sys/queue.h>
11
@@ -43,7 +44,6 @@
11
@@ -44,7 +45,6 @@
12
 #if defined(XOSVIEW_FREEBSD) || defined(XOSVIEW_DFBSD)
13
 static const char ACPIDEV[] = "/dev/acpi";
12
 static const char ACPIDEV[] = "/dev/acpi";
14
 static const char APMDEV[] = "/dev/apm";
13
 static const char APMDEV[] = "/dev/apm";
14
 static int maxcpus = 1;
15
-#include <net/if_var.h>
15
-#include <net/if_var.h>
16
 #include <sys/ioctl.h>
16
 #include <sys/ioctl.h>
17
 #include <sys/resource.h>
17
 #include <dev/acpica/acpiio.h>
18
 #include <dev/acpica/acpiio.h>
18
 #include <machine/apm_bios.h>
19
@@ -114,56 +114,41 @@ static struct nlist nlst[] =
19
@@ -115,56 +115,41 @@
20
 // this later on.  This keeps the indices within the nlist constant.
20
 // this later on.  This keeps the indices within the nlist constant.
21
 #define DUMMY_SYM "dummy_sym"
21
 #define DUMMY_SYM "dummy_sym"
22
 
22
 
Lines 83-89 Link Here
83
 #endif
83
 #endif
84
 { NULL }
84
 { NULL }
85
 };
85
 };
86
@@ -337,7 +322,21 @@
86
@@ -338,7 +323,21 @@ BSDGetPageStats(uint64_t *meminfo, uint6
87
 #else  /* HAVE_UVM */
87
 #else  /* HAVE_UVM */
88
 	struct vmmeter vm;
88
 	struct vmmeter vm;
89
 #if defined(XOSVIEW_FREEBSD)
89
 #if defined(XOSVIEW_FREEBSD)
Lines 106-112 Link Here
106
 #else  /* XOSVIEW_DFBSD */
106
 #else  /* XOSVIEW_DFBSD */
107
 	struct vmstats vms;
107
 	struct vmstats vms;
108
 	size_t size = sizeof(vms);
108
 	size_t size = sizeof(vms);
109
@@ -421,99 +420,37 @@
109
@@ -468,99 +467,37 @@ BSDGetCPUTimes(uint64_t *timeArray, unsi
110
 int
110
 int
111
 BSDNetInit() {
111
 BSDNetInit() {
112
 	OpenKDIfNeeded();
112
 	OpenKDIfNeeded();
Lines 118-124 Link Here
118
 }
118
 }
119
 
119
 
120
 void
120
 void
121
 BSDGetNetInOut(unsigned long long *inbytes, unsigned long long *outbytes, const char *netIface, bool ignored) {
121
 BSDGetNetInOut(uint64_t *inbytes, uint64_t *outbytes, const char *netIface, bool ignored) {
122
-	char ifname[IFNAMSIZ];
122
-	char ifname[IFNAMSIZ];
123
+	struct ifaddrs *ifap, *ifa;
123
+	struct ifaddrs *ifap, *ifa;
124
 	*inbytes = 0;
124
 	*inbytes = 0;
Lines 129-144 Link Here
129
-	struct if_msghdr *ifm;
129
-	struct if_msghdr *ifm;
130
-	struct if_data ifd;
130
-	struct if_data ifd;
131
-	struct sockaddr_dl *sdl;
131
-	struct sockaddr_dl *sdl;
132
-
132
 
133
-	if ( sysctl(mib_ifl, 6, NULL, &size, NULL, 0) < 0 )
133
-	if ( sysctl(mib_ifl, 6, NULL, &size, NULL, 0) < 0 )
134
-		err(EX_OSERR, "BSDGetNetInOut(): sysctl 1 failed");
134
-		err(EX_OSERR, "BSDGetNetInOut(): sysctl 1 failed");
135
-	if ( (buf = (char *)malloc(size)) == NULL)
135
-	if ( (buf = (char *)malloc(size)) == NULL)
136
-		err(EX_OSERR, "BSDGetNetInOut(): malloc failed");
136
-		err(EX_OSERR, "BSDGetNetInOut(): malloc failed");
137
-	if ( sysctl(mib_ifl, 6, buf, &size, NULL, 0) < 0 )
137
-	if ( sysctl(mib_ifl, 6, buf, &size, NULL, 0) < 0 )
138
-		err(EX_OSERR, "BSDGetNetInOut(): sysctl 2 failed");
138
-		err(EX_OSERR, "BSDGetNetInOut(): sysctl 2 failed");
139
+	if (getifaddrs(&ifap) != 0)
140
+		return;
139
 
141
 
140
-	for (next = buf; next < buf + size; next += ifm->ifm_msglen) {
142
-	for (next = buf; next < buf + size; next += ifm->ifm_msglen) {
141
-		bool skipif = false;
143
+	for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
144
 		bool skipif = false;
142
-		ifm = (struct if_msghdr *)next;
145
-		ifm = (struct if_msghdr *)next;
143
-		if (ifm->ifm_type != RTM_IFINFO || ifm->ifm_addrs & RTAX_IFP == 0)
146
-		if (ifm->ifm_type != RTM_IFINFO || ifm->ifm_addrs & RTAX_IFP == 0)
144
-			continue;
147
-			continue;
Lines 168-181 Link Here
168
-#endif
171
-#endif
169
-	safe_kvm_read(nlst[IFNET_SYM_INDEX].n_value, &ifnethd, sizeof(ifnethd));
172
-	safe_kvm_read(nlst[IFNET_SYM_INDEX].n_value, &ifnethd, sizeof(ifnethd));
170
-	ifnetp = TAILQ_FIRST(&ifnethd);
173
-	ifnetp = TAILQ_FIRST(&ifnethd);
171
+	if (getifaddrs(&ifap) != 0)
172
+		return;
173
 
174
 
174
-	while (ifnetp) {
175
-	while (ifnetp) {
175
+	for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
176
-		bool skipif = false;
176
 		bool skipif = false;
177
-		//  Now, dereference the pointer to get the ifnet struct.
177
-		//  Now, dereference the pointer to get the ifnet struct.
178
-		safe_kvm_read((u_long)ifnetp, &ifnet, sizeof(ifnet));
178
-		safe_kvm_read((unsigned long)ifnetp, &ifnet, sizeof(ifnet));
179
-		strlcpy(ifname, ifnet.if_xname, sizeof(ifname));
179
-		strlcpy(ifname, ifnet.if_xname, sizeof(ifname));
180
-#if defined(XOSVIEW_NETBSD)
180
-#if defined(XOSVIEW_NETBSD)
181
-		ifnetp = TAILQ_NEXT(&ifnet, if_list);
181
-		ifnetp = TAILQ_NEXT(&ifnet, if_list);
Lines 183-189 Link Here
183
-		ifnetp = TAILQ_NEXT(&ifnet, if_link);
183
-		ifnetp = TAILQ_NEXT(&ifnet, if_link);
184
-#endif
184
-#endif
185
-		if (!(ifnet.if_flags & IFF_UP))
185
-		if (!(ifnet.if_flags & IFF_UP))
186
+
187
+		if (ifa->ifa_addr->sa_family != AF_LINK)
186
+		if (ifa->ifa_addr->sa_family != AF_LINK)
188
 			continue;
187
 			continue;
189
+
188
+
Lines 201-207 Link Here
201
-			struct ifdata_pcpu ifdata;
200
-			struct ifdata_pcpu ifdata;
202
-			int ncpus = BSDCountCpus();
201
-			int ncpus = BSDCountCpus();
203
-			for (int cpu = 0; cpu < ncpus; cpu++) {
202
-			for (int cpu = 0; cpu < ncpus; cpu++) {
204
-				safe_kvm_read((u_long)ifdatap + cpu * sizeof(ifdata),
203
-				safe_kvm_read((unsigned long)ifdatap + cpu * sizeof(ifdata),
205
-				              &ifdata, sizeof(ifdata));
204
-				              &ifdata, sizeof(ifdata));
206
-				*inbytes  += ifdata.ifd_ibytes;
205
-				*inbytes  += ifdata.ifd_ibytes;
207
-				*outbytes += ifdata.ifd_obytes;
206
-				*outbytes += ifdata.ifd_obytes;
(-)sysutils/xosview/pkg-descr (-5 / +6 lines)
Lines 1-6 Link Here
1
XOsview is an application originally developed by Mike Romberg for 
1
xosview is a monitor which displays the status of several system
2
Linux.  It can be summarized as a graphical performance meter, and 
2
parameters. These include CPU usage, load average, memory, swap space,
3
it looks similar in appearance to the zoomy performance meters to 
3
network usage and more. Each resource is displayed as a horizontal bar
4
be found on various other platforms.  
4
which is separated into color coded regions showing how much of the
5
resource is being put to a particular use.
5
6
6
WWW: http://xosview.sourceforge.net
7
WWW: http://www.pogo.org.uk/~mark/xosview/

Return to bug 204447