Thread (41 messages) 41 messages, 10 authors, 2026-01-05

Re: [PATCH v4 7/7] kernel.h: drop trace_printk.h

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-01-05 16:50:13
Also in: dri-devel, intel-gfx, linux-modules, lkml

On Mon, 5 Jan 2026 11:36:11 -0500
Yury Norov [off-list ref] wrote:
quoted
You do realize this means recompiling everything when adding D=1 for
debugging?  
Yes sir I do.

It would be as simple (or hard) as building another arch:

        make O=../build/linux-arm64
        make O=../build/linux-x86_64
        make D=1 W=1 O=../build/linux-x86_64-dev

If you're both developer and CI engineer in your company, you're likely
already doing something like that. If you're CI-only, there're no
changes for you. If you're a developer - yeah, you'd have to learn a
new flag.
I'm saying this right now.

Hard-nacked-by: Steven Rostedt [off-list ref]

Why do you want to burden developers?
The real problem of course is the status inflation. The fact that
defconfig enables CONFIG_EXPERT and CONFIG_DEBUG_KERNEL implies that
every random person who is able to do:

        git clone && make && sudo make install

now assumed an expert kernel user and active developer. It is not
correct, and it leads to bloating kernel with dev-only features.

What we discuss here is a new marker for those real experts and
developers, I think. (In an hope that it will inflate not very fast.)
This is a generic feature that helps all developers. The ones spending the
most time in maintaining the kernel.

Add the config I mentioned:

config HIDE_TRACE_PRINTK
  depends on TRACING
  help
    trace_printk() is an extremely powerful utility to debug and develop
    kernel code. It is defined in kernel.h so that it can be easily accessed
    during development or having to debug existing code.

    But trace_printk() is not to be included in the final result, and having
    it in kernel.h during normal builds where the builder has no plans of
    debugging the kernel causes wasted cycles and time in compiling the kernel.

    By saying yes here, the include of trace_printk() macros will be hidden
    from kernel.h and help speed up the compile.

    If you do not plan on debugging this kernel, say Y


It is default 'n' as the normal person building their own kernel likely
wants to debug it. Once you set this to 'y' then you get your "fast" builds.

Then in kernel.h have:

#ifndef CONFIG_HIDE_TRACE_PRINTK
# include <linux/trace_printk.h>
#endif

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help