From 44637de3b2e779758a4dc5eff0122688ab5a228f Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 19 Jan 2025 13:25:39 +0100 Subject: [PATCH] T hacks: minor bugfix: don't log more than once In time_meas.c, when getting 0 for the event, we log delta time with previous 1 for the event. "start_valid" was not cleared, so receiving a second 0 without 1 in between may lead to wrong logging. Should not happen in practice, but still, little bug. (Note: we don't protect against streams of 1, but this case should also not happen.) --- common/utils/T/tracer/hacks/time_meas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/utils/T/tracer/hacks/time_meas.c b/common/utils/T/tracer/hacks/time_meas.c index dccba130ad..6e8f1f3bbb 100644 --- a/common/utils/T/tracer/hacks/time_meas.c +++ b/common/utils/T/tracer/hacks/time_meas.c @@ -104,6 +104,7 @@ printf("yo %d\n", on_off); } if (on_off != 0) { printf("fatal!\n"); abort(); } if (!start_valid) continue; + start_valid = 0; stop_time = e.sending_time; delta_time = time_sub(stop_time, start_time); fprintf(stderr, "%ld\n",