[v5,7/9] app/procinfo: add support for debug ring
Checks
Commit Message
Function show_ring is used for displaying the RING of the
primary process.
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
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(-)
@@ -1116,7 +1116,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