[Spread-cvs] commit: r418 - branches/events_testing/daemon
jschultz at spread.org
jschultz at spread.org
Sun May 17 19:35:01 EDT 2009
Author: jschultz
Date: 2009-05-17 19:35:01 -0400 (Sun, 17 May 2009)
New Revision: 418
Modified:
branches/events_testing/daemon/microbench_events_pipes.c
Log:
Added elevation counts to the command line inputs and made the Seed dependent on start time.
Modified: branches/events_testing/daemon/microbench_events_pipes.c
===================================================================
--- branches/events_testing/daemon/microbench_events_pipes.c 2009-05-17 22:52:48 UTC (rev 417)
+++ branches/events_testing/daemon/microbench_events_pipes.c 2009-05-17 23:35:01 UTC (rev 418)
@@ -6,17 +6,21 @@
#include <sys/ioctl.h>
+#include <stdutil/stdutil.h>
#include <stdutil/stdskl.h>
+
#include <sp_events.h>
/***************************************************************************************************************************
***************************************************************************************************************************/
-int Num_Pipes = 1000;
-int Num_Ops = 100000;
-int Num_Pending = 1;
-sp_time Timeout = { 1, 0 };
-int Seed = 0;
+int Num_Pipes = 1000;
+int Num_Ops = 100000;
+int Num_Pending = 1;
+unsigned High_Elevate = 1;
+unsigned Low_Elevate = 1;
+int Seed = 0;
+sp_time Timeout = { 1, 0 };
int Num_Ops_Done = 0;
int Num_Ops_Cmplt = 0;
@@ -152,9 +156,20 @@
void usage(int argc, char ** argv)
{
+ sp_time t = E_get_time();
+
+ Seed = (int) stdhcode_sfh(&t, sizeof(t));
+
switch (argc) {
+
+ case 7:
+ Seed = atoi(argv[6]);
+
+ case 6:
+ Low_Elevate = atoi(argv[5]);
+
case 5:
- Seed = atoi(argv[4]);
+ High_Elevate = atoi(argv[4]);
case 4:
Num_Pending = atoi(argv[3]);
@@ -169,7 +184,7 @@
break;
default:
- fprintf(stderr, "Usage: %s [Num_Pipes [Num_Ops [Seed] ] ]\r\n", argv[0]);
+ fprintf(stderr, "Usage: %s [Num_Pipes [Num_Ops [Num_Pending [Seed]]]]\r\n", argv[0]);
exit(-1);
}
@@ -185,6 +200,7 @@
perror("stdskl_construct failed"), abort();
}
+ fprintf(stdout, "Seed is %d\r\n", Seed);
srand(Seed);
}
@@ -274,8 +290,8 @@
/* loop handling events */
- E_set_elevate_count(HIGH_PRIORITY, 1);
- E_set_elevate_count(LOW_PRIORITY, 1);
+ E_set_elevate_count(HIGH_PRIORITY, High_Elevate);
+ E_set_elevate_count(LOW_PRIORITY, Low_Elevate);
E_queue(delta_timeout, 0, NULL, Timeout);
E_queue_periodic(periodic_timeout, -1, NULL, Timeout);
@@ -292,7 +308,7 @@
T3.sec, T3.usec, Num_Ops / (T3.sec + T3.usec / 1000000.0));
fini();
- fprintf(stdout, "Bye!\r\n");
+ fprintf(stdout, "Seed was %d! Bye!\r\n", Seed);
return 0;
}
More information about the Spread-cvs
mailing list