| 351 | } |
| 352 | |
| 353 | void |
| 354 | graph_stats_print(void) |
| 355 | { |
| 356 | const char topLeft[] = {27, '[', '1', ';', '1', 'H', '\0'}; |
| 357 | const char clr[] = {27, '[', '2', 'J', '\0'}; |
| 358 | struct rte_graph_cluster_stats_param s_param; |
| 359 | struct rte_graph_cluster_stats *stats; |
| 360 | const char *pattern = "worker_*"; |
| 361 | |
| 362 | /* Prepare stats object */ |
| 363 | memset(&s_param, 0, sizeof(s_param)); |
| 364 | s_param.f = stdout; |
| 365 | s_param.socket_id = SOCKET_ID_ANY; |
| 366 | s_param.graph_patterns = &pattern; |
| 367 | s_param.nb_graph_patterns = 1; |
| 368 | |
| 369 | stats = rte_graph_cluster_stats_create(&s_param); |
| 370 | if (stats == NULL) |
| 371 | rte_exit(EXIT_FAILURE, "Unable to create stats object\n"); |
| 372 | |
| 373 | while (!force_quit) { |
| 374 | /* Clear screen and move to top left */ |
| 375 | printf("%s%s", clr, topLeft); |
| 376 | rte_graph_cluster_stats_get(stats, 0); |
| 377 | rte_delay_ms(1E3); |
| 378 | if (app_graph_exit()) |
| 379 | force_quit = true; |
| 380 | } |
| 381 | |
| 382 | rte_graph_cluster_stats_destroy(stats); |
| 383 | } |
| 384 | |
| 385 | uint64_t |
| 386 | graph_coremask_get(void) |
no test coverage detected