From patchwork Mon Aug 17 11:15:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 247784 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2531226ilo; Mon, 17 Aug 2020 04:20:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiLeNzcT1QrYMcgZ5GG7u/WVPGo08zZ/3spmDWbcaGfY1TXZuCMg6pPBlTiaSZt7Zb7zSz X-Received: by 2002:aa7:d7d7:: with SMTP id e23mr13883962eds.347.1597663245814; Mon, 17 Aug 2020 04:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597663245; cv=none; d=google.com; s=arc-20160816; b=AdgqZGG2HEqZzfZe4x5HBCRi9hqaFdF+KP479acGt3o/bdS6rJokjlZAgtd3UOiF3y 4hYOxGHh1HGDOlDEdAX1aKQwJXAHV3LHTClQQPNuXlVXnsKCKUkcPWF7o7MtJVp/lQqf +c9pCInU2DePUVsoOHwY5OcpS4VQ6exn98aL8HIOO3DLW5mjwUdAWST+U1X+i2jHqARf EvB6msS/HLWB7LU5ffC9npnmWOwAk8jPzcZ4VF9MDKMMZl4TN6J+BjnLl0gi2HqnZ+7J yha9uheZq2nHtMYa4P1N5Ilsxl2QuKw0UkzspYZlNwLtQCATaOLaDaYgHfXCz2gLPtsd jurw== 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:references:in-reply-to :message-id:date:cc:to:from; bh=3MuSbuwvKJrQVmgfwbs8elRdgBVckOnLyZM356wdV2M=; b=FKJ2HPeoBO5DKsxujp1ehGptfLwYlJDEwL95iBZew+LGz2xpLcWcFS86mqDMQjH/Ho SpM4kdCASB+0VYPKy/S/W0ySVWVMHHxPbFnRMRywEw0ZX0Kw9d8ZFRSHOUWaNkAvBzFm nBtsxqtGjpKj+Jf+uqZvTfnTunvHtqAjNWmLkS5KkFTDOYZfR1VJD71ZOHegknJdyJhq cA3TgNu86dqiWPf5tq497jGmbSTXjlHH6N1wm3tPbmRUC6tK3iTKir6qxxHkWCT4a4ox ez1ZcksNt4bVEF2KDaPYdF9YvliO86MG8L9nvcW8GfF/SmqvaRUTRUeums1cgj8MemJG mZ1w== 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 df2si10900595edb.520.2020.08.17.04.20.45; Mon, 17 Aug 2020 04:20:45 -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 B053D1C0D9; Mon, 17 Aug 2020 13:20:44 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 532371BFF3 for ; Mon, 17 Aug 2020 13:20:43 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 19FB9200677; Mon, 17 Aug 2020 13:20:43 +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 C9E652008BA; Mon, 17 Aug 2020 13:20:41 +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 B3480402AD; Mon, 17 Aug 2020 13:20:39 +0200 (CEST) From: Hemant Agrawal To: dev@dpdk.org Cc: olivier.matz@6wind.com Date: Mon, 17 Aug 2020 16:45:07 +0530 Message-Id: <20200817111507.30698-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711095936.11535-1-hemant.agrawal@nxp.com> References: <20200711095936.11535-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2] 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 | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 Acked-by: Andrew Rybchenko diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 7774f0c8da..10c5cb708f 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -1266,6 +1266,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; @@ -1288,6 +1289,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) fprintf(f, " private_data_size=%"PRIu32"\n", mp->private_data_size); + fprintf(f, " ops_index=%d\n", mp->ops_index); + ops = rte_mempool_get_ops(mp->ops_index); + fprintf(f, " ops_name: <%s>\n", ops ? ops->name : "NA"); + STAILQ_FOREACH(memhdr, &mp->mem_list, next) mem_len += memhdr->len; if (mem_len != 0) {