public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doron Shoham <dorons-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH]: Add different print macros
Date: Mon, 23 Nov 2009 12:04:19 +0200	[thread overview]
Message-ID: <4B0A5E23.9000104@voltaire.com> (raw)

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

             reply	other threads:[~2009-11-23 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 10:04 Doron Shoham [this message]
     [not found] ` <4B0A5E23.9000104-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-11-26 16:01   ` [PATCH]: Add different print macros Sasha Khapyorsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B0A5E23.9000104@voltaire.com \
    --to=dorons-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox