Re: [GIT PULL] tracing: Updates for 7.2

From: Linus Torvalds

Date: Sat Jun 20 2026 - 18:47:41 EST


On Sat, 20 Jun 2026 at 15:20, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> I totally agree that trace_printk.h should not be added to kernel.h for
> debugging if printk.h is also not included for that purpose. But you
> are stating that it is included because everything "uses" it. But
> really, if we are worried about getting rid of adding headers that are
> not used, I think it would be a worth while exercise to remove printk.h
> from kernel.h to have it included only where it is used.

Feel free to try to come up with such a patch.

But honestly, before you do, what is the *advantage* of such a thing?

Because you seem to think that "trace_printk()" and "printk()" are the same.

They really aren't.

You don't seem to be willing or able to acknowledge that one is very
common, and the other is not.

If I did my quick grep and math right, we have this situation:

'printk()' and the basic 'pr_err()/pr_warn()' calls exported by
<linux/printk.h> exist in 19.2% of all C files in the kernel (7104
files):

git grep -E -wl '(printk)|(pr_err)|(pr_warn)' -- '*.c' | wc -l

While 'trace_printk()' exists in 0.054% of all C files in the kernel
(twenty files total):

git grep -E -wl '(trace_printk)' -- '*.c' | wc -l

and I think you'll get a few more hits if you look for 'tracing_on'
etc, so maybe it will hit a tenth of a percent overall.

But from a quick look, even *that* is actually mostly sample code and
tools/perf/, not in actual kernel code.

So be honest now: one of them makes sense to have as a pretty standard
baseline for kernel programming.

The other DOES NOT.

If you want to find other header files to split out, by all means, be my guest.

As mentioned, the more headers we can split off, the better.

But when one header file is used by about a fifth of all C files,
that's a pretty important header, wouldn't you say? Certainly not the
*first* header you should try to split off.

So I think you should look for *other* headers to split off, instead
of going "ok, printk and trace_printk are the same".

Because they damn well are not even remotely the same, and when you
try to equate the two, you just look incompetent.

Linus