From patchwork Sat Jul 11 09:59:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235289 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1200955ilg; Sat, 11 Jul 2020 03:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpaWu9tnumXHvpbG4YjWtpAlLtjGY1Exum98k9oauCaqdBrWQ4HDou27lA0XCi2+qr0A+y X-Received: by 2002:a17:906:d784:: with SMTP id pj4mr63169927ejb.405.1594461839724; Sat, 11 Jul 2020 03:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594461839; cv=none; d=google.com; s=arc-20160816; b=FuuyUuQoXRrf/hDKnqu992tybvifYgSrY1VpuEiUnJz0duB5HzX3fbQSOHLwzSoAbn z0iayWpyPlC3wU3+KfczAtjXgVZPlkPmBzq1N0feE/aknadJW7afNMGnDt44XvEpcq0z fCWOTjIElLClgAF35EmiKK7sQlgrMPdfg4WCYMaKJlB2+JqQBAR0qj6361Vs3ls2HMnj WwRc9IPzFTqEuXngRElxYJSQWl/GdG+WYsUFlTJcsJ6sm0ZNq1/wOSYWqV0BuU+9Qo8A lx69sdoZtI759vnhZkgIT2a0KRZ1W2TqediB/CUhc8j+/vwme8DgtV3hwJalr4tgUiMP RWtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=BMr6Mj4f/P6Lzpvs321WkJ1J+lrxpG0eRjt8iq54JKc=; b=ST4PQvg60kuIjWMmjs+XzUrxcWyQ6biTPe+dzndch1xd4cHyFR4qD68Pea8YoUcuO1 qZRykwOkVXrzynIysH3BZu2cQr0iTNwhrqHoLAv50ZCkyH/2Un9VVUNxbW6e0HGeKWjj 7ZA++6JPKxh0NDvFNf5Ie/F2jgTZKlFh6EesslCCPUmZgTJRgmXBuhtvREcBbQ/05KxD t7Xa3DTG7TeJy01xuj6D5AW0xn8FU5kIANAVcBuMHgwf4zIha5Tx2mtE5I64a6W78+TW PgUXb6aIK/ctkXHJUbiAFsxWjKDg/sNC/3ZdAUJ8L7jH0FbC9uY/tPPJQ18OT6Pi6PmR wlGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id y19si5468597ejm.324.2020.07.11.03.03.59; Sat, 11 Jul 2020 03:03:59 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C4E9A1D939; Sat, 11 Jul 2020 12:03:58 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 1090F1D62E for ; Sat, 11 Jul 2020 12:03:57 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E28E8200406; Sat, 11 Jul 2020 12:03:56 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4171320047A; Sat, 11 Jul 2020 12:03:55 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A7F8840287; Sat, 11 Jul 2020 18:03:52 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: olivier.matz@6wind.com, Hemant Agrawal Date: Sat, 11 Jul 2020 15:29:36 +0530 Message-Id: <20200711095936.11535-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH] mempool: enhance dump function to print ops name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Enhance the dump function to also print the ops index and associated mempool ops name Signed-off-by: Hemant Agrawal --- lib/librte_mempool/rte_mempool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 5b23e2ae78..462ea850a1 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -1186,6 +1186,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) unsigned lcore_id; #endif struct rte_mempool_memhdr *memhdr; + struct rte_mempool_ops *ops; unsigned common_count; unsigned cache_count; size_t mem_len = 0; @@ -1208,6 +1209,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) fprintf(f, " private_data_size=%"PRIu32"\n", mp->private_data_size); + ops = rte_mempool_get_ops(mp->ops_index); + fprintf(f, " ops_index=%d ops_name: <%s>\n", + mp->ops_index, ops ? ops->name:"NA"); + STAILQ_FOREACH(memhdr, &mp->mem_list, next) mem_len += memhdr->len; if (mem_len != 0) { @@ -1250,7 +1255,6 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) #else fprintf(f, " no statistics available\n"); #endif - rte_mempool_audit(mp); }