[dpdk-dev] [PATCH v2 7/9] app/procinfo: add code for debug ring

Vipin Varghese vipin.varghese at intel.com
Wed Oct 24 08:48:03 CEST 2018


Function debug_ring is used for displaying the RING of the
primary process.

Signed-off-by: Vipin Varghese <vipin.varghese at intel.com>
---
 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 d48334bd0..a4cf9f2ad 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



More information about the dev mailing list