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

Function expand_pattern_to_cluster

dpdk/lib/graph/graph_stats.c:301–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301static int
302expand_pattern_to_cluster(struct cluster *cluster, const char *pattern)
303{
304 struct graph_head *graph_head = graph_list_head_get();
305 struct graph *graph;
306 bool found = false;
307
308 /* Check for pattern match */
309 STAILQ_FOREACH(graph, graph_head, next) {
310 if (fnmatch(pattern, graph->name, 0) == 0) {
311 if (cluster_add(cluster, graph))
312 goto fail;
313 found = true;
314 }
315 }
316 if (found == false)
317 SET_ERR_JMP(EFAULT, fail, "Pattern %s graph not found",
318 pattern);
319
320 return 0;
321fail:
322 return -rte_errno;
323}
324
325struct rte_graph_cluster_stats *
326rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm)

Callers 1

Calls 3

graph_list_head_getFunction · 0.85
cluster_addFunction · 0.85
fnmatchFunction · 0.50

Tested by

no test coverage detected