From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3394FA00E6 for ; Fri, 12 Jul 2019 18:02:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0706B1BE19; Fri, 12 Jul 2019 18:02:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 556651BE02 for ; Fri, 12 Jul 2019 18:02:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 09:02:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,483,1557212400"; d="scan'208";a="250160184" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.223.125]) by orsmga001.jf.intel.com with ESMTP; 12 Jul 2019 09:02:06 -0700 From: Anatoly Burakov To: dev@dpdk.org Date: Fri, 12 Jul 2019 17:02:05 +0100 Message-Id: <1a51612a8bd6b6f359aec9b0072f8763cd59cb6c.1562947317.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test: make multiprocess launch error more informative X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Currently, if there is no procfs mounted, test application will fail to run any multiprocess-related autotests (EAL flags etc.) without a clear explanation as to why this happens. Add a check specifically for that condition, as well as add a general stringified error message to rte_panic. Signed-off-by: Anatoly Burakov --- app/test/process.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test/process.h b/app/test/process.h index 513bc9420..128ce4121 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -5,12 +5,16 @@ #ifndef _PROCESS_H_ #define _PROCESS_H_ +#include /* errno */ #include /* PATH_MAX */ #include /* basename et al */ #include /* NULL */ +#include /* strerror */ #include /* readlink */ #include +#include /* strlcpy */ + #ifdef RTE_EXEC_ENV_FREEBSD #define self "curproc" #define exe "file" @@ -67,8 +71,15 @@ process_dup(const char *const argv[], int numargs, const char *env_value) /* set the environment variable */ if (setenv(RECURSIVE_ENV_VAR, env_value, 1) != 0) rte_panic("Cannot export environment variable\n"); - if (execv("/proc/" self "/" exe, argv_cpy) < 0) - rte_panic("Cannot exec\n"); + + strlcpy(path, "/proc/" self "/" exe, sizeof(path)); + if (execv(path, argv_cpy) < 0) { + if (errno == ENOENT) { + printf("Could not find '%s', is procfs mounted?\n", + path); + } + rte_panic("Cannot exec: %s\n", strerror(errno)); + } } /* parent process does a wait */ #ifdef RTE_LIBRTE_PDUMP -- 2.17.1