From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Jerin Jacob <jerinj@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Vamsi Attunuru <vattunuru@marvell.com>,
John Griffin <john.griffin@intel.com>,
Fiona Trahe <fiona.trahe@intel.com>,
Deepak Kumar Jain <deepak.k.jain@intel.com>
Subject: [dpdk-dev] [PATCH 05/11] drivers/common: use new logtype wrapper
Date: Mon, 19 Aug 2019 13:41:53 +0200 [thread overview]
Message-ID: <1566214919-32250-6-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1566214919-32250-1-git-send-email-david.marchand@redhat.com>
Make use of the newly introduced wrapper.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/common/dpaax/dpaax_iova_table.c | 8 ++---
drivers/common/octeontx/octeontx_mbox.c | 8 ++---
drivers/common/octeontx2/otx2_common.c | 62 ++++++++++++---------------------
drivers/common/qat/qat_logs.c | 18 ++++------
4 files changed, 32 insertions(+), 64 deletions(-)
diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index ae0af09..9bc2a4b 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -457,9 +457,5 @@ dpaax_handle_memevents(void)
dpaax_memevent_cb, NULL);
}
-RTE_INIT(dpaax_log)
-{
- dpaax_logger = rte_log_register("pmd.common.dpaax");
- if (dpaax_logger >= 0)
- rte_log_set_level(dpaax_logger, RTE_LOG_ERR);
-}
+RTE_LOG_REGISTER(dpaax_logger, "pmd.common.dpaax",
+ RTE_LOG_ERR, RTE_LOGTYPE_PMD);
diff --git a/drivers/common/octeontx/octeontx_mbox.c b/drivers/common/octeontx/octeontx_mbox.c
index 880f8a4..825a5ac 100644
--- a/drivers/common/octeontx/octeontx_mbox.c
+++ b/drivers/common/octeontx/octeontx_mbox.c
@@ -61,12 +61,8 @@ struct mbox_ram_hdr {
int octeontx_logtype_mbox;
-RTE_INIT(otx_init_log)
-{
- octeontx_logtype_mbox = rte_log_register("pmd.octeontx.mbox");
- if (octeontx_logtype_mbox >= 0)
- rte_log_set_level(octeontx_logtype_mbox, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(octeontx_logtype_mbox, "pmd.octeontx.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
static inline void
mbox_msgcpy(volatile uint8_t *d, volatile const uint8_t *s, uint16_t size)
diff --git a/drivers/common/octeontx2/otx2_common.c b/drivers/common/octeontx2/otx2_common.c
index 7e45366..a7d5387 100644
--- a/drivers/common/octeontx2/otx2_common.c
+++ b/drivers/common/octeontx2/otx2_common.c
@@ -206,43 +206,25 @@ int otx2_logtype_tim;
*/
int otx2_logtype_dpi;
-RTE_INIT(otx2_log_init);
-static void
-otx2_log_init(void)
-{
- otx2_logtype_base = rte_log_register("pmd.octeontx2.base");
- if (otx2_logtype_base >= 0)
- rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE);
-
- otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox");
- if (otx2_logtype_mbox >= 0)
- rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE);
-
- otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2");
- if (otx2_logtype_npa >= 0)
- rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE);
-
- otx2_logtype_nix = rte_log_register("pmd.net.octeontx2");
- if (otx2_logtype_nix >= 0)
- rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE);
-
- otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow");
- if (otx2_logtype_npc >= 0)
- rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE);
-
- otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm");
- if (otx2_logtype_tm >= 0)
- rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE);
-
- otx2_logtype_sso = rte_log_register("pmd.event.octeontx2");
- if (otx2_logtype_sso >= 0)
- rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE);
-
- otx2_logtype_tim = rte_log_register("pmd.event.octeontx2.timer");
- if (otx2_logtype_tim >= 0)
- rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE);
-
- otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi");
- if (otx2_logtype_dpi >= 0)
- rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE);
-}
+RTE_LOG_REGISTER(otx2_logtype_base, "pmd.octeontx2.base",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_mbox, "pmd.octeontx2.mbox",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_npa, "pmd.mempool.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL);
+
+RTE_LOG_REGISTER(otx2_logtype_nix, "pmd.net.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_npc, "pmd.net.octeontx2.flow",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_tm, "pmd.net.octeontx2.tm",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_sso, "pmd.event.octeontx2",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+RTE_LOG_REGISTER(otx2_logtype_tim, "pmd.event.octeontx2.timer",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+
+RTE_LOG_REGISTER(otx2_logtype_dpi, "pmd.raw.octeontx2.dpi",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index 7a86170..a8d1e84 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -24,15 +24,9 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
return 0;
}
-RTE_INIT(qat_pci_init_log)
-{
- /* Non-data-path logging for pci device and all services */
- qat_gen_logtype = rte_log_register("pmd.qat_general");
- if (qat_gen_logtype >= 0)
- rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE);
-
- /* data-path logging for all services */
- qat_dp_logtype = rte_log_register("pmd.qat_dp");
- if (qat_dp_logtype >= 0)
- rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE);
-}
+/* Non-data-path logging for pci device and all services */
+RTE_LOG_REGISTER(qat_gen_logtype, "pmd.qat_general",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
+/* data-path logging for all services */
+RTE_LOG_REGISTER(qat_dp_logtype, "pmd.qat_dp",
+ RTE_LOG_NOTICE, RTE_LOGTYPE_PMD);
--
1.8.3.1
next prev parent reply other threads:[~2019-08-19 11:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 11:41 [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 01/11] log: fix plugin level restore with patterns David Marchand
2019-08-19 12:30 ` Andrew Rybchenko
2019-08-19 11:41 ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers David Marchand
2019-08-19 12:27 ` Andrew Rybchenko
2019-09-02 14:29 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
2019-09-03 8:47 ` Ferruh Yigit
2019-09-04 17:45 ` Thomas Monjalon
2019-09-04 19:21 ` Andrew Rybchenko
2019-09-04 19:41 ` Thomas Monjalon
2019-09-04 19:58 ` Andrew Rybchenko
2019-09-04 20:44 ` Thomas Monjalon
2019-09-05 6:29 ` Andrew Rybchenko
2019-09-05 7:13 ` David Marchand
2019-09-05 7:45 ` Thomas Monjalon
2019-08-19 11:41 ` [dpdk-dev] [PATCH 03/11] drivers/baseband: use new logtype wrapper David Marchand
2019-08-19 15:39 ` Chautru, Nicolas
2019-08-19 11:41 ` [dpdk-dev] [PATCH 04/11] drivers/bus: " David Marchand
2019-08-19 11:41 ` David Marchand [this message]
2019-08-19 11:41 ` [dpdk-dev] [PATCH 06/11] drivers/compress: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 07/11] drivers/crypto: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 08/11] drivers/event: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 09/11] drivers/mempool: " David Marchand
2019-08-19 11:41 ` [dpdk-dev] [PATCH 10/11] drivers/net: " David Marchand
2019-08-19 14:55 ` Legacy, Allain
2019-09-02 16:11 ` Ferruh Yigit
2019-09-03 8:06 ` David Marchand
2019-09-03 15:03 ` Stephen Hemminger
2019-08-19 11:41 ` [dpdk-dev] [PATCH 11/11] drivers/raw: " David Marchand
2019-09-02 14:17 ` [dpdk-dev] [PATCH 00/11] Fixing log levels for dynamically loaded drivers Ferruh Yigit
2019-09-03 8:06 ` David Marchand
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=1566214919-32250-6-git-send-email-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=deepak.k.jain@intel.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=john.griffin@intel.com \
--cc=ndabilpuram@marvell.com \
--cc=sachin.saxena@nxp.com \
--cc=vattunuru@marvell.com \
/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).