X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ferror.h;h=3fe742c02fe97bf85b792d989e7ab3e02352c1f2;hp=e8c811ee60e34e2510d65907cac6ba94747fe332;hb=557ac9b9cfa00306a0330694846db95fc5cd3b72;hpb=b6dacfe27a91af50a1f81a2a7eadf4f34ca75769 diff --git a/src/common/error.h b/src/common/error.h index e8c811ee6..3fe742c02 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #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); @@ -151,7 +151,11 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) /* Three level of debug. Use -v, -vv or -vvv for the levels */ #define _ERRMSG(msg, type, fmt, args...) __lttng_print(type, msg \ " - %s [%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n", \ - log_add_time(), (long) getpid(), (long) gettid(), ## args, __func__) + log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args, __func__) + +#define _ERRMSG_NO_LOC(msg, type, fmt, args...) __lttng_print(type, msg \ + " - %s [%ld/%ld]: " fmt "\n", \ + log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args) #define MSG(fmt, args...) \ __lttng_print(PRINT_MSG, fmt "\n", ## args) @@ -165,6 +169,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type) #define BUG(fmt, args...) _ERRMSG("BUG", PRINT_BUG, fmt, ## args) #define DBG(fmt, args...) _ERRMSG("DEBUG1", PRINT_DBG, fmt, ## args) +#define DBG_NO_LOC(fmt, args...) _ERRMSG_NO_LOC("DEBUG1", PRINT_DBG, fmt, ## args) #define DBG2(fmt, args...) _ERRMSG("DEBUG2", PRINT_DBG2, fmt, ## args) #define DBG3(fmt, args...) _ERRMSG("DEBUG3", PRINT_DBG3, fmt, ## args) #define LOG(type, fmt, args...) \