[netperf-dev] netperf2 commit notice r68 - in trunk: . src
raj at netperf.org
raj at netperf.org
Fri Apr 14 15:25:04 PDT 2006
Author: raj
Date: 2006-04-14 15:25:02 -0700 (Fri, 14 Apr 2006)
New Revision: 68
Modified:
trunk/config.h.in
trunk/configure
trunk/configure.ac
trunk/src/netsh.c
trunk/src/nettest_bsd.c
Log:
Some initial quick and dirty fixes for #ifdef DIRTY in send_tcp_stream()
much more to follow.
Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in 2006-04-14 21:38:09 UTC (rev 67)
+++ trunk/config.h.in 2006-04-14 22:25:02 UTC (rev 68)
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define to one to enable dirty buffer support. May affect results. */
+#undef DIRTY
+
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
Modified: trunk/configure
===================================================================
--- trunk/configure 2006-04-14 21:38:09 UTC (rev 67)
+++ trunk/configure 2006-04-14 22:25:02 UTC (rev 68)
@@ -856,6 +856,7 @@
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors
--enable-histogram include individual op timing, may affect result
+ --enable-dirty write to buffers each time, may affect result
--enable-demo emit interim results during the run. May affect
results.
--enable-unixdomain include Unix Domain socket tests
@@ -865,8 +866,8 @@
--enable-sctp include tests to measure SCTP performance
--enable-intervals include ability to pace operations, may affect
result
- --enable-spin paces operations should sit and spin - WILL affect
- result
+ --enable-spin paced operations (--enable-intervals) should sit and
+ spin - WILL affect result
--enable-burst include intial request burst ability in _RR tests,
may affect result
--enable-cpuutil include code to measure CPU utilization using
@@ -6569,7 +6570,53 @@
_ACEOF
fi
+# see if we should be enabling histogram support
+echo "$as_me:$LINENO: checking whether to include dirty support" >&5
+echo $ECHO_N "checking whether to include dirty support... $ECHO_C" >&6
+
+# Check whether --enable-dirty or --disable-dirty was given.
+if test "${enable_dirty+set}" = set; then
+ enableval="$enable_dirty"
+
+fi;
+
+case "$enable_dirty" in
+ yes)
+ use_dirty=true
+ ;;
+ no)
+ use_dirty=false
+ ;;
+ '')
+ # whatever
+ use_dirty=false
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: --enable-dirty takes yes or no" >&5
+echo "$as_me: error: --enable-dirty takes yes or no" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+if $use_dirty
+then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if $use_dirty
+then
+
+cat >>confdefs.h <<\_ACEOF
+#define DIRTY
+_ACEOF
+
+fi
+
# see if we should be enabling demo support
echo "$as_me:$LINENO: checking whether to include demo support" >&5
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-04-14 21:38:09 UTC (rev 67)
+++ trunk/configure.ac 2006-04-14 22:25:02 UTC (rev 68)
@@ -121,7 +121,41 @@
then
AC_DEFINE([WANT_HISTOGRAM],,[Define to one to enable histogram support. May affect results.])
fi
+# see if we should be enabling histogram support
+AC_MSG_CHECKING(whether to include dirty support)
+
+AC_ARG_ENABLE(dirty,
+ [AS_HELP_STRING([--enable-dirty],[write to buffers each time, may affect result]) ])
+
+case "$enable_dirty" in
+ yes)
+ use_dirty=true
+ ;;
+ no)
+ use_dirty=false
+ ;;
+ '')
+ # whatever
+ use_dirty=false
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-dirty takes yes or no])
+ ;;
+esac
+
+if $use_dirty
+then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+if $use_dirty
+then
+ AC_DEFINE([DIRTY],,[Define to one to enable dirty buffer support. May affect results.])
+fi
+
# see if we should be enabling demo support
AC_MSG_CHECKING(whether to include demo support)
@@ -378,7 +412,7 @@
AC_MSG_CHECKING([whether paced sends should spin])
AC_ARG_ENABLE(spin,
- [AS_HELP_STRING([--enable-spin],[paces operations should sit and spin - WILL affect result])])
+ [AS_HELP_STRING([--enable-spin],[paced operations (--enable-intervals) should sit and spin - WILL affect result])])
case "$enable_spin" in
yes)
Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c 2006-04-14 21:38:09 UTC (rev 67)
+++ trunk/src/netsh.c 2006-04-14 22:25:02 UTC (rev 68)
@@ -94,7 +94,7 @@
/* Some of the args take optional parameters. Since we are using */
/* getopt to parse the command line, we will tell getopt that they do */
/* not take parms, and then look for them ourselves */
-#define GLOBAL_CMD_LINE_ARGS "A:a:b:B:CcdDf:F:H:hi:I:l:L:n:O:o:P:p:t:T:v:W:w:46"
+#define GLOBAL_CMD_LINE_ARGS "A:a:b:B:CcdDf:F:H:hi:I:k:K:l:L:n:O:o:P:p:t:T:v:W:w:46"
/************************************************************************/
/* */
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-04-14 21:38:09 UTC (rev 67)
+++ trunk/src/nettest_bsd.c 2006-04-14 22:25:02 UTC (rev 68)
@@ -1196,7 +1196,7 @@
#ifdef DIRTY
int *message_int_ptr;
- int i;
+ int i,dirty_totals;
#endif
struct ring_elt *send_ring;
@@ -1491,21 +1491,41 @@
while ((!times_up) || (bytes_remaining > 0)) {
#ifdef DIRTY
- /* we want to dirty some number of consecutive integers in the buffer */
- /* we are about to send. we may also want to bring some number of */
- /* them cleanly into the cache. The clean ones will follow any dirty */
- /* ones into the cache. at some point, we might want to replace */
- /* the rand() call with something from a table to reduce our call */
- /* overhead during the test, but it is not a high priority item. */
+ /* we want to dirty some number of consecutive integers in the
+ buffer we are about to send. we may also want to bring some
+ number of them cleanly into the cache. The clean ones will
+ follow any dirty ones into the cache. at some point, we might
+ want to replace the rand() call with something from a table to
+ reduce our call overhead during the test, but it is not a high
+ priority item.
+
+ we should probably make sure that we don't go charging past the
+ end of the buffer, nor changing the counts when running with
+ confidence intervals. also, we probably neeed to do something
+ to make sure that a compiler's dead code elimination doesn't
+ take this stuff out. raj 2006-04-14 */
message_int_ptr = (int *)(send_ring->buffer_ptr);
- for (i = 0; i < loc_dirty_count; i++) {
+ for (i = 0;
+ ((i < loc_dirty_count) &&
+ (message_int_ptr < (send_ring->buffer_ptr + send_size)));
+ i++) {
*message_int_ptr = rand();
+ dirty_totals += *message_int_ptr;
message_int_ptr++;
}
- for (i = 0; i < loc_clean_count; i++) {
- loc_dirty_count = *message_int_ptr;
+ for (i = 0;
+ ((i < loc_clean_count) &&
+ (message_int_ptr < (send_ring->buffer_ptr + send_size)));
+ i++) {
+ dirty_totals += *message_int_ptr;
message_int_ptr++;
}
+ if (debug > 100) {
+ fprintf(where,
+ "This was here to try to avoid dead-code elimination %d\n",
+ dirty_totals);
+ fflush(where);
+ }
#endif /* DIRTY */
#ifdef WANT_HISTOGRAM
More information about the netperf-dev
mailing list