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 0F1D943C5D; Tue, 12 Mar 2024 02:53:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96102402B5; Tue, 12 Mar 2024 02:53:52 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 56E2D4013F for ; Tue, 12 Mar 2024 02:53:51 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TtxSq2cylz2Bfvl; Tue, 12 Mar 2024 09:51:23 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 6DDAA140485; Tue, 12 Mar 2024 09:53:49 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 12 Mar 2024 09:53:49 +0800 Subject: Re: [PATCH v3] app/dma-perf: add average latency per worker To: Vipin Varghese , CC: , References: <20240306150628.1417-1-vipin.varghese@amd.com> <20240308190646.1456-1-vipin.varghese@amd.com> From: fengchengwen Message-ID: Date: Tue, 12 Mar 2024 09:53:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20240308190646.1456-1-vipin.varghese@amd.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Acked-by: Chengwen Feng On 2024/3/9 3:06, Vipin Varghese wrote: > Modify the user information with total average latency per worker > in both CSV and console logs. > > Signed-off-by: Vipin Varghese > > V3 Changes: > - update CSV_TOTAL_LINE_FMT to change Avg Cycles / op per worker > > V2 Changes: > - keep one-digit precision is enough, suggested by Chengwen > --- > app/test-dma-perf/benchmark.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c > index 9b1f58c78c..fca3ba24f7 100644 > --- a/app/test-dma-perf/benchmark.c > +++ b/app/test-dma-perf/benchmark.c > @@ -23,7 +23,7 @@ > #define CSV_LINE_DMA_FMT "Scenario %u,%u,%s,%u,%u,%u,%u,%.2lf,%" PRIu64 ",%.3lf,%.3lf\n" > #define CSV_LINE_CPU_FMT "Scenario %u,%u,NA,NA,NA,%u,%u,%.2lf,%" PRIu64 ",%.3lf,%.3lf\n" > > -#define CSV_TOTAL_LINE_FMT "Scenario %u Summary, , , , , ,%u,%.2lf,%u,%.3lf,%.3lf\n" > +#define CSV_TOTAL_LINE_FMT "Scenario %u Summary, , , , , ,%u,%.2lf,%.1lf,%.3lf,%.3lf\n" > > struct worker_info { > bool ready_flag; > @@ -470,10 +470,11 @@ mem_copy_benchmark(struct test_configure *cfg, bool is_dma) > bandwidth_total += bandwidth; > avg_cycles_total += avg_cycles; > } > - printf("\nTotal Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", bandwidth_total, mops_total); > + printf("\nAverage Cycles/op per worker: %.1lf, Total Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", > + (avg_cycles_total * (float) 1.0) / nb_workers, bandwidth_total, mops_total); > snprintf(output_str[MAX_WORKER_NB], MAX_OUTPUT_STR_LEN, CSV_TOTAL_LINE_FMT, > cfg->scenario_id, nr_buf, memory * nb_workers, > - avg_cycles_total / nb_workers, bandwidth_total, mops_total); > + (avg_cycles_total * (float) 1.0) / nb_workers, bandwidth_total, mops_total); > > out: > /* free mbufs used in the test */ >