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

Function print_route_distribution

dpdk/app/test/test_fib_perf.c:295–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295static void
296print_route_distribution(const struct route_rule *table, uint32_t n)
297{
298 unsigned int i, j;
299
300 printf("Route distribution per prefix width:\n");
301 printf("DEPTH QUANTITY (PERCENT)\n");
302 printf("---------------------------\n");
303
304 /* Count depths. */
305 for (i = 1; i <= 32; i++) {
306 unsigned int depth_counter = 0;
307 double percent_hits;
308
309 for (j = 0; j < n; j++)
310 if (table[j].depth == (uint8_t) i)
311 depth_counter++;
312
313 percent_hits = ((double)depth_counter)/((double)n) * 100;
314 printf("%.2u%15u (%.2f)\n", i, depth_counter, percent_hits);
315 }
316 printf("\n");
317}
318
319static int
320test_fib_perf(void)

Callers 1

test_fib_perfFunction · 0.70

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected