Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
u16 crtc_width = crtc_state->base.crtc->legacy.mode.hdisplay; u16 crtc_height = crtc_state->base.mode.vdisplay; u16 crtc_width = crtc_state->base.mode.hdisplay; > struct vkms_writeback_job *active_wb; > struct vkms_frame_info *wb_frame_info; > u32 wb_format = fb->format->format; [...] -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
call `drm_atomic_helper_commit_modeset_disables`, which call `drm_atomic_helper_calc_timestamping_constants` which call `drm_calc_timestamping_constants` for every CRTC. I tested kms_vblank, all of them are SUCCESS/SKIP, do you know other tests that can trigger bugs? -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure

2024-10-03 Thread Louis Chauvet
Le 03/10/24 - 18:29, Ville Syrjälä a écrit : > On Thu, Oct 03, 2024 at 05:07:35PM +0200, Louis Chauvet wrote: > > > > > > > diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c > > > > > b/drivers/gpu/drm/vkms/vkms_crtc.c > > > > > index a40295c18b4

Re: [PATCH v2 3/3] drm: remove driver date from struct drm_driver and all drivers

2024-12-09 Thread Louis Chauvet
ate member from struct > drm_driver, its initialization from drivers, along with the common > DRIVER_DATE macros. > > v2: Also update drivers/accel (kernel test robot) > > Reviewed-by: Javier Martinez Canillas > Acked-by: Alex Deucher > Acked-by: Simon Ser > Acked-by: J

Re: [PATCH 2/5] drm/rockchip: stop passing non struct drm_device to drm_err() and friends

2025-02-24 Thread Louis Chauvet
gt;dev, ...). This matches current usage, but drops "[drm] *ERROR*" prefix from logging. Signed-off-by: Jani Nikula Reviewed-by: Louis Chauvet --- Looks like it's possible to hunt down the struct drm_device in most of these cases, if that's desired. This was the simplest ch

Re: [PATCH 5/5] drm/print: require struct drm_device for drm_err() and friends

2025-02-24 Thread Louis Chauvet
uct drm_device to struct device, with the main benefit being the type checking of the macro argument. As a side effect, this also reduces macro argument double references. Signed-off-by: Jani Nikula Reviewed-by: Louis Chauvet --- include/drm/drm_print.h |

Re: [PATCH 3/5] drm/sched: stop passing non struct drm_device to drm_err() and friends

2025-02-24 Thread Louis Chauvet
gt;dev, ...) and similar. This matches current usage, as struct drm_device is not available, but drops "[drm]" or "[drm] *ERROR*" prefix from logging. Unfortunately, there's no dev_WARN_ON(), so the conversion is not exactly the same. Signed-off-by: Jani Nikula Review

Re: [PATCH 10/63] dyndbg: silence debugs with no-change updates

2025-02-25 Thread Louis Chauvet
Le 25/01/2025 à 07:45, Jim Cromie a écrit : In ddebug_apply_class_bitmap(), 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 | 12 +++- 1 file

Re: [PATCH 11/63] dyndbg: tighten ddebug_class_name() 1st arg type

2025-02-25 Thread Louis Chauvet
Le 25/01/2025 à 07:45, Jim Cromie a écrit : Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 10 +

Re: [PATCH 12/63] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2025-02-25 Thread Louis Chauvet
Le 25/01/2025 à 07:45, Jim Cromie a écrit : 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

Re: [PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice

2025-02-25 Thread Louis Chauvet
by name for them. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9eed3683ad76

Re: [PATCH 16/63] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP

2025-02-25 Thread Louis Chauvet
quot;, + "D2_DP", + "D2_DRMRES"); + +DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); +DYNDBG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNDBG_CLASSMAP_USE(map_disjoint_bits); +DYNDBG_CLASSMAP_USE(map_level_num); + +#endif /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +159,7 @@ static void do_levels(void) static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); I just observed it, is the ordering of logs garanteed in /proc/dynamic_debug/control? When I run this test, I have this order: do_cats =_ "doing categories\n" [...] do_levels =_ "doing levels\n" [...] do_prints =_ "do_prints:\n" test_dynamic_debug_init =_ "init start\n" test_dynamic_debug_init =_ "init done\n" test_dynamic_debug_exit =_ "exited\n" Which is clearly not the code execution order. } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submod.c new file mode 100644 index ..9a893402ce1a --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 17/63] dyndbg: check DYNDBG_CLASSMAP_DEFINE args at compile-time

2025-02-25 Thread Louis Chauvet
0 /* ,empty */); Hi Jim, This test is nice, but can we move it in the *_submod.c directly? They don't need anything from this file. Tested-by: Louis Chauvet Thanks, Louis Chauvet #endif +#endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ + /* stand-in for all pr_debug etc */ #define prdbg

Re: [PATCH 08/63] dyndbg: drop NUM_TYPE_ARRAY

2025-02-25 Thread Louis Chauvet
Le 25/01/2025 à 07:45, Jim Cromie a écrit : 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

Re: [PATCH 19/63] dyndbg: make proper substructs in _ddebug_info

2025-02-25 Thread Louis Chauvet
ribute on _ddebug_info and the 3 contained structs closes the holes otherwise created by the structification (which was the excuse for not doing it originally). TBD: see if this can precede other patches, to reduce churn Hi Jim, This could be amazing if possible! Signed-off-by: Jim Crom

Re: [PATCH 18/63] dyndbg: add/use for_subvec() to reduce boilerplate

2025-02-25 Thread Louis Chauvet
it when introducing class_users. Reviewed-by: Louis Chauvet Thanks, Louis Chauvet --- lib/dynamic_debug.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6bca0c6727d4..08b6e4e7489f 100644

Re: [PATCH 13/63] dyndbg: reduce verbose=3 messages in ddebug_add_module

2025-02-25 Thread Louis Chauvet
Le 25/01/2025 à 07:45, Jim Cromie a écrit : 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 Signed-off-by: Jim Cromie Review

Re: [PATCH 04/63] dyndbg: make ddebug_class_param union members same size

2025-02-25 Thread Louis Chauvet
up (or refer to the wrong union member), at least 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

Re: [PATCH 20/63] dyndbg: drop premature optimization in ddebug_add_module

2025-02-25 Thread Louis Chauvet
ther patch earlier, can you also move this one before "for_subvec", so you don't change the same lines twice. Reviewed-by: Louis Chauvet Thanks, Louis Chauvet --- lib/dynamic_debug.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/

Re: [PATCH 21/63] dyndbg: allow ddebug_add_module to fail

2025-02-25 Thread Louis Chauvet
obsoletes part of 2, creating churn, maybe squash it away. Hi Jim, It could be very nice to squash when possible yes! Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 40 +--- 1 file changed, 29 insertions(+), 11 deletions

Re: [PATCH 23/63] dyndbg: fail modprobe on ddebug_class_range_overlap()

2025-02-25 Thread Louis Chauvet
rs.len); return 0; } @@ -1311,11 +1329,11 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) return rc; } } + mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&

Re: [PATCH 05/63] dyndbg: replace classmap list with a vector

2025-02-25 Thread Louis Chauvet
const char *class_string, + __outvar int *class_id) The order between __outvar and int is not important? Here you have __outvar before int, but later [1] the __outvar is after int. [1]:https://elixir.bootlin.com/linux/v6.14-rc3/source/lib/dynamic_debug.c#L183 Thanks, Louis Chau

Re: [PATCH 06/63] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2025-02-25 Thread Louis Chauvet
debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- after `modprobe i915`, heres the module dependencies, though not all on drm.debug. bash-5.2# lsmod Module Size Used by i915

Re: [PATCH 07/63] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns

2025-02-25 Thread Louis Chauvet
changes made. no functional change. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8adb81e75a16

Re: [PATCH 09/63] dyndbg: reduce verbose/debug clutter

2025-02-25 Thread Louis Chauvet
nfo. New output: dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' flags=0x1 *flagsp=0x1 *maskp=0x dyndbg: no-match: func="" file="" module=&

Re: [PATCH 02/63] test-dyndbg: fixup CLASSMAP usage error

2025-02-25 Thread Louis Chauvet
e map. * - base must equal enum's 1st value * - multiple maps must set their base to share the 0-62 class_id space !! 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(-)

Re: [PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_"

2025-02-25 Thread Louis Chauvet
o change them. Classmaps map known classes to reserved .class_ids (the 1..64 val range per module). 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 ind

Re: [PATCH 28/63] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2025-02-25 Thread Louis Chauvet
; + return; } - /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-param */ - ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); - ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); Hi Jim, We lost the do

Re: [PATCH 01/63] docs/dyndbg: update examples \012 to \n

2025-02-25 Thread Louis Chauvet
Hi Jim, I think this patch is incomplete, I just tested and the \012 in [1] needs to be replaced too. [1]:https://elixir.bootlin.com/linux/v6.14-rc3/source/Documentation/admin-guide/dynamic-debug-howto.rst#L39-L46 With this change: Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet -

Re: [PATCH 00/63] Fix CONFIG_DRM_USE_DYNAMIC_DEBUG=y

2025-02-28 Thread Louis Chauvet
additions are ready for review and merging into a (next-next) test/integration tree. So whose tree should this go through? I'm trying to get some drm folks to review/test this, but thus far not much success :-/ I think it's good stuff, but I'm somewhat hesitant if no I tested the

Re: [PATCH v2 23/59] dyndbg: move .mod_name from/to structs ddebug_table/_ddebug_info

2025-03-24 Thread Louis Chauvet
nyway, so it keeps access to the field, just with a different offset. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- include/linux/dynamic_debug.h | 1 + lib/dynamic_debug.c | 41 ++- 2 files changed, 22 insertions(+), 20 deletions(-)

Re: [PATCH v2 25/59] selftests-dyndbg: add comma_terminator_tests

2025-03-24 Thread Louis Chauvet
Reviewed-by: Louis Chauvet --- - skip comma tests if no builtins --- .../dynamic_debug/dyndbg_selftest.sh | 21 ++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests

Re: [PATCH v2 26/59] dyndbg: split multi-query strings with %

2025-03-24 Thread Louis Chauvet
t;foo: %d bar %s", nothing is actually lost here. 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 168663629ef2..c44502787c2b 100644 --- a/li

Re: [PATCH v2 28/59] selftests-dyndbg: add test_mod_submod

2025-03-24 Thread Louis Chauvet
the main reason the test wasn't earlier in the patchset, 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 Cha

Re: [PATCH v2 27/59] selftests-dyndbg: test_percent_splitting

2025-03-24 Thread Louis Chauvet
Jim Cromie Reviewed-by: Louis Chauvet --- .../dynamic_debug/dyndbg_selftest.sh | 20 +++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 36

Re: [PATCH v2 30/59] dyndbg: drop "protection" of class'd pr_debugs from legacy queries

2025-03-24 Thread Louis Chauvet
27;d site */ + else if (ddebug_client_module_protects_classes(dt)) + continue; + /* allow change on class'd pr_debug */ + } /* match against the sour

Re: [PATCH v2 10/59] dyndbg: replace classmap list with a vector

2025-03-24 Thread Louis Chauvet
* This macro does nothing apart clarify for the reader that * the parameter will be filled by the callee */ With any of the modifications (feel free to reword them as you want): Reviewed-by: Louis Chauvet { struct ddebug_class_map *map; - int idx; +

Re: [PATCH v2 47/59] drm-dyndbg: add DRM_CLASSMAP_USE to bochs

2025-03-24 Thread Louis Chauvet
Le 20/03/2025 à 19:52, Jim Cromie a écrit : 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 Reviewed-by: Louis Chauvet --- drivers/gpu/drm/tiny/bochs.

Re: [PATCH 16/63] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP

2025-03-24 Thread Louis Chauvet
Le 16/03/2025 à 20:46, jim.cro...@gmail.com a écrit : hi Louis, On Tue, Feb 25, 2025 at 7:16 AM Louis Chauvet wrote: Le 25/01/2025 à 07:45, Jim Cromie a écrit : DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times"

Re: [PATCH v2 14/59] dyndbg: split _emit_lookup() out of dynamic_emit_prefix()

2025-03-24 Thread Louis Chauvet
uf[PREFIX_SIZE - 1] = '\0'; @@ -885,7 +895,7 @@ static char *__dynamic_emit_prefix(const struct _ddebug *desc, char *buf) static inline char *dynamic_emit_prefix(struct _ddebug *desc, char *buf) { - if (unlikely(desc->flags & _DPRINTK_FLAGS_INCL_ANY)) + if (de

Re: [PATCH v2 15/59] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module

2025-03-24 Thread Louis Chauvet
+* do so for the builtin class _maps & _users. find the Nitpick, the _users builtin class is only introduced in patch 19/56, maybe update the documentation there. +* start,len of the vectors by mod_name, save to dt. +*/ + dd_mark_vector_subrange(i, dt, cm

Re: [PATCH v2 16/59] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2025-03-24 Thread Louis Chauvet
static void do_cats(void) { pr_debug("doing categories\n"); - prdbg(LOW); - prdbg(MID); - prdbg(HI); - prdbg(D2_CORE); prdbg(D2_DRIVER); prdbg(D2_KMS); @@ -129,14 +111,6 @@ static void do_levels(void) prdbg(V5); prdbg(V6); prdbg(V7); - - prdbg(L1); - prdbg(L2); - prdbg(L3); - prdbg(L4); - prdbg(L5); - prdbg(L6); - prdbg(L7); } static void do_prints(void) -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 17/59] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP

2025-03-24 Thread Louis Chauvet
"D2_STATE", + "D2_LEASE", + "D2_DP", + "D2_DRMRES"); + +DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); +DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); + +#endif /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +174,7 @@ static void do_levels(void) static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submod.c new file mode 100644 index ..672aabf40160 --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +/* + * clone the parent, inherit all the properties, for consistency and + * simpler accounting in test expectations. + */ +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 22/59] dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API

2025-03-24 Thread Louis Chauvet
namic_debug_submod.c index 672aabf40160..3adf3925fb86 100644 --- a/lib/test_dynamic_debug_submod.c +++ b/lib/test_dynamic_debug_submod.c @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, +

Re: [PATCH v2 31/59] docs/dyndbg: explain new delimiters: comma, percent

2025-03-24 Thread Louis Chauvet
feature. (I don't know if doc should be in a separate patch, but I think you can at least split this patch and put them just after the feature itself) Reviewed-by: Louis Chauvet --- .../admin-guide/dynamic-debug-howto.rst | 19 +++ 1 file changed, 11 insertions(

Re: [PATCH v2 34/59] checkpatch: dont warn about unused macro arg on empty body

2025-03-24 Thread Louis Chauvet
he macro should properly fail if invoked with 0 or 2+ args. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/

Re: [PATCH v2 36/59] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2

2025-03-24 Thread Louis Chauvet
ere. The drivers still use DECLARE_DYNDBG_CLASSMAP for 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 n

Re: [PATCH v2 40/59] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver

2025-03-24 Thread Louis Chauvet
_" in the control file for the driver's 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,

Re: [PATCH v2 44/59] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver

2025-03-24 Thread Louis Chauvet
+DRM_CLASSMAP_USE(drm_debug_classes); + Is xe_drm_client.c the best place to do it? I think the module entry point is a bit better [1]. [1]:https://elixir.bootlin.com/linux/v6.13.7/source/drivers/gpu/drm/xe/xe_module.c /** * DOC: DRM Client usage stats * -- Louis Chauvet, Bootli

Re: [PATCH v2 39/59] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver

2025-03-24 Thread Louis Chauvet
_" in the control file for the driver's 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,

Re: [PATCH v2 32/59] docs/dyndbg: explain flags parse 1st

2025-03-24 Thread Louis Chauvet
e mildly confusing/annoying, so explain it instead. cc: linux-...@vger.kernel.org Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet I think this could be merged outside this series. --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++ 1 file changed, 10 insertions(+) di

Re: [PATCH v2 38/59] drm-print: fix config-dependent unused variable

2025-03-24 Thread Louis Chauvet
um drm_debug_category category = p->category; - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 24/59] dyndbg: treat comma as a token separator

2025-03-24 Thread Louis Chauvet
return isspace(c) || c == ','; } char *skip(char *s) { while (is_skip(*s)) s++; return s; } With or without this: Reviewed-by: Louis Chauvet /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e

Re: [PATCH v2 29/59] dyndbg: change __dynamic_func_call_cls* macros into expressions

2025-03-24 Thread Louis Chauvet
\ -} while (0) +}) #define __dynamic_func_call_no_desc(id, fmt, func, ...) \ __dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT,\ fmt, func, ##__VA_ARGS__) -- Louis Chauvet,

Re: [PATCH v2 20/59] dyndbg: check DYNDBG_CLASSMAP_DEFINE args at compile-time

2025-03-24 Thread Louis Chauvet
ert added. On my list, with above. Signed-off-by: Jim Cromie Nice addition to avoid issues! Reviewed-by: Louis Chauvet --- - split static-asserts to __DYNDBG_CLASSMAP_CHECK - move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE silences kernel-doc warnings --- includ

Re: [PATCH v2 33/59] docs/dyndbg: add classmap info to howto (TBD)

2025-03-24 Thread Louis Chauvet
EBUG`` will enable all pr_debugs in scope, including any +class'd ones. This won't be reflected in the PARAM readback value, +but the class'd pr_debug callsites can be forced off by toggling the +classmap-kparam all-on then all-off. -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 37/59] drm-dyndbg: adapt DRM to invoke DYNAMIC_DEBUG_CLASSMAP_PARAM

2025-03-24 Thread Louis Chauvet
=y is configured. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 8 ++-- include/drm/drm_print.h | 4 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index

Re: [PATCH v2 53/59] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver

2025-03-24 Thread Louis Chauvet
); ditto, is it better to put it near the module entry point [1]? [1]:https://elixir.bootlin.com/linux/v6.13.7/source/drivers/gpu/drm/udl/udl_drv.c + #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) #define WRITES_IN_FLIGHT (20) #define MAX_VENDOR_DESCRIPTOR_SIZE 256 -- Louis Chauvet

Re: [PATCH v2 59/59] drm: RFC - make drm_dyndbg_user.o for drm-*_helpers, drivers

2025-03-24 Thread Louis Chauvet
: + *DYNDBG_CLASSMAP_USE(drm_debug_classes); + * + * dyndbg classmaps are opt-in, so modules which call drm:_*_dbg must + * link this to authorize dyndbg to change the static-keys underneath. + */ +DRM_CLASSMAP_USE(drm_debug_classes); -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 52/59] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver

2025-03-24 Thread Louis Chauvet
Le 20/03/2025 à 19:52, Jim Cromie a écrit : 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 Reviewed-by: Louis Chauvet --- drivers/gpu/drm/vkms

Re: [PATCH v2 12/59] dyndbg, module: make proper substructs in _ddebug_info

2025-03-24 Thread Louis Chauvet
di.descs = iter_mod_start; + di.descs.len = mod_sites; + di.descs.start = iter_mod_start; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1490,8 +1493,8 @@ static int __init dynamic_debug_init(void) i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), (int)((i * sizeof(struct _ddebug)) >> 10)); - if (di.num_classes) - v2pr_info(" %d builtin ddebug class-maps\n", di.num_classes); + if (di.maps.len) + v2pr_info(" %d builtin ddebug class-maps\n", di.maps.len); /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 13/59] dyndbg: add 2 new _DPRINTK_FLAGS_: INCL_LOOKUP, PREFIX_CACHED

2025-03-24 Thread Louis Chauvet
define _DPRINTK_FLAGS_INCL_ANY \ + (_DPRINTK_FLAGS_INCL_TID | _DPRINTK_FLAGS_INCL_LOOKUP) #if defined DEBUG #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 11/59] dyndbg: macrofy a 2-index for-loop pattern

2025-03-24 Thread Louis Chauvet
-struct member in _box, with array-ref and length + */ Nice macro to make the code easier to read! Reviewed-by: Louis Chauvet +#define for_subvec(_i, _sp, _box, _vec) \ + for ((_i) = 0, (_sp) = (_box)->_vec;\ +