From e5c37ba0f419fd6c46d11ee9ec909b3fa9d2aa2f Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 24 Jul 2024 17:39:55 +0200 Subject: log: Initialise timestamp for relative log time also if we use a log file ...not just for debug messages. Otherwise, timestamps in the log file are consistent but the starting point is not zero. Do this right away as we enter main(), so that the resulting timestamps are as closely as possible relative to when we start. Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- passt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'passt.c') diff --git a/passt.c b/passt.c index eed74ec..72ad704 100644 --- a/passt.c +++ b/passt.c @@ -207,6 +207,8 @@ int main(int argc, char **argv) struct timespec now; struct sigaction sa; + clock_gettime(CLOCK_REALTIME, &log_start); + arch_avx2_exec(argv); isolate_initial(); -- cgit v1.2.3