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

Function test_rw_reader

dpdk/app/test/test_hash_readwrite.c:291–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291static int
292test_rw_reader(void *arg)
293{
294 uint64_t i;
295 uint64_t begin, cycles;
296 uint64_t read_cnt = (uint64_t)((uintptr_t)arg);
297
298 begin = rte_rdtsc_precise();
299 for (i = 0; i < read_cnt; i++) {
300 void *data = arg;
301 rte_hash_lookup_data(tbl_rw_test_param.h,
302 tbl_rw_test_param.keys + i,
303 &data);
304 if (i != (uint64_t)(uintptr_t)data) {
305 printf("lookup find wrong value %"PRIu64","
306 "%"PRIu64"\n", i,
307 (uint64_t)(uintptr_t)data);
308 break;
309 }
310 }
311
312 cycles = rte_rdtsc_precise() - begin;
313 __atomic_fetch_add(&gread_cycles, cycles, __ATOMIC_RELAXED);
314 __atomic_fetch_add(&greads, i, __ATOMIC_RELAXED);
315 return 0;
316}
317
318static int
319test_rw_writer(void *arg)

Callers

nothing calls this directly

Calls 3

rte_hash_lookup_dataFunction · 0.85
rte_rdtsc_preciseFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected