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

Function print_stats

dpdk/examples/l3fwd-graph/main.c:771–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769}
770
771static void
772print_stats(void)
773{
774 const char topLeft[] = {27, '[', '1', ';', '1', 'H', '\0'};
775 const char clr[] = {27, '[', '2', 'J', '\0'};
776 struct rte_graph_cluster_stats_param s_param;
777 struct rte_graph_cluster_stats *stats;
778 const char *pattern = "worker_*";
779
780 /* Prepare stats object */
781 memset(&s_param, 0, sizeof(s_param));
782 s_param.f = stdout;
783 s_param.socket_id = SOCKET_ID_ANY;
784 s_param.graph_patterns = &pattern;
785 s_param.nb_graph_patterns = 1;
786
787 stats = rte_graph_cluster_stats_create(&s_param);
788 if (stats == NULL)
789 rte_exit(EXIT_FAILURE, "Unable to create stats object\n");
790
791 while (!force_quit) {
792 /* Clear screen and move to top left */
793 printf("%s%s", clr, topLeft);
794 rte_graph_cluster_stats_get(stats, 0);
795 rte_delay_ms(1E3);
796 }
797
798 rte_graph_cluster_stats_destroy(stats);
799}
800
801/* Main processing loop. 8< */
802static int

Callers 1

mainFunction · 0.70

Calls 7

memsetFunction · 0.85
rte_exitFunction · 0.85
rte_delay_msFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected