Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(C) 2020 Marvell International Ltd.
3 : : */
4 : :
5 : :
6 : : #include "graph_private.h"
7 : :
8 : : #include <eal_export.h>
9 : :
10 : : void
11 : 0 : graph_dump(FILE *f, struct graph *g)
12 : : {
13 : : struct graph_node *graph_node;
14 : : rte_edge_t i = 0;
15 : :
16 : 0 : fprintf(f, "graph <%s>\n", g->name);
17 : 0 : fprintf(f, " id=%" PRIu32 "\n", g->id);
18 : 0 : fprintf(f, " cir_start=%" PRIu32 "\n", g->cir_start);
19 : 0 : fprintf(f, " cir_mask=%" PRIu32 "\n", g->cir_mask);
20 : : fprintf(f, " addr=%p\n", g);
21 : 0 : fprintf(f, " graph=%p\n", g->graph);
22 : 0 : fprintf(f, " mem_sz=%zu\n", g->mem_sz);
23 : 0 : fprintf(f, " node_count=%" PRIu32 "\n", g->node_count);
24 : 0 : fprintf(f, " src_node_count=%" PRIu32 "\n", g->src_node_count);
25 : :
26 [ # # ]: 0 : STAILQ_FOREACH(graph_node, &g->node_list, next)
27 : 0 : fprintf(f, " node[%d] <%s>\n", i++, graph_node->node->name);
28 : 0 : }
29 : :
30 : : void
31 : 20 : node_dump(FILE *f, struct node *n)
32 : : {
33 : : rte_edge_t i;
34 : :
35 : 20 : fprintf(f, "node <%s>\n", n->name);
36 : 20 : fprintf(f, " id=%" PRIu32 "\n", n->id);
37 : 20 : fprintf(f, " flags=0x%" PRIx64 "\n", n->flags);
38 : : fprintf(f, " addr=%p\n", n);
39 : 20 : fprintf(f, " process=%p\n", n->process);
40 [ + - ]: 20 : if (n->parent_id == RTE_NODE_ID_INVALID)
41 : : fprintf(f, " parent_id=RTE_NODE_ID_INVALID\n");
42 : : else
43 : : fprintf(f, " parent_id=%" PRIu32 "\n", n->parent_id);
44 : 20 : fprintf(f, " init=%p\n", n->init);
45 : 20 : fprintf(f, " fini=%p\n", n->fini);
46 : 20 : fprintf(f, " xstats=%p\n", n->xstats);
47 : 20 : fprintf(f, " next node addr=%p\n", STAILQ_NEXT(n, next));
48 [ + + ]: 20 : if (STAILQ_NEXT(n, next))
49 : 19 : fprintf(f, " next node name=%s\n", STAILQ_NEXT(n, next)->name);
50 : 20 : fprintf(f, " nb_edges=%d\n", n->nb_edges);
51 [ + + ]: 42 : for (i = 0; i < n->nb_edges; i++)
52 : 22 : fprintf(f, " edge[%d] <%s>\n", i, n->next_nodes[i]);
53 : 20 : }
54 : :
55 : : RTE_EXPORT_SYMBOL(rte_graph_obj_dump)
56 : : void
57 : 0 : rte_graph_obj_dump(FILE *f, struct rte_graph *g, bool all)
58 : : {
59 : : rte_node_t count;
60 : : rte_graph_off_t off;
61 : : struct rte_node *n;
62 : : rte_edge_t i;
63 : :
64 : 0 : fprintf(f, "graph <%s> @ %p\n", g->name, g);
65 : 0 : fprintf(f, " id=%" PRIu32 "\n", g->id);
66 : 0 : fprintf(f, " head=%" PRId32 "\n", (int32_t)g->head);
67 : 0 : fprintf(f, " tail=%" PRId32 "\n", (int32_t)g->tail);
68 : 0 : fprintf(f, " cir_mask=0x%" PRIx32 "\n", g->cir_mask);
69 : 0 : fprintf(f, " nb_nodes=%" PRId32 "\n", g->nb_nodes);
70 : 0 : fprintf(f, " socket=%d\n", g->socket);
71 : 0 : fprintf(f, " fence=0x%" PRIx64 "\n", g->fence);
72 : 0 : fprintf(f, " nodes_start=0x%" PRIx32 "\n", g->nodes_start);
73 : 0 : fprintf(f, " cir_start=%p\n", g->cir_start);
74 : :
75 [ # # ]: 0 : rte_graph_foreach_node(count, off, g, n) {
76 [ # # # # ]: 0 : if (!all && n->idx == 0)
77 : 0 : continue;
78 : 0 : fprintf(f, " node[%d] <%s>\n", count, n->name);
79 : 0 : fprintf(f, " fence=0x%" PRIx64 "\n", n->fence);
80 : 0 : fprintf(f, " objs=%p\n", n->objs);
81 : 0 : fprintf(f, " process=%p\n", n->process);
82 : 0 : fprintf(f, " id=0x%" PRIx32 "\n", n->id);
83 : 0 : fprintf(f, " offset=0x%" PRIx32 "\n", n->off);
84 : 0 : fprintf(f, " nb_edges=%" PRId32 "\n", n->nb_edges);
85 : 0 : fprintf(f, " realloc_count=%d\n", n->realloc_count);
86 : 0 : fprintf(f, " size=%d\n", n->size);
87 : 0 : fprintf(f, " idx=%d\n", n->idx);
88 : 0 : fprintf(f, " total_objs=%" PRId64 "\n", n->total_objs);
89 [ # # ]: 0 : if (rte_graph_worker_model_get(g) == RTE_GRAPH_MODEL_MCORE_DISPATCH) {
90 : 0 : fprintf(f, " total_sched_objs=%" PRId64 "\n",
91 : : n->dispatch.total_sched_objs);
92 : 0 : fprintf(f, " total_sched_fail=%" PRId64 "\n",
93 : : n->dispatch.total_sched_fail);
94 : : }
95 : 0 : fprintf(f, " total_calls=%" PRId64 "\n", n->total_calls);
96 [ # # ]: 0 : for (i = 0; i < n->nb_edges; i++)
97 : : fprintf(f, " edge[%d] <%s>\n", i,
98 : 0 : n->nodes[i]->name);
99 : : }
100 : 0 : }
|