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 1D6C5A0567; Wed, 10 Mar 2021 03:15:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A905B22A5D5; Wed, 10 Mar 2021 03:15:44 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 8779A22A5D3; Wed, 10 Mar 2021 03:15:43 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02CEAED1; Tue, 9 Mar 2021 18:15:43 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.125]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9AF8B3F70D; Tue, 9 Mar 2021 18:15:39 -0800 (PST) From: Feifei Wang To: Jerin Jacob , Sunil Kumar Kori , David Marchand Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , stable@dpdk.org, Honnappa Nagarahalli , Honnappa Nagarahalli , Ruifeng Wang , Pavan Nikhilesh Date: Wed, 10 Mar 2021 10:15:27 +0800 Message-Id: <20210310021527.19305-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210310021527.19305-1-feifei.wang2@arm.com> References: <20201222063054.44429-1-feifei.wang2@arm.com> <20210310021527.19305-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/1] test/trace: collect perf data after worker threads exit 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" The measure_perf function should be executed after worker threads exit to collect correct perf data. Otherwise, while workers are running, the main thread may get incomplete data from workers. In the meanwhile, remove unnecessary barrier in the test. For signal variables "ldata.done" and "ldata.start", no operations should keep the order that being executed after them. So the wmb after them can be moved. Fixes: 16a277a24c9f ("test/trace: add performance test cases") Cc: jerinj@marvell.com Cc: stable@dpdk.org Suggested-by: Honnappa Nagarahalli Signed-off-by: Feifei Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ruifeng Wang Acked-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- app/test/test_trace_perf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c index e1ad8e6f5..46ae7d807 100644 --- a/app/test/test_trace_perf.c +++ b/app/test/test_trace_perf.c @@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data) for (workers = 0; workers < data->nb_workers; workers++) { data->ldata[workers].done = 1; - rte_smp_wmb(); } } @@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \ { \ struct lcore_data *ldata = arg; \ ldata->started = 1; \ - rte_smp_wmb(); \ __worker_##func(ldata); \ return 0; \ } @@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz) wait_till_workers_are_ready(data); rte_delay_ms(100); /* Wait for some time to accumulate the stats */ - measure_perf(str, data); signal_workers_to_finish(data); RTE_LCORE_FOREACH_WORKER(id) rte_eal_wait_lcore(id); + + measure_perf(str, data); } static int -- 2.25.1