Thread (98 messages) 98 messages, 8 authors, 2020-07-06

Re: [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro

From: Thomas Monjalon <hidden>
Date: 2020-06-17 10:00:20

17/06/2020 08:30, jerinj@marvell.com:
quoted hunk ↗ jump to hunk
From: Jerin Jacob <redacted>

Introducing the RTE_LOG_REGISTER macro to avoid the code duplication
in the log registration process.

It is a wrapper macro for declaring the logtype, register the log and sets
it's level in the constructor context.

Signed-off-by: Jerin Jacob <redacted>
---
--- a/lib/librte_eal/include/rte_log.h
+++ b/lib/librte_eal/include/rte_log.h
+#define RTE_LOG_REGISTER(type, name, level)			\
+int type;							\
+RTE_INIT(__##type)						\
+{								\
+	type = rte_log_register(RTE_STR(name));			\
+	if (type >= 0)						\
+		rte_log_set_level(type, RTE_LOG_##level);	\
+}
It should use rte_log_register_type_and_pick_level()
which works for drivers loaded later in the init sequence.

rte_log_register() should be deprecated.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help