DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] log: fix pattern matching
@ 2018-05-16 14:05 Ferruh Yigit
  2018-05-16 14:09 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-05-16 14:05 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Ferruh Yigit, stephen

loglevel set wrong when ":" is used as seperator, like
--log-type="user:debug"

This is because fnmatch returns zero on success. Fixed fnmatch return
value check.

Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
Cc: stephen@networkplumber.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/common/eal_common_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index c660ca659..818118944 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -184,7 +184,7 @@ rte_log_set_level_pattern(const char *pattern, uint32_t level)
 		if (rte_logs.dynamic_types[i].name == NULL)
 			continue;
 
-		if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0))
+		if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0) == 0)
 			rte_logs.dynamic_types[i].loglevel = level;
 	}
 
-- 
2.14.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v2] log: fix pattern matching
  2018-05-16 14:05 [dpdk-dev] [PATCH] log: fix pattern matching Ferruh Yigit
@ 2018-05-16 14:09 ` Ferruh Yigit
  2018-05-21 13:52   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-05-16 14:09 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Ferruh Yigit, stephen

loglevel set wrong when ":" is used as separator, like
--log-type="user:debug"

This is because fnmatch returns zero on success. Fixed fnmatch return
value check.

Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
Cc: stephen@networkplumber.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
* s/seperator/separator/ in commit log
---
 lib/librte_eal/common/eal_common_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index c660ca659..818118944 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -184,7 +184,7 @@ rte_log_set_level_pattern(const char *pattern, uint32_t level)
 		if (rte_logs.dynamic_types[i].name == NULL)
 			continue;
 
-		if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0))
+		if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0) == 0)
 			rte_logs.dynamic_types[i].loglevel = level;
 	}
 
-- 
2.14.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] log: fix pattern matching
  2018-05-16 14:09 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
@ 2018-05-21 13:52   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-05-21 13:52 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, stephen

16/05/2018 16:09, Ferruh Yigit:
> loglevel set wrong when ":" is used as separator, like
> --log-type="user:debug"
> 
> This is because fnmatch returns zero on success. Fixed fnmatch return
> value check.
> 
> Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing")
> Cc: stephen@networkplumber.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-21 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 14:05 [dpdk-dev] [PATCH] log: fix pattern matching Ferruh Yigit
2018-05-16 14:09 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2018-05-21 13:52   ` Thomas Monjalon

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).