diff mbox series

[ovs-dev] rconn: Add additional coverage counters rconn_run and rconn_retry

Message ID 20210729142239.2022546-1-mark.d.gray@redhat.com
State Deferred
Headers show
Series [ovs-dev] rconn: Add additional coverage counters rconn_run and rconn_retry | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot success github build: passed

Commit Message

Mark Gray July 29, 2021, 2:22 p.m. UTC
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 <mark.d.gray@redhat.com>
---
 lib/rconn.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Dumitru Ceara Sept. 2, 2021, 11:59 a.m. UTC | #1
On 7/29/21 4:22 PM, Mark Gray wrote:
> 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 <mark.d.gray@redhat.com>
> ---

Looks good to me, thanks!

Acked-by: Dumitru Ceara <dceara@redhat.com>
Ilya Maximets Sept. 15, 2021, 9:49 p.m. UTC | #2
On 7/29/21 16:22, Mark Gray wrote:
> 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 <mark.d.gray@redhat.com>
> ---
>  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);

Hi, Mark.  I'm not sure what is a value of counting this?
rconn_run() supposed to be called unconditionally and it
doesn't seem very useful to count these calls.

What do you think?

> +
>      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);

It might be better to rename to something like 'rconn_send_retry'.

>          }
>          return retval;
>      }
>
Mark Gray Sept. 16, 2021, 9:47 a.m. UTC | #3
On 15/09/2021 22:49, Ilya Maximets wrote:
> On 7/29/21 16:22, Mark Gray wrote:
>> 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 <mark.d.gray@redhat.com>
>> ---
>>  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);
> 
> Hi, Mark.  I'm not sure what is a value of counting this?
> rconn_run() supposed to be called unconditionally and it
> doesn't seem very useful to count these calls.
> 
> What do you think?
> 

I needed it because I was trying to understand the ratio of the number
of rconn_retry() calls to the number of rconn_run() calls. I suppose
(depending on how rconn was being used) you may be able determine this
from another counter but it just seemed more convenient like this. If
you think this is not valuable, I can leave it out.

>> +
>>      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);
> 
> It might be better to rename to something like 'rconn_send_retry'.

Ok. I will rename this when I get a reply to above.
> 
>>          }
>>          return retval;
>>      }
>>
>
Simon Horman Oct. 10, 2023, 12:37 p.m. UTC | #4
On Thu, Jul 29, 2021 at 10:22:39AM -0400, Mark Gray wrote:
> 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 <mark.d.gray@redhat.com>
> Acked-by: Dumitru Ceara <dceara@redhat.com>

Hi Mark,

This patch appears to have gone stale in patchwork, for one reason or
another. If it is still relevant then I think it needs to be revisited,
by being reposted after appropriate preparation.

As such I'm marking this patch as "Deferred" in patchwork.

No action is required unless there is a desire to revisit this patch.
diff mbox series

Patch

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;
     }