[1/3] port: convert to dynamic log type
Checks
Commit Message
Replace static RTE_LOGTYPE_PORT with dynamic type.
Since there are several types of port do initialization
in a short standalone file.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/log/log.c | 1 -
lib/log/rte_log.h | 2 +-
lib/port/meson.build | 1 +
lib/port/port_log.h | 4 +++-
4 files changed, 5 insertions(+), 3 deletions(-)
@@ -353,7 +353,6 @@ struct logtype {
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_PORT, "lib.port"},
{RTE_LOGTYPE_TABLE, "lib.table"},
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
@@ -40,7 +40,7 @@ extern "C" {
/* was RTE_LOGTYPE_POWER */
/* was RTE_LOGTYPE_METER */
/* was RTE_LOGTYPE_SCHED */
-#define RTE_LOGTYPE_PORT 13 /**< Log related to port. */
+ /* was RTE_LOGTYPE_PORT */
#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */
#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
/* was RTE_LOGTYPE_MBUF */
@@ -8,6 +8,7 @@ if is_windows
endif
sources = files(
+ 'port_log.c',
'rte_port_ethdev.c',
'rte_port_fd.c',
'rte_port_frag.c',
@@ -4,6 +4,8 @@
#include <rte_log.h>
+extern int port_logtype;
+#define RTE_LOGTYPE_PORT port_logtype
+
#define PORT_LOG(level, ...) \
RTE_LOG_LINE(level, PORT, "" __VA_ARGS__)
-