DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: thomas@monjalon.net, ferruh.yigit@intel.com
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH] ethdev: add function name to log message
Date: Thu, 11 Oct 2018 10:59:40 -0700	[thread overview]
Message-ID: <20181011175940.6800-1-stephen@networkplumber.org> (raw)

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

             reply	other threads:[~2018-10-11 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 17:59 Stephen Hemminger [this message]
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

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=20181011175940.6800-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).