From: Julien Desfossez Date: Fri, 10 Nov 2017 21:21:46 +0000 (-0500) Subject: Fix: lttng logs nanoseconds X-Git-Tag: v2.9.9~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a14cb7665e5f450c9781004dc4fb5f93037af3e2;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 938932cdc..ba50d2760 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 9b07e0a47..820369c88 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);