From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 76DF55F29 for ; Tue, 6 Nov 2018 03:38:39 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 18:38:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="86950968" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by orsmga007.jf.intel.com with ESMTP; 05 Nov 2018 18:38:36 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 08:04:36 +0530 Message-Id: <20181106023438.36740-7-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106023438.36740-1-vipin.varghese@intel.com> References: <20181106023438.36740-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v4 7/9] app/procinfo: add support for debug ring 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: , X-List-Received-Date: Tue, 06 Nov 2018 02:38:39 -0000 Function show_ring is used for displaying the RING of the primary process. Signed-off-by: Vipin Varghese --- V3: - replace space to tab in printf - Reshma Pathan - change ring display information - Vipin Varghese --- app/proc-info/main.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 7213b43fe..b97668d7f 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1119,7 +1119,39 @@ show_crypto(void) static void show_ring(char *name) { - printf(" rings Name (%s)\n", name); + snprintf(bdr_str, MAX_STRING_LEN, " show - RING %"PRIu64, + rte_get_tsc_hz()); + STATS_BDR_STR(10, bdr_str); + + if (name != NULL) { + struct rte_ring *ptr = rte_ring_lookup(name); + if (ptr != NULL) { + printf(" - Name (%s) on socket (%d)\n" + " - flags:\n" + "\t -- Single Producer Enqueue (%u)\n" + "\t -- Single Consmer Dequeue (%u)\n", + ptr->name, + ptr->memzone->socket_id, + ptr->flags & RING_F_SP_ENQ, + ptr->flags & RING_F_SC_DEQ); + printf(" - size (%u) mask (0x%x) capacity (%u)\n", + ptr->size, + ptr->mask, + ptr->capacity); + printf(" - count (%u) free count (%u)\n", + rte_ring_count(ptr), + rte_ring_free_count(ptr)); + printf(" - full (%d) empty (%d)\n", + rte_ring_full(ptr), + rte_ring_empty(ptr)); + + STATS_BDR_STR(50, ""); + return; + } + } + + rte_ring_list_dump(stdout); + STATS_BDR_STR(50, ""); } static void -- 2.17.1