[v2] mempool: dump includes list of memory chunks

Message ID 20240611063822.13046-1-mb@smartsharesystems.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] mempool: dump includes list of memory chunks |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS

Commit Message

Morten Brørup June 11, 2024, 6:38 a.m. UTC
Added information about the memory chunks holding the objects in the
mempool when dumping the status of the mempool to a file.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Paul Szczepanek <paul.szczepanek@arm.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
v2:
* Dump one line per entry. Remove headline and index number.
  (Stephen, Konstantin.)
* Changed reviewed-by to acked-by.
---
 lib/mempool/rte_mempool.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..f72cbc7217 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1264,6 +1264,10 @@  rte_mempool_dump(FILE *f, struct rte_mempool *mp)
 			(long double)mem_len / mp->size);
 	}
 
+	STAILQ_FOREACH(memhdr, &mp->mem_list, next)
+		fprintf(f, "    memory chunk at %p, addr=%p, iova=0x%" PRIx64 ", len=%zu\n",
+				memhdr, memhdr->addr, memhdr->iova, memhdr->len);
+
 	cache_count = rte_mempool_dump_cache(f, mp);
 	common_count = rte_mempool_ops_get_count(mp);
 	if ((cache_count + common_count) > mp->size)