- static int only_once;
- uint64_t etot, eavg, emax, emin;
- uint64_t dtot, davg, dmax, dmin;
- uint64_t ctot, cavg, cmax, cmin;
- double ttot, tavg, tmax, tmin;
-
- const uint64_t tunit = 1000000; /* us */
- const uint64_t tsc_hz = rte_get_tsc_hz();
-
- etot = ctx->results.enqd_tot;
- eavg = ctx->results.enqd_tot / ctx->results.burst_num;
- emax = ctx->results.enqd_max;
- emin = ctx->results.enqd_min;
-
- dtot = ctx->results.deqd_tot;
- davg = ctx->results.deqd_tot / ctx->results.burst_num;
- dmax = ctx->results.deqd_max;
- dmin = ctx->results.deqd_min;
-
- ctot = ctx->results.cycles_tot;
- cavg = ctx->results.cycles_tot / ctx->results.num;
- cmax = ctx->results.cycles_max;
- cmin = ctx->results.cycles_min;
-
- ttot = tunit*(double)(ctot) / tsc_hz;
- tavg = tunit*(double)(cavg) / tsc_hz;
- tmax = tunit*(double)(cmax) / tsc_hz;
- tmin = tunit*(double)(cmin) / tsc_hz;
-
- if (ctx->options->csv) {
- if (!only_once)
- printf("\n# lcore, Pakt Seq #, Packet Size, cycles,"
- " time (us)");
-
- for (i = 0; i < ctx->options->total_ops; i++) {
-
- printf("\n%u;%"PRIu64";%"PRIu64";%.3f",
- ctx->lcore_id, i + 1,
- ctx->res[i].tsc_end - ctx->res[i].tsc_start,
- tunit * (double) (ctx->res[i].tsc_end
- - ctx->res[i].tsc_start)
- / tsc_hz);
-
- }
- only_once = 1;
- } else {
- printf("\n# Device %d on lcore %u\n", ctx->dev_id,
- ctx->lcore_id);
- printf("\n# total operations: %u", ctx->options->total_ops);
- printf("\n# verified failed: %"PRIu64,
- ctx->results.ops_failed);
- printf("\n# burst number: %"PRIu64,
- ctx->results.burst_num);
- printf("\n#");
- printf("\n# \t Total\t Average\t Maximum\t "
- " Minimum");
- printf("\n# enqueued\t%12"PRIu64"\t%10"PRIu64"\t%10"PRIu64"\t"
- "%10"PRIu64, etot, eavg, emax, emin);
- printf("\n# dequeued\t%12"PRIu64"\t%10"PRIu64"\t%10"PRIu64"\t"
- "%10"PRIu64, dtot, davg, dmax, dmin);
- printf("\n# cycles\t%12"PRIu64"\t%10"PRIu64"\t%10"PRIu64"\t"
- "%10"PRIu64, ctot, cavg, cmax, cmin);
- printf("\n# time [us]\t%12.0f\t%10.3f\t%10.3f\t%10.3f", ttot,
- tavg, tmax, tmin);
- printf("\n\n");
-
- }
- cperf_latency_test_free(ctx, ctx->options->pool_sz);