From: Matthew Dillon Date: Thu, 17 Jul 2008 23:56:43 +0000 (+0000) Subject: MFC 1.21: Give krateprintf() a burst capability. X-Git-Tag: v2.0.1~86 X-Git-Url: https://gitweb.dragonflybsd.org/~mneumann/dragonfly.git/commitdiff_plain/048b2200deb308fc84e5ccb3edbc2e7f005fdf34 MFC 1.21: Give krateprintf() a burst capability. --- diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index de4617ce81..1f457465d9 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -37,7 +37,7 @@ * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_prf.c,v 1.61.2.5 2002/08/31 18:22:08 dwmalone Exp $ - * $DragonFly: src/sys/kern/subr_prf.c,v 1.20 2008/01/04 12:16:19 matthias Exp $ + * $DragonFly: src/sys/kern/subr_prf.c,v 1.20.4.1 2008/07/17 23:56:43 dillon Exp $ */ #include "opt_ddb.h" @@ -335,6 +335,9 @@ kvprintf(const char *fmt, __va_list ap) * Limited rate kprintf. The passed rate structure must be initialized * with the desired reporting frequency. A frequency of 0 will result in * no output. + * + * count may be initialized to a negative number to allow an initial + * burst. */ void krateprintf(struct krate *rate, const char *fmt, ...) @@ -343,7 +346,8 @@ krateprintf(struct krate *rate, const char *fmt, ...) if (rate->ticks != (int)time_second) { rate->ticks = (int)time_second; - rate->count = 0; + if (rate->count > 0) + rate->count = 0; } if (rate->count < rate->freq) { ++rate->count;