[Xorp-cvs] SF.net SVN: xorp:[11637] trunk/xorp/libxipc/tests/test_xrl_sender.cc

bms_fbsd at users.sourceforge.net bms_fbsd at users.sourceforge.net
Sat Nov 28 21:04:15 PST 2009


Revision: 11637
          http://xorp.svn.sourceforge.net/xorp/?rev=11637&view=rev
Author:   bms_fbsd
Date:     2009-11-29 05:04:14 +0000 (Sun, 29 Nov 2009)

Log Message:
-----------
Add -N <count> flag to control the number of XRL sends
per run. Defaults to 10000.

Modified Paths:
--------------
    trunk/xorp/libxipc/tests/test_xrl_sender.cc

Modified: trunk/xorp/libxipc/tests/test_xrl_sender.cc
===================================================================
--- trunk/xorp/libxipc/tests/test_xrl_sender.cc	2009-11-29 03:58:36 UTC (rev 11636)
+++ trunk/xorp/libxipc/tests/test_xrl_sender.cc	2009-11-29 05:04:14 UTC (rev 11637)
@@ -106,8 +106,8 @@
 //
 // Global variables
 //
-static uint32_t    MAX_XRL_ID	    = 10000;	// Number of Xrls in a test run
 static uint32_t    XRL_PIPE_SIZE    = 40;	// Maximum in flight
+static uint32_t    g_max_xrls_per_run	    = 10000;
 static uint32_t    g_send_method    = SEND_METHOD_PIPELINE;
 static uint32_t    g_send_style     = SEND_CMDLINE_VAR_XRL;
 static uint32_t    g_atoms_per_xrl  = 1;
@@ -329,7 +329,7 @@
 void
 TestSender::send_batch()
 {
-    unsigned xrls = 100000;
+    unsigned int xrls = 100000;
 
     // XXX get target into finder cache
     bool rc = transmit_xrl_next(&TestSender::send_batch_cb);
@@ -634,6 +634,7 @@
     fprintf(output, "           -h                                    : usage (this message)\n");
     fprintf(output, "           -m <M>                                : send method (see below)\n");
     fprintf(output, "           -n <count>                            : number of XrlAtoms in each Xrl call\n");
+    fprintf(output, "           -N <count>                            : number of Xrls to send in a test run\n");
     fprintf(output, "           -r                                    : run receiver in same process\n");
     fprintf(output, "           -a                                    : eventloop aggressiveness\n");
     fprintf(output, "           -1                                    : parameter 1\n");
@@ -670,7 +671,7 @@
     XrlStdRouter xrl_std_router_test_sender(eventloop, "test_xrl_sender",
 					    finder_hostname, finder_port);
     TestSender test_sender(eventloop, &xrl_std_router_test_sender,
-			   MAX_XRL_ID);
+			   g_max_xrls_per_run);
     g_test_sender = &test_sender;
 
     xrl_std_router_test_sender.finalize();
@@ -744,7 +745,7 @@
     //
     // Get the program options
     //
-    while ((ch = getopt(argc, argv, "F:hm:n:ra:1:2:")) != -1) {
+    while ((ch = getopt(argc, argv, "F:hm:n:N:ra:1:2:")) != -1) {
 	switch (ch) {
 	case 'a':
 	    g_aggressiveness = atoi(optarg);
@@ -782,6 +783,9 @@
 	case 'n':
 	    g_atoms_per_xrl = atoi(optarg);
 	    break;
+	case 'N':
+	    g_max_xrls_per_run = atoi(optarg);
+	    break;
 	case 'r':
 	    g_run_receiver = true;
 	    break;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Xorp-cvs mailing list