diff mbox series

[v3] mempool: enhance dump function to print ops name

Message ID 20200908054153.29154-1-hemant.agrawal@nxp.com
State New
Headers show
Series [v3] mempool: enhance dump function to print ops name | expand

Commit Message

Hemant Agrawal Sept. 8, 2020, 5:41 a.m. UTC
Enhance the dump function to also print the ops index
and associated mempool ops name

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

---
 lib/librte_mempool/rte_mempool.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.17.1

Comments

Thomas Monjalon Oct. 6, 2020, 9:43 p.m. UTC | #1
> Enhance the dump function to also print the ops index

> and associated mempool ops name

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>


Applied, thanks
diff mbox series

Patch

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 7774f0c8da..d72056d28d 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -1266,6 +1266,7 @@  rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 	unsigned lcore_id;
 #endif
 	struct rte_mempool_memhdr *memhdr;
+	struct rte_mempool_ops *ops;
 	unsigned common_count;
 	unsigned cache_count;
 	size_t mem_len = 0;
@@ -1288,6 +1289,10 @@  rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 
 	fprintf(f, "  private_data_size=%"PRIu32"\n", mp->private_data_size);
 
+	fprintf(f, "  ops_index=%d\n", mp->ops_index);
+	ops = rte_mempool_get_ops(mp->ops_index);
+	fprintf(f, "  ops_name: <%s>\n", (ops != NULL) ? ops->name : "NA");
+
 	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
 		mem_len += memhdr->len;
 	if (mem_len != 0) {