| 41 | } while (0) |
| 42 | |
| 43 | static void |
| 44 | measure_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 | |
| 65 | static void |
| 66 | wait_till_workers_are_ready(struct test_data *data) |
no test coverage detected