dyndbg: pr_fmt(fmt) with additional arguments?
From: Philipp Hahn
Date: Fri Feb 27 2026 - 06:20:11 EST
Hello Jason, hello Jim,
I've been using the following in my modules to prefix all messages with
the module and function name:
#define pr_fmt(fmt) KBUILD_MODNAME ".%s ", __func__
This worked nicely until `pr_debug_ratelimit()` is used: The additional
arguments breaks `DEFINE_DYNAMIC_DEBUG_METADATA_CLS`:
#define pr_debug_ratelimited(fmt, ...) \
DEFINE_DYNAMIC_DEBUG_METADATA(…, pr_fmt(fmt)); \
#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, …, fmt)
#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \
static struct _ddebug __aligned(8) \
__section("__dyndbg") name = { \
… \
.format = (fmt), \
This could be fixed easily by adding an additional '...' to it to slurp
any additional argument which `pr_fmt` might add.
Would this be okay or do I miss something?
For testing I have recompiled current 7.0.0-rc1 for x86_64 with no
compile failures.
Philipp Hahn