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

raj at netperf.org raj at netperf.org
Tue Jan 11 13:27:47 PST 2011


Author: raj
Date: 2011-01-11 13:27:46 -0800 (Tue, 11 Jan 2011)
New Revision: 375

Modified:
   trunk/AUTHORS
   trunk/src/netlib.c
   trunk/src/netsh.c
   trunk/src/nettest_bsd.c
Log:
some windows tweaks from Dongshent Song

Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2010-12-21 17:57:43 UTC (rev 374)
+++ trunk/AUTHORS	2011-01-11 21:27:46 UTC (rev 375)
@@ -252,4 +252,7 @@
 Discovering that FreeBSD 8.X also does not need an SCTP library
 
 Josselin Costanzi
-DEBUG_LOG_FILE patch for Android
\ No newline at end of file
+DEBUG_LOG_FILE patch for Android
+
+Dongsheng Song
+Assorted Windows fixes
\ No newline at end of file

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2010-12-21 17:57:43 UTC (rev 374)
+++ trunk/src/netlib.c	2011-01-11 21:27:46 UTC (rev 375)
@@ -1358,7 +1358,7 @@
 
   /* some functionality might want to use random numbers, so we should
      initialize the random number generator */
-  srand48(getpid());
+  srand(getpid());
 
 }
 
@@ -1773,8 +1773,8 @@
 	  int count;
 	  int *int_ptr;
 
-	  /* initialize the random number generator */
-	  srand(getpid());
+	  /* we initialize the random number generator in
+	     netlib_init() now. raj 20110111 */
 
 	  /* unlink the file so it goes poof when we
 	     exit. unless/until shown to be a problem we will
@@ -3834,7 +3834,7 @@
    }
    h->hmin = ((h->hmin < time_delta) ? h->hmin : time_delta);
    h->hmax = ((h->hmax > time_delta) ? h->hmax : time_delta);
-   val = time_delta;
+   val = (float) time_delta;
    /* check for < 0 added via VMware ESX patches */
    if (val < 0) {
      h->ridiculous++;
@@ -3935,7 +3935,7 @@
 /* get percentile from histogram */
 int
 HIST_get_percentile(HIST h, const double percentile){
-  int num = h->total * percentile;
+  int num = (int) h->total * percentile;
   int last = 0;
   int current = 0;
   int result;

Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c	2010-12-21 17:57:43 UTC (rev 374)
+++ trunk/src/netsh.c	2011-01-11 21:27:46 UTC (rev 375)
@@ -39,6 +39,12 @@
 #else
 #include <time.h>
 #include <winsock2.h>
+/* while it is unlikely that anyone running Windows 2000 or NT 4 is
+   going to be trying to compile this, if they are they will want to
+   define DONT_IPV6 in the sources file */
+#ifndef DONT_IPV6
+#include <ws2tcpip.h>
+#endif
 #define netperf_socklen_t socklen_t
 #endif
 

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2010-12-21 17:57:43 UTC (rev 374)
+++ trunk/src/nettest_bsd.c	2011-01-11 21:27:46 UTC (rev 375)
@@ -1651,11 +1651,16 @@
   int bytes_remaining;
   int tcp_mss = -1;  /* possibly uninitialized on printf far below */
 
-  /* with links like fddi, one can send > 32 bits worth of bytes */
-  /* during a test... ;-) at some point, this should probably become a */
-  /* 64bit integral type, but those are not entirely common yet */
+  /* with links like fddi, one can send > 32 bits worth of bytes
+     during a test... ;-) at some point, this should probably become a
+     64bit integral type, but those are not entirely common
+     yet... time passes, and 64 bit types do indeed become common. */
+#if _MSC_VER <= 1200
+  __int64 local_bytes_sent = 0
+#else
+  unsigned long long local_bytes_sent = 0;
+#endif
 
-  unsigned long long local_bytes_sent = 0;
   double	bytes_sent = 0.0;
   
   float	local_cpu_utilization;
@@ -2359,11 +2364,17 @@
   int bytes_remaining;
   int tcp_mss = -1;  /* possibly uninitialized on printf far below */
 
-  /* with links like fddi, one can recv > 32 bits worth of bytes */
-  /* during a test... ;-) at some point, this should probably become a */
-  /* 64bit integral type, but those are not entirely common yet */
+  /* with links like fddi, one can recv > 32 bits worth of bytes
+     during a test... ;-) at some point, this should probably become a
+     64bit integral type, but those are not entirely common yet.  of
+     course, time passes and they do become common.
+ */
   double	bytes_sent = 0.0;
+#if _MSC_VER < 1200
+  __int64 local_bytes_recvd = 0;
+#else
   unsigned long long local_bytes_recvd = 0;
+#endif
 
   float	local_cpu_utilization;
   float	local_service_demand;
@@ -12858,7 +12869,11 @@
   if (debug) {
     int i;
     printf("%s called with the following argument vector\n",
+#if _MSC_VER <= 1200
+	   "scan_sockets_args");
+#else
 	   __func__);
+#endif
     for (i = 0; i< argc; i++) {
       printf("%s ",argv[i]);
     }



More information about the netperf-dev mailing list