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 886D2A0032; Sat, 31 Dec 2022 17:07:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5839840689; Sat, 31 Dec 2022 17:07:44 +0100 (CET) Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.220]) by mails.dpdk.org (Postfix) with ESMTP id 7BBFB40141 for ; Sat, 31 Dec 2022 17:07:43 +0100 (CET) HMM_SOURCE_IP: 172.18.0.48:39354.58551753 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-101.43.140.16 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id A0321280099; Sun, 1 Jan 2023 00:07:39 +0800 (CST) X-189-SAVE-TO-SEND: +wushaohua@chinatelecom.cn Received: from ([101.43.140.16]) by app0024 with ESMTP id 04abe9500a6740cdac33e8aeacb002d5 for dev@dpdk.org; Sun, 01 Jan 2023 00:07:40 CST X-Transaction-ID: 04abe9500a6740cdac33e8aeacb002d5 X-Real-From: wushaohua@chinatelecom.cn X-Receive-IP: 101.43.140.16 X-MEDUSA-Status: 0 Sender: wushaohua@chinatelecom.cn From: wushaohua@chinatelecom.cn To: dev@dpdk.org Cc: wushaohua@chinatelecom.cn Subject: [PATCH] mempool:Add monitor print for memory pool Date: Sun, 1 Jan 2023 00:07:38 +0800 Message-Id: <20221231160738.1232373-1-wushaohua@chinatelecom.cn> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: wushaohua rte_mempool_dump adds prints for monitoring available and used memory blocks Signed-off-by: wushaohua --- 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 f33f455790..f6790bcc78 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -1268,7 +1268,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) if ((cache_count + common_count) > mp->size) common_count = mp->size - cache_count; fprintf(f, " common_pool_count=%u\n", common_count); - + fprintf(f, " common_pool_avail_count=%u\n", + rte_mempool_avail_count(mp)); + fprintf(f, " common_pool_used=%u", + rte_mempool_in_use_count(mp)); /* sum and dump statistics */ #ifdef RTE_LIBRTE_MEMPOOL_STATS rte_mempool_ops_get_info(mp, &info); -- 2.30.2