From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH] ethdev: add function name to log message Date: Thu, 11 Oct 2018 10:59:40 -0700 Message-ID: <20181011175940.6800-1-stephen@networkplumber.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Stephen Hemminger To: thomas@monjalon.net, ferruh.yigit@intel.com Return-path: Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 2E20F1B5BB for ; Thu, 11 Oct 2018 19:59:49 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id v133-v6so4540785pgb.2 for ; Thu, 11 Oct 2018 10:59:49 -0700 (PDT) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 #include #include 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