params->expireslop = 4;
params->verbose = !!DBG_ENABLED();
params->uninitvalue = 0;
+ params->maxexecutions = 0;
}
static void print_usage(const char *program_name, struct model_params *params)
"-b, --bound=MAX Upper length bound.\n"
" Default: %d\n"
"-v[NUM], --verbose[=NUM] Print verbose execution information. NUM is optional:\n"
-" 0 is quiet; 1 is noisy; 2 is noisier.\n"
+" 0 is quiet; 1 shows valid executions; 2 is noisy;\n"
+" 3 is noisier.\n"
" Default: %d\n"
"-u, --uninitialized=VALUE Return VALUE any load which may read from an\n"
" uninitialized atomic.\n"
" Default: %u\n"
"-t, --analysis=NAME Use Analysis Plugin.\n"
"-o, --options=NAME Option for previous analysis plugin. \n"
+"-x, --maxexec=NUM Maximum number of executions.\n"
+" Default: %u\n"
" -o help for a list of options\n"
" -- Program arguments follow.\n\n",
program_name,
params->enabledcount,
params->bound,
params->verbose,
- params->uninitvalue);
+ params->uninitvalue,
+ params->maxexecutions);
model_print("Analysis plugins:\n");
for(unsigned int i=0;i<registeredanalysis->size();i++) {
TraceAnalysis * analysis=(*registeredanalysis)[i];
static void parse_options(struct model_params *params, int argc, char **argv)
{
- const char *shortopts = "hyYt:o:m:M:s:S:f:e:b:u:v::";
+ const char *shortopts = "hyYt:o:m:M:s:S:f:e:b:u:x:v::";
const struct option longopts[] = {
{"help", no_argument, NULL, 'h'},
{"liveness", required_argument, NULL, 'm'},
{"uninitialized", optional_argument, NULL, 'u'},
{"analysis", optional_argument, NULL, 't'},
{"options", optional_argument, NULL, 'o'},
+ {"maxexecutions", required_argument, NULL, 'x'},
{0, 0, 0, 0} /* Terminator */
};
int opt, longindex;
case 'h':
print_usage(argv[0], params);
break;
+ case 'x':
+ params->maxexecutions = atoi(optarg);
+ break;
case 's':
params->maxfuturedelay = atoi(optarg);
break;
get_execution_number());
print_program_output();
- if (params.verbose >= 2) {
+ if (params.verbose >= 3) {
model_print("\nEarliest divergence point since last feasible execution:\n");
if (earliest_diverge)
earliest_diverge->print();
record_stats();
/* Output */
- if (params.verbose || (complete && execution->have_bug_reports()))
+ if ( (complete && params.verbose) || params.verbose>1 || (complete && execution->have_bug_reports()))
print_execution(complete);
else
clear_program_output();
execution_number++;
+ if (params.maxexecutions != 0 && stats.num_complete >= params.maxexecutions)
+ return false;
+
reset_to_initial_state();
return true;
}
model_print("Elapsed time in usec %llu\n", stats->elapsedtime);
model_print("SC count: %u\n", stats->sccount);
model_print("Non-SC count: %u\n", stats->nonsccount);
+ model_print("Total actions: %llu\n", stats->actions);
+ unsigned long long actionperexec=(stats->actions)/(stats->sccount+stats->nonsccount);
+ model_print("Actions per execution: %llu\n", actionperexec);
}
bool SCAnalysis::option(char * opt) {
action_list_t * SCAnalysis::generateSC(action_list_t *list) {
int numactions=buildVectors(list);
+ stats->actions+=numactions;
+
computeCV(list);
action_list_t *sclist = new action_list_t();