diff mbox series

[ovs-dev,3/3] timeval: Add coverage counter for long poll interval events.

Message ID 170314684482.1799515.8358384740367911002.stgit@ebuild
State Changes Requested
Delegated to: Eelco Chaudron
Headers show
Series [ovs-dev,1/3] ofproto-dpif-upcall: Change flow dump duration message to WARN level. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Eelco Chaudron Dec. 21, 2023, 8:22 a.m. UTC
This patch adds a coverage counter for long poll interval events
which might help debugging the issue.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---
 lib/timeval.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Horman Dec. 21, 2023, 1:08 p.m. UTC | #1
On Thu, Dec 21, 2023 at 09:22:22AM +0100, Eelco Chaudron wrote:
> This patch adds a coverage counter for long poll interval events
> which might help debugging the issue.
> 
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>

Acked-by: Simon Horman <horms@ovn.org>
Aaron Conole Jan. 3, 2024, 4:32 p.m. UTC | #2
Eelco Chaudron <echaudro@redhat.com> writes:

> This patch adds a coverage counter for long poll interval events
> which might help debugging the issue.
>
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> ---

I prefer the commit log from:

  https://www.mail-archive.com/ovs-dev@openvswitch.org/msg79323.html

There's a bit more justification on why we should expose via the
coverage counters.  For instance, this data is currently available via
the journal / system log.  But it isn't available programmatically or if
the journal entry rotates.

>  lib/timeval.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/timeval.c b/lib/timeval.c
> index 193c7bab1..0abe7e555 100644
> --- a/lib/timeval.c
> +++ b/lib/timeval.c
> @@ -41,6 +41,8 @@
>  
>  VLOG_DEFINE_THIS_MODULE(timeval);
>  
> +COVERAGE_DEFINE(long_poll_interval);
> +
>  #if !defined(HAVE_CLOCK_GETTIME)
>  typedef unsigned int clockid_t;
>  static int clock_gettime(clock_t id, struct timespec *ts);
> @@ -644,6 +646,8 @@ log_poll_interval(long long int last_wakeup)
>          const struct rusage *last_rusage = get_recent_rusage();
>          struct rusage rusage;
>  
> +        COVERAGE_INC(long_poll_interval);
> +
>          if (!getrusage_thread(&rusage)) {
>              VLOG_WARN("Unreasonably long %lldms poll interval"
>                        " (%lldms user, %lldms system)",
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Eelco Chaudron Jan. 3, 2024, 4:38 p.m. UTC | #3
On 3 Jan 2024, at 17:32, Aaron Conole wrote:

> Eelco Chaudron <echaudro@redhat.com> writes:
>
>> This patch adds a coverage counter for long poll interval events
>> which might help debugging the issue.
>>
>> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
>> ---
>
> I prefer the commit log from:
>
>  https://www.mail-archive.com/ovs-dev@openvswitch.org/msg79323.html
>
> There's a bit more justification on why we should expose via the
> coverage counters.  For instance, this data is currently available via
> the journal / system log.  But it isn't available programmatically or if
> the journal entry rotates.

Did not even realize you did a patch for this earlier, which I acked. Guess it was waiting for a new revision :)

I can add your commit message, add you to the sign-off also.

>>  lib/timeval.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/timeval.c b/lib/timeval.c
>> index 193c7bab1..0abe7e555 100644
>> --- a/lib/timeval.c
>> +++ b/lib/timeval.c
>> @@ -41,6 +41,8 @@
>>
>>  VLOG_DEFINE_THIS_MODULE(timeval);
>>
>> +COVERAGE_DEFINE(long_poll_interval);
>> +
>>  #if !defined(HAVE_CLOCK_GETTIME)
>>  typedef unsigned int clockid_t;
>>  static int clock_gettime(clock_t id, struct timespec *ts);
>> @@ -644,6 +646,8 @@ log_poll_interval(long long int last_wakeup)
>>          const struct rusage *last_rusage = get_recent_rusage();
>>          struct rusage rusage;
>>
>> +        COVERAGE_INC(long_poll_interval);
>> +
>>          if (!getrusage_thread(&rusage)) {
>>              VLOG_WARN("Unreasonably long %lldms poll interval"
>>                        " (%lldms user, %lldms system)",
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Aaron Conole Jan. 3, 2024, 10:06 p.m. UTC | #4
Eelco Chaudron <echaudro@redhat.com> writes:

> On 3 Jan 2024, at 17:32, Aaron Conole wrote:
>
>> Eelco Chaudron <echaudro@redhat.com> writes:
>>
>>> This patch adds a coverage counter for long poll interval events
>>> which might help debugging the issue.
>>>
>>> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
>>> ---
>>
>> I prefer the commit log from:
>>
>>  https://www.mail-archive.com/ovs-dev@openvswitch.org/msg79323.html
>>
>> There's a bit more justification on why we should expose via the
>> coverage counters.  For instance, this data is currently available via
>> the journal / system log.  But it isn't available programmatically or if
>> the journal entry rotates.
>
> Did not even realize you did a patch for this earlier, which I
> acked. Guess it was waiting for a new revision :)
>
> I can add your commit message, add you to the sign-off also.

Works for me. :)

>>>  lib/timeval.c |    4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/lib/timeval.c b/lib/timeval.c
>>> index 193c7bab1..0abe7e555 100644
>>> --- a/lib/timeval.c
>>> +++ b/lib/timeval.c
>>> @@ -41,6 +41,8 @@
>>>
>>>  VLOG_DEFINE_THIS_MODULE(timeval);
>>>
>>> +COVERAGE_DEFINE(long_poll_interval);
>>> +
>>>  #if !defined(HAVE_CLOCK_GETTIME)
>>>  typedef unsigned int clockid_t;
>>>  static int clock_gettime(clock_t id, struct timespec *ts);
>>> @@ -644,6 +646,8 @@ log_poll_interval(long long int last_wakeup)
>>>          const struct rusage *last_rusage = get_recent_rusage();
>>>          struct rusage rusage;
>>>
>>> +        COVERAGE_INC(long_poll_interval);
>>> +
>>>          if (!getrusage_thread(&rusage)) {
>>>              VLOG_WARN("Unreasonably long %lldms poll interval"
>>>                        " (%lldms user, %lldms system)",
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev@openvswitch.org
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/lib/timeval.c b/lib/timeval.c
index 193c7bab1..0abe7e555 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -41,6 +41,8 @@ 
 
 VLOG_DEFINE_THIS_MODULE(timeval);
 
+COVERAGE_DEFINE(long_poll_interval);
+
 #if !defined(HAVE_CLOCK_GETTIME)
 typedef unsigned int clockid_t;
 static int clock_gettime(clock_t id, struct timespec *ts);
@@ -644,6 +646,8 @@  log_poll_interval(long long int last_wakeup)
         const struct rusage *last_rusage = get_recent_rusage();
         struct rusage rusage;
 
+        COVERAGE_INC(long_poll_interval);
+
         if (!getrusage_thread(&rusage)) {
             VLOG_WARN("Unreasonably long %lldms poll interval"
                       " (%lldms user, %lldms system)",