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

Function measure_perf_get

dpdk/app/test/test_graph_perf.c:628–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628static int
629measure_perf_get(rte_graph_t graph_id)
630{
631 const char *pattern = rte_graph_id_to_name(graph_id);
632 uint32_t lcore_id = rte_get_next_lcore(-1, 1, 0);
633 struct rte_graph_cluster_stats_param param;
634 struct rte_graph_cluster_stats *stats;
635 struct graph_lcore_data *data;
636
637 data = rte_zmalloc("Graph_perf", sizeof(struct graph_lcore_data),
638 RTE_CACHE_LINE_SIZE);
639 data->graph_id = graph_id;
640 data->done = 0;
641
642 /* Run graph worker thread function */
643 rte_eal_remote_launch(_graph_perf_wrapper, data, lcore_id);
644
645 /* Collect stats for few msecs */
646 if (rte_graph_has_stats_feature()) {
647 memset(&param, 0, sizeof(param));
648 param.f = stdout;
649 param.socket_id = SOCKET_ID_ANY;
650 param.graph_patterns = &pattern;
651 param.nb_graph_patterns = 1;
652
653 stats = rte_graph_cluster_stats_create(&param);
654 if (stats == NULL) {
655 printf("Failed to create stats\n");
656 return -ENOMEM;
657 }
658
659 rte_delay_ms(3E2);
660 rte_graph_cluster_stats_get(stats, true);
661 rte_delay_ms(1E3);
662 rte_graph_cluster_stats_get(stats, false);
663 rte_graph_cluster_stats_destroy(stats);
664 } else
665 rte_delay_ms(1E3);
666
667 data->done = 1;
668 rte_eal_wait_lcore(lcore_id);
669
670 return 0;
671}
672
673static inline void
674graph_fini(void)

Callers 1

measure_perfFunction · 0.85

Calls 12

rte_graph_id_to_nameFunction · 0.85
rte_get_next_lcoreFunction · 0.85
rte_zmallocFunction · 0.85
rte_eal_remote_launchFunction · 0.85
memsetFunction · 0.85
rte_delay_msFunction · 0.85
rte_eal_wait_lcoreFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected