[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240319125833.30098a37@gandalf.local.home>
Date: Tue, 19 Mar 2024 12:58:33 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Alison Schofield <alison.schofield@...el.com>, Beau Belgrave
<beaub@...ux.microsoft.com>, Huang Yiwei <quic_hyiwei@...cinc.com>, John
Garry <john.g.garry@...cle.com>, Randy Dunlap <rdunlap@...radead.org>,
Thorsten Blum <thorsten.blum@...lux.com>, Vincent Donnefort
<vdonnefort@...gle.com>, linke li <lilinke99@...com>
Subject: Re: [GIT PULL v2] tracing: Updates for v6.9
On Tue, 19 Mar 2024 09:23:10 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Mon, 18 Mar 2024 at 08:28, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > - Added checks to make sure that the source of __string() is also the
> > source of __assign_str() so that it can be safely removed in the next
> > merge window.
>
> Aargh.
>
> I didn't notice this initially, because it doesn't happen with gcc (or
> maybe not with allmodconfig), but with clang I get
>
> CC [M] net/sunrpc/sched.o
> In file included from net/sunrpc/sched.c:31:
> In file included from ./include/trace/events/sunrpc.h:2524:
> In file included from ./include/trace/define_trace.h:102:
> In file included from ./include/trace/trace_events.h:419:
> include/trace/events/sunrpc.h:707:4: error: result of comparison
> against a string literal is unspecified (use an explicit string
> comparison function instead) [-Werror,-Wstring-compare]
>
> and then about 250 lines ot messy "explanations" for how it was
> expanded because it happens on line 709 too in the same macro, and it
> ends up being three macros deep or something.
>
> So no, this all needs to be re-done. That
>
> WARN_ON_ONCE(__builtin_constant_p(src) ? \
> strcmp((src), __data_offsets.dst##_ptr_) : \
> (src) != __data_offsets.dst##_ptr_); \
>
> does *NOT* work.
>
> Also, looking at that __assign_str() macro, it seems literally insane.
> On the next line it will do
>
> memcpy(__str__, __data_offsets.dst##_ptr_ ? : \
> EVENT_NULL_STR, __len__); \
>
> so now it checks "__data_offsets.dst##_ptr_" for NULL - but that's one
> line after it just did that strcmp on it.
>
> WTF?
>
> This code is completely bogus.
The WARN_ON_ONCE() was added separately and missed that we do now allow it
to be NULL.
I'll fix that.
-- Steve
Powered by blists - more mailing lists