From 870bdaf901db6f8ff0931b63451ead96a10a474d Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 10 Nov 2017 16:21:46 -0500 Subject: [PATCH] Fix: lttng logs nanoseconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- src/common/error.c | 2 +- src/common/error.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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); -- 2.34.1