From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DA48BA00E6 for ; Wed, 20 Mar 2019 12:33:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D767569B; Wed, 20 Mar 2019 12:33:26 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6E0B65589; Wed, 20 Mar 2019 12:33:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 04:33:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,248,1549958400"; d="scan'208";a="330283059" Received: from silpixa00400214.ir.intel.com (HELO silpixa00400214.ger.corp.intel.com) ([10.237.223.195]) by fmsmga005.fm.intel.com with ESMTP; 20 Mar 2019 04:33:22 -0700 From: Reshma Pattan To: dev@dpdk.org Cc: rami.rosen@intel.com, stable@dpdk.org, Reshma Pattan Date: Wed, 20 Mar 2019 11:33:19 +0000 Message-Id: <20190320113319.26134-1-reshma.pattan@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test: fix build when pdump config is disabled 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190320113319.04MRcp1D2jI7PrP5vQXo98Xr4fLNT7E-AwHT19yN1XE@z> pdump unit test has dependency on pthread code in test.c and process.h to run send_pkts(), this code should be enabled only when CONFIG_RTE_LIBRTE_PDUMP is enabled. Bugzilla ID: 222 Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library") CC: stable@dpdk.org Signed-off-by: Reshma Pattan --- app/test/process.h | 8 ++++++++ app/test/test.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/app/test/process.h b/app/test/process.h index 2701127a2..513bc9420 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -19,9 +19,11 @@ #define exe "exe" #endif +#ifdef RTE_LIBRTE_PDUMP #include extern void *send_pkts(void *empty); extern uint16_t flag_for_send_pkts; +#endif /* * launches a second copy of the test process using the given argv parameters, @@ -36,7 +38,9 @@ process_dup(const char *const argv[], int numargs, const char *env_value) char *argv_cpy[numargs + 1]; int i, fd, status; char path[32]; +#ifdef RTE_LIBRTE_PDUMP pthread_t thread; +#endif pid_t pid = fork(); if (pid < 0) @@ -67,15 +71,19 @@ process_dup(const char *const argv[], int numargs, const char *env_value) rte_panic("Cannot exec\n"); } /* parent process does a wait */ +#ifdef RTE_LIBRTE_PDUMP if ((strcmp(env_value, "run_pdump_server_tests") == 0)) pthread_create(&thread, NULL, &send_pkts, NULL); +#endif while (wait(&status) != pid) ; +#ifdef RTE_LIBRTE_PDUMP if ((strcmp(env_value, "run_pdump_server_tests") == 0)) { flag_for_send_pkts = 0; pthread_join(thread, NULL); } +#endif return status; } diff --git a/app/test/test.c b/app/test/test.c index d646f5160..1c91ed675 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -30,7 +30,9 @@ extern cmdline_parse_ctx_t main_ctx[]; #endif #include "test.h" +#ifdef RTE_LIBRTE_PDUMP #include "test_pdump.h" +#endif #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 @@ -50,7 +52,9 @@ do_recursive_call(void) int (*action_fn)(void); } actions[] = { { "run_secondary_instances", test_mp_secondary }, +#ifdef RTE_LIBRTE_PDUMP { "run_pdump_server_tests", test_pdump }, +#endif { "test_missing_c_flag", no_action }, { "test_master_lcore_flag", no_action }, { "test_invalid_n_flag", no_action }, -- 2.17.1