public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Anshu Kumari <anskuma@redhat.com>
Cc: passt-dev@passt.top, lvivier@redhat.com, david@gibson.dropbear.id.au
Subject: Re: [PATCH v4] log: Add rate-limiting macros for log messages
Date: Sun, 29 Mar 2026 14:02:39 +0200 (CEST)	[thread overview]
Message-ID: <20260329140239.6a7cce74@elisabeth> (raw)
In-Reply-To: <20260326095019.387307-2-anskuma@redhat.com>

On Thu, 26 Mar 2026 15:20:20 +0530
Anshu Kumari <anskuma@redhat.com> wrote:

> Currently, some log messages that would be useful at info or warn level
> are kept at debug level because there is no way to throttle them, and a
> guest could otherwise flood the host logs.
> 
> Add a logmsg_ratelimit() macro that uses per-call-site static variables
> to independently track each call site's rate.  It allows up to
> LOG_RATELIMIT_BURST (5) messages per LOG_RATELIMIT_INTERVAL (1 second)
> window, then prints a suppression notice.  When a new window opens and
> messages were suppressed, the count is reported after the next allowed
> message.
> 
> Link: https://bugs.passt.top/show_bug.cgi?id=134
> Signed-off-by: Anshu Kumari <anskuma@redhat.com>

Applied, thanks, and welcome to the git log!

> ---
> v4:
>    - Print suppression notice immediately after the last allowed message,
>      not on the next call, to avoid confusion with unrelated messages
>      in between.
>    - Add Link: tag before Signed-off-by

By the way, you can also decide to leave the whole history (v2, v3)
here. I actually find it a bit more convenient, but not everybody does.

I guess it depends on how fast you re-post: if there are chances
somebody missed your v3, then having the whole history is nicer for
reviewers.

You could also consider using git-publish for this:

  https://github.com/stefanha/git-publish

I don't use it because of my own scripts and habits, but some others on
this list certainly do.

-- 
Stefano


      parent reply	other threads:[~2026-03-29 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26  9:50 Anshu Kumari
2026-03-27  0:17 ` David Gibson
2026-03-29 12:02 ` Stefano Brivio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260329140239.6a7cce74@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=anskuma@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).