Re: [GIT PULL] tracing: Updates for 7.2
From: Linus Torvalds
Date: Fri Jun 19 2026 - 10:35:53 EST
On Fri, 19 Jun 2026 at 05:15, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> Many developers use trace_printk() over printk().
You're on some bad drugs, Steven.
By "many developers" you clearly must have meant "almost nobody".
> Requiring people to
> add that include for every use case would severely limit debugging of
> the kernel. Would you be OK if we did the same for printk?
Stop making inane and silly arguments that have nothing to do with reality.
The two are not the same:
$ git grep -wl printk | wc -l
3212
$ git grep -wl trace_printk | wc -l
50
and making them sound remotely similar is just making you look dishonst.
Look, the attached patch makes my defconfig build cleanly, and makes a
$ touch include/linux/trace_printk.h
cause my recompile to build just a handful of files. While touching
linux/kernel.h causes thousands of files to be re-build.
That's a whopping
6 files changed, 6 insertions(+), 1 deletion(-)
to make my tree build without including <linux/trace_printk.h> everywhere.
Now, that's _just_ my defconfig, and the full build clearly has a
handful of other cases. From a quick look, mostly in the 'samples'
directory.
But it looks like a *handful* of other cases.
Now, if the same was true for printk(), I'd happily split that into
some other header too.
But it isn't.
Because we live in reality.
Linus
drivers/tty/sysrq.c | 1 +
include/linux/kernel.h | 1 -
include/linux/trace.h | 2 ++
kernel/panic.c | 1 +
kernel/rcu/rcu.h | 1 +
lib/sys_info.c | 1 +
6 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index c2e4b31b699a..9d080e10baa3 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -51,6 +51,7 @@
#include <linux/syscalls.h>
#include <linux/of.h>
#include <linux/rcupdate.h>
+#include <linux/trace_printk.h>
#include <asm/ptrace.h>
#include <asm/irq_regs.h>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e5570a16cbb1..e87a40fbd152 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -31,7 +31,6 @@
#include <linux/build_bug.h>
#include <linux/sprintf.h>
#include <linux/static_call_types.h>
-#include <linux/trace_printk.h>
#include <linux/util_macros.h>
#include <linux/wordpart.h>
diff --git a/include/linux/trace.h b/include/linux/trace.h
index 7eaad857dee0..070a406a7f05 100644
--- a/include/linux/trace.h
+++ b/include/linux/trace.h
@@ -2,6 +2,8 @@
#ifndef _LINUX_TRACE_H
#define _LINUX_TRACE_H
+#include <linux/trace_printk.h>
+
#define TRACE_EXPORT_FUNCTION BIT(0)
#define TRACE_EXPORT_EVENT BIT(1)
#define TRACE_EXPORT_MARKER BIT(2)
diff --git a/kernel/panic.c b/kernel/panic.c
index 213725b612aa..983ad272d622 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -37,6 +37,7 @@
#include <linux/context_tracking.h>
#include <linux/seq_buf.h>
#include <linux/sys_info.h>
+#include <linux/trace_printk.h>
#include <trace/events/error_report.h>
#include <asm/sections.h>
#include <kunit/test-bug.h>
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index fa6d30ce73d1..7db85c9f6c73 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -11,6 +11,7 @@
#define __LINUX_RCU_H
#include <linux/slab.h>
+#include <linux/trace_printk.h>
#include <trace/events/rcu.h>
/*
diff --git a/lib/sys_info.c b/lib/sys_info.c
index f32a06ec9ed4..7ded4e7f3671 100644
--- a/lib/sys_info.c
+++ b/lib/sys_info.c
@@ -10,6 +10,7 @@
#include <linux/sched/debug.h>
#include <linux/string.h>
#include <linux/sysctl.h>
+#include <linux/trace_printk.h>
#include <linux/sys_info.h>