[netperf-dev] netperf2 commit notice r232 - in trunk: . src

raj at netperf.org raj at netperf.org
Wed Feb 20 17:52:01 PST 2008


Author: raj
Date: 2008-02-20 17:52:00 -0800 (Wed, 20 Feb 2008)
New Revision: 232

Modified:
   trunk/config.h.in
   trunk/configure
   trunk/configure.ac
   trunk/src/netcpu_sysctl.c
Log:
some bsd fixes from someone yet to decide if they want credit

Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in	2008-02-19 23:50:29 UTC (rev 231)
+++ trunk/config.h.in	2008-02-21 01:52:00 UTC (rev 232)
@@ -295,7 +295,7 @@
 /* Use Linux's rtnetlink interface to determine egress interface. */
 #undef USE_RTNETLINK
 
-/* Use FreeBSD's sysctl interface to measure CPU util. */
+/* Use MumbleBSD's sysctl interface to measure CPU util. */
 #undef USE_SYSCTL
 
 /* Version number of package */

Modified: trunk/configure
===================================================================
--- trunk/configure	2008-02-19 23:50:29 UTC (rev 231)
+++ trunk/configure	2008-02-21 01:52:00 UTC (rev 232)
@@ -9445,7 +9445,7 @@
 			enable_cpuutil="kstat - auto"
 			NETCPU_SOURCE="kstat"
 			;;
-                     *-*-freebsd4.* | *-*-freebsd5.* | *-*-freebsd6.* | *-*-freebsd7.* )
+                     *-*-freebsd4-7.* | *-*-netbsd1-9.* )
 			use_cpuutil=true
 
 cat >>confdefs.h <<\_ACEOF

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-02-19 23:50:29 UTC (rev 231)
+++ trunk/configure.ac	2008-02-21 01:52:00 UTC (rev 232)
@@ -690,9 +690,9 @@
 			enable_cpuutil="kstat - auto"
 			NETCPU_SOURCE="kstat"
 			;;
-                     *-*-freebsd4.* | *-*-freebsd5.* | *-*-freebsd6.* | *-*-freebsd7.* )
+                     *-*-freebsd[4-7].* | *-*-netbsd[1-9].* )
 			use_cpuutil=true
-			AC_DEFINE([USE_SYSCTL],,[Use FreeBSD's sysctl interface to measure CPU util.])
+			AC_DEFINE([USE_SYSCTL],,[Use MumbleBSD's sysctl interface to measure CPU util.])
 			enable_cpuutil="sysctl - auto"
 			NETCPU_SOURCE="sysctl"
 			;;

Modified: trunk/src/netcpu_sysctl.c
===================================================================
--- trunk/src/netcpu_sysctl.c	2008-02-19 23:50:29 UTC (rev 231)
+++ trunk/src/netcpu_sysctl.c	2008-02-21 01:52:00 UTC (rev 232)
@@ -33,6 +33,11 @@
 # endif /* LONG_LONG_MAX */
 #endif
 
+#ifdef __NetBSD__
+#define	CP_TIME_TYPE	uint64_t
+#else
+#define	CP_TIME_TYPE	long
+#endif
 
 #include <errno.h>
 
@@ -55,8 +60,8 @@
 #include "netsh.h"
 #include "netlib.h"
 
-static long lib_start_count[CPUSTATES];
-static long lib_end_count[CPUSTATES];
+static CP_TIME_TYPE lib_start_count[CPUSTATES];
+static CP_TIME_TYPE lib_end_count[CPUSTATES];
 
 void
 cpu_util_init(void) 
@@ -77,7 +82,7 @@
 }
 
 static void
-get_cpu_time(long *cpu_time)
+get_cpu_time(CP_TIME_TYPE *cpu_time)
 {
   size_t cpu_time_len = CPUSTATES * sizeof (cpu_time[0]);
 
@@ -99,7 +104,7 @@
 float
 calc_cpu_util_internal(float elapsed_time)
 {
-  long sum_idle, sum_busy;
+  CP_TIME_TYPE sum_idle, sum_busy;
   int i;
 
   for (sum_busy = 0, i = 0; i < CPUSTATES; i++) {



More information about the netperf-dev mailing list