+/* Logs the coverage counters, unless a similar set of events has already been
+ * logged.
+ *
+ * This function logs at log level VLL_INFO. Use care before adjusting this
+ * level, because depending on its configuration, syslogd can write changes
+ * synchronously, which can cause the coverage messages to take several seconds
+ * to write. */
+void
+coverage_log(void)
+{
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 3);
+
+ if (!VLOG_DROP_INFO(&rl)) {
+ uint32_t hash = coverage_hash();
+ if (coverage_hit(hash)) {
+ VLOG_INFO("Skipping details of duplicate event coverage for "
+ "hash=%08"PRIx32" in epoch %u", hash, epoch);
+ } else {
+ struct svec lines;
+ const char *line;
+ size_t i;
+
+ svec_init(&lines);
+ coverage_read(&lines);
+ SVEC_FOR_EACH (i, line, &lines) {
+ VLOG_INFO("%s", line);
+ }
+ svec_destroy(&lines);
+ }
+ }
+}
+