#include <threads.h>
#include "common.h"
#include "threads-model.h"
+#include "output.h"
#include "datarace.h"
params->enabledcount = 1;
params->bound = 0;
params->maxfuturevalues = 0;
- params->expireslop = 2;
+ params->expireslop = 10;
+ params->verbose = 0;
}
static void print_usage(struct model_params *params) {
/* Reset defaults before printing */
param_defaults(params);
- printf(
+ model_print(
"Usage: <program name> [MC_OPTIONS] -- [PROGRAM ARGUMENTS]\n"
"\n"
"Options:\n"
" priority for execution. Default: %d\n"
"-e Enabled count. Default: %d\n"
"-b Upper length bound. Default: %d\n"
+"-v Print verbose execution information.\n"
"-- Program arguments follow.\n\n",
params->maxreads, params->maxfuturevalues, params->maxfuturedelay, params->expireslop, params->fairwindow, params->enabledcount, params->bound);
exit(EXIT_SUCCESS);
}
static void parse_options(struct model_params *params, int *argc, char ***argv) {
- const char *shortopts = "hm:M:s:S:f:e:b:";
+ const char *shortopts = "hm:M:s:S:f:e:b:v";
int opt;
bool error = false;
while (!error && (opt = getopt(*argc, *argv, shortopts)) != -1) {
case 'M':
params->maxfuturevalues = atoi(optarg);
break;
+ case 'v':
+ params->verbose = 1;
+ break;
default: /* '?' */
error = true;
break;
model->finish_execution();
} while (model->next_execution());
+ model->print_stats();
+
delete model;
DEBUG("Exiting\n");
main_argc = argc;
main_argv = argv;
+ /* Configure output redirection for the model-checker */
+ redirect_output();
+
/* Let's jump in quickly and start running stuff */
initSnapshotLibrary(10000, 1024, 1024, 4000, &model_main);
}