DPDK patches and discussions
 help / color / mirror / Atom feed
From: <jerinj@marvell.com>
To: <dev@dpdk.org>, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Rosen Xu <rosen.xu@intel.com>,
	Stephen Hemminger <sthemmin@microsoft.com>
Cc: <thomas@monjalon.net>, <olivier.matz@6wind.com>,
	<david.marchand@redhat.com>, Jerin Jacob <jerinj@marvell.com>
Subject: [dpdk-dev]  [PATCH 11/13] drivers/bus: use log register macro
Date: Wed, 17 Jun 2020 12:00:45 +0530	[thread overview]
Message-ID: <20200617063047.1555518-12-jerinj@marvell.com> (raw)
In-Reply-To: <20200617063047.1555518-1-jerinj@marvell.com>

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>
---
 drivers/bus/dpaa/dpaa_bus.c      | 10 +---------
 drivers/bus/fslmc/fslmc_bus.c    | 11 +----------
 drivers/bus/ifpga/ifpga_bus.c    |  9 +--------
 drivers/bus/vdev/vdev.c          | 10 +---------
 drivers/bus/vmbus/vmbus_common.c |  9 +--------
 5 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index d53fe6083..0d8b13e5f 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -42,8 +42,6 @@
 #include <fsl_bman.h>
 #include <netcfg.h>
 
-int dpaa_logtype_bus;
-
 static struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
 
@@ -749,10 +747,4 @@ static struct rte_dpaa_bus rte_dpaa_bus = {
 };
 
 RTE_REGISTER_BUS(FSL_DPAA_BUS_NAME, rte_dpaa_bus.bus);
-
-RTE_INIT(dpaa_init_log)
-{
-	dpaa_logtype_bus = rte_log_register("bus.dpaa");
-	if (dpaa_logtype_bus >= 0)
-		rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa_logtype_bus, bus.dpaa, NOTICE);
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index afbd82e8d..d9f403bd9 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -21,8 +21,6 @@
 
 #include <dpaax_iova_table.h>
 
-int dpaa2_logtype_bus;
-
 #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups"
 #define FSLMC_BUS_NAME	fslmc
 
@@ -649,11 +647,4 @@ struct rte_fslmc_bus rte_fslmc_bus = {
 };
 
 RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus);
-
-RTE_INIT(fslmc_init_log)
-{
-	/* Bus level logs */
-	dpaa2_logtype_bus = rte_log_register("bus.fslmc");
-	if (dpaa2_logtype_bus >= 0)
-		rte_log_set_level(dpaa2_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(dpaa2_logtype_bus, bus.fslmc, NOTICE);
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index addbc3e86..103915d43 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -32,7 +32,6 @@
 #include "ifpga_logs.h"
 #include "ifpga_common.h"
 
-int ifpga_bus_logtype;
 
 /* Forward declaration to access Intel FPGA bus
  * on which iFPGA devices are connected
@@ -474,10 +473,4 @@ static struct rte_bus rte_ifpga_bus = {
 };
 
 RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus);
-
-RTE_INIT(ifpga_init_log)
-{
-	ifpga_bus_logtype = rte_log_register("bus.ifpga");
-	if (ifpga_bus_logtype >= 0)
-		rte_log_set_level(ifpga_bus_logtype, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(ifpga_bus_logtype, bus.ifpga, NOTICE);
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index a89ea2353..d746149a2 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -27,8 +27,6 @@
 
 #define VDEV_MP_KEY	"bus_vdev_mp"
 
-int vdev_logtype_bus;
-
 /* Forward declare to access virtual bus name */
 static struct rte_bus rte_vdev_bus;
 
@@ -557,10 +555,4 @@ static struct rte_bus rte_vdev_bus = {
 };
 
 RTE_REGISTER_BUS(vdev, rte_vdev_bus);
-
-RTE_INIT(vdev_init_log)
-{
-	vdev_logtype_bus = rte_log_register("bus.vdev");
-	if (vdev_logtype_bus >= 0)
-		rte_log_set_level(vdev_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vdev_logtype_bus, bus.vdev, NOTICE);
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 3adef01c9..4c9ac33ac 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -22,7 +22,6 @@
 
 #include "private.h"
 
-int vmbus_logtype_bus;
 extern struct rte_vmbus_bus rte_vmbus_bus;
 
 /* map a particular resource from a file */
@@ -298,10 +297,4 @@ struct rte_vmbus_bus rte_vmbus_bus = {
 };
 
 RTE_REGISTER_BUS(vmbus, rte_vmbus_bus.bus);
-
-RTE_INIT(vmbus_init_log)
-{
-	vmbus_logtype_bus = rte_log_register("bus.vmbus");
-	if (vmbus_logtype_bus >= 0)
-		rte_log_set_level(vmbus_logtype_bus, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(vmbus_logtype_bus, bus.vmbus, NOTICE);
-- 
2.26.2


  parent reply	other threads:[~2020-06-17  6:32 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  6:30 [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro jerinj
2020-06-17 10:00   ` Thomas Monjalon
2020-06-17 10:26     ` Andrew Rybchenko
2020-06-24 13:08       ` Jerin Jacob
2020-06-17 10:02   ` David Marchand
2020-06-17 10:21     ` Andrew Rybchenko
2020-06-24 13:11       ` Jerin Jacob
2020-06-24 15:26         ` Andrew Rybchenko
2020-06-24 15:32           ` Jerin Jacob
2020-06-24 15:43             ` Andrew Rybchenko
2020-06-24 18:10               ` Jerin Jacob
2020-06-26 11:16                 ` Jerin Jacob
2020-06-26 11:42                   ` David Marchand
2020-06-26 12:06                     ` Jerin Jacob
2020-06-26 12:13                       ` David Marchand
2020-06-26 12:16                       ` David Marchand
2020-06-26 12:37                         ` Jerin Jacob
2020-06-29 13:39                           ` Jerin Jacob
2020-06-30 13:39                           ` David Marchand
2020-06-30 14:42                             ` Jerin Jacob
2020-06-21  9:30   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 02/13] lib: use " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 03/13] drivers/vdpa: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 04/13] drivers/raw: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 05/13] drivers/net: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 06/13] drivers/mempool: " jerinj
2020-06-21  9:46   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 07/13] drivers/event: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 08/13] drivers/crypto: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 09/13] drivers/compress: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 10/13] drivers/common: " jerinj
2020-06-21  9:48   ` Sachin Saxena (OSS)
2020-06-17  6:30 ` jerinj [this message]
2020-06-21  9:52   ` [dpdk-dev] [PATCH 11/13] drivers/bus: " Sachin Saxena (OSS)
2020-06-17  6:30 ` [dpdk-dev] [PATCH 12/13] drivers/baseband: " jerinj
2020-06-17  6:30 ` [dpdk-dev] [PATCH 13/13] app/test: " jerinj
2020-06-25 16:18 ` [dpdk-dev] [PATCH 00/13] rte_log registration usage improvement Dybkowski, AdamX
2020-06-25 16:20   ` Dybkowski, AdamX
2020-07-01  3:58 ` [dpdk-dev] [PATCH v2 " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 01/13] eal/log: introduce log register macro jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 02/13] lib: use " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 03/13] drivers/vdpa: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 04/13] drivers/raw: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 05/13] drivers/net: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 06/13] drivers/mempool: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 07/13] drivers/event: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 08/13] drivers/crypto: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 09/13] drivers/compress: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 10/13] drivers/common: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 11/13] drivers/bus: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 12/13] drivers/baseband: " jerinj
2020-07-01  3:58   ` [dpdk-dev] [PATCH v2 13/13] app/test: " jerinj
2020-07-01  6:48   ` [dpdk-dev] [PATCH v3 00/13] rte_log registration usage improvement jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 01/13] eal/log: introduce log register macro jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 02/13] lib: use " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 03/13] drivers/vdpa: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 04/13] drivers/raw: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 05/13] drivers/net: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 06/13] drivers/mempool: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 07/13] drivers/event: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 08/13] drivers/crypto: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 09/13] drivers/compress: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 10/13] drivers/common: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 11/13] drivers/bus: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 12/13] drivers/baseband: " jerinj
2020-07-01  6:48     ` [dpdk-dev] [PATCH v3 13/13] app/test: " jerinj
2020-07-01 10:44     ` [dpdk-dev] [PATCH v4 00/13] rte_log registration usage improvement jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 01/13] eal/log: introduce log register macro jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 02/13] lib: use " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 03/13] drivers/vdpa: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 04/13] drivers/raw: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 05/13] drivers/net: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 06/13] drivers/mempool: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 07/13] drivers/event: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 08/13] drivers/crypto: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 09/13] drivers/compress: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 10/13] drivers/common: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 11/13] drivers/bus: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 12/13] drivers/baseband: " jerinj
2020-07-01 10:44       ` [dpdk-dev] [PATCH v4 13/13] app/test: " jerinj
2020-07-01 12:33       ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 01/13] eal/log: introduce log register macro jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 02/13] lib: use " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 03/13] drivers/vdpa: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 04/13] drivers/raw: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 05/13] drivers/net: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 06/13] drivers/mempool: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 07/13] drivers/event: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 08/13] drivers/crypto: " jerinj
2020-07-02 17:59           ` Akhil Goyal
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 09/13] drivers/compress: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 10/13] drivers/common: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 11/13] drivers/bus: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 12/13] drivers/baseband: " jerinj
2020-07-01 12:33         ` [dpdk-dev] [PATCH v5 13/13] app/test: " jerinj
2020-07-03 13:55         ` [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement David Marchand
2020-07-06  9:31           ` Jerin Jacob

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=20200617063047.1555518-12-jerinj@marvell.com \
    --to=jerinj@marvell.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=olivier.matz@6wind.com \
    --cc=rosen.xu@intel.com \
    --cc=sachin.saxena@nxp.com \
    --cc=sthemmin@microsoft.com \
    --cc=thomas@monjalon.net \
    /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).