Re: [GIT PULL v2] tracing: Updates for v6.9

From: Steven Rostedt
Date: Tue Mar 19 2024 - 17:25:26 EST


On Tue, 19 Mar 2024 14:03:29 -0700
Nathan Chancellor <nathan@xxxxxxxxxx> wrote:

> > #define __assign_str(dst, src) \
> > do { \
> > char *__str__ = __get_str(dst); \
> > int __len__ = __get_dynamic_array_len(dst) - 1; \
> > WARN_ON_ONCE(!src != !__data_offsets.dst##_ptr_); \
> > WARN_ON_ONCE(src && strcmp((src), __data_offsets.dst##_ptr_)); \
> > memcpy(__str__, __data_offsets.dst##_ptr_ ? : \
> > EVENT_NULL_STR, __len__); \
> > __str__[__len__] = '\0'; \
> > } while (0)
> >
> > The first WARN_ON() will report the bug if src is not NULL and the pointer
> > is even though the strcmp() will likely crash in that case. But that's a
> > bug if that happens anyway.
>
> For what it's worth, I applied that change and built ARCH=x86_64
> defconfig with LLVM 18.1.1 from [1] but it does not appear to help the
> instances of -Wstring-compare; in fact, it adds some additional warnings
> that I have not seen before. I have attached the full build log.

That was just me posting what I was going to do before testing it. You want
the actual patch that Linus pulled in.

https://lore.kernel.org/all/20240319133959.349f5082@xxxxxxxxxxxxxxxxxx/

-- Steve