[netperf-dev] netperf2 commit notice r196 - trunk/src
raj at netperf.org
raj at netperf.org
Thu Jan 31 14:34:09 PST 2008
Author: raj
Date: 2008-01-31 14:34:08 -0800 (Thu, 31 Jan 2008)
New Revision: 196
Modified:
trunk/src/netsh.c
trunk/src/nettest_bsd.c
trunk/src/nettest_bsd.h
trunk/src/nettest_omni.c
Log:
always more tweaks for omni
Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c 2008-01-31 21:38:59 UTC (rev 195)
+++ trunk/src/netsh.c 2008-01-31 22:34:08 UTC (rev 196)
@@ -423,20 +423,28 @@
}
#ifdef IPPROTO_TCP
- if (strstr(temp,"tcp"))
+ if (strstr(temp,"tcp")){
+ socket_type = SOCK_STREAM;
return IPPROTO_TCP;
+ }
#endif
#ifdef IPPROTO_UDP
- if (strstr(temp,"udp"))
+ if (strstr(temp,"udp")) {
+ socket_type = SOCK_DGRAM;
return IPPROTO_UDP;
+ }
#endif
#ifdef IPPROTO_SCTP
- if (strstr(temp,"sctp"))
+ if (strstr(temp,"sctp")) {
+ /* it can be more than one socket type */
return IPPROTO_SCTP;
+ }
#endif
#ifdef IPPROTO_SDP
- if (strstr(temp,"sdp"))
+ if (strstr(temp,"sdp")) {
+ socket_type = SOCK_STREAM;
return IPPROTO_SDP;
+ }
#endif
return IPPROTO_IP;
}
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2008-01-31 21:38:59 UTC (rev 195)
+++ trunk/src/nettest_bsd.c 2008-01-31 22:34:08 UTC (rev 196)
@@ -147,6 +147,7 @@
#include "hist.h"
#endif /* WANT_HISTOGRAM */
+
/* make first_burst_size unconditional so we can use it easily enough
when calculating transaction latency for the TCP_RR test. raj
2007-06-08 however, change its default value so one can tell in
@@ -169,6 +170,7 @@
*/
int
+ socket_type, /* used initially by the "omni" tests */
rss_size_req = -1, /* requested remote socket send buffer size */
rsr_size_req = -1, /* requested remote socket recv buffer size */
rss_size, /* initial remote socket send buffer size */
@@ -6077,7 +6079,7 @@
since this is basically the last thing we are going to do with
it, it does not matter. so there :) raj 2007-06-08 */
/* if the user was asking for transactions, then we report
- megabits per sedcond for the unidirectional throughput,
+ megabits per second for the unidirectional throughput,
otherwise we use the desired units. */
if ('x' == libfmt) {
libfmt = 'm';
Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h 2008-01-31 21:38:59 UTC (rev 195)
+++ trunk/src/nettest_bsd.h 2008-01-31 22:34:08 UTC (rev 196)
@@ -481,6 +481,7 @@
};
extern int
+ socket_type, /* initially used by the "omni" tests */
rss_size_req, /* requested remote socket send buffer size */
rsr_size_req, /* requested remote socket recv buffer size */
rss_size, /* remote socket send buffer size */
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2008-01-31 21:38:59 UTC (rev 195)
+++ trunk/src/nettest_omni.c 2008-01-31 22:34:08 UTC (rev 196)
@@ -234,7 +234,6 @@
double rem_cpu_confid_pct = -1.0;
double interval_pct = -1.0;
-int socket_type;
int protocol;
int direction;
int remote_send_size = -1;
@@ -272,16 +271,21 @@
uint64_t remote_bytes_received;
uint64_t remote_send_calls;
uint64_t remote_receive_calls;
- double bytes_xferd;
- double remote_bytes_xferd;
- double remote_bytes_per_recv;
- double remote_bytes_per_send;
- float elapsed_time;
- float local_cpu_utilization;
- float local_service_demand;
- float remote_cpu_utilization;
- float remote_service_demand;
- double thruput;
+double bytes_xferd;
+double remote_bytes_xferd;
+double remote_bytes_per_recv;
+double remote_bytes_per_send;
+float elapsed_time;
+float local_cpu_utilization;
+float local_service_demand;
+float remote_cpu_utilization;
+float remote_service_demand;
+double thruput;
+double local_send_thruput;
+double local_recv_thruput;
+double remote_send_thruput;
+double remote_recv_thruput;
+
/* kludges for omni output */
double elapsed_time_double;
double local_cpu_utilization_double;
@@ -347,6 +351,10 @@
DEST_ADDR,
DEST_FAMILY,
THROUGHPUT,
+ LOCAL_SEND_THROUGHPUT,
+ LOCAL_RECV_THROUGHPUT,
+ REMOTE_SEND_THROUGHPUT,
+ REMOTE_RECV_THROUGHPUT,
THROUGHPUT_UNITS,
CONFIDENCE_LEVEL,
CONFIDENCE_INTERVAL,
@@ -579,6 +587,14 @@
return "DEST_FAMILY";
case THROUGHPUT:
return "THROUGHPUT";
+ case LOCAL_SEND_THROUGHPUT:
+ return "LOCAL_SEND_THROUGHPUT";
+ case LOCAL_RECV_THROUGHPUT:
+ return "LOCAL_RECV_THROUGHPUT";
+ case REMOTE_SEND_THROUGHPUT:
+ return "REMOTE_SEND_THROUGHPUT";
+ case REMOTE_RECV_THROUGHPUT:
+ return "REMOTE_RECV_THROUGHPUT";
case THROUGHPUT_UNITS:
return "THROUGHPUT_UNITS";
case CONFIDENCE_LEVEL:
@@ -977,6 +993,10 @@
output_csv_list[i++] = REMOTE_RECV_SIZE;
output_csv_list[i++] = RESPONSE_SIZE;
output_csv_list[i++] = THROUGHPUT;
+ output_csv_list[i++] = LOCAL_SEND_THROUGHPUT;
+ output_csv_list[i++] = LOCAL_RECV_THROUGHPUT;
+ output_csv_list[i++] = REMOTE_SEND_THROUGHPUT;
+ output_csv_list[i++] = REMOTE_RECV_THROUGHPUT;
output_csv_list[i++] = THROUGHPUT_UNITS;
output_csv_list[i++] = LOCAL_CPU_UTIL;
output_csv_list[i++] = REMOTE_CPU_UTIL;
@@ -1212,6 +1232,50 @@
netperf_output_source[THROUGHPUT].tot_line_len =
NETPERF_LINE_TOT(THROUGHPUT);
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].output_name = LOCAL_SEND_THROUGHPUT;
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].line[0] = "Local";
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].line[1] = "Send";
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].line[2] = "Throughput";
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].format = "%.2f";
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].display_value = &local_send_thruput;
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].max_line_len =
+ NETPERF_LINE_MAX(LOCAL_SEND_THROUGHPUT);
+ netperf_output_source[LOCAL_SEND_THROUGHPUT].tot_line_len =
+ NETPERF_LINE_TOT(LOCAL_SEND_THROUGHPUT);
+
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].output_name = LOCAL_RECV_THROUGHPUT;
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].line[0] = "Local";
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].line[1] = "Recv";
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].line[2] = "Throughput";
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].format = "%.2f";
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].display_value = &local_recv_thruput;
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].max_line_len =
+ NETPERF_LINE_MAX(LOCAL_RECV_THROUGHPUT);
+ netperf_output_source[LOCAL_RECV_THROUGHPUT].tot_line_len =
+ NETPERF_LINE_TOT(LOCAL_RECV_THROUGHPUT);
+
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].output_name = REMOTE_SEND_THROUGHPUT;
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].line[0] = "Remote";
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].line[1] = "Send";
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].line[2] = "Throughput";
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].format = "%.2f";
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].display_value = &remote_send_thruput;
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].max_line_len =
+ NETPERF_LINE_MAX(REMOTE_SEND_THROUGHPUT);
+ netperf_output_source[REMOTE_SEND_THROUGHPUT].tot_line_len =
+ NETPERF_LINE_TOT(REMOTE_SEND_THROUGHPUT);
+
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].output_name = REMOTE_RECV_THROUGHPUT;
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].line[0] = "Remote";
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].line[1] = "Recv";
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].line[2] = "Throughput";
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].format = "%.2f";
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].display_value = &remote_recv_thruput;
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].max_line_len =
+ NETPERF_LINE_MAX(REMOTE_RECV_THROUGHPUT);
+ netperf_output_source[REMOTE_RECV_THROUGHPUT].tot_line_len =
+ NETPERF_LINE_TOT(REMOTE_RECV_THROUGHPUT);
+
netperf_output_source[THROUGHPUT_UNITS].output_name = THROUGHPUT_UNITS;
netperf_output_source[THROUGHPUT_UNITS].line[0] = "Throughput";
netperf_output_source[THROUGHPUT_UNITS].line[1] = "Units";
@@ -2667,7 +2731,6 @@
int need_socket;
int temp_recvs;
-
struct addrinfo *local_res;
struct addrinfo *remote_res;
@@ -3583,6 +3646,15 @@
interval_pct = interval * 100.0;
}
+ /* at some point we need to average these during a confidence
+ interval run, and when we do do that, we need to make sure we
+ restore the value of libfmt correctly */
+ if ('x' == libfmt) libfmt = 'm';
+ local_send_thruput = calc_thruput(bytes_sent);
+ local_recv_thruput = calc_thruput(bytes_received);
+ remote_send_thruput = calc_thruput(remote_bytes_sent);
+ remote_recv_thruput = calc_thruput(remote_bytes_received);
+
print_omni();
#if defined(DEBUG_OMNI_OUTPUT)
@@ -4465,7 +4537,6 @@
case 't':
/* set the socket type */
socket_type = parse_socket_type(optarg);
- socket_type_str = hst_to_str(socket_type);
break;
case 'T':
/* set the protocol - aka "Transport" */
@@ -4503,6 +4574,7 @@
};
}
+ socket_type_str = hst_to_str(socket_type);
protocol_str = protocol_to_str(protocol);
direction_str = direction_to_str(direction);
/* some other sanity checks we need to make would include stuff when
More information about the netperf-dev
mailing list