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

Function print_route_distribution

dpdk/app/test/test_fib6_perf.c:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#define NUMBER_TBL8S (1 << 16)
29
30static void
31print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)
32{
33 unsigned int i, j;
34
35 printf("Route distribution per prefix width:\n");
36 printf("DEPTH QUANTITY (PERCENT)\n");
37 printf("---------------------------\n");
38
39 /* Count depths. */
40 for (i = 1; i <= 128; i++) {
41 unsigned int depth_counter = 0;
42 double percent_hits;
43
44 for (j = 0; j < n; j++)
45 if (table[j].depth == (uint8_t) i)
46 depth_counter++;
47
48 percent_hits = ((double)depth_counter)/((double)n) * 100;
49 printf("%.2u%15u (%.2f)\n", i, depth_counter, percent_hits);
50 }
51 printf("\n");
52}
53
54static inline uint8_t
55bits_in_nh(uint8_t nh_sz)

Callers 1

test_fib6_perfFunction · 0.70

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected