Re: [PATCH v3 2/2] tracing: Remove trace_printk.h from kernel.h
From: David Laight
Date: Wed Jun 24 2026 - 11:48:55 EST
On Wed, 24 Jun 2026 10:32:25 -0400
Steven Rostedt <rostedt@xxxxxxxxxx> wrote:
> On Wed, 24 Jun 2026 11:11:52 +0100
> David Laight <david.laight.linux@xxxxxxxxx> wrote:
>
> > That is all about changes to the file causing everything to be rebuilt,
> > not the contents of the file slowing down builds.
>
> I guess I should say it better. It causes more build time if that file
> changes. That's what I meant. I update the wording to say:
>
> There have been complaints about trace_printk.h causing more build time
> for being in kernel.h it if changes. There is also an effort to clean up
> kernel.h to have it not include unneeded header files. Move trace_printk.h
> out of kernel.h and place it in the headers and C files that use it.
> >
> > The part you are moving out of normal builds is just a few #defines.
> > They won't have a significant effect on build times either.
> >
> > So there is no point splitting out trace_controls.h.
>
> That is a completely different reason. trace_printk.h is about
> trace_printk() usage. The stuff split out into trace_controls.h have
> nothing to do with trace_printk()s.
True, but every header file costs extra time to open.
That could easily be more that the cost of parsing it (ok hand waving!).
With a long list of -I parameters just finding a file costs because of
all the failed opens.
I've just knocked it out of kernel.h, had to fix:
rcu.h
linux/ftrace.h
to make my 'normal' kernel build.
Lots of stuff includes the latter.
David
>
> -- Steve
>