[dpdk-dev] [PATCH 2/2] eal: fix dynamic logs failing to print

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Thu Nov 16 11:31:44 CET 2017


Dynamic logs fail to print if the global log level is less than dynamic
loglevel. Example if the global log level is set to INFO and dynamic log
level for a specific module is set to DEBUG then the log fails to print.

Check modules log level before checking the global log level.

Fixes: c1b5fa94a46f ("eal: support dynamic log types")

Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
---
 lib/librte_eal/common/eal_common_log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 061e96ef9..e31099d1a 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -336,12 +336,12 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 		}
 	}
 
-	if (level > rte_logs.level)
-		return 0;
 	if (logtype >= rte_logs.dynamic_types_len)
 		return -1;
-	if (level > rte_logs.dynamic_types[logtype].loglevel)
+	if (level > rte_logs.dynamic_types[logtype].loglevel &&
+			level > rte_logs.level) {
 		return 0;
+	}
 
 	/* save loglevel and logtype in a global per-lcore variable */
 	RTE_PER_LCORE(log_cur_msg).loglevel = level;
-- 
2.14.1



More information about the dev mailing list