Use RTE_LOG_LINE_PREFIX instead of RTE_LOG_LINE in macro expansions which allow a prefix and arguments to be inserted into the log line without the need to use the ## args variadic argument pack extension.
Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com> --- lib/rcu/rte_rcu_qsbr.c | 4 ++-- lib/rcu/rte_rcu_qsbr.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index bd0b83b..f08d974 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -19,8 +19,8 @@ #include "rte_rcu_qsbr.h" #include "rcu_qsbr_pvt.h" -#define RCU_LOG(level, fmt, args...) \ - RTE_LOG_LINE(level, RCU, "%s(): " fmt, __func__, ## args) +#define RCU_LOG(level, ...) \ + RTE_LOG_LINE_PREFIX(level, RCU, "%s(): ", __func__, __VA_ARGS__) /* Get the memory size of QSBR variable */ size_t diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index e7ef788..e4119cc 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -39,19 +39,19 @@ #define RTE_LOGTYPE_RCU rte_rcu_log_type #if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG -#define __RTE_RCU_DP_LOG(level, fmt, args...) \ - RTE_LOG_LINE(level, RCU, "%s(): " fmt, __func__, ## args) +#define __RTE_RCU_DP_LOG(level, ...) \ + RTE_LOG_DP_LINE_PREFIX(level, RCU, "%s(): ", __func__, __VA_ARGS__) #else -#define __RTE_RCU_DP_LOG(level, fmt, args...) +#define __RTE_RCU_DP_LOG(level, ...) #endif #if defined(RTE_LIBRTE_RCU_DEBUG) -#define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, fmt, args...) do { \ +#define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, ...) do { \ if (v->qsbr_cnt[thread_id].lock_cnt) \ - RTE_LOG_LINE(level, RCU, "%s(): " fmt, __func__, ## args); \ + RTE_LOG_LINE_PREFIX(level, RCU, "%s(): ", __func__, __VA_ARGS__); \ } while (0) #else -#define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, fmt, args...) +#define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, fmt, ...) #endif /* Registered thread IDs are stored as a bitmap of 64b element array. -- 1.8.3.1