[2/4] test/cryptodev: improve csv output for perf tests

Message ID 20201211173114.1924772-3-ciara.power@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series add crypto perf test graphing script |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Power, Ciara Dec. 11, 2020, 5:31 p.m. UTC
  The csv outputs for performance tests were not easily consumed, due to
unnecessary whitespaces and capitals. The delimiter is modified to now
be "," instead of ";" which was present in some cases. Some unnecessary
values were also removed from the output.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test-crypto-perf/cperf_test_latency.c    | 13 +++++--------
 app/test-crypto-perf/cperf_test_throughput.c | 12 ++++++------
 2 files changed, 11 insertions(+), 14 deletions(-)
  

Comments

Doherty, Declan Jan. 11, 2021, 3:43 p.m. UTC | #1
On 11/12/2020 5:31 PM, Ciara Power wrote:
> The csv outputs for performance tests were not easily consumed, due to
> unnecessary whitespaces and capitals. The delimiter is modified to now
> be "," instead of ";" which was present in some cases. Some unnecessary
> values were also removed from the output.
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>   app/test-crypto-perf/cperf_test_latency.c    | 13 +++++--------
>   app/test-crypto-perf/cperf_test_throughput.c | 12 ++++++------
>   2 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
> index c2590a4dcf..f3c09b8c1c 100644
> --- a/app/test-crypto-perf/cperf_test_latency.c
> +++ b/app/test-crypto-perf/cperf_test_latency.c
> @@ -309,18 +309,15 @@ cperf_latency_test_runner(void *arg)
>   
>   		if (ctx->options->csv) {
>   			if (rte_atomic16_test_and_set(&display_once))
> -				printf("\n# lcore, Buffer Size, Burst Size, Pakt Seq #, "
> -						"cycles, time (us)");
> +				printf("\n#buffer_size(b),burst_size,time(us)");
>   
>   			for (i = 0; i < ctx->options->total_ops; i++) {
>   
> -				printf("\n%u;%u;%u;%"PRIu64";%"PRIu64";%.3f",
> -					ctx->lcore_id, ctx->options->test_buffer_size,
> -					test_burst_size, i + 1,
> -					ctx->res[i].tsc_end - ctx->res[i].tsc_start,
> +				printf("\n%u,%u,%.3f",
> +					ctx->options->test_buffer_size,
> +					test_burst_size,
>   					tunit * (double) (ctx->res[i].tsc_end
> -							- ctx->res[i].tsc_start)
> -						/ tsc_hz);
> +					- ctx->res[i].tsc_start) / tsc_hz);
>   
>   			}
>   		} else {
> diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
> index f30f7d5c2c..a841a890b9 100644
> --- a/app/test-crypto-perf/cperf_test_throughput.c
> +++ b/app/test-crypto-perf/cperf_test_throughput.c
> @@ -294,13 +294,13 @@ cperf_throughput_test_runner(void *test_ctx)
>   					cycles_per_packet);
>   		} else {
>   			if (rte_atomic16_test_and_set(&display_once))
> -				printf("#lcore id,Buffer Size(B),"
> -					"Burst Size,Enqueued,Dequeued,Failed Enq,"
> -					"Failed Deq,Ops(Millions),Throughput(Gbps),"
> -					"Cycles/Buf\n\n");
> +				printf("#lcore_id,buffer_size(b),"
> +					"burst_size,enqueued,dequeued,failed_enq,"
> +					"failed_deq,ops(millions),throughput(gbps),"
> +					"cycles_per_buf\n\n");
>   
> -			printf("%u;%u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
> -					"%.3f;%.3f;%.3f\n",
> +			printf("%u,%u,%u,%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
> +					"%.3f,%.3f,%.3f\n",
>   					ctx->lcore_id,
>   					ctx->options->test_buffer_size,
>   					test_burst_size,
> 

I would suggest limiting the changes here to just fixing the delimiter 
here to being comma's instead of semi-colon's, that way it should be 
possible to make the python script support only versions of the output 
which wouldn't be possible if we change column names.
  

Patch

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index c2590a4dcf..f3c09b8c1c 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -309,18 +309,15 @@  cperf_latency_test_runner(void *arg)
 
 		if (ctx->options->csv) {
 			if (rte_atomic16_test_and_set(&display_once))
-				printf("\n# lcore, Buffer Size, Burst Size, Pakt Seq #, "
-						"cycles, time (us)");
+				printf("\n#buffer_size(b),burst_size,time(us)");
 
 			for (i = 0; i < ctx->options->total_ops; i++) {
 
-				printf("\n%u;%u;%u;%"PRIu64";%"PRIu64";%.3f",
-					ctx->lcore_id, ctx->options->test_buffer_size,
-					test_burst_size, i + 1,
-					ctx->res[i].tsc_end - ctx->res[i].tsc_start,
+				printf("\n%u,%u,%.3f",
+					ctx->options->test_buffer_size,
+					test_burst_size,
 					tunit * (double) (ctx->res[i].tsc_end
-							- ctx->res[i].tsc_start)
-						/ tsc_hz);
+					- ctx->res[i].tsc_start) / tsc_hz);
 
 			}
 		} else {
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index f30f7d5c2c..a841a890b9 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -294,13 +294,13 @@  cperf_throughput_test_runner(void *test_ctx)
 					cycles_per_packet);
 		} else {
 			if (rte_atomic16_test_and_set(&display_once))
-				printf("#lcore id,Buffer Size(B),"
-					"Burst Size,Enqueued,Dequeued,Failed Enq,"
-					"Failed Deq,Ops(Millions),Throughput(Gbps),"
-					"Cycles/Buf\n\n");
+				printf("#lcore_id,buffer_size(b),"
+					"burst_size,enqueued,dequeued,failed_enq,"
+					"failed_deq,ops(millions),throughput(gbps),"
+					"cycles_per_buf\n\n");
 
-			printf("%u;%u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
-					"%.3f;%.3f;%.3f\n",
+			printf("%u,%u,%u,%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64","
+					"%.3f,%.3f,%.3f\n",
 					ctx->lcore_id,
 					ctx->options->test_buffer_size,
 					test_burst_size,