This change makes it visible how often we cannot receive a full JSON
message with a single jsonrpc_recv() call.

Signed-off-by: Martin Morgenstern <martin.morgenst...@cloudandheat.com>
---
 lib/jsonrpc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index ae55e2113..0a2b8dd7d 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -39,6 +39,7 @@
 VLOG_DEFINE_THIS_MODULE(jsonrpc);
 
 COVERAGE_DEFINE(jsonrpc_gratuitous_echo);
+COVERAGE_DEFINE(jsonrpc_recv_needs_retry);
 
 struct jsonrpc {
     struct stream *stream;
@@ -388,6 +389,10 @@ jsonrpc_recv(struct jsonrpc *rpc, struct jsonrpc_msg 
**msgp)
         }
     }
 
+    /* We tried hard but didn't get a complete JSON message within the above
+     * iterations. We want to know how often we abort for this reason. */
+    COVERAGE_INC(jsonrpc_recv_needs_retry);
+
     return EAGAIN;
 }
 
-- 
2.45.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to