[dpdk-dev] [PATCH v3 04/29] graph: implement node debug routines
Wang, Xiao W
xiao.w.wang at intel.com
Sat Apr 4 09:57:21 CEST 2020
Hi,
Comment inline.
Best Regards,
Xiao
> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of jerinj at marvell.com
> Sent: Wednesday, April 1, 2020 3:29 AM
> To: Jerin Jacob <jerinj at marvell.com>; Kiran Kumar K
> <kirankumark at marvell.com>
> Cc: dev at dpdk.org; thomas at monjalon.net; david.marchand at redhat.com;
> mdr at ashroe.eu; mattias.ronnblom at ericsson.com;
> pbhagavatula at marvell.com; ndabilpuram at marvell.com
> Subject: [dpdk-dev] [PATCH v3 04/29] graph: implement node debug routines
>
> From: Jerin Jacob <jerinj at marvell.com>
>
> Adding node debug API implementation support to dump
> single or all the node objects to the given file.
>
> Signed-off-by: Jerin Jacob <jerinj at marvell.com>
> Signed-off-by: Kiran Kumar K <kirankumark at marvell.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
> ---
> lib/librte_graph/Makefile | 1 +
> lib/librte_graph/graph_debug.c | 25 ++++++++++++++++++++
> lib/librte_graph/graph_private.h | 12 ++++++++++
> lib/librte_graph/meson.build | 2 +-
> lib/librte_graph/node.c | 32 ++++++++++++++++++++++++++
> lib/librte_graph/rte_graph_version.map | 1 +
> 6 files changed, 72 insertions(+), 1 deletion(-)
> create mode 100644 lib/librte_graph/graph_debug.c
>
> diff --git a/lib/librte_graph/Makefile b/lib/librte_graph/Makefile
> index 933d0ee49..2a6d86933 100644
> --- a/lib/librte_graph/Makefile
> +++ b/lib/librte_graph/Makefile
> @@ -16,6 +16,7 @@ EXPORT_MAP := rte_graph_version.map
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += node.c
> SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph.c
> +SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph_debug.c
>
[...]
> diff --git a/lib/librte_graph/meson.build b/lib/librte_graph/meson.build
> index 5754ac23b..01512182f 100644
> --- a/lib/librte_graph/meson.build
> +++ b/lib/librte_graph/meson.build
> @@ -4,7 +4,7 @@
>
> name = 'graph'
>
> -sources = files('node.c', 'graph.c')
> +sources = files('node.c', 'graph.c', 'graph_debug.c')
> headers = files('rte_graph.h')
> allow_experimental_apis = true
>
> diff --git a/lib/librte_graph/node.c b/lib/librte_graph/node.c
> index 8de857889..2f9c2ea4c 100644
> --- a/lib/librte_graph/node.c
> +++ b/lib/librte_graph/node.c
> @@ -377,6 +377,38 @@ rte_node_edge_get(rte_node_t id, char
> *next_nodes[])
> return rc;
> }
>
> +static void
> +node_scan_dump(FILE *f, rte_node_t id, bool all)
> +{
> + struct node *node;
> +
> + RTE_ASSERT(f != NULL);
> + NODE_ID_CHECK(id);
> +
> + STAILQ_FOREACH(node, &node_list, next) {
> + if (all == true) {
> + node_dump(f, node);
> + } else if (node->id == id) {
> + node_dump(f, node);
> + return;
> + }
> + }
> +fail:
we can remove this "fail" mark since it's not used as jmp target.
> + return;
> +}
More information about the dev
mailing list