From: Julien Desfossez Date: Fri, 10 Nov 2017 21:21:46 +0000 (-0500) Subject: Fix: lttng logs nanoseconds X-Git-Tag: v2.10.4~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6ea623231467f9f787781ea64f9027836522948b;p=lttng-tools.git Fix: lttng logs nanoseconds Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/error.c b/src/common/error.c index 2215886db..db3042318 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -59,7 +59,7 @@ const char *log_add_time(void) /* Format time in the TLS variable. */ ret = snprintf(URCU_TLS(error_log_time).str, sizeof(URCU_TLS(error_log_time).str), - "%02d:%02d:%02d.%06ld", + "%02d:%02d:%02d.%09ld", tm.tm_hour, tm.tm_min, tm.tm_sec, tp.tv_nsec); if (ret < 0) { goto error; diff --git a/src/common/error.h b/src/common/error.h index 6fe8d8c2d..c90c4ae07 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -48,8 +48,8 @@ * every time a log is fired. */ struct log_time { - /* Format: 00:00:00.000000 plus NULL byte. */ - char str[16]; + /* Format: 00:00:00.000000000 plus NULL byte. */ + char str[19]; }; extern DECLARE_URCU_TLS(struct log_time, error_log_time);