From ae4d143aa004105b89311ac7068382869a8f2dd2 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 17 Sep 2014 15:46:41 +0200 Subject: [PATCH] i40e/base: add a raw log macro Since base driver always add a trailing \n, add a PMD_DRV_LOG_RAW macro that will not add one. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- 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 0ed4b65706..de71b0d84f 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 f991dd289c..043ecba1ba 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_ */ -- 2.20.1