[netperf-dev] netperf2 commit notice r386 - in trunk: . src
raj at netperf.org
raj at netperf.org
Tue Feb 8 14:32:33 PST 2011
Author: raj
Date: 2011-02-08 14:32:33 -0800 (Tue, 08 Feb 2011)
New Revision: 386
Modified:
trunk/config.h.in
trunk/configure
trunk/configure.ac
trunk/src/nettest_bsd.c
trunk/src/nettest_omni.c
Log:
address issues with _MSC_VER
Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in 2011-01-27 01:31:24 UTC (rev 385)
+++ trunk/config.h.in 2011-02-08 22:32:33 UTC (rev 386)
@@ -114,6 +114,9 @@
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <linux/tcp.h> header file. */
+#undef HAVE_LINUX_TCP_H
+
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
Modified: trunk/configure
===================================================================
--- trunk/configure 2011-01-27 01:31:24 UTC (rev 385)
+++ trunk/configure 2011-02-08 22:32:33 UTC (rev 386)
@@ -4494,7 +4494,8 @@
-for ac_header in arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h sys/sysinfo.h syscall.h netinet/sctp.h
+
+for ac_header in arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h sys/sysinfo.h syscall.h netinet/sctp.h linux/tcp.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2011-01-27 01:31:24 UTC (rev 385)
+++ trunk/configure.ac 2011-02-08 22:32:33 UTC (rev 386)
@@ -36,7 +36,7 @@
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h sys/sysinfo.h syscall.h netinet/sctp.h])
+AC_CHECK_HEADERS([arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h sys/sysinfo.h syscall.h netinet/sctp.h linux/tcp.h])
# Some platforms require these. There may be a better way.
AC_HAVE_LIBRARY(socket)
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2011-01-27 01:31:24 UTC (rev 385)
+++ trunk/src/nettest_bsd.c 2011-02-08 22:32:33 UTC (rev 386)
@@ -1659,7 +1659,7 @@
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
+#if defined(WIN32) && _MSC_VER <= 1200
__int64 local_bytes_sent = 0
#else
unsigned long long local_bytes_sent = 0;
@@ -2374,7 +2374,8 @@
course, time passes and they do become common.
*/
double bytes_sent = 0.0;
-#if _MSC_VER < 1200
+
+#if defined(WIN32) && (_MSC_VER < 1200)
__int64 local_bytes_recvd = 0;
#else
unsigned long long local_bytes_recvd = 0;
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2011-01-27 01:31:24 UTC (rev 385)
+++ trunk/src/nettest_omni.c 2011-02-08 22:32:33 UTC (rev 386)
@@ -4332,7 +4332,42 @@
return 0;
}
+#ifdef HAVE_LINUX_TCP_H
static void
+dump_transport_stats(SOCKET socket, int protocol)
+{
+
+ struct tcp_info tcp_info;
+ int ret, infosize;
+
+ if (protocol != IPPROTO_TCP)
+ return;
+
+ infosize = sizeof(struct tcp_info);
+
+ if (ret = getsockopt(socket,protocol,TCP_INFO,&tcp_info,&infosize)) {
+ perror("dump_transport_stats:getsockopt");
+ return;
+ }
+
+ printf("tcpi_rto %d tcpi_ato %d tcpi_pmtu %d tcpi_rcv_ssthresh %d\n",
+ tcp_info.tcpi_rto,
+ tcp_info.tcpi_ato,
+ tcp_info.tcpi_pmtu,
+ tcp_info.tcpi_rcv_ssthresh);
+ printf("tcpi_rtt %d tcpi_rttvar %d tcpi_snd_ssthresh %d tpci_snd_cwnd %d\n",
+ tcp_info.tcpi_rtt,
+ tcp_info.tcpi_rttvar,
+ tcp_info.tcpi_snd_ssthresh,
+ tcp_info.tcpi_snd_cwnd);
+ printf("tcpi_reordering %d tcpi_total_retrans %d\n",
+ tcp_info.tcpi_reordering,
+ tcp_info.tcpi_total_retrans);
+ return;
+}
+#endif
+
+static void
get_transport_info(SOCKET socket, int *mss, int protocol)
{
@@ -4368,6 +4403,12 @@
fflush(where);
*mss = -1;
}
+
+#ifdef HAVE_LINUX_TCP_H
+ if (debug) {
+ dump_transport_stats(socket,protocol);
+ }
+#endif
}
/* brain dead simple way to get netperf to emit a uuid. sadly, by this
More information about the netperf-dev
mailing list