From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76703A0C4A; Wed, 7 Jul 2021 14:53:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59F5B413A8; Wed, 7 Jul 2021 14:53:09 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 3116C41391 for ; Wed, 7 Jul 2021 14:53:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="273139837" X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="273139837" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 05:53:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,331,1616482800"; d="scan'208";a="628021431" Received: from silpixa00399126.ir.intel.com ([10.237.223.29]) by orsmga005.jf.intel.com with ESMTP; 07 Jul 2021 05:53:04 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , David Marchand , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Ciara Power Date: Wed, 7 Jul 2021 13:52:55 +0100 Message-Id: <20210707125255.664793-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210707125255.664793-1-bruce.richardson@intel.com> References: <20210701093456.43426-1-bruce.richardson@intel.com> <20210707125255.664793-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 2/2] telemetry: add extra log message on socket bind failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If the library fails to create the needed socket, add an additional check to report if the error is due to a missing DPDK runtime dir. Signed-off-by: Bruce Richardson Reviewed-by: David Marchand Acked-by: Morten Brørup Acked-by: Ciara Power --- lib/telemetry/telemetry.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index 6baba57ec2..8665db8d03 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #endif /* !RTE_EXEC_ENV_WINDOWS */ @@ -422,7 +423,11 @@ create_socket(char *path) strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); unlink(sun.sun_path); if (bind(sock, (void *) &sun, sizeof(sun)) < 0) { + struct stat st; + TMTY_LOG(ERR, "Error binding socket: %s\n", strerror(errno)); + if (stat(socket_dir, &st) < 0 || !S_ISDIR(st.st_mode)) + TMTY_LOG(ERR, "Cannot access DPDK runtime directory: %s\n", socket_dir); sun.sun_path[0] = 0; goto error; } -- 2.30.2