| 144 | } |
| 145 | |
| 146 | static int |
| 147 | test_trace_perf(void) |
| 148 | { |
| 149 | unsigned int nb_cores, nb_workers; |
| 150 | struct test_data *data; |
| 151 | size_t sz; |
| 152 | |
| 153 | nb_cores = rte_lcore_count(); |
| 154 | nb_workers = nb_cores - 1; |
| 155 | if (nb_cores < 2) { |
| 156 | printf("Need minimum two cores for testing\n"); |
| 157 | return TEST_SKIPPED; |
| 158 | } |
| 159 | |
| 160 | printf("Timer running at %5.2fMHz\n", rte_get_timer_hz()/1E6); |
| 161 | sz = sizeof(struct test_data); |
| 162 | sz += nb_workers * sizeof(struct lcore_data); |
| 163 | |
| 164 | data = rte_zmalloc(NULL, sz, RTE_CACHE_LINE_SIZE); |
| 165 | if (data == NULL) { |
| 166 | printf("Failed to allocate memory\n"); |
| 167 | return TEST_FAILED; |
| 168 | } |
| 169 | |
| 170 | run_test("void", worker_fn_GENERIC_VOID, data, sz); |
| 171 | run_test("u64", worker_fn_GENERIC_U64, data, sz); |
| 172 | run_test("int", worker_fn_GENERIC_INT, data, sz); |
| 173 | run_test("float", worker_fn_GENERIC_FLOAT, data, sz); |
| 174 | run_test("double", worker_fn_GENERIC_DOUBLE, data, sz); |
| 175 | run_test("string", worker_fn_GENERIC_STR, data, sz); |
| 176 | run_test("void_fp", worker_fn_VOID_FP, data, sz); |
| 177 | |
| 178 | rte_free(data); |
| 179 | return TEST_SUCCESS; |
| 180 | } |
| 181 | |
| 182 | REGISTER_PERF_TEST(trace_perf_autotest, test_trace_perf); |
nothing calls this directly
no test coverage detected