[PATCH v3] mempool: dump includes list of memory chunks

lihuisong (C) lihuisong at huawei.com
Tue Jun 11 13:27:17 CEST 2024


在 2024/6/11 14:51, Morten Brørup 写道:
> 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 at smartsharesystems.com>
> Acked-by: Paul Szczepanek <paul.szczepanek at arm.com>
> Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
> ---
> v3:
> * Fix output indentation.
> * Print in existing loop, instead of adding a new loop.
> v2:
> * Dump one line per entry. Remove index number and headline.
>    (Stephen, Konstantin.)
> * Changed reviewed-by to acked-by.
> ---
>   lib/mempool/rte_mempool.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 12390a2c81..7ab1fcb480 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -1257,8 +1257,11 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp)
>   	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)
> +	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);
>   		mem_len += memhdr->len;
> +	}
>   	if (mem_len != 0) {
>   		fprintf(f, "  avg bytes/object=%#Lf\n",
>   			(long double)mem_len / mp->size);
Acked-by: Huisong Li<lihuisong at huawei.com>


More information about the dev mailing list