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

Ben Pfaff blp at nicira.com
Mon Sep 23 17:49:47 UTC 2013


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




More information about the dev mailing list