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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation 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-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Vipin Varghese March 6, 2024, 3:06 p.m. UTC
  Modify the user display data with total average latency per worker.

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

V2 Changes:
 - keep one-digit precision is enough, suggested by Chengwen
---
 app/test-dma-perf/benchmark.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

fengchengwen March 8, 2024, 1:15 a.m. UTC | #1
Unaddressed
Hi Vipin,

On 2024/3/6 23:06, Vipin Varghese wrote:
> Modify the user display data with total average latency per worker.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>
> 
> V2 Changes:
>  - keep one-digit precision is enough, suggested by Chengwen
> ---
>  app/test-dma-perf/benchmark.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
> index 9b1f58c78c..2e110d0d98 100644
> --- a/app/test-dma-perf/benchmark.c
> +++ b/app/test-dma-perf/benchmark.c
> @@ -470,7 +470,8 @@ 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: %.1f, 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);

As previous mentioned, please make sure the csv format and the above snprintf also modified (make sure stdout and csv has the same value).

>
  
Vipin Varghese March 8, 2024, 2:39 a.m. UTC | #2
<snipped>
>> -     printf("\nTotal Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", bandwidth_total, mops_total);
>> +     printf("\nAverage Cycles/op per worker: %.1f, 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);
> As previous mentioned, please make sure the csv format and the above snprintf also modified (make sure stdout and csv has the same value).

Hi Chengwen, the CSV_TOTAL_LINE_FMT already has `Cycles/op` with `%u`. I 
think you are asking to convert this to `%0.1f`to keep it same as `printf`.

Sure I will share v3 for the same.
  

Patch

diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 9b1f58c78c..2e110d0d98 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -470,7 +470,8 @@  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: %.1f, 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);