X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvlog.c;h=279c6e739c73a742ef3caf1cadd914f83ed821c8;hb=c002dde70329b5553b79f3f1ad6d60771f4179c0;hp=265e9c6dd0bc914b53d27bb2f5b4db7a3538b45f;hpb=8628b0b71d1cf5b3bd7425e50f0aa1435aa38804;p=openvswitch diff --git a/lib/vlog.c b/lib/vlog.c index 265e9c6d..279c6e73 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -740,6 +740,7 @@ vlog_should_drop(const struct vlog_module *module, enum vlog_level level, if (!rl->n_dropped) { rl->first_dropped = now; } + rl->last_dropped = now; rl->n_dropped++; return true; } @@ -747,10 +748,15 @@ vlog_should_drop(const struct vlog_module *module, enum vlog_level level, rl->tokens -= VLOG_MSG_TOKENS; if (rl->n_dropped) { + time_t now = time_now(); + unsigned int first_dropped_elapsed = now - rl->first_dropped; + unsigned int last_dropped_elapsed = now - rl->last_dropped; + vlog(module, level, - "Dropped %u log messages in last %u seconds " - "due to excessive rate", - rl->n_dropped, (unsigned int) (time_now() - rl->first_dropped)); + "Dropped %u log messages in last %u seconds (most recently, " + "%u seconds ago) due to excessive rate", + rl->n_dropped, first_dropped_elapsed, last_dropped_elapsed); + rl->n_dropped = 0; } return false;