[netperf-dev] netperf2 commit notice r276 - trunk/src

raj at netperf.org raj at netperf.org
Tue Apr 22 14:21:36 PDT 2008


Author: raj
Date: 2008-04-22 14:21:35 -0700 (Tue, 22 Apr 2008)
New Revision: 276

Modified:
   trunk/src/nettest_omni.c
Log:
emit the current list of available outputs when a question mark is used as the name of the file passed to omni test-specific o or O options

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2008-04-04 19:20:33 UTC (rev 275)
+++ trunk/src/nettest_omni.c	2008-04-22 21:21:35 UTC (rev 276)
@@ -1020,7 +1020,27 @@
 {
 }
 
+void print_omni_init_list();
+
 void
+dump_netperf_output_list(FILE *where, int csv) {
+  int i;
+
+  print_omni_init_list();
+
+  for (i = OUTPUT_NONE; i < NETPERF_OUTPUT_MAX; i++){
+    if (OUTPUT_NONE != i) {
+      fprintf(where,"%c",(csv) ? ',' : '\n');
+    }
+    fprintf(where,
+	    "%s",
+	    netperf_output_enum_to_str(netperf_output_source[i].output_name));
+  }
+  fprintf(where,"\n");
+  fflush(where);
+}
+
+void
 dump_netperf_output_source(FILE *where)
 {
   int i;
@@ -1308,16 +1328,11 @@
 
 }
 
-/* lots of boring, repetitive code */
-void 
-print_omni_init() {
+void
+print_omni_init_list() {
 
-  int i,j;
+  int i;
 
-  if (printing_initialized) return;
-
-  printing_initialized = 1;
-
   /* belts and suspenders everyone... */
   for (i = OUTPUT_NONE; i < NETPERF_OUTPUT_MAX; i++) {
     netperf_output_source[i].output_name = i;
@@ -2917,6 +2932,19 @@
   netperf_output_source[OUTPUT_END].tot_line_len = 
     NETPERF_LINE_TOT(OUTPUT_END);
 
+}
+/* lots of boring, repetitive code */
+void 
+print_omni_init() {
+
+  int i,j;
+
+  if (printing_initialized) return;
+
+  printing_initialized = 1;
+
+  print_omni_init_list();
+
   /* belts and suspenders */
   for (i = OUTPUT_NONE; i < NETPERF_OUTPUT_MAX; i++)
     output_csv_list[i] = OUTPUT_END;
@@ -5574,6 +5602,12 @@
 	   list of desired output values. */
 	csv_selection_file = strdup(argv[optind]);
 	optind++;
+	/* special case - if the file name is "?" then we will emit a
+	   list of the available outputs */
+	if (strcmp(csv_selection_file,"?") == 0) {
+	  dump_netperf_output_list(where,1);
+	  exit(1);
+	}
       }
       break;
     case 'O':
@@ -5592,6 +5626,10 @@
 	   list of desired output values */
 	human_selection_file = strdup(argv[optind]);
 	optind++;
+	if (strcmp(human_selection_file,"?") == 0) {
+	  dump_netperf_output_list(where,0);
+	  exit(1);
+	}
       }
       break;
     case 'p':



More information about the netperf-dev mailing list