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 EFBD5A052A; Tue, 22 Dec 2020 07:31:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 86BBFCAC7; Tue, 22 Dec 2020 07:31:13 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id EC886CAC5; Tue, 22 Dec 2020 07:31:11 +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 6DF551FB; Mon, 21 Dec 2020 22:31:10 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A5A43F66E; Mon, 21 Dec 2020 22:31:07 -0800 (PST) From: Feifei Wang To: Jerin Jacob , Sunil Kumar Kori , David Marchand Cc: dev@dpdk.org, nd@arm.com, Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com, Feifei Wang , stable@dpdk.org Date: Tue, 22 Dec 2020 14:30:54 +0800 Message-Id: <20201222063054.44429-3-feifei.wang2@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201222063054.44429-1-feifei.wang2@arm.com> References: <20201222063054.44429-1-feifei.wang2@arm.com> Subject: [dpdk-dev] [PATCH v1 2/2] app/test: collect perf data after worker threads exit 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" The measure_perf function should be excuted 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 --- 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.17.1