From patchwork Tue Sep 8 05:41:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 249269 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4257525ilg; Mon, 7 Sep 2020 22:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyozgBRdF0DYqOJeM/UjUeztpJ4OvB4eJamqN0bzduEO8tiRxdDQ2/ogbinzBJtMIreF8mS X-Received: by 2002:a17:906:e24f:: with SMTP id gq15mr24625104ejb.395.1599544097900; Mon, 07 Sep 2020 22:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599544097; cv=none; d=google.com; s=arc-20160816; b=Rl9EHiqsmSPAJ7AERBPorgJZXq739Vs20wueWxu0HKhwR2GnIzWZEajwg3eVnJ9xoC u+PJNvNv6VDDgPFrCUjXTZTKz06d/Jhq1/kxxcm+8h8Mqlmg5Ff8x2ftgx6dXuEPZpmI Y6H3HMtrZpMwu3ooYcnQM3CQabhm24QYbiNf4gRKt6ktLC42geJL8yqJst4JvIoQlUIJ 8xx6MGa96/AHuMebQSBFrmDsPQp135CXDD/DlOaPcMlFT7eY9Ycg+EENQox+yp1/Cot9 HyEsFMeyzNdQHMVobkqYIbAxCMyGOFE34wlnYmARq3KZ+EvP7PdfcRCFAK0xxWQn6mqB 6cIw== 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=LUg5RflO1upyhBGXQOO0kYjEKu+CAdishHsMh1QelcY=; b=MVcOXBDmkveYY1KKN6sky9Gz6pDQe4L0W9cIXFF4opxcNGomyp5ThRQ0w3MMTL6aJ4 vgRVAE78q6V7HkjNfvr/wgs0FM3p2+5xEFrpfDp4kZNaAv7+KRE1nIh4dqdt74Od00ia zvscTnvfNeZnkuKUQJVFXwCg+W44Gzg/50ngOsZuAomWZOLM1indS5TG1wCirhMUbMCD lfe48CxS2imMJPdErLr0j7NBS2giKCFp4/Y5PYvrP3EqwLW3qA2HfXk2awWtjQe0e5Mr UE2TG3Qdn4MnwCkZDq5Zq8EWspBNRKZdYAUtxInfjGDz21ofYQcwy/zwQOHZFcFlgYU4 QHNg== 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 lf11si11226111ejb.48.2020.09.07.22.48.17; Mon, 07 Sep 2020 22:48:17 -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 6615E1BEE1; Tue, 8 Sep 2020 07:48:16 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id DEA331BEB1 for ; Tue, 8 Sep 2020 07:48:14 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B702D1A02C2; Tue, 8 Sep 2020 07:48:14 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1A4861A02B9; Tue, 8 Sep 2020 07:48:13 +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 7E6534024E; Tue, 8 Sep 2020 07:48:10 +0200 (CEST) From: Hemant Agrawal To: dev@dpdk.org Cc: thomas@monjalon.net, olivier.matz@6wind.com Date: Tue, 8 Sep 2020 11:11:53 +0530 Message-Id: <20200908054153.29154-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817111507.30698-1-hemant.agrawal@nxp.com> References: <20200817111507.30698-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3] 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 Acked-by: Andrew Rybchenko --- lib/librte_mempool/rte_mempool.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 7774f0c8da..d72056d28d 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 != NULL) ? ops->name : "NA"); + STAILQ_FOREACH(memhdr, &mp->mem_list, next) mem_len += memhdr->len; if (mem_len != 0) {