[dpdk-dev,2/4] app/eventdev: add packet distribution logs

Message ID 20171130072406.15605-2-pbhagavatula@caviumnetworks.com
State Superseded, archived
Delegated to: Jerin Jacob
Headers show

Checks

Context Check Description
ci/Intel-compilation fail apply patch file failure
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Nov. 30, 2017, 7:24 a.m.
Add logs for packet distribution across worker cores to be printed
along with the test results.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 app/test-eventdev/evt_main.c         |  3 +++
 app/test-eventdev/test_perf_common.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)

--
2.7.4

Comments

Jerin Jacob Dec. 10, 2017, 12:31 p.m. | #1
-----Original Message-----
> Date: Thu, 30 Nov 2017 12:54:04 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: jerin.jacobkollanukkaran@cavium.com, gage.eads@intel.com,
>  harry.van.haaren@intel.com, bruce.richardson@intel.com,
>  hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 2/4] app/eventdev: add packet distribution logs
> X-Mailer: git-send-email 2.14.1
> 
> Add logs for packet distribution across worker cores to be printed
> along with the test results.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Patch

diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
index 1c3a7fa..bde388b 100644
--- a/app/test-eventdev/evt_main.c
+++ b/app/test-eventdev/evt_main.c
@@ -57,6 +57,9 @@  signal_handler(int signum)

 		rte_eal_mp_wait_lcore();

+		if (test->ops.test_result)
+			test->ops.test_result(test, &opt);
+
 		if (test->ops.eventdev_destroy)
 			test->ops.eventdev_destroy(test, &opt);

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 60965dc..f5d292c 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -36,8 +36,20 @@  int
 perf_test_result(struct evt_test *test, struct evt_options *opt)
 {
 	RTE_SET_USED(opt);
+	int i;
+	uint64_t total = 0;
 	struct test_perf *t = evt_test_priv(test);

+	printf("Packet distribution across worker cores :\n");
+	for (i = 0; i < t->nb_workers; i++)
+		total += t->worker[i].processed_pkts;
+	for (i = 0; i < t->nb_workers; i++)
+		printf("Worker %d packets: "CLGRN"%"PRIx64" "CLNRM"percentage:"
+				CLGRN" %3.2f\n"CLNRM, i,
+				t->worker[i].processed_pkts,
+				(((double)t->worker[i].processed_pkts)/total)
+				* 100);
+
 	return t->result;
 }