DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers
Date: Mon, 19 Aug 2019 13:41:50 +0200	[thread overview]
Message-ID: <1566214919-32250-3-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1566214919-32250-1-git-send-email-david.marchand@redhat.com>

The function rte_log_register_type_and_pick_level() fills a gap for
dynamically loaded code (especially drivers) who would not pick up
the log level passed at startup.

Let's promote it to stable and export it for use by drivers via
a wrapper.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/common/include/rte_log.h | 12 ++++++++----
 lib/librte_eal/rte_eal_version.map      |  8 +++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index cbb4184..c3aff00 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -209,9 +209,6 @@ int rte_log_cur_msg_logtype(void);
 int rte_log_register(const char *name);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Register a dynamic log type and try to pick its level from EAL options
  *
  * rte_log_register() is called inside. If successful, the function tries
@@ -227,9 +224,16 @@ int rte_log_register(const char *name);
  *    - >=0: the newly registered log type
  *    - <0: rte_log_register() error value
  */
-__rte_experimental
 int rte_log_register_type_and_pick_level(const char *name, uint32_t level_def);
 
+#define RTE_LOG_REGISTER(token, name, level, fallback) \
+RTE_INIT(token##_init) \
+{ \
+	token = rte_log_register_type_and_pick_level(name, level); \
+	if (token < 0) \
+		token = fallback; \
+}
+
 /**
  * Dump log information.
  *
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7cbf82d..7326e92 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -312,6 +312,13 @@ DPDK_19.08 {
 
 } DPDK_19.05;
 
+DPDK_19.11 {
+	global:
+
+	rte_log_register_type_and_pick_level;
+
+} DPDK_19.08;
+
 EXPERIMENTAL {
 	global:
 
@@ -342,7 +349,6 @@ EXPERIMENTAL {
 	rte_fbarray_is_used;
 	rte_fbarray_set_free;
 	rte_fbarray_set_used;
-	rte_log_register_type_and_pick_level;
 	rte_malloc_dump_heaps;
 	rte_mem_alloc_validator_register;
 	rte_mem_alloc_validator_unregister;
-- 
1.8.3.1


  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 ` David Marchand [this message]
2019-08-19 12:27   ` [dpdk-dev] [PATCH 02/11] log: define logtype register wrapper for drivers 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 ` [dpdk-dev] [PATCH 05/11] drivers/common: " David Marchand
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-3-git-send-email-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).