Lines Matching defs:stat

25 	struct rte_graph_cluster_node_stats stat;
87 print_node(FILE *f, const struct rte_graph_cluster_node_stats *stat, bool dispatch)
90 const uint64_t prev_calls = stat->prev_calls;
91 const uint64_t prev_objs = stat->prev_objs;
92 const uint64_t cycles = stat->cycles;
93 const uint64_t calls = stat->calls;
94 const uint64_t objs = stat->objs;
101 call_delta ? (double)((cycles - stat->prev_cycles) / call_delta)
103 ts_per_hz = (double)((stat->ts - stat->prev_ts) / stat->hz);
112 stat->name, calls, objs, stat->dispatch.sched_objs,
113 stat->dispatch.sched_fail, stat->realloc_count, objs_per_call,
119 stat->name, calls, objs, stat->realloc_count, objs_per_call,
125 print_xstat(FILE *f, const struct rte_graph_cluster_node_stats *stat, bool dispatch)
130 for (i = 0; i < stat->xstat_cntrs; i++)
133 stat->xstat_desc[i], "", stat->xstat_count[i], "", "", "", "", "",
136 for (i = 0; i < stat->xstat_cntrs; i++)
139 stat->xstat_desc[i], "", stat->xstat_count[i], "", "", "", "");
145 const struct rte_graph_cluster_node_stats *stat)
151 if (stat->objs) {
152 print_node(f, stat, dispatch);
153 if (stat->xstat_cntrs)
154 print_xstat(f, stat, dispatch);
168 const struct rte_graph_cluster_node_stats *stat)
170 return graph_cluster_stats_cb(false, is_first, is_last, cookie, stat);
175 const struct rte_graph_cluster_node_stats *stat)
177 return graph_cluster_stats_cb(true, is_first, is_last, cookie, stat);
235 if (cluster->stat.id == id) {
258 memcpy(cluster->stat.name, graph_node->node->name, RTE_NODE_NAMESIZE);
259 cluster->stat.id = graph_node->node->id;
260 cluster->stat.hz = rte_get_timer_hz();
267 cluster->stat.xstat_cntrs = graph_node->node->xstats->nb_xstats;
268 cluster->stat.xstat_count = rte_zmalloc_socket(NULL,
271 if (cluster->stat.xstat_count == NULL)
275 cluster->stat.xstat_desc = rte_zmalloc_socket(NULL,
278 if (cluster->stat.xstat_desc == NULL) {
279 rte_free(cluster->stat.xstat_count);
284 for (i = 0; i < cluster->stat.xstat_cntrs; i++) {
285 if (rte_strscpy(cluster->stat.xstat_desc[i],
288 rte_free(cluster->stat.xstat_count);
289 rte_free(cluster->stat.xstat_desc);
442 rte_graph_cluster_stats_destroy(struct rte_graph_cluster_stats *stat)
447 cluster = stat->clusters;
448 for (count = 0; count < stat->max_nodes; count++) {
449 if (cluster->stat.xstat_cntrs) {
450 rte_free(cluster->stat.xstat_count);
451 rte_free(cluster->stat.xstat_desc);
454 cluster = RTE_PTR_ADD(cluster, stat->cluster_node_size);
456 return rte_free(stat);
463 struct rte_graph_cluster_node_stats *stat = &cluster->stat;
470 memset(stat->xstat_count, 0, sizeof(uint64_t) * stat->xstat_cntrs);
487 for (i = 0; i < stat->xstat_cntrs; i++)
488 stat->xstat_count[i] += xstat[i];
491 stat->calls = calls;
492 stat->objs = objs;
493 stat->cycles = cycles;
496 stat->dispatch.sched_objs = sched_objs;
497 stat->dispatch.sched_fail = sched_fail;
500 stat->ts = rte_get_timer_cycles();
501 stat->realloc_count = realloc_count;
507 struct rte_graph_cluster_node_stats *stat = &cluster->stat;
509 stat->prev_ts = stat->ts;
510 stat->prev_calls = stat->calls;
511 stat->prev_objs = stat->objs;
512 stat->prev_cycles = stat->cycles;
516 rte_graph_cluster_stats_get(struct rte_graph_cluster_stats *stat, bool skip_cb)
522 cluster = stat->clusters;
524 for (count = 0; count < stat->max_nodes; count++) {
525 cluster_node_arregate_stats(cluster, stat->dispatch);
527 rc = stat->fn(!count, (count == stat->max_nodes - 1),
528 stat->cookie, &cluster->stat);
532 cluster = RTE_PTR_ADD(cluster, stat->cluster_node_size);
537 rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat)
543 cluster = stat->clusters;
545 for (count = 0; count < stat->max_nodes; count++) {
546 struct rte_graph_cluster_node_stats *node = &cluster->stat;
559 cluster = RTE_PTR_ADD(cluster, stat->cluster_node_size);