[netperf-dev] netperf2 commit notice r87 - in trunk: . src
raj at netperf.org
raj at netperf.org
Wed Feb 7 15:17:00 PST 2007
Author: raj
Date: 2007-02-07 15:16:58 -0800 (Wed, 07 Feb 2007)
New Revision: 87
Modified:
trunk/README.windows
trunk/Release_Notes
trunk/src/hist.h
trunk/src/netcpu_ntperf.c
trunk/src/netlib.c
trunk/src/nettest_bsd.c
trunk/src/nettest_sctp.c
Log:
Windows HISTOGRAM improvements
Modified: trunk/README.windows
===================================================================
--- trunk/README.windows 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/README.windows 2007-02-07 23:16:58 UTC (rev 87)
@@ -12,12 +12,17 @@
(target OS version; free vs checked build; x86, AMD64, or IA64).
This is picked from the "Start\Developer Kits" path.
-C) go to the netperf\src directory and type "build /cD".
+C) enter the netperf\src directory
-D) the target files will be in a directory like:
- NetPerf\objchk_wnet_IA64\IA64, NetServer\objchk_wnet_IA64\IA64
- NetPerf\objfre_wnet_x86\i386, or NetPerf\objfre_wnet_AMD64\amd64
+D) Edit NetPerfDir\config.h and/or NetServerDir\config.h to enable the
+ desired optional features.
+E) while still in the netperf\src directory type "build /cD".
+
+F) the target files will be in a directory like:
+ NetPerfDir\objchk_wnet_IA64\IA64, NetServerDir\objchk_wnet_IA64\IA64
+ NetPerfDir\objfre_wnet_x86\i386, or NetPerfDir\objfre_wnet_AMD64\amd64
+
NOTE: If any components of the path (ie the full names of the files,
including parent directories) contain spaces (eg "My Documents"),
build will charge off into the weeds.
Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/Release_Notes 2007-02-07 23:16:58 UTC (rev 87)
@@ -2,6 +2,11 @@
Things changed in this release:
+*) Use a higher resolution "time" source for HISTOGRAM support under
+ Windows, courtesy of Spencer Frink. Prior to this it had no better
+ than 10ms granularity which could lead to some rather strange
+ looking results :)
+
*) A bug fix reporting recv_size rather than send_size in TCP_MAERTS
when CPU utilization was requested.
Modified: trunk/src/hist.h
===================================================================
--- trunk/src/hist.h 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/src/hist.h 2007-02-07 23:16:58 UTC (rev 87)
@@ -92,6 +92,8 @@
void HIST_timestamp(hrtime_t *timestamp);
#elif defined(HAVE_GET_HRT)
void HIST_timestamp(hrt_t *timestamp);
+#elif defined(WIN32)
+void HIST_timestamp(LARGE_INTEGER *timestamp);
#else
void HIST_timestamp(struct timeval *timestamp);
#endif
@@ -104,6 +106,8 @@
int delta_micro(hrtime_t *begin, hrtime_t *end);
#elif defined(HAVE_GET_HRT)
int delta_micro(hrt_t *begin, hrt_t *end);
+#elif defined(WIN32)
+int delta_micro(LARGE_INTEGER *begin, LARGE_INTEGER *end);
#else
int delta_micro(struct timeval *begin, struct timeval *end);
#endif
Modified: trunk/src/netcpu_ntperf.c
===================================================================
--- trunk/src/netcpu_ntperf.c 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/src/netcpu_ntperf.c 2007-02-07 23:16:58 UTC (rev 87)
@@ -75,7 +75,7 @@
NT_QUERY_SYSTEM_INFORMATION NtQuerySystemInformation = NULL;
-static LARGE_INTEGER TickHz;
+static LARGE_INTEGER TickHz = {0,0};
_inline LARGE_INTEGER ReadPerformanceCounter(VOID)
{
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/src/netlib.c 2007-02-07 23:16:58 UTC (rev 87)
@@ -1,6 +1,7 @@
char netlib_id[]="\
-@(#)netlib.c (c) Copyright 1993-2006 Hewlett-Packard Company. Version 2.4.2";
+@(#)netlib.c (c) Copyright 1993-2007 Hewlett-Packard Company. Version 2.4.3";
+
/****************************************************************/
/* */
/* netlib.c */
@@ -3235,7 +3236,7 @@
int
sum_row(int *row) {
- int sum;
+ int sum = 0;
int i;
for (i = 0; i < 10; i++) sum += row[i];
return(sum);
@@ -3298,6 +3299,34 @@
return((int)get_hrt_delta(*end,*begin));
}
+#elif defined(WIN32)
+void HIST_timestamp(LARGE_INTEGER *timestamp)
+{
+ QueryPerformanceCounter(timestamp);
+}
+
+int delta_micro(LARGE_INTEGER *begin, LARGE_INTEGER *end)
+{
+ LARGE_INTEGER DeltaTimestamp;
+ static LARGE_INTEGER TickHz = {0,0};
+
+ if (TickHz.QuadPart == 0)
+ {
+ QueryPerformanceFrequency(&TickHz);
+ }
+
+ /*+*+ Rick; this will overflow after ~2000 seconds, is that
+ good enough? Spencer: Yes, that should be more than good
+ enough for histogram support */
+
+ DeltaTimestamp.QuadPart = (end->QuadPart - begin->QuadPart) *
+ 1000000/TickHz.QuadPart;
+ assert((DeltaTimestamp.HighPart == 0) &&
+ ((int)DeltaTimestamp.LowPart >= 0));
+
+ return (int)DeltaTimestamp.LowPart;
+}
+
#else
void
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/src/nettest_bsd.c 2007-02-07 23:16:58 UTC (rev 87)
@@ -1,12 +1,9 @@
#ifndef lint
char nettest_id[]="\
-@(#)nettest_bsd.c (c) Copyright 1993-2004 Hewlett-Packard Co. Version 2.3pl2";
-#else
-#define DIRTY
-#define WANT_HISTOGRAM
-#define WANT_INTERVALS
+@(#)nettest_bsd.c (c) Copyright 1993-2004 Hewlett-Packard Co. Version 2.4.3";
#endif /* lint */
+
/****************************************************************/
/* */
/* nettest_bsd.c */
@@ -120,6 +117,8 @@
#include <windows.h>
#define sleep(x) Sleep((x)*1000)
+
+#define __func__ __FUNCTION__
#endif /* WIN32 */
#if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
@@ -195,6 +194,9 @@
#include "hrt.h"
static hrt_t time_one;
static hrt_t time_two;
+#elif defined(WIN32)
+static LARGE_INTEGER time_one;
+static LARGE_INTEGER time_two;
#else
static struct timeval time_one;
static struct timeval time_two;
@@ -252,6 +254,12 @@
static hrtime_t *intvl_one_ptr = &intvl_one;
static hrtime_t *intvl_two_ptr = &intvl_two;
static hrtime_t *temp_intvl_ptr = &intvl_one;
+#elif defined(WIN32)
+static LARGE_INTEGER intvl_one;
+static LARGE_INTEGER intvl_two;
+static LARGE_INTEGER *intvl_one_ptr = &intvl_one;
+static LARGE_INTEGER *intvl_two_ptr = &intvl_two;
+static LARGE_INTEGER *temp_intvl_ptr = &intvl_one;
#else
static struct timeval intvl_one;
static struct timeval intvl_two;
@@ -295,6 +303,12 @@
static hrtime_t *demo_one_ptr = &demo_one;
static hrtime_t *demo_two_ptr = &demo_two;
static hrtime_t *temp_demo_ptr = &demo_one;
+#elif defined(WIN32)
+static LARGE_INTEGER demo_one;
+static LARGE_INTEGER demo_two;
+static LARGE_INTEGER *demo_one_ptr = &demo_one;
+static LARGE_INTEGER *demo_two_ptr = &demo_two;
+static LARGE_INTEGER *temp_demo_ptr = &demo_one;
#else
static struct timeval demo_one;
static struct timeval demo_two;
Modified: trunk/src/nettest_sctp.c
===================================================================
--- trunk/src/nettest_sctp.c 2007-01-19 22:41:43 UTC (rev 86)
+++ trunk/src/nettest_sctp.c 2007-02-07 23:16:58 UTC (rev 87)
@@ -1,6 +1,6 @@
#ifndef lint
char nettest_sctp[]="\
-@(#)nettest_sctp.c (c) Copyright 2005 Hewlett-Packard Co. Version 2.4.1";
+@(#)nettest_sctp.c (c) Copyright 2005 Hewlett-Packard Co. Version 2.4.3";
#else
#define DIRTY
#define WANT_HISTOGRAM
More information about the netperf-dev
mailing list