app/eventdev: add packet distribution logs
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tue, 16 Jan 2018 17:45:53 +0000 (23:15 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 19 Jan 2018 15:09:56 +0000 (16:09 +0100)
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>
app/test-eventdev/evt_main.c
app/test-eventdev/test_perf_common.c

index 3c27f32..57bb945 100644 (file)
@@ -29,6 +29,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);
 
index e82cc93..e279d81 100644 (file)
@@ -8,8 +8,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;
 }