Add linter mode

This commit is contained in:
Rodrigo Arias 2021-11-08 17:06:17 +01:00
parent 4fcef1c5b6
commit 97320eda4e
2 changed files with 10 additions and 1 deletions

8
emu.c
View File

@ -426,6 +426,9 @@ next_event(struct ovni_emu *emu)
{ {
err("warning: backwards jump in time %lu -> %lu for tid %d\n", err("warning: backwards jump in time %lu -> %lu for tid %d\n",
emu->lastclock, stream->lastclock, stream->tid); emu->lastclock, stream->lastclock, stream->tid);
if(emu->enable_linter)
exit(EXIT_FAILURE);
} }
emu->lastclock = stream->lastclock; emu->lastclock = stream->lastclock;
@ -756,13 +759,16 @@ parse_args(struct ovni_emu *emu, int argc, char *argv[])
{ {
int opt; int opt;
while((opt = getopt(argc, argv, "c:")) != -1) while((opt = getopt(argc, argv, "c:l")) != -1)
{ {
switch(opt) switch(opt)
{ {
case 'c': case 'c':
emu->clock_offset_file = optarg; emu->clock_offset_file = optarg;
break; break;
case 'l':
emu->enable_linter = 1;
break;
default: /* '?' */ default: /* '?' */
usage(argc, argv); usage(argc, argv);
} }

3
emu.h
View File

@ -449,6 +449,9 @@ struct ovni_emu {
/* Counters for statistics */ /* Counters for statistics */
int64_t nev_processed; int64_t nev_processed;
/* Be strict */
int enable_linter;
FILE *prv_thread; FILE *prv_thread;
FILE *prv_cpu; FILE *prv_cpu;
FILE *pcf_thread; FILE *pcf_thread;