DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] log: allow log register API to update log level
@ 2024-08-09 13:01 Bharath Paulraj
  2024-08-09 14:06 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Bharath Paulraj @ 2024-08-09 13:01 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Bharath Paulraj

This commit fixes the bug in the registration API where it fails to
set the log level if 'id' already exists.

Signed-off-by: Bharath Paulraj <bharathpaul@gmail.com>
---
 .mailmap      | 1 +
 lib/log/log.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 4a508bafad..05eca16a96 100644
--- a/.mailmap
+++ b/.mailmap
@@ -181,6 +181,7 @@ Bernard Iremonger <bernard.iremonger@intel.com>
 Bert van Leeuwen <bert.vanleeuwen@netronome.com>
 Bhagyada Modali <bhagyada.modali@amd.com>
 Bharat Mota <bharat.mota@broadcom.com> <bmota@vmware.com>
+Bharath Paulraj <bharathpaul@gmail.com>
 Bhuvan Mital <bhuvan.mital@amd.com>
 Bill Hong <bhong@brocade.com>
 Billy McFall <bmcfall@redhat.com>
diff --git a/lib/log/log.c b/lib/log/log.c
index 255f757d94..4338795b16 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -292,8 +292,10 @@ log_register(const char *name, uint32_t level)
 	int id;
 
 	id = log_lookup(name);
-	if (id >= 0)
+	if (id >= 0) {
+		logtype_set_level(id, level);
 		return id;
+	}
 
 	new_dynamic_types = realloc(rte_logs.dynamic_types,
 		sizeof(struct rte_log_dynamic_type) *
-- 
2.34.1


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

* Re: [PATCH] log: allow log register API to update log level
  2024-08-09 13:01 [PATCH] log: allow log register API to update log level Bharath Paulraj
@ 2024-08-09 14:06 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2024-08-09 14:06 UTC (permalink / raw)
  To: Bharath Paulraj; +Cc: dev

09/08/2024 15:01, Bharath Paulraj:
> This commit fixes the bug in the registration API where it fails to
> set the log level if 'id' already exists.

Why registering twice?



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

end of thread, other threads:[~2024-08-09 14:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-09 13:01 [PATCH] log: allow log register API to update log level Bharath Paulraj
2024-08-09 14:06 ` 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).