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

Function print_route_distribution

dpdk/app/test/test_lpm_perf.c:331–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331static void
332print_route_distribution(const struct route_rule *table, uint32_t n)
333{
334 unsigned i, j;
335
336 printf("Route distribution per prefix width: \n");
337 printf("DEPTH QUANTITY (PERCENT)\n");
338 printf("--------------------------- \n");
339
340 /* Count depths. */
341 for (i = 1; i <= 32; i++) {
342 unsigned depth_counter = 0;
343 double percent_hits;
344
345 for (j = 0; j < n; j++)
346 if (table[j].depth == (uint8_t) i)
347 depth_counter++;
348
349 percent_hits = ((double)depth_counter)/((double)n) * 100;
350 printf("%.2u%15u (%.2f)\n", i, depth_counter, percent_hits);
351 }
352 printf("\n");
353}
354
355/* Check condition and return an error if true. */
356static uint16_t enabled_core_ids[RTE_MAX_LCORE];

Callers 1

test_lpm_perfFunction · 0.70

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected