summaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm/message_queue.c')
-rw-r--r--src/svm/message_queue.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c
index 6113450e7cb..10266a8039c 100644
--- a/src/svm/message_queue.c
+++ b/src/svm/message_queue.c
@@ -15,6 +15,7 @@
#include <svm/message_queue.h>
#include <vppinfra/mem.h>
+#include <vppinfra/format.h>
#include <sys/eventfd.h>
static inline svm_msg_q_ring_t *
@@ -265,6 +266,19 @@ svm_msg_q_alloc_producer_eventfd (svm_msg_q_t * mq)
return 0;
}
+u8 *
+format_svm_msg_q (u8 * s, va_list * args)
+{
+ svm_msg_q_t *mq = va_arg (*args, svm_msg_q_t *);
+ s = format (s, " [Q:%d/%d]", mq->q->cursize, mq->q->maxsize);
+ for (u32 i = 0; i < vec_len (mq->rings); i++)
+ {
+ s = format (s, " [R%d:%d/%d]", i, mq->rings[i].cursize,
+ mq->rings[i].nitems);
+ }
+ return s;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*