[v3] app/dma-perf: add average latency per worker

Message ID 20240308190646.1456-1-vipin.varghese@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] app/dma-perf: add average latency per worker |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Vipin Varghese March 8, 2024, 7:06 p.m. UTC
  Modify the user information with total average latency per worker
in both CSV and console logs.

Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>

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(-)
  

Comments

fengchengwen March 12, 2024, 1:53 a.m. UTC | #1
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

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 <vipin.varghese@amd.com>
> 
> 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 */
>
  
Thomas Monjalon March 18, 2024, 2:36 a.m. UTC | #2
12/03/2024 02:53, fengchengwen:
> 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 <vipin.varghese@amd.com>
> > 
> > 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

The changelog should not appear in git so it must be below the 3 dashes.

> > ---
> >  app/test-dma-perf/benchmark.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>

Applied, thanks.
  

Patch

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 */