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 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index 2e35180f8..d2d8ef41d 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -21,6 +21,7 @@
 #include <errno.h>
 
 #include "byteq.h"
+#include "coverage.h"
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "openvswitch/json.h"
@@ -36,6 +37,8 @@
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(jsonrpc);
+
+COVERAGE_DEFINE(jsonrpc_recv_incomplete);
 
 struct jsonrpc {
     struct stream *stream;
@@ -385,6 +388,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_incomplete);
+
     return EAGAIN;
 }
 
-- 
2.45.2

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

Reply via email to