Add breakdown option

This commit is contained in:
Rodrigo Arias 2023-02-28 19:15:13 +01:00 committed by Rodrigo Arias Mallo
parent 029e185c6c
commit 31f24a2a55
2 changed files with 8 additions and 2 deletions

View File

@ -17,13 +17,15 @@ usage(void)
{
rerr("%s -- version %s\n", progname, version);
rerr("\n");
rerr("Usage: %s [-c offsetfile] [-lh] tracedir\n", progname);
rerr("Usage: %s [-c offsetfile] [-blh] tracedir\n", progname);
rerr("\n");
rerr("Options:\n");
rerr(" -c offsetfile Use the given offset file to correct\n");
rerr(" the clocks among nodes. It can be\n");
rerr(" generated by the ovnisync program\n");
rerr("\n");
rerr(" -b Enable breakdown model (costly)\n");
rerr("\n");
rerr(" -l Enable linter mode. Extra tests will\n");
rerr(" be performed.\n");
rerr("\n");
@ -42,7 +44,7 @@ emu_args_init(struct emu_args *args, int argc, char *argv[])
memset(args, 0, sizeof(struct emu_args));
int opt;
while ((opt = getopt(argc, argv, "c:lh")) != -1) {
while ((opt = getopt(argc, argv, "bc:lh")) != -1) {
switch (opt) {
case 'c':
args->clock_offset_file = optarg;
@ -50,6 +52,9 @@ emu_args_init(struct emu_args *args, int argc, char *argv[])
case 'l':
args->linter_mode = 1;
break;
case 'b':
args->breakdown = 1;
break;
case 'h':
default: /* '?' */
usage();

View File

@ -6,6 +6,7 @@
struct emu_args {
int linter_mode;
int breakdown;
char *clock_offset_file;
char *tracedir;
};