Re: [PATCH v3 24/30] tools: tracing: Append extra cflags

From: Leo Yan

Date: Tue Mar 10 2026 - 07:50:15 EST


On Mon, Mar 09, 2026 at 09:37:07AM -0700, Ian Rogers wrote:
> On Mon, Mar 9, 2026 at 8:44 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> >
> > On Sun, 08 Mar 2026 16:46:29 +0000
> > Leo Yan <leo.yan@xxxxxxx> wrote:
> >
> > > Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> > > the compiler.
> > >
> > > Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
> >
> > Acked-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
>
> Not a problem with the change but running this patch through an AI
> agent brought up:
>
> Should CFLAGS be initialized with default optimization and warning flags
> (e.g., -g -O2 -Wall)?
>
> Currently, latency-collector is built without these standard compilation
> flags because they are missing from the Makefile. In other commits in this
> series (like for libbpf and thermal), CFLAGS was explicitly initialized to
> -g -O2 or -g -Wall when EXTRA_CFLAGS is not set.
>
> Additionally, should EXTRA_WARNINGS (provided by
> tools/scripts/Makefile.include) be appended to CFLAGS here, similar to
> how it is done for other tools?

Thanks for sharing this, Ian.

I would like to keep the scope of this series focused on appending the
-fzero-init-padding-bits=all option. The comment above from AI is not
relevant to this purpose, I'd leave it to the project maintainer for
further refactoring.

As you suggested in other reples, I will update to append EXTRA_CFLAGS
at the last so that it can override the default values. I will also
collect Steven's ACK tag.

If there are any concerns, please let me know.

Leo