| 969 | } |
| 970 | |
| 971 | static int |
| 972 | test_print_stats(void) |
| 973 | { |
| 974 | struct rte_graph_cluster_stats_param s_param; |
| 975 | struct rte_graph_cluster_stats *stats; |
| 976 | const char *pattern = "worker0"; |
| 977 | |
| 978 | if (!rte_graph_has_stats_feature()) |
| 979 | return 0; |
| 980 | |
| 981 | /* Prepare stats object */ |
| 982 | memset(&s_param, 0, sizeof(s_param)); |
| 983 | s_param.f = stdout; |
| 984 | s_param.socket_id = SOCKET_ID_ANY; |
| 985 | s_param.graph_patterns = &pattern; |
| 986 | s_param.nb_graph_patterns = 1; |
| 987 | s_param.fn = graph_cluster_stats_cb_t; |
| 988 | |
| 989 | stats = rte_graph_cluster_stats_create(&s_param); |
| 990 | if (stats == NULL) { |
| 991 | printf("Unable to get stats\n"); |
| 992 | return -1; |
| 993 | } |
| 994 | /* Clear screen and move to top left */ |
| 995 | rte_graph_cluster_stats_get(stats, 0); |
| 996 | rte_graph_cluster_stats_destroy(stats); |
| 997 | |
| 998 | return 0; |
| 999 | } |
| 1000 | |
| 1001 | static int |
| 1002 | graph_setup(void) |
nothing calls this directly
no test coverage detected