From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 09/20] i40e/base: add a raw macro for use by shared code
Date: Wed, 17 Sep 2014 15:46:41 +0200 [thread overview]
Message-ID: <1410961612-8571-10-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <1410961612-8571-1-git-send-email-david.marchand@6wind.com>
Since shared code always add a trailing \n, add a PMD_DRV_LOG_RAW macro that
will not add one.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_pmd_i40e/i40e/i40e_osdep.h | 8 ++++----
lib/librte_pmd_i40e/i40e_logs.h | 9 ++++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/librte_pmd_i40e/i40e/i40e_osdep.h b/lib/librte_pmd_i40e/i40e/i40e_osdep.h
index 0ed4b65..de71b0d 100644
--- a/lib/librte_pmd_i40e/i40e/i40e_osdep.h
+++ b/lib/librte_pmd_i40e/i40e/i40e_osdep.h
@@ -100,10 +100,10 @@ typedef enum i40e_status_code i40e_status;
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
#define ASSERT(x) if(!(x)) rte_panic("IXGBE: x")
-#define DEBUGOUT(S) PMD_DRV_LOG(DEBUG, S)
-#define DEBUGOUT1(S, A...) PMD_DRV_LOG(DEBUG, S, ##A)
+#define DEBUGOUT(S) PMD_DRV_LOG_RAW(DEBUG, S)
+#define DEBUGOUT1(S, A...) PMD_DRV_LOG_RAW(DEBUG, S, ##A)
-#define DEBUGFUNC(F) DEBUGOUT(F)
+#define DEBUGFUNC(F) DEBUGOUT(F "\n")
#define DEBUGOUT2 DEBUGOUT1
#define DEBUGOUT3 DEBUGOUT2
#define DEBUGOUT6 DEBUGOUT3
@@ -112,7 +112,7 @@ typedef enum i40e_status_code i40e_status;
#define i40e_debug(h, m, s, ...) \
do { \
if (((m) & (h)->debug_mask)) \
- PMD_DRV_LOG(DEBUG, "i40e %02x.%x " s, \
+ PMD_DRV_LOG_RAW(DEBUG, "i40e %02x.%x " s, \
(h)->bus.device, (h)->bus.func, \
##__VA_ARGS__); \
} while (0)
diff --git a/lib/librte_pmd_i40e/i40e_logs.h b/lib/librte_pmd_i40e/i40e_logs.h
index f991dd2..043ecba 100644
--- a/lib/librte_pmd_i40e/i40e_logs.h
+++ b/lib/librte_pmd_i40e/i40e_logs.h
@@ -65,10 +65,13 @@
#endif
#ifdef RTE_LIBRTE_I40E_DEBUG_DRIVER
-#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_DRV_LOG_RAW(level, fmt, args...) \
+ RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
#else
-#define PMD_DRV_LOG(level, fmt, args...) do { } while(0)
+#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
#endif
+#define PMD_DRV_LOG(level, fmt, args...) \
+ PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+
#endif /* _I40E_LOGS_H_ */
--
1.7.10.4
next prev parent reply other threads:[~2014-09-17 13:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 13:46 [dpdk-dev] [PATCH v3 00/20] cleanup logs in main PMDs David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 01/20] ixgbe: use the right debug macro David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 02/20] ixgbe/base: add a raw macro for use by shared code David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 03/20] ixgbe: indent logs sections David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 04/20] ixgbe: clean log messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 05/20] ixgbe: always log init messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 06/20] ixgbe: add a message when forcing scatter mode David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 07/20] ixgbe: add log messages when rx bulk mode is not usable David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 08/20] i40e: use the right debug macro David Marchand
2014-09-17 13:46 ` David Marchand [this message]
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 10/20] i40e: indent logs sections David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 11/20] i40e: clean log messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 12/20] i40e: always log init messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 13/20] i40e: add log messages when rx bulk mode is not usable David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 14/20] e1000: use the right debug macro David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 15/20] e1000/base: add a raw macro for use by shared code David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 16/20] e1000: indent logs sections David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 17/20] e1000: clean log messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 18/20] e1000: always log init messages David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 19/20] e1000: add a message when forcing scatter mode David Marchand
2014-09-17 13:46 ` [dpdk-dev] [PATCH v3 20/20] eal: set log level from command line David Marchand
2014-09-17 14:45 ` Neil Horman
2014-09-18 7:46 ` David Marchand
2014-09-18 10:27 ` Neil Horman
2014-09-19 7:52 ` [dpdk-dev] [PATCH v3 00/20] cleanup logs in main PMDs Thomas Monjalon
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=1410961612-8571-10-git-send-email-david.marchand@6wind.com \
--to=david.marchand@6wind.com \
--cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).