ARRAY_SIZE works here, since array decl is complete.
no functional change
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
include/linux/dynamic_debug.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
Add a DECLARE_DYNDBG_CLASSMAP stub/do-nothing defn, so that callers
will compile properly with CONFIG_DYNAMIC_DEBUG=n
Signed-off-by: Jim Cromie
---
include/linux/dynamic_debug.h | 39 ++-
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/include
they will both see the same value.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
include/linux/dynamic_debug.h | 2 +-
lib/dynamic_debug.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
ead.
cc: linux-...@vger.kernel.org
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
Documentation/admin-guide/dynamic-debug-howto.rst | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst
b/Documentation/adm
nts messages (once) to the-log.
NB: the count is clamped to 1, chosen to be notice able, but not
annoying, and not enough to accidentally flood the logs.
Signed-off-by: Jim Cromie
---
lib/test_dynamic_debug.c | 32 +---
1 file changed, 21 insertions(+), 11 deleti
ng is actually lost here.
selftests-dyndbg: test_percent_splitting
This does basic testing of classmaps using '%' separated
multi-queries. It modprobes test_dynamic_debug with several classes
enabled, and counts to verify that the expected sites show the
enablement in the control file.
Signed-off-by: J
chset, closer to the classmap patches its validating.
With some tedium, the tests could be refactored to split out early
tests which avoid multi-cmds, and test only the class-params.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
r3 - skip test if LACK_TMOD
older
drop -v used in test_
forward.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
lib/dynamic_debug.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 283926530a43..ddcaa87f3b02 100644
--- a/lib/dynamic_debug.c
+++ b/lib
ntains a _ddebug_info field and module/main.c sets it
up, so that gets adjusted rather obviously.
The __packed attribute on _ddebug_info and the 3 contained structs
closes the holes otherwise created by the structification (which was
my excuse for not doing it originally).
Signed-off-by: Jim Cromie
hi Louis, thx for the nudge.
On Mon, Sep 8, 2025 at 8:38 AM Louis Chauvet
wrote:
> \
>
> Le 03/08/2025 à 05:57, Jim Cromie a écrit :
> > Describe the 3 API macros providing dynamic_debug's classmaps
> >
> > DYNDBG_CLASSMAP_DEFINE - create & export a classma
The udl driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/udl/udl_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/udl
The qxl driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/qxl/qxl_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c
The gud driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/gud/gud_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/gud/gud_drv.c
The vmwgfx driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm
tiny/bochs has 5 DRM_UT_* debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/tiny/bochs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tiny/boch
examples are added to test_dynamic_debug_submod.ko, and will fail
compilation if -DDD_MACRO_ARGCHECK is added to cflags. This wouldn't
be a useful CONFIG_ item, since it breaks the build.
Signed-off-by: Jim Cromie
---
v3- $macro_name =~ s/DYNDBG/DYNAMIC_DEBUG/
prev-
- split sta
tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/sysfb/simpledrm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
drivers/gpu/drm/display/drm_dp_helper.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gp
etnaviv has 5 DRM_UT_CORE debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs as well as plain-old pr_debug()s
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++
1 file changed, 2 insertions(+)
C: Maxime Ripard
CC: Thomas Zimmermann
CC: David Airlie
CC: Simona Vetter
Signed-off-by: Jim Cromie
---
drivers/accel/amdxdna/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/accel/amdxdna/Makefile b/drivers/accel/amdxdna/Makefile
index 0e9adf6890a01..800f81f5a7023 100644
virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/v
contained structs
closes the holes otherwise created by the structification (which was
my excuse for not doing it originally).
Signed-off-by: Jim Cromie
---
-v2 rework towards front of series
---
include/asm-generic/vmlinux.lds.h | 4 +-
include/linux/dynamic_debug.h | 42 +++-
ke
Signed-off-by: Jim Cromie
---
lib/dynamic_debug.c | 56 ++---
1 file changed, 32 insertions(+), 24 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 53ce282554266..bbbdb8aba0716 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_de
that gets called.
The cache contents must avoid the Thread-id (its not callsite), and
could avoid the line (to shrink the cache). But then line needs %d
each time pr_debug is reached.
ATM, this is just the flag-bit reservation.
Signed-off-by: Jim Cromie
---
include/linux/dynamic_debug.h | 1
ead.
cc: linux-...@vger.kernel.org
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
Documentation/admin-guide/dynamic-debug-howto.rst | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst
b/Documentation/adm
tristate, allowing 3 super/sub combos: Y/Y,
Y/M, M/M (not N/Y, since this is disallowed by dependence).
Y/Y testing exposed a missing __align(8) in the _METADATA macro, which
M/M didn't see because the module-loader memory placement constrains
it instead.
Fixes: aad0214f3026 ("dyndbg: add
Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with
CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe has
drm.debug callsites.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/xe/xe_drm_client.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe
Time for some thorough CI.
Also, the previous 18 patches could perhaps be replaced by a single
invocation of DYNDBG_CLASSMAP_USE, from a C-file linked into all drm
drivers & helpers. I didn't find such a file, nor a drm-client
linkage item in the Makefile.
Signed-off-by: J
r now, so they still
redundantly re-declare the classmap, but we can convert the drivers
later to DYNDBG_CLASSMAP_USE
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
this ignores a checkpatch
WARNING: Argument 'name' is not used in function-like macro
#70: FILE: include/
orage which
is not fast enough for every-time pr_debugs, but would work to fill
the cache the 1st time its enabled and invoked.
Signed-off-by: Jim Cromie
---
lib/dynamic_debug.c | 40 +---
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gp
The mgag200 driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm
t value,
in this case it was _base + 1. This leaves HI class un-selectable.
NB: the macro could better validate its arguments.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
Tested-by: Louis Chauvet
---
lib/test_dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
drivers/gpu/drm/drm_crtc_helper.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm
radeon has some DRM_UT_* debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg about its use of
the class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/radeon/radeon_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/r
TBD: some of this might be over-specification, or just over-talked.
NB: The _DEFINE & _USE model makes the user dependent on the definer,
just like EXPORT_SYMBOL(__drm_debug) already does.
cc: linux-...@vger.kernel.org
Signed-off-by: Jim Cromie
---
v3- rework protection around PARAM
v0
dule:function:sourcfile:line: "
So this patch extracts _DPRINTK_FLAGS_INCL_LOOKUP flags-combo out of
_DPRINTK_FLAGS_INCL_ANY, then redefs latter.
Next re-refactor dynamic_emit_prefix inner/outer fns accordingly.
Signed-off-by: Jim Cromie
---
include/linux/dynamic_debug.h | 9 +
1 file changed,
ARRAY_SIZE works here, since array decl is complete.
no functional change
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
include/linux/dynamic_debug.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
NKNOWN_" to loudly announce the erroneous situation, and to
make it uniquely greppable.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
lib/dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 5a007952f7f2
ssmap and controlling kparam.
Signed-off-by: Jim Cromie
---
drivers/accel/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile
index a301fb6089d4c..e437549cba8ac 100644
--- a/drivers/accel/Makefile
+++ b/drivers/accel/Makefile
@@ -1,5 +1,7 @
The gma500 has 126 DRM_UT_* debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/gma500/psb_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/g
commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control")
changed the control-file to display format strings with "\n" rather
than "\012". Update the docs to match the new reality.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
Tested-by: Louis Cha
ing of classmaps
currently, and doesn't need to. For now, just add comment.
Signed-off-by: Jim Cromie
---
v3- drop __outvar as promising magic it doesnt have
---
include/linux/dynamic_debug.h | 1 -
lib/dynamic_debug.c | 62 ++-
2 files changed, 32
nside the fn, to give
access to all kp members.
Also clean up and improve comments in test-code, and add
MODULE_DESCRIPTIONs.
cc: linux-...@vger.kernel.org
Signed-off-by: Jim Cromie
---
-v9
- fixup drm-print.h add PARAM_REF forwarding macros
with DYNAMIC_DEBUG_CLASSMAP_PARAM_REF in the API
onfigurations.
Signed-off-by: Jim Cromie
Co-developed-by: Łukasz Bartosik
Signed-off-by: Łukasz Bartosik
---
- skip comma tests if no builtins
-v3 squash in tests and doc
---
.../admin-guide/dynamic-debug-howto.rst | 9 +---
lib/dynamic_debug.c
The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make
them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling
dyndbg that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/drm_gem_shmem_helper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a
ng is actually lost here.
selftests-dyndbg: test_percent_splitting
This does basic testing of classmaps using '%' separated
multi-queries. It modprobes test_dynamic_debug with several classes
enabled, and counts to verify that the expected sites show the
enablement in the control file.
Signed-off-by: J
Invoke DYNAMIC_DEBUG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the
DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it.
Add DRM_CLASSMAP_* adapter macros to selectively use
DYNAMIC_DEBUG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=y is configured.
Signed-off-by: Jim Cromie
d for by anyone else, so reduce LOC & test-surface; simplify things.
Also rename enum class_map_type to enum ddebug_class_map_type.
Signed-off-by: Jim Cromie
---
include/linux/dynamic_debug.h | 23 ++--
lib/dynamic_debug.c | 102 +++---
lib/test_dyn
they will both see the same value.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
include/linux/dynamic_debug.h | 2 +-
lib/dynamic_debug.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
drivers/gpu/drm/i915/i915_params.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/
ddebug_apply_class_bitmap(), also check for actual changes to the
bits before announcing them, to declutter logs.
No functional change.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
v3 s/modnm/mod_name/g
---
lib/dynamic_debug.c | 65 -
1 file
old_bits arg is currently a pointer to the input bits, but this could
allow inadvertent changes to the input by the fn. Disallow this.
And constify new_bits while here.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
lib/dynamic_debug.c | 21 +++--
1 file changed, 11
Disambiguate pr_fmt(fmt) arg, by changing it to _FMT_, to avoid naming
confusion with many later macros also using that argname.
no functional change
Signed-off-by: Jim Cromie
---
lib/dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dynamic_debug.c b/lib
ed 1 queries, with 0 matches, 0 errs
Also reduce verbose=3 messages in ddebug_add_module
When modprobing a module, dyndbg currently logs/says "add-module", and
then "skipping" if the module has no prdbgs. Instead just check 1st
and return quietly.
no functional change
Signe
;
modules built with CONFIG_DYNAMIC_DEBUG=y (!1) don't need the flag.
Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factory
macro")
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/
f up.
ddebug_table contains a _ddebug_info member, so its users keep access
to mod_name, just now with "->info." added in.
In static ddebug_add_module(&di), reinforce the cursor-model by
dropping the modname arg, and setting di->mod_name at each caller.
Signed-off-by: Jim Cromie
tic-key patches in the proper state. The
compiler evidently sees this lack of reference and complains.
So this drops the local var and refs the field directly in the
macro-call, which avoids the warning/error.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
drivers/gpu/drm/drm_pri
ow the module
defining the classmap to protect its classes from unintended
alterations by legacy/class-less queries.
Next:
Author choice: use of DYNAMIC_DEBUG_CLASSMAP_PARAM() means they want
the drm.debug style control point. We should presume they want it to
reflect whats set underneath, with o
tection macro'd to false
-v2.with-this-patch - sysfs knob decides
-v2.speculative - module decides wrt classmap protection
seems unneeded now, TBD
NOTE: protection is only against class-less queries, explicit "class
FOO" adjustments are allowed (that is the mechanism
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm
The vkms driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/vkms/vkms_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/vkms
nts messages (once) to the-log.
NB: the count is clamped to 1, chosen to be notice able, but not
annoying, and not enough to accidentally flood the logs.
Signed-off-by: Jim Cromie
---
lib/test_dynamic_debug.c | 37 ++---
1 file changed, 26 insertions(+),
t a
common or desirable build/config.
Signed-off-by: Jim Cromie
Co-developed-by: Łukasz Bartosik
Signed-off-by: Łukasz Bartosik
---
-r3 turn off green at end
drop config dep on TEST_DYNAMIC_DEBUG,
since basic-test uses builtin params
---
MAINTAINERS
chset, closer to the classmap patches its validating.
With some tedium, the tests could be refactored to split out early
tests which avoid multi-cmds, and test only the class-params.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
r3 - skip test if LACK_TMOD
older
drop -v used in test_
ore stuff
}
Fix for this usage by changing __dynamic_func_call_cls{,_no_desc}
macros into expressions, by replacing the do-while-0s with a ({ })
wrapper. In the common usage, the trailing ';' converts the
expression into a statement.
drm_dbg("statement form");
Signed
forward.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
lib/dynamic_debug.c | 20 +---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 283926530a43b..7c5a1ae2c0a65 100644
--- a/lib/dynamic_debug.c
+++ b/lib
igned-off-by: Jim Cromie
---
---
lib/dynamic_debug.c | 29 +
lib/test_dynamic_debug.c | 8
2 files changed, 37 insertions(+)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index fa8d1ee214066..d6687623c5a96 100644
--- a/lib/dynamic_debug.c
+++
minor:
.rework several cleanup patches forward
.code/doc/commit-msg tweaks for Louis Chauvet feedback.
.refactor dyndbg dynamic-prefix to split TID from cacheable prefix
.cflags for drivers/accel borrowing DRM.debug
Jim Cromie (58):
docs/dyndbg: update examples \012 to \n
docs/dyndbg:
On Fri, Jun 20, 2025 at 8:47 AM Sean Paul wrote:
> On Thu, Apr 3, 2025 at 9:48 AM Jim Cromie wrote:
> >
>
> \snip
>
> >
> > -static void ddebug_match_apply_kparam(const struct kernel_param *kp,
> > - c
On Tue, Apr 15, 2025 at 4:04 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > echo 1000 > /sys/module/test_dynamic_debug/parameters/do_prints
> >
> > This allows its use as a scriptable load generator, to generate
> > dynami
On Tue, Apr 15, 2025 at 4:05 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > Treat comma as a token terminator, just like a space. This allows a
> > user to avoid quoting hassles when spaces are otherwise needed:
> >
> > :#>
On Tue, Apr 15, 2025 at 4:01 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic
> > K&R rule: "define once, refer many times".
> >
> > When D
On Tue, Apr 15, 2025 at 4:04 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > Add __DYNAMIC_DEBUG_CLASSMAP_CHECK to implement the following
> > arg-checks at compile-time:
> >
> > 0 <= _base < 63
> > class_
On Tue, Apr 15, 2025 at 4:06 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if
> > (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=y because
> >
On Tue, Apr 15, 2025 at 4:02 AM Louis Chauvet wrote:
>
>
>
> Le 02/04/2025 à 19:41, Jim Cromie a écrit :
> > Add a selftest script for dynamic-debug. The config requires
> > CONFIG_TEST_DYNAMIC_DEBUG=m and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m,
> > which tacitly requir
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm
Signed-off-by: Jim Cromie
---
lib/dynamic_debug.c | 57 -
1 file changed, 35 insertions(+), 22 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index f7ec2365ab40..192783ff7b98 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debu
etnaviv has 5 DRM_UT_CORE debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs as well as plain-old pr_debug()s
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++
1 file changed, 2 insertions(+)
virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/v
ddebug_apply_class_bitmap(), also check for actual changes to the
bits before announcing them, to declutter logs.
No functional change.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
---
lib/dynamic_debug.c | 65 -
1 file changed, 40 insertions
old_bits arg is currently a pointer to the input bits, but this could
allow inadvertent changes to the input by the fn. Disallow this.
And constify new_bits while here.
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
lib/dynamic_debug.c | 21 +++--
1 file changed, 11
nside the fn, to give
access to all kp members.
Also clean up and improve comments in test-code, and add
MODULE_DESCRIPTIONs.
cc: linux-...@vger.kernel.org
Signed-off-by: Jim Cromie
---
-v9
- fixup drm-print.h add PARAM_REF forwarding macros
with DYNAMIC_DEBUG_CLASSMAP_PARAM_REF in the API
contained structs
closes the holes otherwise created by the structification (which was
my excuse for not doing it originally).
Signed-off-by: Jim Cromie
---
-v2 rework towards front of series
---
include/asm-generic/vmlinux.lds.h | 4 +-
include/linux/dynamic_debug.h | 28 +++---
ke
The vmwgfx driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm
this usage by changing __dynamic_func_call_cls{,_no_desc}
macros into expressions, by replacing the do-while-0s with a ({ })
wrapper. In the common usage, the trailing ';' converts the
expression into a statement.
drm_dbg("statement form");
Signed-off-by: Jim Cromie
drm_dbg()s.
Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3
drivers.")
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +---
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu
Invoke DYNAMIC_DEBUG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the
DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it.
Add DRM_CLASSMAP_* adapter macros to selectively use
DYNAMIC_DEBUG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=y is configured.
Signed-off-by: Jim Cromie
a different offset.
Signed-off-by: Jim Cromie
---
include/linux/dynamic_debug.h | 1 +
lib/dynamic_debug.c | 41 ++-
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index
tiny/bochs has 5 DRM_UT_* debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/tiny/bochs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tiny/boch
igned-off-by: Jim Cromie
---
---
lib/dynamic_debug.c | 29 +
lib/test_dynamic_debug.c | 8
2 files changed, 37 insertions(+)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 53e261dbf81e..56b503af0b31 100644
--- a/lib/dynamic_debug.c
+++
The vkms driver has a number of DRM_UT_* debugs, make them
controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg
that the module uses them.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/vkms/vkms_drv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/vkms
onfigurations.
Signed-off-by: Jim Cromie
Co-developed-by: Łukasz Bartosik
Signed-off-by: Łukasz Bartosik
---
- skip comma tests if no builtins
-v3 squash in tests and doc
---
.../admin-guide/dynamic-debug-howto.rst | 9 +---
lib/dynamic_debug.c
Signed-off-by: Jim Cromie
---
lib/dynamic_debug.c | 56 ++---
1 file changed, 32 insertions(+), 24 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 104cf8abdf33..046c4ffb38f8 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_de
tic-key patches in the proper state. The
compiler evidently sees this lack of reference and complains.
So this drops the local var and refs the field directly in the
macro-call, which avoids the warning/error.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/drm_print.c | 3 +--
1 file changed, 1
ARRAY_SIZE works here, since array decl is complete.
no functional change
Signed-off-by: Jim Cromie
Reviewed-by: Louis Chauvet
---
include/linux/dynamic_debug.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/tiny/simpledrm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm
uld soften ERR to WARN and qualify advice wrt file-vs-fn scope,
& new-scope-declaratives exception (forex: _METADATA_)
The known exceptions by name/pattern works well (_METADATA_ is covered
by "struct"), this patch just wants static_assert added. On my list,
with above.
Signed-off
chset, closer to the classmap patches its validating.
With some tedium, the tests could be refactored to split out early
tests which avoid multi-cmds, and test only the class-params.
Signed-off-by: Jim Cromie
---
- drop -v used in test_mod_submod(). V=1 does it for whole test
etnaviv has 5 DRM_UT_CORE debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs as well as plain-old pr_debug()s
Signed-off-by: Jim Cromie
---
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++
1 file changed, 2 insertions(+)
1 - 100 of 1143 matches
Mail list logo