From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: "Yury Norov (NVIDIA)" <yury.norov@gmail.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Christophe Leroy <chleroy@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
David Laight <david.laight@runbox.com>,
Petr Pavlu <petr.pavlu@suse.com>,
Andi Shyti <andi.shyti@kernel.org>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
Daniel Gomez <da.gomez@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v4 7/7] kernel.h: drop trace_printk.h
Date: Mon, 29 Dec 2025 17:25:08 -0500 [thread overview]
Message-ID: <9833cb61-1ec5-4cc1-ad9d-3e07f3deff80@efficios.com> (raw)
In-Reply-To: <20251229111748.3ba66311@gandalf.local.home>
On 2025-12-29 11:17, Steven Rostedt wrote:
> On Sun, 28 Dec 2025 13:31:50 -0800
> Andrew Morton <akpm@linux-foundation.org> wrote:
>
>>> trace_printk() should be as available to the kernel as printk() is.
>>
>> um, why? trace_printk is used 1% as often as is printk. Seems
>> reasonable to include a header file to access such a rarely-used(!) and
>> specialized thing?
[...]
> Yes, it's not in your kernel, but it is in several other people's kernels
> as they develop it. And adding a requirement that they need to include a
> header file for every place they add it (and then have to remember to
> remove that header file when they are done debugging) is going to waste
> more precious time that kernel developers don't have much of.
I agree with Steven. trace_printk() needs to stay convenient to use for
kernel developers. Part of this convenience comes from not having to
include additional header files by hand. It has been around for
16 years and documented as such in kernel documentation [1],
LWN articles [2], and conference presentation material. Changing
this would lead to confusion for people trying to use the feature.
I personally use trace_printk() to sprinkle temporary debug-style
trace events in frequently executed kernel code I need to follow
carefully.
One possible compromise would be to move it to its own header file,
and introduce a CONFIG_TRACE_PRINTK Kconfig option (default Y) that
would surround an include from linux/kernel.h with a preprocessor
conditional. But please make sure the default stays as it is today:
include the trace printk header by default.
Thanks,
Mathieu
[1] Debugging the kernel using Ftrace - part 1 https://lwn.net/Articles/365835/
[2] Documentation/trace/ftrace.txt
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2025-12-29 22:25 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-25 17:09 [PATCH v4 0/7] Unload linux/kernel.h Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 1/7] kernel.h: drop STACK_MAGIC macro Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 2/7] moduleparam: include required headers explicitly Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 3/7] kernel.h: move VERIFY_OCTAL_PERMISSIONS() to sysfs.h Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 4/7] kernel.h: include linux/instruction_pointer.h explicitly Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 5/7] tracing: Remove size parameter in __trace_puts() Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 6/7] tracing: move tracing declarations from kernel.h to a dedicated header Yury Norov (NVIDIA)
2025-12-25 17:09 ` [PATCH v4 7/7] kernel.h: drop trace_printk.h Yury Norov (NVIDIA)
2025-12-26 16:58 ` Steven Rostedt
2025-12-27 14:45 ` Andy Shevchenko
2025-12-27 15:57 ` Steven Rostedt
2025-12-27 19:35 ` Yury Norov
2025-12-27 21:27 ` Steven Rostedt
2025-12-28 21:31 ` Andrew Morton
2025-12-29 16:17 ` Steven Rostedt
2025-12-29 16:41 ` Danilo Krummrich
2025-12-29 17:19 ` Borislav Petkov
2025-12-29 22:25 ` Mathieu Desnoyers [this message]
2025-12-30 8:55 ` Andy Shevchenko
2025-12-30 14:21 ` Mathieu Desnoyers
2025-12-30 16:18 ` Yury Norov
2025-12-30 16:46 ` Steven Rostedt
2026-01-03 0:50 ` Joel Fernandes
2026-01-03 12:57 ` Andy Shevchenko
2026-01-03 14:22 ` Yury Norov
2026-01-05 9:29 ` Jani Nikula
2026-01-05 16:36 ` Yury Norov
2026-01-05 16:50 ` Steven Rostedt
2026-01-05 18:30 ` Jani Nikula
2026-01-03 15:36 ` Joel Fernandes
2026-01-04 0:20 ` Andy Shevchenko
2026-01-05 16:39 ` Steven Rostedt
2026-01-05 17:11 ` Joel Fernandes
2026-01-05 18:21 ` Christophe Leroy (CS GROUP)
2026-01-05 19:33 ` Joel Fernandes
2026-01-05 20:04 ` Steven Rostedt
2026-01-05 20:15 ` Joel Fernandes
2026-01-05 18:02 ` Andy Shevchenko
2026-01-05 18:07 ` Yury Norov
2026-01-05 18:11 ` Andy Shevchenko
2025-12-27 14:50 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9833cb61-1ec5-4cc1-ad9d-3e07f3deff80@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=akpm@linux-foundation.org \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=chleroy@kernel.org \
--cc=da.gomez@kernel.org \
--cc=dakr@kernel.org \
--cc=david.laight@runbox.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rodrigo.vivi@intel.com \
--cc=rostedt@goodmis.org \
--cc=tursulin@ursulin.net \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox