From: Jerin Jacob <jerinj@marvell.com>
Use log register macro to avoid the code duplication
in the log registration process.
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
drivers/event/dpaa/dpaa_eventdev.c | 8 +-------
drivers/event/dpaa2/dpaa2_eventdev.c | 10 +---------
drivers/event/octeontx/ssovf_evdev.c | 8 +-------
drivers/event/octeontx/timvf_evdev.c | 9 +--------
drivers/event/opdl/opdl_evdev.c | 8 +-------
drivers/event/opdl/opdl_ring.c | 2 --
drivers/event/sw/sw_evdev.c | 11 +----------
7 files changed, 6 insertions(+), 50 deletions(-)
@@ -46,7 +46,7 @@
* Eventqueue = Channel Instance
* 1 Eventdev can have N Eventqueue
*/
-int dpaa_logtype_eventdev;
+RTE_LOG_REGISTER(dpaa_logtype_eventdev, pmd.event.dpaa, NOTICE);
#define DISABLE_INTR_MODE "disable_intr"
@@ -1069,9 +1069,3 @@ static struct rte_vdev_driver vdev_eventdev_dpaa_pmd = {
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA_PMD, vdev_eventdev_dpaa_pmd);
RTE_PMD_REGISTER_PARAM_STRING(EVENTDEV_NAME_DPAA_PMD,
DISABLE_INTR_MODE "=<int>");
-RTE_INIT(dpaa_event_init_log)
-{
- dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa");
- if (dpaa_logtype_eventdev >= 0)
- rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
-}
@@ -48,8 +48,6 @@
* Soft Event Flow is DPCI Instance
*/
-/* Dynamic logging identified for mempool */
-int dpaa2_logtype_event;
#define DPAA2_EV_TX_RETRY_COUNT 10000
static uint16_t
@@ -1205,10 +1203,4 @@ static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = {
};
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA2_PMD, vdev_eventdev_dpaa2_pmd);
-
-RTE_INIT(dpaa2_eventdev_init_log)
-{
- dpaa2_logtype_event = rte_log_register("pmd.event.dpaa2");
- if (dpaa2_logtype_event >= 0)
- rte_log_set_level(dpaa2_logtype_event, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_event, pmd.event.dpaa2, NOTICE);
@@ -20,15 +20,9 @@
#include "ssovf_evdev.h"
#include "timvf_evdev.h"
-int otx_logtype_ssovf;
static uint8_t timvf_enable_stats;
-RTE_INIT(otx_ssovf_init_log)
-{
- otx_logtype_ssovf = rte_log_register("pmd.event.octeontx");
- if (otx_logtype_ssovf >= 0)
- rte_log_set_level(otx_logtype_ssovf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_ssovf, pmd.event.octeontx, NOTICE);
/* SSOPF Mailbox messages */
@@ -4,14 +4,7 @@
#include "timvf_evdev.h"
-int otx_logtype_timvf;
-
-RTE_INIT(otx_timvf_init_log)
-{
- otx_logtype_timvf = rte_log_register("pmd.event.octeontx.timer");
- if (otx_logtype_timvf >= 0)
- rte_log_set_level(otx_logtype_timvf, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx_logtype_timvf, pmd.event.octeontx.timer, NOTICE);
struct __rte_packed timvf_mbox_dev_info {
uint64_t ring_active[4];
@@ -754,13 +754,7 @@ static struct rte_vdev_driver evdev_opdl_pmd_drv = {
.remove = opdl_remove
};
-RTE_INIT(opdl_init_log)
-{
- opdl_logtype_driver = rte_log_register("pmd.event.opdl.driver");
- if (opdl_logtype_driver >= 0)
- rte_log_set_level(opdl_logtype_driver, RTE_LOG_INFO);
-}
-
+RTE_LOG_REGISTER(opdl_logtype_driver, pmd.event.opdl.driver, INFO);
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_OPDL_PMD, evdev_opdl_pmd_drv);
RTE_PMD_REGISTER_PARAM_STRING(event_opdl, NUMA_NODE_ARG "=<int>"
@@ -31,8 +31,6 @@
#define OPDL_OPA_MASK (0xFF)
#define OPDL_OPA_OFFSET (0x38)
-int opdl_logtype_driver;
-
/* Types of dependency between stages */
enum dep_type {
DEP_NONE = 0, /* no dependency */
@@ -1083,13 +1083,4 @@ static struct rte_vdev_driver evdev_sw_pmd_drv = {
RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SW_PMD, evdev_sw_pmd_drv);
RTE_PMD_REGISTER_PARAM_STRING(event_sw, NUMA_NODE_ARG "=<int> "
SCHED_QUANTA_ARG "=<int>" CREDIT_QUANTA_ARG "=<int>");
-
-/* declared extern in header, for access from other .c files */
-int eventdev_sw_log_level;
-
-RTE_INIT(evdev_sw_init_log)
-{
- eventdev_sw_log_level = rte_log_register("pmd.event.sw");
- if (eventdev_sw_log_level >= 0)
- rte_log_set_level(eventdev_sw_log_level, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(eventdev_sw_log_level, pmd.event.sw, NOTICE);