Skip to content

Commit

Permalink
lib: use per line logging in helpers
Browse files Browse the repository at this point in the history
Use RTE_LOG_LINE in existing macros that append a \n.

Signed-off-by: David Marchand <[email protected]>
Reviewed-by: Chengwen Feng <[email protected]>
Reviewed-by: Andrew Rybchenko <[email protected]>
  • Loading branch information
david-marchand committed Dec 18, 2023
1 parent 00f96c7 commit ef62ed0
Show file tree
Hide file tree
Showing 25 changed files with 83 additions and 79 deletions.
5 changes: 3 additions & 2 deletions lib/bbdev/rte_bbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

/* BBDev library logging ID */
RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE);
#define RTE_LOGTYPE_BBDEV bbdev_logtype

/* Helper macro for logging */
#define rte_bbdev_log(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, bbdev_logtype, fmt "\n", ##__VA_ARGS__)
#define rte_bbdev_log(level, ...) \
RTE_LOG_LINE(level, BBDEV, "" __VA_ARGS__)

#define rte_bbdev_log_debug(fmt, ...) \
rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
Expand Down
2 changes: 1 addition & 1 deletion lib/bpf/bpf_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern int rte_bpf_logtype;
#define RTE_LOGTYPE_BPF rte_bpf_logtype

#define RTE_BPF_LOG_LINE(lvl, fmt, args...) \
RTE_LOG(lvl, BPF, fmt "\n", ##args)
RTE_LOG_LINE(lvl, BPF, fmt, ##args)

static inline size_t
bpf_size(uint32_t bpf_op_sz)
Expand Down
4 changes: 2 additions & 2 deletions lib/cfgfile/rte_cfgfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ struct rte_cfgfile {

/* Setting up dynamic logging 8< */
RTE_LOG_REGISTER_DEFAULT(cfgfile_logtype, INFO);
#define RTE_LOGTYPE_CFGFILE cfgfile_logtype

#define CFG_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, cfgfile_logtype, "%s(): " fmt "\n", \
__func__, ## args)
RTE_LOG_LINE(level, CFGFILE, "%s(): " fmt, __func__, ## args)
/* >8 End of setting up dynamic logging */

/** when we resize a file structure, how many extra entries
Expand Down
5 changes: 3 additions & 2 deletions lib/compressdev/rte_compressdev_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ extern "C" {

/* Logging Macros */
extern int compressdev_logtype;
#define RTE_LOGTYPE_COMPRESSDEV compressdev_logtype

#define COMPRESSDEV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, compressdev_logtype, "%s(): " fmt "\n", \
__func__, ##args)
RTE_LOG_LINE(level, COMPRESSDEV, "%s(): " fmt, __func__, ## args)

/**
* Dequeue processed packets from queue pair of a device.
Expand Down
22 changes: 10 additions & 12 deletions lib/cryptodev/rte_cryptodev.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,22 @@ extern int rte_cryptodev_logtype;

/* Logging Macros */
#define CDEV_LOG_ERR(...) \
RTE_LOG(ERR, CRYPTODEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(ERR, CRYPTODEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

#define CDEV_LOG_INFO(...) \
RTE_LOG(INFO, CRYPTODEV, \
RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(INFO, CRYPTODEV, "" __VA_ARGS__)

#define CDEV_LOG_DEBUG(...) \
RTE_LOG(DEBUG, CRYPTODEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(DEBUG, CRYPTODEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

#define CDEV_PMD_TRACE(...) \
RTE_LOG(DEBUG, CRYPTODEV, \
RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
dev, __func__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(DEBUG, CRYPTODEV, \
RTE_FMT("[%s] %s: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
dev, __func__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

/**
* A macro that points to an offset from the start
Expand Down
6 changes: 4 additions & 2 deletions lib/dmadev/rte_dmadev.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ static struct {
} *dma_devices_shared_data;

RTE_LOG_REGISTER_DEFAULT(rte_dma_logtype, INFO);
#define RTE_LOGTYPE_DMA rte_dma_logtype

#define RTE_DMA_LOG(level, ...) \
rte_log(RTE_LOG_ ## level, rte_dma_logtype, RTE_FMT("dma: " \
RTE_FMT_HEAD(__VA_ARGS__,) "\n", RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(level, DMA, RTE_FMT("dma: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
RTE_FMT_TAIL(__VA_ARGS__ ,)))

int
rte_dma_dev_max(size_t dev_max)
Expand Down
3 changes: 1 addition & 2 deletions lib/ethdev/rte_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ extern int rte_eth_dev_logtype;
#define RTE_LOGTYPE_ETHDEV rte_eth_dev_logtype

#define RTE_ETHDEV_LOG_LINE(level, ...) \
RTE_LOG(level, ETHDEV, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
RTE_FMT_TAIL(__VA_ARGS__ ,)))
RTE_LOG_LINE(level, ETHDEV, "" __VA_ARGS__)

struct rte_mbuf;

Expand Down
12 changes: 6 additions & 6 deletions lib/eventdev/eventdev_pmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ extern "C" {

/* Logging Macros */
#define RTE_EDEV_LOG_ERR(...) \
RTE_LOG(ERR, EVENTDEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(ERR, EVENTDEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
#define RTE_EDEV_LOG_DEBUG(...) \
RTE_LOG(DEBUG, EVENTDEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(DEBUG, EVENTDEV, \
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))
#else
#define RTE_EDEV_LOG_DEBUG(...) (void)0
#endif
Expand Down
17 changes: 10 additions & 7 deletions lib/eventdev/rte_event_timer_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,30 @@
#define DATA_MZ_NAME_FORMAT "rte_event_timer_adapter_data_%d"

RTE_LOG_REGISTER_SUFFIX(evtim_logtype, adapter.timer, NOTICE);
#define RTE_LOGTYPE_EVTIM evtim_logtype
RTE_LOG_REGISTER_SUFFIX(evtim_buffer_logtype, adapter.timer, NOTICE);
#define RTE_LOGTYPE_EVTIM_BUF evtim_buffer_logtype
RTE_LOG_REGISTER_SUFFIX(evtim_svc_logtype, adapter.timer.svc, NOTICE);
#define RTE_LOGTYPE_EVTIM_SVC evtim_svc_logtype

static struct rte_event_timer_adapter *adapters;

static const struct event_timer_adapter_ops swtim_ops;

#define EVTIM_LOG(level, logtype, ...) \
rte_log(RTE_LOG_ ## level, logtype, \
RTE_FMT("EVTIMER: %s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) \
"\n", __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
RTE_LOG_LINE(level, logtype, \
RTE_FMT("EVTIMER: %s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

#define EVTIM_LOG_ERR(...) EVTIM_LOG(ERR, evtim_logtype, __VA_ARGS__)
#define EVTIM_LOG_ERR(...) EVTIM_LOG(ERR, EVTIM, __VA_ARGS__)

#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
#define EVTIM_LOG_DBG(...) \
EVTIM_LOG(DEBUG, evtim_logtype, __VA_ARGS__)
EVTIM_LOG(DEBUG, EVTIM, __VA_ARGS__)
#define EVTIM_BUF_LOG_DBG(...) \
EVTIM_LOG(DEBUG, evtim_buffer_logtype, __VA_ARGS__)
EVTIM_LOG(DEBUG, EVTIM_BUF, __VA_ARGS__)
#define EVTIM_SVC_LOG_DBG(...) \
EVTIM_LOG(DEBUG, evtim_svc_logtype, __VA_ARGS__)
EVTIM_LOG(DEBUG, EVTIM_SVC, __VA_ARGS__)
#else
#define EVTIM_LOG_DBG(...) (void)0
#define EVTIM_BUF_LOG_DBG(...) (void)0
Expand Down
6 changes: 4 additions & 2 deletions lib/gpudev/gpudev.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

/* Logging */
RTE_LOG_REGISTER_DEFAULT(gpu_logtype, NOTICE);
#define RTE_LOGTYPE_GPUDEV gpu_logtype

#define GPU_LOG(level, ...) \
rte_log(RTE_LOG_ ## level, gpu_logtype, RTE_FMT("gpu: " \
RTE_FMT_HEAD(__VA_ARGS__, ) "\n", RTE_FMT_TAIL(__VA_ARGS__, )))
RTE_LOG_LINE(level, GPUDEV, RTE_FMT("gpu: " RTE_FMT_HEAD(__VA_ARGS__ ,), \
RTE_FMT_TAIL(__VA_ARGS__ ,)))

/* Set any driver error as EPERM */
#define GPU_DRV_RET(function) \
Expand Down
7 changes: 4 additions & 3 deletions lib/graph/graph_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#include "rte_graph_worker.h"

extern int rte_graph_logtype;
#define RTE_LOGTYPE_GRAPH rte_graph_logtype

#define GRAPH_LOG(level, ...) \
rte_log(RTE_LOG_##level, rte_graph_logtype, \
RTE_FMT("GRAPH: %s():%u " RTE_FMT_HEAD(__VA_ARGS__, ) "\n", \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__, )))
RTE_LOG_LINE(level, GRAPH, \
RTE_FMT("GRAPH: %s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

#define graph_err(...) GRAPH_LOG(ERR, __VA_ARGS__)
#define graph_warn(...) GRAPH_LOG(WARNING, __VA_ARGS__)
Expand Down
4 changes: 2 additions & 2 deletions lib/member/member.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern int librte_member_logtype;
#define RTE_LOGTYPE_MEMBER librte_member_logtype

#define MEMBER_LOG(level, ...) \
RTE_LOG(level, MEMBER, \
RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
RTE_LOG_LINE(level, MEMBER, \
RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__ ,), \
__func__, RTE_FMT_TAIL(__VA_ARGS__ ,)))

4 changes: 2 additions & 2 deletions lib/metrics/rte_metrics_telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
struct telemetry_metrics_data tel_met_data;

int metrics_log_level;
#define RTE_LOGTYPE_METRICS metrics_log_level

/* Logging Macros */
#define METRICS_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ##level, metrics_log_level, "%s(): "fmt "\n", \
__func__, ##args)
RTE_LOG_LINE(level, METRICS, "%s(): "fmt, __func__, ## args)

#define METRICS_LOG_ERR(fmt, args...) \
METRICS_LOG(ERR, fmt, ## args)
Expand Down
5 changes: 3 additions & 2 deletions lib/mldev/rte_mldev.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ extern "C" {

/* Logging Macro */
extern int rte_ml_dev_logtype;
#define RTE_LOGTYPE_MLDEV rte_ml_dev_logtype

#define RTE_MLDEV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_##level, rte_ml_dev_logtype, "%s(): " fmt "\n", __func__, ##args)
#define RTE_MLDEV_LOG(level, fmt, args...) \
RTE_LOG_LINE(level, MLDEV, "%s(): " fmt, __func__, ##args)

#define RTE_ML_STR_MAX 128
/**< Maximum length of name string */
Expand Down
8 changes: 4 additions & 4 deletions lib/net/rte_net_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ static const rte_net_crc_handler handlers_neon[] = {

static uint16_t max_simd_bitwidth;

#define NET_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, libnet_logtype, "%s(): " fmt "\n", \
__func__, ## args)

RTE_LOG_REGISTER_DEFAULT(libnet_logtype, INFO);
#define RTE_LOGTYPE_NET libnet_logtype

#define NET_LOG(level, fmt, args...) \
RTE_LOG_LINE(level, NET, "%s(): " fmt, __func__, ## args)

/* Scalar handling */

Expand Down
8 changes: 5 additions & 3 deletions lib/node/node_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
#include <rte_mbuf_dyn.h>

extern int rte_node_logtype;
#define RTE_LOGTYPE_NODE rte_node_logtype

#define NODE_LOG(level, node_name, ...) \
rte_log(RTE_LOG_##level, rte_node_logtype, \
RTE_FMT("NODE %s: %s():%u " RTE_FMT_HEAD(__VA_ARGS__, ) "\n", \
RTE_LOG_LINE(level, NODE, \
RTE_FMT("NODE %s: %s():%u " RTE_FMT_HEAD(__VA_ARGS__ ,), \
node_name, __func__, __LINE__, \
RTE_FMT_TAIL(__VA_ARGS__, )))
RTE_FMT_TAIL(__VA_ARGS__ ,)))

#define node_err(node_name, ...) NODE_LOG(ERR, node_name, __VA_ARGS__)
#define node_info(node_name, ...) NODE_LOG(INFO, node_name, __VA_ARGS__)
Expand Down
5 changes: 2 additions & 3 deletions lib/pdump/rte_pdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
RTE_LOG_REGISTER_DEFAULT(pdump_logtype, NOTICE);
#define RTE_LOGTYPE_PDUMP pdump_logtype

#define PDUMP_LOG_LINE(level, fmt, args...) \
RTE_LOG(level, PDUMP, "%s(): " fmt "\n", \
__func__, ## args)
#define PDUMP_LOG_LINE(level, fmt, args...) \
RTE_LOG_LINE(level, PDUMP, "%s(): " fmt, __func__, ## args)

/* Used for the multi-process communication */
#define PDUMP_MP "mp_pdump"
Expand Down
2 changes: 1 addition & 1 deletion lib/power/power_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern int power_logtype;

#ifdef RTE_LIBRTE_POWER_DEBUG
#define POWER_DEBUG_LOG(fmt, args...) \
RTE_LOG(ERR, POWER, "%s: " fmt "\n", __func__, ## args)
RTE_LOG_LINE(ERR, POWER, "%s: " fmt, __func__, ## args)
#else
#define POWER_DEBUG_LOG(fmt, args...)
#endif
Expand Down
4 changes: 2 additions & 2 deletions lib/rawdev/rte_rawdev_pmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ extern "C" {
#include "rte_rawdev.h"

extern int librawdev_logtype;
#define RTE_LOGTYPE_RAWDEV librawdev_logtype

/* Logging Macros */
#define RTE_RDEV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, librawdev_logtype, "%s(): " fmt "\n", \
__func__, ##args)
RTE_LOG_LINE(level, RAWDEV, "%s(): " fmt, __func__, ##args)

#define RTE_RDEV_ERR(fmt, args...) \
RTE_RDEV_LOG(ERR, fmt, ## args)
Expand Down
8 changes: 3 additions & 5 deletions lib/rcu/rte_rcu_qsbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ extern int rte_rcu_log_type;

#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG
#define __RTE_RCU_DP_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, rte_rcu_log_type, \
"%s(): " fmt "\n", __func__, ## args)
RTE_LOG_LINE(level, RCU, "%s(): " fmt, __func__, ## args)
#else
#define __RTE_RCU_DP_LOG(level, fmt, args...)
#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, fmt, args...) do { \
if (v->qsbr_cnt[thread_id].lock_cnt) \
rte_log(RTE_LOG_ ## level, rte_rcu_log_type, \
"%s(): " fmt "\n", __func__, ## args); \
RTE_LOG_LINE(level, RCU, "%s(): " fmt, __func__, ## args); \
} while (0)
#else
#define __RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, level, fmt, args...)
Expand Down
3 changes: 1 addition & 2 deletions lib/regexdev/rte_regexdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ extern int rte_regexdev_logtype;
#define RTE_LOGTYPE_REGEXDEV rte_regexdev_logtype

#define RTE_REGEXDEV_LOG_LINE(level, ...) \
RTE_LOG(level, REGEXDEV, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
RTE_FMT_TAIL(__VA_ARGS__ ,)))
RTE_LOG_LINE(level, REGEXDEV, "" __VA_ARGS__)

/* Macros to check for valid port */
#define RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, retval) do { \
Expand Down
4 changes: 2 additions & 2 deletions lib/stack/stack_pvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <rte_log.h>

extern int stack_logtype;
#define RTE_LOGTYPE_STACK stack_logtype

#define STACK_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ##level, stack_logtype, "%s(): "fmt "\n", \
__func__, ##args)
RTE_LOG_LINE(level, STACK, "%s(): "fmt, __func__, ##args)

#define STACK_LOG_ERR(fmt, args...) \
STACK_LOG(ERR, fmt, ## args)
Expand Down
4 changes: 1 addition & 3 deletions lib/telemetry/telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ static rte_cpuset_t *thread_cpuset;

RTE_LOG_REGISTER_DEFAULT(logtype, WARNING);
#define RTE_LOGTYPE_TMTY logtype
#define TMTY_LOG_LINE(l, ...) \
RTE_LOG(l, TMTY, RTE_FMT("TELEMETRY: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
RTE_FMT_TAIL(__VA_ARGS__ ,)))
#define TMTY_LOG_LINE(l, ...) RTE_LOG_LINE(l, TMTY, "TELEMETRY: " __VA_ARGS__)

/* list of command callbacks, with one command registered by default */
static struct cmd_callback *callbacks;
Expand Down
8 changes: 4 additions & 4 deletions lib/vhost/vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ extern int vhost_data_log_level;
#define RTE_LOGTYPE_VHOST_DATA vhost_data_log_level

#define VHOST_CONFIG_LOG(prefix, level, fmt, args...) \
RTE_LOG(level, VHOST_CONFIG, \
"VHOST_CONFIG: (%s) " fmt "\n", prefix, ##args)
RTE_LOG_LINE(level, VHOST_CONFIG, \
"VHOST_CONFIG: (%s) " fmt, prefix, ##args)

#define VHOST_DATA_LOG(prefix, level, fmt, args...) \
RTE_LOG_DP(level, VHOST_DATA, \
"VHOST_DATA: (%s) " fmt "\n", prefix, ##args)
RTE_LOG_DP_LINE(level, VHOST_DATA, \
"VHOST_DATA: (%s) " fmt, prefix, ##args)

#ifdef RTE_LIBRTE_VHOST_DEBUG
#define VHOST_MAX_PRINT_BUFF 6072
Expand Down
6 changes: 3 additions & 3 deletions lib/vhost/vhost_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ RTE_LOG_REGISTER_SUFFIX(vhost_crypto_logtype, crypto, INFO);
#define RTE_LOGTYPE_VHOST_CRYPTO vhost_crypto_logtype

#define VC_LOG_ERR(fmt, args...) \
RTE_LOG(ERR, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
RTE_LOG_LINE(ERR, VHOST_CRYPTO, "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#define VC_LOG_INFO(fmt, args...) \
RTE_LOG(INFO, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
RTE_LOG_LINE(INFO, VHOST_CRYPTO, "%s() line %u: " fmt, \
__func__, __LINE__, ## args)

#ifdef RTE_LIBRTE_VHOST_DEBUG
#define VC_LOG_DBG(fmt, args...) \
RTE_LOG(DEBUG, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
RTE_LOG_LINE(DEBUG, VHOST_CRYPTO, "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#else
#define VC_LOG_DBG(fmt, args...)
Expand Down

0 comments on commit ef62ed0

Please sign in to comment.