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 1E7D7424CA; Tue, 11 Jun 2024 13:27:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5B6C40263; Tue, 11 Jun 2024 13:27:24 +0200 (CEST) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 875944021F for ; Tue, 11 Jun 2024 13:27:22 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Vz5rz47W6z1X3fT; Tue, 11 Jun 2024 19:23:31 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 9CCA514022E; Tue, 11 Jun 2024 19:27:18 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 11 Jun 2024 19:27:18 +0800 Message-ID: <560c5279-53a8-92e2-01bd-9906ee96d476@huawei.com> Date: Tue, 11 Jun 2024 19:27:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3] mempool: dump includes list of memory chunks To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , CC: References: <20240516085940.61119-1-mb@smartsharesystems.com> <20240611065114.13395-1-mb@smartsharesystems.com> From: "lihuisong (C)" In-Reply-To: <20240611065114.13395-1-mb@smartsharesystems.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600004.china.huawei.com (7.193.23.242) 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 在 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 > 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); Acked-by: Huisong Li