| 329 | } |
| 330 | |
| 331 | static void |
| 332 | print_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. */ |
| 356 | static uint16_t enabled_core_ids[RTE_MAX_LCORE]; |
no test coverage detected