Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B288FC07E95 for ; Wed, 7 Jul 2021 12:53:10 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 4933061C73 for ; Wed, 7 Jul 2021 12:53:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4933061C73 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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