public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: Add different print macros
@ 2009-11-23 10:04 Doron Shoham
       [not found] ` <4B0A5E23.9000104-smomgflXvOZWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Doron Shoham @ 2009-11-23 10:04 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Add different print macros for warning, verbose and
debug messages.

Signed-off-by: Doron Shoham <dorons-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 infiniband-diags/include/ibdiag_common.h |    4 ++--
 libibmad/include/infiniband/mad.h        |    6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/infiniband-diags/include/ibdiag_common.h b/infiniband-diags/include/ibdiag_common.h
index 74f6deb..9b2add7 100644
--- a/infiniband-diags/include/ibdiag_common.h
+++ b/infiniband-diags/include/ibdiag_common.h
@@ -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__)
 
diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 9347bc2..2e407b0 100644
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -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__); \
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]: Add different print macros
       [not found] ` <4B0A5E23.9000104-smomgflXvOZWk0Htik3J/w@public.gmane.org>
@ 2009-11-26 16:01   ` Sasha Khapyorsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Khapyorsky @ 2009-11-26 16:01 UTC (permalink / raw)
  To: Doron Shoham; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12:04 Mon 23 Nov     , Doron Shoham wrote:
> Add different print macros for warning, verbose and
> debug messages.
> 
> Signed-off-by: Doron Shoham <dorons-smomgflXvOZWk0Htik3J/w@public.gmane.org>

Applied. Thanks.

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-26 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 10:04 [PATCH]: Add different print macros Doron Shoham
     [not found] ` <4B0A5E23.9000104-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-11-26 16:01   ` Sasha Khapyorsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox