X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttngerr.h;h=2ba5b32b219f9c4d1066bfbeeced6bb419a6f6c1;hp=1da7863a1c6d8c84c473b2b34cf1c647d2a5ed05;hb=24ccb5f387f66603973a447728262c744e9a7218;hpb=3ce7388b1164c37fcc702b4150aa5bbf8e76e379 diff --git a/include/lttngerr.h b/include/lttngerr.h index 1da7863a1..2ba5b32b2 100644 --- a/include/lttngerr.h +++ b/include/lttngerr.h @@ -20,7 +20,11 @@ #define _LTTNGERR_H #include -#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 */