: Add different print macros
PATCH 1/1 : Add different print macros
Add different print macros for warning, verbose and debug messages.
--- infiniband-diags/include/ibdiag_common.h | 4 ++-- libibmad/include/infiniband/mad.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
infiniband-diags/include/ibdiag_common.h +2 -2
@@ -50,10 +50,10 @@ extern int ibd_timeout;#undef DEBUG#define DEBUG (fmt, ...) do { \ - if (ibdebug || ibverbose) IBWARN(fmt, ## __VA_ARGS__); \ + if (ibdebug) IBDEBUG(fmt, ## __VA_ARGS__); \ } while (0)#define VERBOSE (fmt, ...) do { \ - if (ibdebug || ibverbose > 1) IBWARN(fmt, ## __VA_ARGS__); \ + if (ibverbose) IBVERBOSE(fmt, ## __VA_ARGS__); \ } while (0)#define IBERROR (fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
libibmad/include/infiniband/mad.h +6 -0
@@ -1020,6 +1020,12 @@ static inline uint64_t htonll(uint64_t x)/** printf style warning MACRO, includes name of function and pid */ #define IBWARN (fmt, ...) fprintf(stderr, "ibwarn: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) +/** printf style debug MACRO, includes name of function and pid */ +#define IBDEBUG (fmt, ...) fprintf(stdout, "ibdebug: [%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) + +/** printf style verbose MACRO, includes name of function and pid */ +#define IBVERBOSE (fmt, ...) fprintf(stdout, "[%d] %s: " fmt "\n", getpid(), __func__, ## __VA_ARGS__) +/** printf style abort MACRO, includes name of function and pid */ #define IBPANIC (fmt, ...) do { \ fprintf(stderr, "ibpanic: [%d] %s: " fmt ": %m\n", getpid(), __func__, ## __VA_ARGS__); \
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 4B0A5E23.9000104-smomgflXvOZWk0Htik3J/[email protected]
Sasha Khapyorsky
AppliedQuoted 4 lines · Doron Shoham
Add different print macros for warning, verbose and debug messages.
Applied. Thanks.
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html