From: David Goulet Date: Thu, 26 May 2011 18:45:40 +0000 (-0400) Subject: Add file, line nb. and function to debug error X-Git-Tag: v2.0-pre1~114 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=57d0d50175ef25d3171bb8be9e9c30aba77674fe;p=lttng-tools.git Add file, line nb. and function to debug error Signed-off-by: David Goulet --- diff --git a/include/lttngerr.h b/include/lttngerr.h index 1feb6cc4d..2ba5b32b2 100644 --- a/include/lttngerr.h +++ b/include/lttngerr.h @@ -22,6 +22,10 @@ #include #include +/* Stringify the expansion of a define */ +#define XSTR(d) STR(d) +#define STR(s) #s + extern int opt_quiet; extern int opt_verbose; @@ -54,6 +58,6 @@ enum __lttng_print_type { #define ERR(fmt, args...) __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args) #define WARN(fmt, args...) __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args) #define BUG(fmt, args...) __lttng_print(PRINT_BUG, "BUG: " fmt "\n", ## args) -#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG: " fmt "\n", ## args) +#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG: " fmt " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__) #endif /* _LTTNGERR_H */