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

(-)zabbix2-server/Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	zabbix2
8
PORTNAME=	zabbix2
9
PORTVERSION=	2.0.0
9
PORTVERSION=	2.0.2
10
CATEGORIES=	net-mgmt
10
CATEGORIES=	net-mgmt
11
MASTER_SITES=	SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
11
MASTER_SITES=	SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
12
PKGNAMESUFFIX?=	-server
12
PKGNAMESUFFIX?=	-server
(-)zabbix2-server/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (zabbix-2.0.0.tar.gz) = 52cc4b8a8624d53ff4591ebf86a92c19230964d46d39e5cccf7b8648fb2ecf4d
1
SHA256 (zabbix-2.0.2.tar.gz) = 2db56e4fc291f5469584844703f6815fe739c3b33b4c2d5854285a780650cfbb
2
SIZE (zabbix-2.0.0.tar.gz) = 12091622
2
SIZE (zabbix-2.0.2.tar.gz) = 12070505
(-)zabbix2-server/files/patch-src_libs_zbxsysinfo_freebsd__proc.c (-98 lines)
Lines 1-98 Link Here
1
--- src/libs/zbxsysinfo/freebsd/proc.c.orig	2011-12-28 03:27:42.000000000 -0600
2
+++ src/libs/zbxsysinfo/freebsd/proc.c	2012-04-25 21:54:13.877489156 -0500
3
@@ -36,17 +36,13 @@
4
 #	define ZBX_PROC_PID	ki_pid
5
 #	define ZBX_PROC_COMM	ki_comm
6
 #	define ZBX_PROC_STAT	ki_stat
7
-#	define ZBX_PROC_TSIZE	ki_tsize
8
-#	define ZBX_PROC_DSIZE	ki_dsize
9
-#	define ZBX_PROC_SSIZE	ki_ssize
10
+#	define ZBX_PROC_VSIZE	ki_size
11
 #else
12
 #	define ZBX_COMMLEN	MAXCOMLEN
13
 #	define ZBX_PROC_PID	kp_proc.p_pid
14
 #	define ZBX_PROC_COMM	kp_proc.p_comm
15
 #	define ZBX_PROC_STAT	kp_proc.p_stat
16
-#	define ZBX_PROC_TSIZE	kp_eproc.e_vm.vm_tsize
17
-#	define ZBX_PROC_DSIZE	kp_eproc.e_vm.vm_dsize
18
-#	define ZBX_PROC_SSIZE	kp_eproc.e_vm.vm_ssize
19
+#	define ZBX_PROC_VSIZE	kp_eproc.e_vm.vm_map.size
20
 #endif
21
 
22
 static char	*get_commandline(struct kinfo_proc *proc)
23
@@ -97,7 +93,7 @@
24
 	char	procname[MAX_STRING_LEN],
25
 		buffer[MAX_STRING_LEN],
26
 		proccomm[MAX_STRING_LEN], *args;
27
-	int	do_task, pagesize, count, i,
28
+	int	do_task, count, i,
29
 		proc_ok, comm_ok,
30
 		mib[4], mibs;
31
 
32
@@ -152,8 +148,6 @@
33
 	if (0 != get_param(param, 4, proccomm, sizeof(proccomm)))
34
 		*proccomm = '\0';
35
 
36
-	pagesize = getpagesize();
37
-
38
 	mib[0] = CTL_KERN;
39
 	mib[1] = KERN_PROC;
40
 	if (NULL != usrinfo)
41
@@ -164,7 +158,11 @@
42
 	}
43
 	else
44
 	{
45
+#if(__FreeBSD_version > 500000)
46
+		mib[2] = KERN_PROC_PROC;
47
+#else
48
 		mib[2] = KERN_PROC_ALL;
49
+#endif
50
 		mib[3] = 0;
51
 		mibs = 3;
52
 	}
53
@@ -184,11 +182,6 @@
54
 
55
 	for (i = 0; i < count; i++)
56
 	{
57
-#if(__FreeBSD_version > 500000)
58
-		if (proc[i].ki_flag & P_KTHREAD)	/* skip a system thread */
59
-			continue;
60
-#endif
61
-
62
 		proc_ok = 0;
63
 		comm_ok = 0;
64
 		if (*procname == '\0' || 0 == strcmp(procname, proc[i].ZBX_PROC_COMM))
65
@@ -205,8 +198,7 @@
66
 
67
 		if (proc_ok && comm_ok)
68
 		{
69
-			value = proc[i].ZBX_PROC_TSIZE + proc[i].ZBX_PROC_DSIZE + proc[i].ZBX_PROC_SSIZE;
70
-			value *= pagesize;
71
+			value = proc[i].ZBX_PROC_VSIZE; /* vsize is bytes not pages */
72
 
73
 			if (0 == proccount++)
74
 				memsize = value;
75
@@ -306,7 +298,11 @@
76
 	}
77
 	else
78
 	{
79
+#if(__FreeBSD_version > 500000)
80
+		mib[2] = KERN_PROC_PROC;
81
+#else
82
 		mib[2] = KERN_PROC_ALL;
83
+#endif
84
 		mib[3] = 0;
85
 		mibs = 3;
86
 	}
87
@@ -326,11 +322,6 @@
88
 
89
 	for (i = 0; i < count; i++)
90
 	{
91
-#if(__FreeBSD_version > 500000)
92
-		if (proc[i].ki_flag & P_KTHREAD)	/* skip a system thread */
93
-			continue;
94
-#endif
95
-
96
 		proc_ok = 0;
97
 		stat_ok = 0;
98
 		comm_ok = 0;

Return to bug 170700