Re: [PATCH net-next RFC 4/6] netconsole: tell the target when the rate limit drops messages
Breno Leitao <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 20, 2026 at 09:49:47PM +0100, Gustavo Luiz Duarte wrote: > On Tue, Aug 18, 2026 at 11:30 AM Breno Leitao <[email protected]> wrote: > > +static void send_ratelimit_notice(struct netconsole_target *nt, bool extended) > > +{ > > + int len = 0; > > + u64 ts_usec; > > + u32 drops; > > + > > + drops = netconsole_take_drops(nt); > > + if (!drops) > > + return; > > + > > + if (extended) { > > + /* append the extended headers */ > > + if (nt->release) > > + len = scnprintf(nt->buf, sizeof(nt->buf), "%s,", > > + init_utsname()->release); > > + > > + ts_usec = div_u64(local_clock(), NSEC_PER_USEC); > > + len += scnprintf(nt->buf + len, sizeof(nt->buf) - len, > > + "%u,0,%llu,-;", LOGLEVEL_WARNING, ts_usec); > > + } > > This additional message with sequence number zero in the middle of a > stream looks awkward. First of all Thanks for the review. Agreed, but I don't think there is any other solution rather than a 0, given this is coming from printk(), and we don't want to conflict/collide. > I don't think we need to send a notice about dropped messages to > extended console targets. Those targets can detect dropped messages by > tracking the sequence number in the message header. I've come up with this "extra" message in a say to get it very clear that some messages were rate limit. We can certainly do it using the sequence number if we enable message counting. What would be an option to tell we had ratelimited for those not using message count? Thanks! --breno