Add counters to measure the number of times rconn_run() is
executed and the number of times rconn_send() must retry
due to an overflow at the vconn layer.

These counters allow for more effective debugging of buffer
overflows from rconn_send().

Signed-off-by: Mark Gray <[email protected]>
---
 lib/rconn.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/rconn.c b/lib/rconn.c
index a96b2eb8bf43..e635a7ff6284 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -40,6 +40,8 @@ COVERAGE_DEFINE(rconn_discarded);
 COVERAGE_DEFINE(rconn_overflow);
 COVERAGE_DEFINE(rconn_queued);
 COVERAGE_DEFINE(rconn_sent);
+COVERAGE_DEFINE(rconn_run);
+COVERAGE_DEFINE(rconn_retry);
 
 /* The connection states have the following meanings:
  *
@@ -624,6 +626,8 @@ rconn_run(struct rconn *rc)
     int old_state;
     size_t i;
 
+    COVERAGE_INC(rconn_run);
+
     ovs_mutex_lock(&rc->mutex);
     if (rc->vconn) {
         int error;
@@ -1132,6 +1136,8 @@ try_send(struct rconn *rc)
         if (retval != EAGAIN) {
             report_error(rc, retval);
             disconnect(rc, retval);
+        } else {
+            COVERAGE_INC(rconn_retry);
         }
         return retval;
     }
-- 
2.27.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to