DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: add function name to log message
@ 2018-10-11 17:59 Stephen Hemminger
  2018-10-12 10:42 ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2018-10-11 17:59 UTC (permalink / raw)
  To: thomas, ferruh.yigit; +Cc: dev, Stephen Hemminger

While debugging some virtio driver issues, saw:
	Invalid port_id=3
but it was not clear which function was logging this because the
same log is being done in multiple places in ethdev.

Trivial fix is to prefix with function name as is done in other
drivers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/failsafe/failsafe.c | 1 -
 lib/librte_ethdev/rte_ethdev.h  | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index c3999f0265b2..3830ed33dba2 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -2,7 +2,6 @@
  * Copyright 2017 6WIND S.A.
  * Copyright 2017 Mellanox Technologies, Ltd
  */
-
 #include <rte_alarm.h>
 #include <rte_malloc.h>
 #include <rte_ethdev_driver.h>
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 012577b0ab22..9632c67b929b 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -161,8 +161,9 @@ extern "C" {
 
 extern int rte_eth_dev_logtype;
 
-#define RTE_ETHDEV_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
+#define RTE_ETHDEV_LOG(level, fmt, ...)		\
+	rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, \
+		"%s():" fmt, __func__, ## __VA_ARGS__)
 
 struct rte_mbuf;
 
-- 
2.19.1

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

end of thread, other threads:[~2018-10-17 17:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 17:59 [dpdk-dev] [PATCH] ethdev: add function name to log message Stephen Hemminger
2018-10-12 10:42 ` Ferruh Yigit
2018-10-12 10:45   ` Ferruh Yigit
2018-10-12 12:43     ` Adrien Mazarguil
2018-10-12 14:54       ` Stephen Hemminger
2018-10-16 15:55         ` Ferruh Yigit
2018-10-17  9:26           ` Gaëtan Rivet
2018-10-17 17:08             ` Ferruh Yigit

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