From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D78AA1B51D for ; Tue, 23 Oct 2018 16:01:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2018 07:01:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,416,1534834800"; d="scan'208";a="80934691" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by fmsmga008.fm.intel.com with ESMTP; 23 Oct 2018 07:01:50 -0700 From: Vipin Varghese To: dev@dpdk.org, maryam.tahhan@intel.com, reshma.pattan@intel.com Cc: amol.patel@intel.com, sivaprasad.tummala@intel.com, stephen1.byrne@intel.com, michael.j.glynn@intel.com, Vipin Varghese Date: Tue, 23 Oct 2018 19:27:49 +0530 Message-Id: <20181023135751.21536-7-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181023135751.21536-1-vipin.varghese@intel.com> References: <20181023135751.21536-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v1 7/9] app/procinfo: add code 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, 23 Oct 2018 14:01:53 -0000 Function debug_ring is used for displaying the RING of the primary process. Signed-off-by: Vipin Varghese --- app/proc-info/main.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 0f2045858..f8b28d47f 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1073,7 +1073,34 @@ printf("\t -- OOP_LB_IN_LB_OUT (%c)\n", \ static void debug_ring(char *name) { - printf(" rings Name (%s)", name); + snprintf(bdr_str, 100, "debug - 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) Socket (%d) flags (0x%x)\n", + ptr->name, + ptr->memzone->socket_id, + ptr->flags); + 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