MCPcopy Create free account
hub / github.com/F-Stack/f-stack / measure_perf

Function measure_perf

dpdk/app/test/test_trace_perf.c:43–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41} while (0)
42
43static void
44measure_perf(const char *str, struct test_data *data)
45{
46 uint64_t hz = rte_get_timer_hz();
47 uint64_t total_cycles = 0;
48 uint64_t total_calls = 0;
49 double cycles, ns;
50 unsigned int workers;
51
52 for (workers = 0; workers < data->nb_workers; workers++) {
53 total_cycles += data->ldata[workers].total_cycles;
54 total_calls += data->ldata[workers].total_calls;
55 }
56
57 cycles = total_calls ? (double)total_cycles / (double)total_calls : 0;
58 cycles /= STEP;
59 cycles /= 100; /* CENT_OPS */
60
61 ns = (cycles / (double)hz) * 1E9;
62 printf("%16s: cycles=%f ns=%f\n", str, cycles, ns);
63}
64
65static void
66wait_till_workers_are_ready(struct test_data *data)

Callers 1

WORKER_DEFINEFunction · 0.70

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected