[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250825080356.VOaAyf_7@linutronix.de>
Date: Mon, 25 Aug 2025 10:03:56 +0200
From: Nam Cao <namcao@...utronix.de>
To: Gabriele Monaco <gmonaco@...hat.com>
Cc: linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-trace-kernel@...r.kernel.org,
Tomas Glozar <tglozar@...hat.com>, Juri Lelli <jlelli@...hat.com>,
Clark Williams <williams@...hat.com>,
John Kacur <jkacur@...hat.com>
Subject: Re: [RFC PATCH 01/17] rv: Refactor da_monitor to minimise macros
On Thu, Aug 21, 2025 at 10:49:05AM +0200, Gabriele Monaco wrote:
> On Thu, 2025-08-21 at 10:14 +0200, Nam Cao wrote:
> > On Thu, Aug 14, 2025 at 05:07:53PM +0200, Gabriele Monaco wrote:
> I think the reason was mostly laziness / wish to change less things.
Laziness is contagious, maybe you got it from me.
> > > +/*
> > > + * model_get_state_name - return the (string) name of the given
> > > state
> > > + */
> > > +static char *model_get_state_name(enum states state)
> > > +{
> > > + if ((state < 0) || (state >= STATE_MAX))
> > > + return "INVALID";
> >
> > Just notice that this probably should be
> > if (BUG_ON((state < 0) || (state >= STATE_MAX)))
> >
> > You shouldn't do it in this patch of course. I just want to note it
> > down.
>
> Mmh, I'm not quite sure about this one, sure it's not a good thing when
> we try to get an invalid state/event, but isn't BUG a bit too much here?
> We're handling things gracefully so the kernel is not broken (although
> rv likely is).
>
> If you really think we should note that, what about just WARN/WARN_ONCE ?
I think that if RV is run, then the system is just being tested, and
therefore it is not a big problem if the kernel crashes.
But WARN_ONCE is fine too.
Nam
Powered by blists - more mailing lists