[netperf-dev] netperf2 commit notice r52 - in trunk: . src
raj at netperf.org
raj at netperf.org
Thu Feb 2 00:04:10 PST 2006
Author: raj
Date: 2006-02-02 00:04:06 -0800 (Thu, 02 Feb 2006)
New Revision: 52
Added:
trunk/README.osx
Modified:
trunk/src/netsh.c
trunk/src/netsh.h
trunk/src/nettest_bsd.c
Log:
Add the global -B option which takes a string that will be appended to
results when the printing of test headers is suppressed. This is to allow
one to know which result is which when running multiple, concurrent tests
without having to redirect each to a separate file. If no -B option is
supplied, a null string will be emitted so the output will look just like
it did before. This has been added to the TCP_STREAM, TCP_MAERTS and
TCP_RR tests but not as yet to any others.
Added: trunk/README.osx
===================================================================
--- trunk/README.osx 2006-02-01 22:24:12 UTC (rev 51)
+++ trunk/README.osx 2006-02-02 08:04:06 UTC (rev 52)
@@ -0,0 +1,16 @@
+When compiling under MacOS X you may encounter problems with the
+NetPerf and NetServer directories in src/. Seems that filenames can
+be case insensitive in OSX and so there are conflicts with the netperf
+and netserver binaries the makefile will try to create. Brilliant!
+
+As NetPerf/ and NetServer/ are only for Windows compilation, you can
+safely rename them to NetPerf.dir and NetServer.dir and the make will
+be fat dumb and happy.
+
+However, if you are using subversion to grab bits, it will become
+rather cranky at commit or update time - it will miss NetPerf and
+NetServer and will complain bitterly until you move them back again.
+
+At some point it is hoped that those two directories can be renamed so
+there is no case-insensitive conflict between them and the names of
+the binaries.
Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c 2006-02-01 22:24:12 UTC (rev 51)
+++ trunk/src/netsh.c 2006-02-02 08:04:06 UTC (rev 52)
@@ -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: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:l:L:n:O:o:P:p:t:T:v:W:w:46"
/************************************************************************/
/* */
@@ -137,6 +137,12 @@
print_headers, /* do/don't display headers */
verbosity; /* verbosity level */
+/* When specified with -B, this will be displayed at the end of the line
+ for output that does not include the test header. mostly this is
+ to help identify a specific netperf result when concurrent netperfs
+ are run. raj 2006-02-01 */
+char *result_brand = NULL;
+
/* cpu variables */
int
local_cpu_usage, /* you guessed it */
@@ -239,6 +245,7 @@
Global options:\n\
-a send,recv Set the local send,recv buffer alignment\n\
-A send,recv Set the remote send,recv buffer alignment\n\
+ -B brandstr Specify a string to be emitted with brief output\n\
-c [cpu_rate] Report local CPU usage\n\
-C [cpu_rate] Report remote CPU usage\n\
-d Increase debugging output\n\
@@ -717,6 +724,16 @@
"Packet burst size is not compiled in. \n");
#endif /* WANT_INTERVALS */
break;
+ case 'B':
+ result_brand = malloc(strlen(optarg)+1);
+ if (NULL != result_brand) {
+ strcpy(result_brand,optarg);
+ }
+ else {
+ fprintf(where,
+ "Unable to malloc space for result brand\n");
+ }
+ break;
case '4':
address_family = AF_INET;
local_address_family = AF_INET;
Modified: trunk/src/netsh.h
===================================================================
--- trunk/src/netsh.h 2006-02-01 22:24:12 UTC (rev 51)
+++ trunk/src/netsh.h 2006-02-02 08:04:06 UTC (rev 52)
@@ -130,6 +130,9 @@
extern char
fill_file[BUFSIZ];
+extern char *
+ result_brand;
+
#ifdef WANT_DLPI
extern int
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-02-01 22:24:12 UTC (rev 51)
+++ trunk/src/nettest_bsd.c 2006-02-02 08:04:06 UTC (rev 52)
@@ -1063,10 +1063,10 @@
bytes bytes bytes secs. %s/sec \n\n";
char *tput_fmt_0 =
- "%7.2f\n";
+ "%7.2f %s\n";
char *tput_fmt_1 =
- "%6d %6d %6d %-6.2f %7.2f \n";
+ "%6d %6d %6d %-6.2f %7.2f %s\n";
char *cpu_title = "\
Recv Send Send Utilization Service Demand\n\
@@ -1075,10 +1075,10 @@
bytes bytes bytes secs. %-8.8s/s %% %c %% %c us/KB us/KB\n\n";
char *cpu_fmt_0 =
- "%6.3f %c\n";
+ "%6.3f %c %s\n";
char *cpu_fmt_1 =
- "%6d %6d %6d %-6.2f %7.2f %-6.2f %-6.2f %-6.3f %-6.3f\n";
+ "%6d %6d %6d %-6.2f %7.2f %-6.2f %-6.2f %-6.3f %-6.3f %s\n";
char *ksink_fmt = "\n\
Alignment Offset %-8.8s %-8.8s Sends %-8.8s Recvs\n\
@@ -1656,16 +1656,20 @@
switch (verbosity) {
case 0:
if (local_cpu_usage) {
- fprintf(where,
+ fprintf(where,
cpu_fmt_0,
local_service_demand,
- local_cpu_method);
+ local_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
else {
- fprintf(where,
+ fprintf(where,
cpu_fmt_0,
remote_service_demand,
- remote_cpu_method);
+ remote_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
break;
case 1:
@@ -1688,7 +1692,9 @@
local_cpu_utilization, /* local cpu */
remote_cpu_utilization, /* remote cpu */
local_service_demand, /* local service demand */
- remote_service_demand); /* remote service demand */
+ remote_service_demand, /* remote service demand */
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
}
}
@@ -1699,7 +1705,9 @@
case 0:
fprintf(where,
tput_fmt_0,
- thruput);
+ thruput,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
case 1:
case 2:
@@ -1712,7 +1720,9 @@
lss_size, /* local sendbuf size */
send_size, /* how large were the sends */
elapsed_time, /* how long did it take */
- thruput);/* how fast did it go */
+ thruput, /* how fast did it go */
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
}
}
@@ -1779,10 +1789,10 @@
bytes bytes bytes secs. %s/sec \n\n";
char *tput_fmt_0 =
- "%7.2f\n";
+ "%7.2f %s\n";
char *tput_fmt_1 =
- "%6d %6d %6d %-6.2f %7.2f \n";
+ "%6d %6d %6d %-6.2f %7.2f \n %s";
char *cpu_title = "\
Recv Send Send Utilization Service Demand\n\
@@ -1791,10 +1801,10 @@
bytes bytes bytes secs. %-8.8s/s %% %c %% %c us/KB us/KB\n\n";
char *cpu_fmt_0 =
- "%6.3f %c\n";
+ "%6.3f %c %s\n";
char *cpu_fmt_1 =
- "%6d %6d %6d %-6.2f %7.2f %-6.2f %-6.2f %-6.3f %-6.3f\n";
+ "%6d %6d %6d %-6.2f %7.2f %-6.2f %-6.2f %-6.3f %-6.3f %s\n";
char *ksink_fmt = "\n\
Alignment Offset %-8.8s %-8.8s Recvs %-8.8s Sends\n\
@@ -2378,13 +2388,17 @@
fprintf(where,
cpu_fmt_0,
local_service_demand,
- local_cpu_method);
+ local_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
else {
fprintf(where,
cpu_fmt_0,
remote_service_demand,
- remote_cpu_method);
+ remote_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
break;
case 1:
@@ -2407,7 +2421,9 @@
local_cpu_utilization, /* local cpu */
remote_cpu_utilization, /* remote cpu */
local_service_demand, /* local service demand */
- remote_service_demand); /* remote service demand */
+ remote_service_demand, /* remote service demand */
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
}
}
@@ -2418,7 +2434,9 @@
case 0:
fprintf(where,
tput_fmt_0,
- thruput);
+ thruput,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
case 1:
case 2:
@@ -2431,7 +2449,9 @@
rss_size, /* remot sendbuf size */
send_size, /* how large were the recvs */
elapsed_time, /* how long did it take */
- thruput);/* how fast did it go */
+ thruput, /* how fast did it go */
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
}
}
@@ -2631,7 +2651,7 @@
exit (1);
}
if (debug) {
- fprintf (where, "send_tcp_stream: qhandle=%d\n", exs_qhandle);
+ fprintf (where, "send_exs_tcp_stream: qhandle=%d\n", exs_qhandle);
}
/* we have a great-big while loop which controls the number of times */
@@ -4873,10 +4893,10 @@
bytes Bytes bytes bytes secs. per sec \n\n";
char *tput_fmt_0 =
- "%7.2f\n";
+ "%7.2f %s\n";
char *tput_fmt_1_line_1 = "\
-%-6d %-6d %-6d %-6d %-6.2f %7.2f \n";
+%-6d %-6d %-6d %-6d %-6.2f %7.2f %s\n";
char *tput_fmt_1_line_2 = "\
%-6d %-6d\n";
@@ -4887,10 +4907,10 @@
bytes bytes bytes bytes secs. per sec %% %c %% %c us/Tr us/Tr\n\n";
char *cpu_fmt_0 =
- "%6.3f %c\n";
+ "%6.3f %c %s\n";
char *cpu_fmt_1_line_1 = "\
-%-6d %-6d %-6d %-6d %-6.2f %-6.2f %-6.2f %-6.2f %-6.3f %-6.3f\n";
+%-6d %-6d %-6d %-6d %-6.2f %-6.2f %-6.2f %-6.2f %-6.3f %-6.3f %s\n";
char *cpu_fmt_1_line_2 = "\
%-6d %-6d\n";
@@ -5496,13 +5516,17 @@
fprintf(where,
cpu_fmt_0,
local_service_demand,
- local_cpu_method);
+ local_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
else {
fprintf(where,
cpu_fmt_0,
remote_service_demand,
- remote_cpu_method);
+ remote_cpu_method,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
}
break;
case 1:
@@ -5525,7 +5549,9 @@
local_cpu_utilization, /* local cpu */
remote_cpu_utilization, /* remote cpu */
local_service_demand, /* local service demand */
- remote_service_demand); /* remote service demand */
+ remote_service_demand, /* remote service demand */
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
fprintf(where,
cpu_fmt_1_line_2,
rss_size,
@@ -5540,7 +5566,9 @@
case 0:
fprintf(where,
tput_fmt_0,
- thruput);
+ thruput,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
break;
case 1:
case 2:
@@ -5555,7 +5583,9 @@
req_size, /* how large were the requests */
rsp_size, /* how large were the responses */
elapsed_time, /* how long did it take */
- thruput);
+ thruput,
+ ((print_headers) ||
+ (result_brand == NULL)) ? "" : result_brand);
fprintf(where,
tput_fmt_1_line_2,
rss_size, /* remote recvbuf size */
@@ -12043,6 +12073,7 @@
}
#endif
#endif
+
/* we do not want to make remote_data_address non-NULL because if
the user has not specified a remote adata address, we want to
take it from the hostname in the -H global option. raj
More information about the netperf-dev
mailing list