From: John Ogness <john.ogness@linutronix.de>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] printk: add print_hex_dump_devel()
Date: Thu, 19 Mar 2026 10:52:09 +0106 [thread overview]
Message-ID: <87a4w4gnj2.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20260319092932.208939-3-thorsten.blum@linux.dev>
On 2026-03-19, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> Add print_hex_dump_devel() as the hex dump equivalent of pr_devel(),
> which emits output only when DEBUG is enabled, but keeps call sites
> compiled otherwise.
>
> Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> include/linux/printk.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index 63d516c873b4..54e3c621fec3 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -801,6 +801,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
> }
> #endif
>
> +#if defined(DEBUG)
> +#define print_hex_dump_devel(prefix_str, prefix_type, rowsize, \
> + groupsize, buf, len, ascii) \
> + print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
> + groupsize, buf, len, ascii)
> +#else
> +static inline void print_hex_dump_devel(const char *prefix_str, int prefix_type,
> + int rowsize, int groupsize,
> + const void *buf, size_t len, bool ascii)
> +{
> +}
If you look at the implementation of pr_devel(), it is using no_printk()
in the !DEBUG case. I believe this is to validate correct arg
formatting, even if the code will optimized out.
John Ogness
next prev parent reply other threads:[~2026-03-19 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 9:29 [PATCH v3 1/2] printk: add print_hex_dump_devel() Thorsten Blum
2026-03-19 9:29 ` [PATCH v3 2/2] crypto: caam - guard HMAC key hex dumps in hash_digest_key Thorsten Blum
2026-03-19 9:46 ` John Ogness [this message]
2026-03-19 9:48 ` [PATCH v3 1/2] printk: add print_hex_dump_devel() John Ogness
2026-03-27 10:07 ` Herbert Xu
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=87a4w4gnj2.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=thorsten.blum@linux.dev \
/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