From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0099424C4; Tue, 11 Jun 2024 08:51:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0F47402DC; Tue, 11 Jun 2024 08:51:17 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id F0C73402D1 for ; Tue, 11 Jun 2024 08:51:15 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id DB8682035F; Tue, 11 Jun 2024 08:51:15 +0200 (CEST) Received: from dkrd2.smartsharesys.local ([192.168.4.12]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 11 Jun 2024 08:51:15 +0200 From: =?UTF-8?q?Morten=20Br=C3=B8rup?= To: dev@dpdk.org Cc: stephen@networkplumber.org, =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v3] mempool: dump includes list of memory chunks Date: Tue, 11 Jun 2024 08:51:14 +0200 Message-Id: <20240611065114.13395-1-mb@smartsharesystems.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240516085940.61119-1-mb@smartsharesystems.com> References: <20240516085940.61119-1-mb@smartsharesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 11 Jun 2024 06:51:15.0816 (UTC) FILETIME=[C163F680:01DABBCB] X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Paul Szczepanek Acked-by: Andrew Rybchenko Acked-by: Konstantin Ananyev --- 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); -- 2.17.1