From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: olivier.matz@6wind.com, thomas@monjalon.net
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 2/2] eal: fix dynamic logs failing to print
Date: Thu, 16 Nov 2017 16:01:44 +0530 [thread overview]
Message-ID: <20171116103144.4197-2-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20171116103144.4197-1-pbhagavatula@caviumnetworks.com>
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@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
next prev parent reply other threads:[~2017-11-16 10:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 10:31 [dpdk-dev] [PATCH 1/2] eal: fix legacy dynamic logs defaulting to debug Pavan Nikhilesh
2017-11-16 10:31 ` Pavan Nikhilesh [this message]
2017-11-16 19:48 ` [dpdk-dev] [PATCH 2/2] eal: fix dynamic logs failing to print Ferruh Yigit
2017-11-17 8:47 ` Pavan Nikhilesh Bhagavatula
2017-11-20 18:40 ` Ferruh Yigit
2017-11-21 8:30 ` Pavan Nikhilesh Bhagavatula
2017-11-21 10:55 ` Thomas Monjalon
2017-11-21 11:14 ` Pavan Nikhilesh Bhagavatula
2017-11-21 13:30 ` Thomas Monjalon
2017-11-21 14:04 ` Pavan Nikhilesh Bhagavatula
2017-11-21 18:10 ` Ferruh Yigit
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=20171116103144.4197-2-pbhagavatula@caviumnetworks.com \
--to=pbhagavatula@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
--cc=thomas@monjalon.net \
/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).