From: Ben Pfaff Date: Tue, 2 Jun 2009 21:08:04 +0000 (-0700) Subject: ovs-brcompatd: Log the time to reload vswitch, to aid with debugging. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7ee8e8bcb4f8ec3123a894d2fc34a431d270de6;p=openvswitch ovs-brcompatd: Log the time to reload vswitch, to aid with debugging. --- diff --git a/lib/automake.mk b/lib/automake.mk index 98f47a08..b447aa56 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -176,7 +176,8 @@ COVERAGE_SOURCES = \ secchan/ofproto.c \ secchan/pktbuf.c \ vswitchd/bridge.c \ - vswitchd/mgmt.c + vswitchd/mgmt.c \ + vswitchd/ovs-brcompatd.c lib/coverage-counters.c: $(COVERAGE_SOURCES) lib/coverage-scan.pl (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_SOURCES)) > $@.tmp mv $@.tmp $@ diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 5531aa44..bdd13152 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -35,6 +35,7 @@ #include "cfg.h" #include "command-line.h" +#include "coverage.h" #include "daemon.h" #include "dirs.h" #include "dpif.h" @@ -183,13 +184,18 @@ rewrite_and_reload_config(void) if (cfg_is_dirty()) { int error1 = cfg_write(); int error2 = cfg_read(); + long long int reload_start = time_msec(); int error3 = system(reload_command); + long long int elapsed = time_msec() - reload_start; + COVERAGE_INC(brcompatd_reload); + if (elapsed > 0) { + VLOG_INFO("reload command executed in %lld ms", elapsed); + } if (error3 == -1) { - VLOG_ERR_RL(&rl, "failed to execute reload command: %s", - strerror(errno)); + VLOG_ERR("failed to execute reload command: %s", strerror(errno)); } else if (error3 != 0) { char *msg = process_status_msg(error3); - VLOG_ERR_RL(&rl, "reload command exited with error (%s)", msg); + VLOG_ERR("reload command exited with error (%s)", msg); free(msg); } return error1 ? error1 : error2 ? error2 : error3 ? ECHILD : 0;