Re: [Linuxptp-devel] [PATCH RFC 2/2] port: print bogus delay request message as rate limited info.

2015-09-10 Thread Richard Cochran
On Mon, Sep 07, 2015 at 06:25:26PM +0200, Miroslav Lichvar wrote: > Upgrade the message level to info so the user can see it, but print it > at most once per 5 minutes to not spam the syslog. > --- > port.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/port.c b/port

Re: [Linuxptp-devel] [PATCH RFC 2/2] port: print bogus delay request message as rate limited info.

2015-09-10 Thread Miroslav Lichvar
On Thu, Sep 10, 2015 at 10:55:10AM +0200, Richard Cochran wrote: > I like this feature, but it would be so much nicer to have: > > pl_debug(300, "port %hu: ignore bogus delay request interval > 2^%d", >portnum(p), rsp->hdr.logMessageInterval); > > I mean hav

[Linuxptp-devel] [PATCHv2 2/3] print: add rate limited versions of pr_* macros.

2015-09-10 Thread Miroslav Lichvar
Signed-off-by: Miroslav Lichvar --- print.h | 17 + 1 file changed, 17 insertions(+) diff --git a/print.h b/print.h index f5ed248..6d7aa94 100644 --- a/print.h +++ b/print.h @@ -44,4 +44,21 @@ void print_set_verbose(int value); #define pr_info(x...)print(LOG_INFO, x) #defin

[Linuxptp-devel] [PATCHv2 3/3] port: print bogus delay request message as rate limited info.

2015-09-10 Thread Miroslav Lichvar
Upgrade the message level to info so the user can see it, but print it at most once per 5 minutes to not spam the syslog too much. Signed-off-by: Miroslav Lichvar --- port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port.c b/port.c index 9c804cf..3f32433 100644 ---

[Linuxptp-devel] [PATCHv2 1/3] util: add function for simple rate limiting.

2015-09-10 Thread Miroslav Lichvar
Signed-off-by: Miroslav Lichvar --- util.c | 14 ++ util.h | 9 + 2 files changed, 23 insertions(+) diff --git a/util.c b/util.c index 6bbbe91..e10cedc 100644 --- a/util.c +++ b/util.c @@ -512,3 +512,17 @@ void parray_extend(void ***a, ...) va_end(ap); (*a)[l