[ovs-dev] [arp-rw 01/13] timeval: Call coverage_clear() before coverage_log() in time_poll().

Alex Wang alexw at nicira.com
Tue Oct 8 14:24:09 UTC 2013


looks good to me, since the "reimplement coverage/show" patch is in, should
also call coverage_run() beforehand,


On Mon, Sep 23, 2013 at 10:49 AM, Ben Pfaff <blp at nicira.com> wrote:

> time_poll() calls log_poll_interval(), which in some circumstances calls
> coverage_log().  Before this commit, time_poll() also called
> coverage_clear() after log_poll_interval().  This made sense before commit
> 857165b5fd26 (coverage: Make thread-safe.), because coverage_log() would
> log the most recent main loop's coverage counters separately and calling
> coverage_clear() beforehand would zero out those counters.  However, it
> doesn't make sense any longer because the most recent loop's counters are
> no longer separately logged and in fact this practice now means that the
> most recent loop's counters are omitted from the logged counters.
>
> Therefore, this commit moves the call to coverage_clear() earlier, so that
> the most recent loop's counters are included.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/timeval.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/timeval.c b/lib/timeval.c
> index 223ed30..bd73f35 100644
> --- a/lib/timeval.c
> +++ b/lib/timeval.c
> @@ -230,10 +230,10 @@ time_poll(struct pollfd *pollfds, int n_pollfds,
> long long int timeout_when,
>      int retval;
>
>      time_init();
> +    coverage_clear();
>      if (*last_wakeup) {
>          log_poll_interval(*last_wakeup);
>      }
> -    coverage_clear();
>      start = time_msec();
>
>      timeout_when = MIN(timeout_when, deadline);
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20131008/0528f19c/attachment-0003.html>


More information about the dev mailing list