Fix: lttng logs nanoseconds
[lttng-tools.git] / src / common / error.h
index ad6113fa7494599cebcdb81b0a3bd7c2ef4956a0..820369c8810862e1b6e9cc780ef90bc1e9960643 100644 (file)
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include <urcu/tls-compat.h>
-#include <time.h>
+#include <common/compat/time.h>
 
 #ifndef _GNU_SOURCE
 #error "lttng-tools error.h needs _GNU_SOURCE"
@@ -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);
 
@@ -58,7 +58,7 @@ extern int lttng_opt_verbose;
 extern int lttng_opt_mi;
 
 /* Error type. */
-enum lttng_error_type {
+enum lttng_error_level {
        PRINT_ERR =     0,
        PRINT_BUG =     1,
        PRINT_WARN =    2,
@@ -68,7 +68,7 @@ enum lttng_error_type {
        PRINT_DBG3 =    6,
 };
 
-static inline bool __lttng_print_check_opt(enum lttng_error_type type)
+static inline bool __lttng_print_check_opt(enum lttng_error_level type)
 {
        /* lttng_opt_mi and lttng_opt_quiet. */
        switch (type) {
@@ -117,7 +117,7 @@ static inline bool __lttng_print_check_opt(enum lttng_error_type type)
 
 void lttng_abort_on_error(void);
 
-static inline void __lttng_print_check_abort(enum lttng_error_type type)
+static inline void __lttng_print_check_abort(enum lttng_error_level type)
 {
        switch (type) {
        case PRINT_DBG3:
@@ -198,7 +198,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_type type)
 
 #define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ## args)
 
-#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
+#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
 
 /*
  * Version using XSI strerror_r.
This page took 0.028577 seconds and 4 git commands to generate.