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

Function timed_adds_sketch

dpdk/app/test/test_member_perf.c:317–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static int
318timed_adds_sketch(struct member_perf_params *params, int type)
319{
320 const uint64_t start_tsc = rte_rdtsc();
321 unsigned int i, j, a;
322 int32_t ret;
323
324 for (i = 0; i < NUM_ADDS / KEYS_TO_ADD; i++) {
325 for (j = 0; j < KEYS_TO_ADD; j++) {
326 if (type == SKETCH_BYTE)
327 ret = rte_member_add_byte_count(params->setsum[type],
328 &hh_keys[j], SKETCH_PKT_SIZE);
329 else
330 ret = rte_member_add(params->setsum[type], &hh_keys[j], 1);
331 if (ret < 0) {
332 printf("Error %d in rte_member_add - key=0x", ret);
333 for (a = 0; a < params->key_size; a++)
334 printf("%02x", hh_keys[j][a]);
335 printf("type: %d\n", type);
336
337 return -1;
338 }
339 }
340 }
341
342 const uint64_t end_tsc = rte_rdtsc();
343 const uint64_t time_taken = end_tsc - start_tsc;
344
345 cycles[type][params->cycle][ADD] = time_taken / NUM_ADDS;
346
347 return 0;
348}
349
350static int
351timed_lookups(struct member_perf_params *params, int type)

Callers 1

run_all_tbl_perf_testsFunction · 0.85

Calls 4

rte_member_addFunction · 0.85
rte_rdtscFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected