From patchwork Thu May 16 08:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Morten_Br=C3=B8rup?= X-Patchwork-Id: 140139 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF0FE44042; Thu, 16 May 2024 10:59:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5458A4029B; Thu, 16 May 2024 10:59:45 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 507934025C for ; Thu, 16 May 2024 10:59:44 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 2A9052292A; Thu, 16 May 2024 10:59:44 +0200 (CEST) Received: from dkrd2.smartsharesys.local ([192.168.4.12]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 16 May 2024 10:59:42 +0200 From: =?utf-8?q?Morten_Br=C3=B8rup?= To: andrew.rybchenko@oktetlabs.ru, konstantin.v.ananyev@yandex.ru, paul.szczepanek@arm.com Cc: dev@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= Subject: [PATCH] mempool: dump includes list of memory chunks Date: Thu, 16 May 2024 10:59:40 +0200 Message-Id: <20240516085940.61119-1-mb@smartsharesystems.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-OriginalArrivalTime: 16 May 2024 08:59:42.0676 (UTC) FILETIME=[644BF940:01DAA76F] 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 Reviewed-by: Paul Szczepanek --- lib/mempool/rte_mempool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 12390a2c81..e9a8a5b411 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -1230,6 +1230,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) #endif struct rte_mempool_memhdr *memhdr; struct rte_mempool_ops *ops; + unsigned int n; unsigned common_count; unsigned cache_count; size_t mem_len = 0; @@ -1264,6 +1265,15 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) (long double)mem_len / mp->size); } + fprintf(f, " mem_list:\n"); + n = 0; + STAILQ_FOREACH(memhdr, &mp->mem_list, next) { + fprintf(f, " addr[%u]=%p\n", n, memhdr->addr); + fprintf(f, " iova[%u]=0x%" PRIx64 "\n", n, memhdr->iova); + fprintf(f, " len[%u]=%zu\n", n, memhdr->len); + n++; + } + cache_count = rte_mempool_dump_cache(f, mp); common_count = rte_mempool_ops_get_count(mp); if ((cache_count + common_count) > mp->size)