From 97320eda4ec92c77b014db929446bd3f8987c9a8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 8 Nov 2021 17:06:17 +0100 Subject: [PATCH] Add linter mode --- emu.c | 8 +++++++- emu.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/emu.c b/emu.c index ccf0f41..ab501cb 100644 --- a/emu.c +++ b/emu.c @@ -426,6 +426,9 @@ next_event(struct ovni_emu *emu) { err("warning: backwards jump in time %lu -> %lu for tid %d\n", emu->lastclock, stream->lastclock, stream->tid); + + if(emu->enable_linter) + exit(EXIT_FAILURE); } emu->lastclock = stream->lastclock; @@ -756,13 +759,16 @@ parse_args(struct ovni_emu *emu, int argc, char *argv[]) { int opt; - while((opt = getopt(argc, argv, "c:")) != -1) + while((opt = getopt(argc, argv, "c:l")) != -1) { switch(opt) { case 'c': emu->clock_offset_file = optarg; break; + case 'l': + emu->enable_linter = 1; + break; default: /* '?' */ usage(argc, argv); } diff --git a/emu.h b/emu.h index 1e390ac..e31ccf5 100644 --- a/emu.h +++ b/emu.h @@ -449,6 +449,9 @@ struct ovni_emu { /* Counters for statistics */ int64_t nev_processed; + /* Be strict */ + int enable_linter; + FILE *prv_thread; FILE *prv_cpu; FILE *pcf_thread;